Also silence yacc and stuff.
This commit is contained in:
parent
6c38906a51
commit
2086af34d9
|
@ -32,7 +32,7 @@ def main():
|
||||||
|
|
||||||
global llvm_parser
|
global llvm_parser
|
||||||
llvm_parser = parser.LLVMParser()
|
llvm_parser = parser.LLVMParser()
|
||||||
llvm_parser.build()
|
llvm_parser.build( parse_res['print_level'] <= 1 )
|
||||||
|
|
||||||
if parse_res['auto_path'] is not None:
|
if parse_res['auto_path'] is not None:
|
||||||
step_behavior = {
|
step_behavior = {
|
||||||
|
@ -47,11 +47,13 @@ def main():
|
||||||
def go_auto(path_to_file, step_behavior):
|
def go_auto(path_to_file, step_behavior):
|
||||||
with open(path_to_file, 'r') as f:
|
with open(path_to_file, 'r') as f:
|
||||||
file_contents = f.read()
|
file_contents = f.read()
|
||||||
print('Parsing {}'
|
if step_behavior['step_print_level'] > 1:
|
||||||
.format(path_to_file))
|
print('Parsing {}'
|
||||||
|
.format(path_to_file))
|
||||||
ast = llvm_parser.parse(file_contents)
|
ast = llvm_parser.parse(file_contents)
|
||||||
print('Beginning execution of {}'
|
if step_behavior['step_print_level'] > 1:
|
||||||
.format(path_to_file))
|
print('Beginning execution of {}'
|
||||||
|
.format(path_to_file))
|
||||||
stepper.auto_step(ast, step_behavior = step_behavior)
|
stepper.auto_step(ast, step_behavior = step_behavior)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -474,7 +474,7 @@ class LLVMParser(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.tokens += self.reserved.values()
|
self.tokens += self.reserved.values()
|
||||||
|
|
||||||
def build(self):
|
def build(self, silence_yacc=False):
|
||||||
"""
|
"""
|
||||||
Build the parser.
|
Build the parser.
|
||||||
|
|
||||||
|
@ -484,7 +484,7 @@ class LLVMParser(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
self.lexer = lex.lex(module=self)
|
self.lexer = lex.lex(module=self)
|
||||||
self.parser = yacc.yacc(module=self)
|
self.parser = yacc.yacc(module=self, errorlog=(silence_yacc and yacc.NullLogger() or None))
|
||||||
|
|
||||||
def parse(self, text):
|
def parse(self, text):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -643,7 +643,6 @@ def auto_step(ast, function_name='tigermain', function_args=[1234, 5678], step_b
|
||||||
if True:
|
if True:
|
||||||
global PRINT_LEVEL
|
global PRINT_LEVEL
|
||||||
PRINT_LEVEL = step_behavior['step_print_level']
|
PRINT_LEVEL = step_behavior['step_print_level']
|
||||||
print(PRINT_LEVEL)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
tdecls = ast.tdecls
|
tdecls = ast.tdecls
|
||||||
|
|
Loading…
Reference in New Issue
Block a user