def createcodetreebuilderparserdependencyCrossTerminalParserinc(): ParserTableGenerator.validateAllFirstSets(productions) lines_ = [] for start_nonterminal in sorted(productions): transitions_ = ParserTableGenerator.computeTransitions(start_nonterminal, productions) lines_.append(ParserTableGenerator.generateTransitionMapCode(transitions_, productions)) with open("./code/treebuilder/parser/dependency/CrossTerminalParser.inc", "w") as file: file.write(LICENSE_STRING + "\n".join(lines_))
def enterMain(): terminal_set, non_terminal_set = ParserTableGenerator.computeTerminals(productions) terminal_set |= {"UNIDENTIFIED"} non_terminal_set |= {"EPSILONATE"} createcodetreebuilderlexerdependencyKeywordMatchercpp(terminal_set) createcodetreebuilderlexerdependencySymbolMatchercpp(terminal_set) createcodetreebuilderparserdependencyCrossTerminalParserinc() createcodetreebuilderparserdependencyCrossTerminalToStringcpp(terminal_set, non_terminal_set) createcodetreebuilderparserdependencyTokenTypeToCrossTerminalcpp(terminal_set) createprotocolsCrossTerminalhpp(terminal_set, non_terminal_set) createprotocolsTokenTypehpp(terminal_set, non_terminal_set)