def function_open(self, ast): # noqa return ast def function_close(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'start' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = BELParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, BELParser, name='BEL') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def monthconstraint(self, ast): # noqa return ast def startingat(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'start' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = UnknownParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, UnknownParser, name='Unknown') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def rule(self, ast): # noqa return ast def string(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'start' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = rrParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, rrParser, name='rr') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def INDENT(self, ast): # noqa return ast def DEDENT(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = "start" if not filename or filename == "-": text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = UnknownParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == "__main__": import json from tatsu.util import asjson ast = generic_main(main, UnknownParser, name="Unknown") print("AST:") print(ast) print() print("JSON:") print(json.dumps(asjson(ast), indent=2)) print()
def product(self, ast): # noqa return ast def factor(self, ast): # noqa return ast def identifier(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'program' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = PseudoCodeParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, PseudoCodeParser, name='PseudoCode') data = asjson(ast) print(json.dumps(data, indent=2))
def newline(self, ast): # noqa return ast def ws(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'start' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = KdlParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, KdlParser, name='Kdl') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def literal_expr(self, ast): # noqa return ast def symbol(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'identifier' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = LinneaParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, LinneaParser, name='Linnea') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
return ast def atom(self, ast): # noqa return ast def symbol(self, ast): # noqa return ast def number(self, ast): # noqa return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = KaleidoscopeParser() return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, KaleidoscopeParser, name='Kaleidoscope') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def param(self, ast): # noqa return ast def param_value(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'ALPHADIGIT_MINUS_PLUS' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = contentlineParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, contentlineParser, name='contentline') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def float(self, ast): # noqa return ast def integer(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'start' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = CALCParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, CALCParser, name='CALC') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def relative_modifier(self, ast): # noqa return ast def timeframe(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'start' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = CalendarGrammarParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, CalendarGrammarParser, name='CalendarGrammar') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
return ast def q(self, ast): # noqa return ast def r(self, ast): # noqa return ast def y(self, ast): # noqa return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = DatavaultLanguageParser() return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, DatavaultLanguageParser, name='DatavaultLanguage') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def parens(self, ast): # noqa return ast def word(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'start' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = BugParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, BugParser, name='Bug') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def REGULAR_EXPRESSION_CLASS_CHAR(self, ast): # noqa return ast def REGULAR_EXPRESSION_BACKSLASH_SEQUENCE(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'start' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = JavaScriptParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, JavaScriptParser, name='JavaScript') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
return ast def regex(self, ast): # noqa return ast def boolean(self, ast): # noqa return ast def eof(self, ast): # noqa return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = EBNFBootstrapParser() return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, EBNFBootstrapParser, name='EBNFBootstrap') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def number(self, ast): # noqa return ast def string(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'start' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = BAASParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, BAASParser, name='BAAS') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def program(self, ast): # noqa return ast def start(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'id' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = BoiParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, BoiParser, name='Boi') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
self._token('#') self._check_eof() class GrammarSemantics(object): def start(self, ast): # noqa return ast def main(filename, start='start', **kwargs): if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = GrammarParser() return parser.parse(text, start=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, GrammarParser, name='Grammar') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def grammar(self, ast): # noqa return ast def start(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'symbol' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = TextGrammarParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, TextGrammarParser, name='TextGrammar') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def bool(self, ast): # noqa return ast def typed_belly(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'start' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = PlistParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, PlistParser, name='Plist') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
return ast def codeblock(self, ast): # noqa return ast def code(self, ast): # noqa return ast def lang(self, ast): # noqa return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = FLUENTParser() return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, FLUENTParser, name='FLUENT') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
return ast def S2(self, ast): # noqa return ast def S3(self, ast): # noqa return ast def S4(self, ast): # noqa return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = RegexpParser() return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, RegexpParser, name='Regexp') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def if_stmt(self, ast): # noqa return ast def return_stmt(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'start' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = CryoLangParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, CryoLangParser, name='CryoLang') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
return ast def name(self, ast): # noqa return ast def identifier(self, ast): # noqa return ast def main(filename, start='start', **kwargs): if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = WewParser() return parser.parse(text, start=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, WewParser, name='Wew') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def onlyAction(self, ast): # noqa return ast def onlyRule(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'str' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = GameLogicParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, GameLogicParser, name='GameLogic') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def declarations(self, ast): # noqa return ast def all_declarations(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'triple_dbl_quoted_string' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = depfileParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, depfileParser, name='depfile') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def string(self, ast): # noqa return ast def arg(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'start' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = DiscordScriptParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, DiscordScriptParser, name='DiscordScript') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def array(self, ast): # noqa return ast def struct(self, ast): # noqa return ast def operator(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'start' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = straceParser() return parser.parse(text, rule_name=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, straceParser, name='strace') data = asjson(ast) print(json.dumps(data, indent=2))
return ast def TSTRING_BODY(self, ast): # noqa return ast def op(self, ast): # noqa return ast def main(filename, start='program', **kwargs): if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = ObsidianParser() return parser.parse(text, start=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, ObsidianParser, name='Obsidian') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
return ast def eof(self, ast): # noqa return ast def main(filename, start=None, **kwargs): if start is None: start = 'start' if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = EBNFBootstrapParser() return parser.parse( text, rule_name=start, filename=filename, **kwargs ) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, EBNFBootstrapParser, name='EBNFBootstrap') data = asjson(ast) print(json.dumps(data, indent=2))
return ast def invert(self, ast): # noqa return ast def selector(self, ast): # noqa return ast def main(filename, start='start', **kwargs): if not filename or filename == '-': text = sys.stdin.read() else: with open(filename) as f: text = f.read() parser = SelectorParser() return parser.parse(text, start=start, filename=filename, **kwargs) if __name__ == '__main__': import json from tatsu.util import asjson ast = generic_main(main, SelectorParser, name='Selector') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()