From: Gabe Black Date: Sat, 26 May 2007 02:26:26 +0000 (-0700) Subject: Make the lexer and parser use objects and not the last lexer and parser generated. X-Git-Tag: m5_2.0_beta4~397 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ad02a59f89139a75dfcfaa7a79498e54f7ce7e5d;p=gem5.git Make the lexer and parser use objects and not the last lexer and parser generated. --HG-- extra : convert_revision : e751969973599cde711f9d4de0dc4772dda651ed --- diff --git a/src/arch/isa_parser.py b/src/arch/isa_parser.py index 4c8d0706d..57d58cc9d 100755 --- a/src/arch/isa_parser.py +++ b/src/arch/isa_parser.py @@ -194,7 +194,7 @@ def t_error(t): t.skip(1) # Build the lexer -lex.lex() +lexer = lex.lex() ##################################################################### # @@ -729,7 +729,7 @@ def p_error(t): # END OF GRAMMAR RULES # # Now build the parser. -yacc.yacc() +parser = yacc.yacc() ##################################################################### @@ -1881,7 +1881,8 @@ def parse_isa_desc(isa_desc_file, output_dir): fileNameStack.push((isa_desc_file, 0)) # Parse it. - (isa_name, namespace, global_code, namespace_code) = yacc.parse(isa_desc) + (isa_name, namespace, global_code, namespace_code) = \ + parser.parse(isa_desc, lexer=lexer) # grab the last three path components of isa_desc_file to put in # the output