-rw-r--r-- | lib/sitecing_parser.ll | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/lib/sitecing_parser.ll b/lib/sitecing_parser.ll index 8ba8673..9514ce4 100644 --- a/lib/sitecing_parser.ll +++ b/lib/sitecing_parser.ll @@ -149,3 +149,3 @@ NOIDCHAR [^A-Za-z0-9_] {WHITESPACE}+ { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); if(!m.output.empty()) { @@ -160,3 +160,3 @@ NOIDCHAR [^A-Za-z0-9_] \* { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); ECHO; @@ -170,3 +170,3 @@ NOIDCHAR [^A-Za-z0-9_] \( { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); if(m.output.empty()) { @@ -187,3 +187,3 @@ NOIDCHAR [^A-Za-z0-9_] \%\> { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); m._args = m.output; @@ -225,3 +225,3 @@ NOIDCHAR [^A-Za-z0-9_] {WHITESPACE}+ { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); if(!m.output.empty()) { @@ -236,3 +236,3 @@ NOIDCHAR [^A-Za-z0-9_] \* { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); ECHO; @@ -246,3 +246,3 @@ NOIDCHAR [^A-Za-z0-9_] \( { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); if(m.output.empty()) { @@ -263,3 +263,3 @@ NOIDCHAR [^A-Za-z0-9_] \%\> { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); m._args = m.output; @@ -275,8 +275,9 @@ NOIDCHAR [^A-Za-z0-9_] {ID} { - if(!modi.front()._name.empty()) + modus_operandi& m = M(); + if(!m._name.empty()) throw preprocessor_error(CODEPOINT,"syntax error",lineno()); - modi.front()._name = yytext; + m._name = yytext; } \= { - modi.front().output.clear(); + M().output.clear(); BEGIN(IMPORTCOMPONENT); @@ -308,8 +309,9 @@ NOIDCHAR [^A-Za-z0-9_] {ID} { - if(!modi.front()._name.empty()) + modus_operandi& m = M(); + if(!m._name.empty()) throw preprocessor_error(CODEPOINT,"syntax error",lineno()); - modi.front()._name = yytext; + m._name = yytext; } \= { - modi.front().output.clear(); + M().output.clear(); BEGIN(IMPORTTYPECOMPONENT); @@ -341,8 +343,9 @@ NOIDCHAR [^A-Za-z0-9_] {ID} { - if(!modi.front()._name.empty()) + modus_operandi& m = M(); + if(!m._name.empty()) throw preprocessor_error(CODEPOINT,"syntax_error",lineno()); - modi.front()._name = yytext; + m._name = yytext; } \= { - modi.front().output.clear(); + M().output.clear(); BEGIN(DERIVECOMPONENT); @@ -373,3 +376,3 @@ NOIDCHAR [^A-Za-z0-9_] {WHITESPACE}+ { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); if(!m.output.empty()) { @@ -384,3 +387,3 @@ NOIDCHAR [^A-Za-z0-9_] \* { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); ECHO; @@ -394,3 +397,3 @@ NOIDCHAR [^A-Za-z0-9_] \;|\n|\= { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); if(m.output.empty()) { @@ -412,3 +415,3 @@ NOIDCHAR [^A-Za-z0-9_] \n { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); string::size_type t = m.output.find_first_not_of(" \t"); @@ -428,3 +431,3 @@ NOIDCHAR [^A-Za-z0-9_] ECHO; - decl += modi.front().output; + decl += M().output; modi.pop_front(); @@ -434,3 +437,3 @@ NOIDCHAR [^A-Za-z0-9_] ECHO; - impl += modi.front().output; + impl += M().output; modi.pop_front(); @@ -439,3 +442,3 @@ NOIDCHAR [^A-Za-z0-9_] <CLASSLINE>\n { - class_name = modi.front().output; + class_name = M().output; modi.pop_front(); @@ -479,3 +482,3 @@ NOIDCHAR [^A-Za-z0-9_] if(YY_START!=DECLBLOCK) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); - decl += modi.front().output; + decl += M().output; modi.pop_front(); @@ -485,3 +488,3 @@ NOIDCHAR [^A-Za-z0-9_] if(YY_START!=IMPLBLOCK) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); - impl += modi.front().output; + impl += M().output; modi.pop_front(); @@ -491,3 +494,3 @@ NOIDCHAR [^A-Za-z0-9_] if(YY_START!=CONSTRUCTOR) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); - member_functions.push_back(member_function("","","",modi.front().output)); + member_functions.push_back(member_function("","","",M().output)); have_constructor = true; @@ -498,3 +501,3 @@ NOIDCHAR [^A-Za-z0-9_] if(YY_START!=DESTRUCTOR) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); - member_functions.push_back(member_function("","~","",modi.front().output)); + member_functions.push_back(member_function("","~","",M().output)); modi.pop_front(); @@ -504,3 +507,3 @@ NOIDCHAR [^A-Za-z0-9_] if(YY_START!=CODEMETHODBLOCK) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); - modus_operandi& m = modi.front(); + modus_operandi& m = M(); member_functions.push_back(member_function(m._type,m._name,m._args,m.output)); @@ -511,3 +514,3 @@ NOIDCHAR [^A-Za-z0-9_] if(YY_START!=METHODBLOCK) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); - modus_operandi& m = modi.front(); + modus_operandi& m = M(); m.modify(modus_operandi::modus_code); |