From ef14961fe10614eb15c71dd5b0b83f292bd7a5b0 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Thu, 31 Mar 2005 13:27:36 +0000 Subject: minor improvements to code aesthetics --- 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 @@ -147,28 +147,28 @@ NOIDCHAR [^A-Za-z0-9_] { {WHITESPACE}+ { - modus_operandi& m = modi.front(); - if(!m.output.empty()) { - if(!m._lastid.empty()) { - if(!m._type.empty()) m._type += ' '; - m._type += m._lastid; - } - m._lastid = m.output; - m.output.clear(); - } - } + modus_operandi& m = M(); + if(!m.output.empty()) { + if(!m._lastid.empty()) { + if(!m._type.empty()) m._type += ' '; + m._type += m._lastid; + } + m._lastid = m.output; + m.output.clear(); + } + } \* { - modus_operandi& m = modi.front(); - ECHO; - if(!m._lastid.empty()) { - if(!m._type.empty()) m._type += ' '; - m._type += m._lastid; - } - m._lastid = m.output; - m.output.clear(); - } + modus_operandi& m = M(); + ECHO; + if(!m._lastid.empty()) { + if(!m._type.empty()) m._type += ' '; + m._type += m._lastid; + } + m._lastid = m.output; + m.output.clear(); + } \( { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); if(m.output.empty()) { m._name=m._lastid; }else{ @@ -185,7 +185,7 @@ NOIDCHAR [^A-Za-z0-9_] } { \%\> { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); m._args = m.output; m.output.clear(); anchor(); @@ -223,28 +223,28 @@ NOIDCHAR [^A-Za-z0-9_] { {WHITESPACE}+ { - modus_operandi& m = modi.front(); - if(!m.output.empty()) { - if(!m._lastid.empty()) { - if(!m._type.empty()) m._type += ' '; - m._type += m._lastid; - } - m._lastid = m.output; - m.output.clear(); - } - } + modus_operandi& m = M(); + if(!m.output.empty()) { + if(!m._lastid.empty()) { + if(!m._type.empty()) m._type += ' '; + m._type += m._lastid; + } + m._lastid = m.output; + m.output.clear(); + } + } \* { - modus_operandi& m = modi.front(); - ECHO; - if(!m._lastid.empty()) { - if(!m._type.empty()) m._type += ' '; - m._type += m._lastid; - } - m._lastid = m.output; - m.output.clear(); - } + modus_operandi& m = M(); + ECHO; + if(!m._lastid.empty()) { + if(!m._type.empty()) m._type += ' '; + m._type += m._lastid; + } + m._lastid = m.output; + m.output.clear(); + } \( { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); if(m.output.empty()) { m._name=m._lastid; }else{ @@ -261,7 +261,7 @@ NOIDCHAR [^A-Za-z0-9_] } { \%\> { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); m._args = m.output; m.output.clear(); m.flags=0; @@ -273,12 +273,13 @@ NOIDCHAR [^A-Za-z0-9_] { {WHITESPACE}+ { } {ID} { - if(!modi.front()._name.empty()) - throw preprocessor_error(CODEPOINT,"syntax error",lineno()); - modi.front()._name = yytext; - } + modus_operandi& m = M(); + if(!m._name.empty()) + throw preprocessor_error(CODEPOINT,"syntax error",lineno()); + m._name = yytext; + } \= { - modi.front().output.clear(); + M().output.clear(); BEGIN(IMPORTCOMPONENT); } } @@ -306,12 +307,13 @@ NOIDCHAR [^A-Za-z0-9_] { {WHITESPACE}+ { } {ID} { - if(!modi.front()._name.empty()) - throw preprocessor_error(CODEPOINT,"syntax error",lineno()); - modi.front()._name = yytext; - } + modus_operandi& m = M(); + if(!m._name.empty()) + throw preprocessor_error(CODEPOINT,"syntax error",lineno()); + m._name = yytext; + } \= { - modi.front().output.clear(); + M().output.clear(); BEGIN(IMPORTTYPECOMPONENT); } } @@ -339,12 +341,13 @@ NOIDCHAR [^A-Za-z0-9_] { {WHITESPACE}+ { } {ID} { - if(!modi.front()._name.empty()) - throw preprocessor_error(CODEPOINT,"syntax_error",lineno()); - modi.front()._name = yytext; - } + modus_operandi& m = M(); + if(!m._name.empty()) + throw preprocessor_error(CODEPOINT,"syntax_error",lineno()); + m._name = yytext; + } \= { - modi.front().output.clear(); + M().output.clear(); BEGIN(DERIVECOMPONENT); } } @@ -371,7 +374,7 @@ NOIDCHAR [^A-Za-z0-9_] { {WHITESPACE}+ { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); if(!m.output.empty()) { if(!m._lastid.empty()) { if(!m._type.empty()) m._type += ' '; @@ -382,17 +385,17 @@ NOIDCHAR [^A-Za-z0-9_] } } \* { - modus_operandi& m = modi.front(); - ECHO; - if(!m._lastid.empty()) { - if(!m._type.empty()) m._type += ' '; - m._type += m._lastid; - } - m._lastid = m.output; - m.output.clear(); - } + modus_operandi& m = M(); + ECHO; + if(!m._lastid.empty()) { + if(!m._type.empty()) m._type += ' '; + m._type += m._lastid; + } + m._lastid = m.output; + m.output.clear(); + } \;|\n|\= { - modus_operandi& m = modi.front(); + modus_operandi& m = M(); if(m.output.empty()) { m._name=m._lastid; }else{ @@ -410,7 +413,7 @@ 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"); if(t!=string::npos) m.output.erase(0,t); @@ -426,18 +429,18 @@ NOIDCHAR [^A-Za-z0-9_] } \n { ECHO; - decl += modi.front().output; + decl += M().output; modi.pop_front(); BEGIN(INITIAL); } \n { ECHO; - impl += modi.front().output; + impl += M().output; modi.pop_front(); BEGIN(INITIAL); } \n { - class_name = modi.front().output; + class_name = M().output; modi.pop_front(); BEGIN(INITIAL); } @@ -477,39 +480,39 @@ NOIDCHAR [^A-Za-z0-9_] { \<\/\%decl\> { if(YY_START!=DECLBLOCK) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); - decl += modi.front().output; + decl += M().output; modi.pop_front(); BEGIN(INITIAL); } \<\/\%impl\> { if(YY_START!=IMPLBLOCK) throw preprocessor_error(CODEPOINT,"tags mismatch",lineno()); - impl += modi.front().output; + impl += M().output; modi.pop_front(); BEGIN(INITIAL); } \<\/\%constructor\> { 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; modi.pop_front(); BEGIN(INITIAL); } \<\/\%destructor\> { 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(); BEGIN(INITIAL); } \<\/\%codemethod\> { 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)); modi.pop_front(); BEGIN(INITIAL); } \<\/%method\> { 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); member_functions.push_back(member_function(m._type,m._name,m._args,m.output)); modi.pop_front(); -- cgit v0.9.0.2