From aa3e0813f3948d9da71b3d354b8545f0b3108c30 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 24 May 2014 16:14:49 +0300 Subject: Add manual rule names. --- src/rules/debug.cpp | 4 ++-- src/rules/dump.cpp | 4 ++-- src/template.hpp | 26 +++++++++++++------------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/rules/debug.cpp b/src/rules/debug.cpp index 7edae01..e2279bf 100644 --- a/src/rules/debug.cpp +++ b/src/rules/debug.cpp @@ -20,7 +20,7 @@ #include "template.hpp" -registerRuleExt(debugH, "(.+)[.]h") +registerRuleExt(debugH, "003", "(.+)[.]h") startRule(debugH) { @@ -41,7 +41,7 @@ parseLineRule(debugH) } -registerRuleExt(debugCpp, "(.+)[.]cpp") +registerRuleExt(debugCpp, "004", "(.+)[.]cpp") startRule(debugCpp) { diff --git a/src/rules/dump.cpp b/src/rules/dump.cpp index f074f41..a01aefe 100644 --- a/src/rules/dump.cpp +++ b/src/rules/dump.cpp @@ -21,7 +21,7 @@ #include "template.hpp" /* -registerRuleExt(dumpCpp, "(.+)[.]cpp") +registerRuleExt(dumpCpp, "001", "(.+)[.]cpp") startRule(dumpCpp) { @@ -39,7 +39,7 @@ parseLineRule(dumpCpp) } -registerRuleExt(dumpH, "(.+)[.]h") +registerRuleExt(dumpH, "002", "(.+)[.]h") startRule(dumpH) { diff --git a/src/template.hpp b/src/template.hpp index 0002a35..3acfb86 100644 --- a/src/template.hpp +++ b/src/template.hpp @@ -23,11 +23,11 @@ #include "localconsts.h" -#define registerRule(name) \ -class name : public RuleBase \ +#define registerRule(rule) \ +class rule : public RuleBase \ { \ public: \ - name(); \ + rule(); \ \ void start(); \ \ @@ -38,16 +38,16 @@ class name : public RuleBase \ \ namespace \ { \ - name instance##name; \ + rule instance##rule; \ } \ -#define registerRuleExt(name, ext) \ -class name : public RuleBase \ +#define registerRuleExt(rule, name, ext) \ +class rule : public RuleBase \ { \ public: \ - name() \ + rule() \ { \ - setName(#name); \ + setName(name); \ addMask(ext); \ } \ \ @@ -60,11 +60,11 @@ class name : public RuleBase \ \ namespace \ { \ - name instance##name; \ + rule instance##rule; \ } \ -#define constructRule(name) name::name() -#define startRule(name) void name::start() -#define endRule(name) void name::end() -#define parseLineRule(name) void name::parseLine(std::string data) +#define constructRule(rule) rule::rule() +#define startRule(rule) void rule::start() +#define endRule(rule) void rule::end() +#define parseLineRule(rule) void rule::parseLine(std::string data) -- cgit v1.2.3-70-g09d2