Commit 1a4774ff authored by eckhart's avatar eckhart
Browse files

- stub for compiler verification written

parent f60c89e1
......@@ -480,10 +480,10 @@ def compile_on_disk(source_file: str, compiler_suite="", extension=".xml") -> It
source = f.read()
sections = RX_SECTION_MARKER.split(source)
intro, imports, preprocessor, _, ast, compiler, outro = sections
# TODO: Verify transformation table
ast_trans_table = compile_python_object(DHPARSER_IMPORTS + ast,
r'(?:\w+_)?AST_transformation_table$')
messages.extend(ebnf_compiler.verify_transformation_table(ast_trans_table))
# TODO: Verify compiler
except (PermissionError, FileNotFoundError, IOError):
intro, imports, preprocessor, _, ast, compiler, outro = '', '', '', '', '', '', ''
except ValueError:
......
......@@ -516,6 +516,13 @@ class EBNFCompiler(Compiler):
0, Error.UNDEFINED_SYMBOL_IN_TRANSFORMATION_TABLE))
return messages
def verify_compiler(self, compiler):
"""
Checks for on_XXXX()-methods that occur in the compiler, although XXXX
has never been defined in the grammar. Usually, this kind of
inconsistency results from an error like a typo in the compiler-code.
"""
pass # TODO: add verification code here
def assemble_parser(self, definitions: List[Tuple[str, str]], root_node: Node) -> str:
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment