global yychar
if yychar == YYEMPTY:
yychar = lex_yy.flexscan()
- #print('yyy yychar', yychar, 'yylval', yylval, 'yylloc', yylloc, 'lex_yy.yytext', yytext)
+ #print('yyy yychar', yychar, 'yylval', yylval, 'yylloc', yylloc, 'lex_yy.yytext', lex_yy.yytext)
insert_before(1, '</AST_Section3>')
insert_after(0, '<AST_Section3>')
}
#$$ = scon_stk_ptr
if yychar == YYEMPTY:
yychar = lex_yy.flexscan()
- #print('xxx yychar', yychar, 'yylval', yylval, 'yylloc', yylloc, 'lex_yy.yytext', yytext)
+ #print('xxx yychar', yychar, 'yylval', yylval, 'yylloc', yylloc, 'lex_yy.yytext', lex_yy.yytext)
temp = lex_yy.piece[piece2 + 1]
lex_yy.piece[piece2 + 1] = lex_yy.piece[piece2]
lex_yy.piece[piece2] = lex_yy.piece[piece2 - 1]
/* Nick added ("no"*) prefix to all, instead of it being a separate rule */
<OPTION>{
- ("no"*){NL} {
+ {NL} {
state.linenum += 1
BEGIN(INITIAL)
}
- ("no"*){WS} {
+ {WS} {
#global option_sense
#option_sense = True
}
- ("no"*)"=" return ord('=')
+ "=" return ord('=')
/*no {
global option_sense
piece_append('</AST_Section1_Options_BisonLocations>')
return y_tab.TOK_OPTION_OTHER # Nick
}
- "c++" {
+ ("no"*)"c++" {
option_sense = (len(yy_groups[1]) & 2) == 0
#C_plus_plus = option_sense
piece_append(
return y_tab.TOK_OPTION_OTHER # Nick
}
- ("no"*)extra-type return y_tab.TOK_EXTRA_TYPE
- ("no"*)outfile return y_tab.TOK_OUTFILE
- ("no"*)prefix return y_tab.TOK_PREFIX
- ("no"*)yyclass return y_tab.TOK_YYCLASS
- ("no"*)header(-file)? return y_tab.TOK_HEADER_FILE
- ("no"*)tables-file return y_tab.TOK_TABLES_FILE
+ extra-type return y_tab.TOK_EXTRA_TYPE
+ outfile return y_tab.TOK_OUTFILE
+ prefix return y_tab.TOK_PREFIX
+ yyclass return y_tab.TOK_YYCLASS
+ header(-file)? return y_tab.TOK_HEADER_FILE
+ tables-file return y_tab.TOK_TABLES_FILE
("no"*)tables-verify {
option_sense = (len(yy_groups[1]) & 2) == 0
#tablesverify = option_sense
return y_tab.TOK_OPTION_OTHER # Nick
}
-
- ("no"*)\"[^"\n]*\" {
+ \"[^"\n]*\" {
state.nmstr = yytext[1:-1]
piece_pack()
piece_append('<AST_String>"<AST_Text>')
return ~y_tab.NAME
}
- ("no"*)(([a-mo-z]|n[a-np-z])[[:alpha:]\-+]*)|. {
+ (([a-mo-z]|n[a-np-z])[[:alpha:]\-+]*)|. {
state.synerr('unrecognized %option: {0:s}'.format(yytext))
BEGIN(RECOVER)
}
yy_push_state(ACTION_GROUP)
bracelevel = 1
piece_flush(len(yytext))
- piece_append('<RegexGroupAction_Text>')
+ markup_stack.append(len(piece)) # <RegexGroupAction_Text>
}
"E{" {
global bracelevel
yy_push_state(ELEMENT_GROUP)
bracelevel = 1
piece_flush(len(yytext))
- piece_append('<RegexGroupElement_Text>')
+ markup_stack.append(len(piece)) # <RegexGroupElement_Text>
}
":" {
BEGIN(SECT2)
"'"([^\'\\\n]|\\.)"'" #add_action(yytext)
"'" {
#add_action(yytext)
- BEGIN(y_tab.CHARACTER_CONSTANT)
+ BEGIN(CHARACTER_CONSTANT)
}
\" {
#add_action(yytext)
bracelevel -= 1
if bracelevel == 0:
yy_pop_state()
+ piece_insert(markup_stack.pop(), '<RegexGroupAction_Text>')
piece_append('</RegexGroupAction_Text>')
- return TOK_ACTION_GROUP
+ return y_tab.TOK_ACTION_GROUP
}
}
<ELEMENT_GROUP>{
bracelevel -= 1
if bracelevel == 0:
yy_pop_state()
+ piece_insert(markup_stack.pop(), '<RegexGroupElement_Text>')
piece_append('</RegexGroupElement_Text>')
- return TOK_ELEMENT_GROUP
+ return y_tab.TOK_ELEMENT_GROUP
}
}
<ACTION_GROUP,ELEMENT_GROUP>{