From ad02a59f89139a75dfcfaa7a79498e54f7ce7e5d Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 25 May 2007 19:26:26 -0700 Subject: [PATCH] Make the lexer and parser use objects and not the last lexer and parser generated. --HG-- extra : convert_revision : e751969973599cde711f9d4de0dc4772dda651ed --- src/arch/isa_parser.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 -- 2.30.2