--- /dev/null
+#!/bin/sh
+if ! test -d out
+then
+ mkdir out
+ ../../bootstrap_bison.git/src/bison -o /dev/null ../tests/cal.y 2>out/cal.y.xml.ok
+ ../../bootstrap_bison.git/src/bison -o /dev/null ../../bootstrap_flex.git/src/parse.y 2>out/parse.y.xml.ok
+ ../../bootstrap_bison.git/src/bison ../../bootstrap_bison.git/src/parse-gram.y 2>out/parse-gram.y.xml.ok
+ rm parse-gram.output parse-gram.tab.c parse-gram.tab.h
+fi
+./markup.py <../tests/cal.y >out/cal.y.xml
+diff --unified out/cal.y.xml.ok out/cal.y.xml
+./markup.py <../../bootstrap_flex.git/src/parse.y >out/parse.y.xml
+diff --unified out/parse.y.xml.ok out/parse.y.xml
+./markup.py <../../bootstrap_bison.git/src/parse-gram.y >out/parse-gram.y.xml
+diff --unified out/parse-gram.y.xml.ok out/parse-gram.y.xml
lex_yy_code.yy_buffer_stack = [lex_yy_code.YYBufferState()]
lex_yy_code.yytext = '' # fool unput()
lex_yy_code.unput($2)
+ lex_yy_code.sc_context = lex_yy_code.SC_SYMBOL_ACTION # CODE_PROPS_SYMBOL_ACTION
lex_yy_code.yylex()
lex_yy_code.code_piece_append('</AST_Text>')
lex_yy_code.code_piece_pack()
code_props_type
: "%destructor"
{
- $$ = destructor
+ $$ = state.destructor
}
| "%printer"
{
- $$ = printer
+ $$ = state.printer
}
;
}
"%prec" return y_tab.PERCENT_PREC
"%precedence" return y_tab.PERCENT_PRECEDENCE
- "%printer" return y_tab.PERCENT_PRy_tab.INTER
+ "%printer" return y_tab.PERCENT_PRINTER
"%pure-parser" {
y_tab.yylval = 'api.pure'
return y_tab.PERCENT_FLAG
# pass
# return w - buf
# return bytes_read
-#
-#def scan_integer(number, base, loc):
-# num = strtoul(number, None, base)
-# if 0x7fffffff < num:
-# state.complain(y_tab.yylloc, state.complaint, 'integer out of range: %s', quote(number))
-# num = 0x7fffffff
-# return num
-#
+
+def scan_integer(number, base, loc):
+ num = int(number, base)
+ if 0x7fffffff < num:
+ state.complain(y_tab.yylloc, state.complaint, 'integer out of range: %s', quote(number))
+ num = 0x7fffffff
+ return num
+
#def convert_ucn_to_byte(ucn):
# code = strtoul(ucn + 2, None, 16)
# if 0x7f * 2 + 1 < code: