def factor(self, ast): return ast def unary(self, ast): return ast def id(self, ast): return ast def constant(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = cl1ckParser(parseinfo=False) return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json ast = generic_main(main, cl1ckParser, name='cl1ck') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
nameguard=None, comments_re=None, eol_comments_re=None, ignorecase=None, left_recursion=True, **kwargs): with open(filename) as f: text = f.read() parser = DatParser(parseinfo=False) ast = parser.parse( text, startrule, filename=filename, trace=trace, whitespace=whitespace, nameguard=nameguard, ignorecase=ignorecase, **kwargs) return ast if __name__ == '__main__': import json ast = generic_main(main, DatParser, name='Dat') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
comments_re=None, eol_comments_re=None, ignorecase=None, left_recursion=True, **kwargs): with open(filename) as f: text = f.read() whitespace = whitespace or None parser = CalcParser(parseinfo=False) ast = parser.parse( text, startrule, filename=filename, trace=trace, whitespace=whitespace, nameguard=nameguard, ignorecase=ignorecase, **kwargs) return ast if __name__ == '__main__': import json ast = generic_main(main, CalcParser, name='Calc') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
comments_re=None, eol_comments_re=None, ignorecase=None, left_recursion=True, **kwargs): with open(filename) as f: text = f.read() whitespace = whitespace or None parser = MusicTextParser(parseinfo=False) ast = parser.parse(text, startrule, filename=filename, trace=trace, whitespace=whitespace, nameguard=nameguard, ignorecase=ignorecase, **kwargs) return ast if __name__ == '__main__': import json ast = generic_main(main, MusicTextParser, name='MusicText') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
return ast def label(self, ast): return ast def content(self, ast): return ast def etext(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = djvused_hiddentextParser() return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json from grako.util import asjson ast = generic_main(main, djvused_hiddentextParser, name='djvused_hiddentext') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
return ast def term(self, ast): return ast def factor(self, ast): return ast def literal(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = PraxParser() return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json from grako.util import asjson ast = generic_main(main, PraxParser, name='Prax') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def div(self, ast): return ast def atom(self, ast): return ast def number(self, ast): return ast def identifier(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = SimpleLangParser(parseinfo=False) return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json ast = generic_main(main, SimpleLangParser, name='SimpleLang') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
return ast def string(self, ast): return ast def NEWLINE(self, ast): return ast def CLASS(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = thinkingprocessesParser() return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json from grako.util import asjson ast = generic_main(main, thinkingprocessesParser, name='thinkingprocesses') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
comments_re=None, eol_comments_re=None, ignorecase=None, left_recursion=True, **kwargs): with open(filename) as f: text = f.read() whitespace = whitespace or None parser = RQLParser(parseinfo=False) ast = parser.parse( text, startrule, filename=filename, trace=trace, whitespace=whitespace, nameguard=nameguard, ignorecase=ignorecase, **kwargs) return ast if __name__ == '__main__': import json ast = generic_main(main, RQLParser, name='RQL') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
comments_re='\\(\\*((?:.|\\n)*?)\\*\\)', eol_comments_re='#([^\\n]*?)$', ignorecase=None, left_recursion=True, **kwargs): with open(filename) as f: text = f.read() whitespace = whitespace or None parser = GrakoBootstrapParser(parseinfo=False) ast = parser.parse( text, startrule, filename=filename, trace=trace, whitespace=whitespace, nameguard=nameguard, ignorecase=ignorecase, **kwargs) return ast if __name__ == '__main__': import json ast = generic_main(main, GrakoBootstrapParser, name='GrakoBootstrap') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
def message(self, ast): return ast def messageBody(self, ast): return ast def proto(self, ast): return ast def topLevelDef(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = ProtobufParser(parseinfo=False) return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json ast = generic_main(main, ProtobufParser, name='Protobuf') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
nameguard=None, comments_re=None, eol_comments_re=None, ignorecase=None, left_recursion=True, **kwargs): with open(filename) as f: text = f.read() parser = DatParser(parseinfo=False) ast = parser.parse(text, startrule, filename=filename, trace=trace, whitespace=whitespace, nameguard=nameguard, ignorecase=ignorecase, **kwargs) return ast if __name__ == '__main__': import json ast = generic_main(main, DatParser, name='Dat') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
return ast def integer(self, ast): return ast def float(self, ast): return ast def infinity(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = CspParser() return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json from grako.util import asjson ast = generic_main(main, CspParser, name='Csp') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
nameguard=None, comments_re=None, eol_comments_re=None, ignorecase=None, left_recursion=True, **kwargs): with open(filename) as f: text = f.read() parser = SSSLParser(parseinfo=False) ast = parser.parse( text, startrule, filename=filename, trace=trace, whitespace=whitespace, nameguard=nameguard, ignorecase=ignorecase, **kwargs) return ast if __name__ == '__main__': import json ast = generic_main(main, SSSLParser, name='SSSL') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
comments_re='/\\*[\\s\\S]*?\\*/', eol_comments_re='--.*?$', ignorecase=True, left_recursion=True, **kwargs): with open(filename) as f: text = f.read() whitespace = whitespace or re.compile('\\s+', RE_FLAGS | re.DOTALL) parser = SqlParser(parseinfo=False) ast = parser.parse(text, startrule, filename=filename, trace=trace, whitespace=whitespace, nameguard=nameguard, ignorecase=ignorecase, **kwargs) return ast if __name__ == '__main__': import json ast = generic_main(main, SqlParser, name='Sql') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
return ast def regex(self, ast): return ast def boolean(self, ast): return ast def eof(self, ast): 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 grako.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()
comments_re=None, eol_comments_re=None, ignorecase=None, left_recursion=True, **kwargs): with open(filename) as f: text = f.read() whitespace = whitespace or None parser = LilyParser(parseinfo=False) ast = parser.parse(text, startrule, filename=filename, trace=trace, whitespace=whitespace, nameguard=nameguard, ignorecase=ignorecase, **kwargs) return ast if __name__ == '__main__': import json ast = generic_main(main, LilyParser, name='Lily') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
nameguard=None, comments_re=None, eol_comments_re=None, ignorecase=None, left_recursion=True, **kwargs): with open(filename) as f: text = f.read() parser = signatureParser(parseinfo=False) ast = parser.parse( text, startrule, filename=filename, trace=trace, whitespace=whitespace, nameguard=nameguard, ignorecase=ignorecase, **kwargs) return ast if __name__ == '__main__': import json ast = generic_main(main, signatureParser, name='signature') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
def STRING(self, ast): return ast def NEWLINE(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() print('got text', text) print('startrule', startrule) parser = PythonParser(parseinfo=False) print 'made this', parser.parse(text, startrule, filename=filename, **kwargs) return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json ast = generic_main(main, PythonParser, name='Python') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
return ast def identifier_start(self, ast): return ast def identifier_part(self, ast): return ast def attribute_name(self, ast): return ast def compound_attribute_name(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = CqlParser(parseinfo=False) return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json ast = generic_main(main, CqlParser, name='Cql') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
return ast def pattern(self, ast): return ast def topts(self, ast): return ast def fopts(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = jasParser() return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json from grako.util import asjson ast = generic_main(main, jasParser, name='jas') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
comments_re=None, eol_comments_re=None, ignorecase=None, left_recursion=True, **kwargs): with open(filename) as f: text = f.read() whitespace = whitespace or None parser = RQLParser(parseinfo=False) ast = parser.parse(text, startrule, filename=filename, trace=trace, whitespace=whitespace, nameguard=nameguard, ignorecase=ignorecase, **kwargs) return ast if __name__ == '__main__': import json ast = generic_main(main, RQLParser, name='RQL') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
return ast def parameter(self, ast): return ast def text(self, ast): return ast def string(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = DisplayPatternParser() return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json from grako.util import asjson ast = generic_main(main, DisplayPatternParser, name='DisplayPattern') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
comments_re='\\(\\*((?:.|\\n)*?)\\*\\)', eol_comments_re='#([^\\n]*?)$', ignorecase=None, left_recursion=True, **kwargs): with open(filename) as f: text = f.read() whitespace = whitespace or None parser = GrakoBootstrapParser(parseinfo=False) ast = parser.parse(text, startrule, filename=filename, trace=trace, whitespace=whitespace, nameguard=nameguard, ignorecase=ignorecase, **kwargs) return ast if __name__ == '__main__': import json ast = generic_main(main, GrakoBootstrapParser, name='GrakoBootstrap') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
nameguard=None, comments_re=None, eol_comments_re=None, ignorecase=None, left_recursion=True, **kwargs): with open(filename) as f: text = f.read() parser = signatureParser(parseinfo=False) ast = parser.parse(text, startrule, filename=filename, trace=trace, whitespace=whitespace, nameguard=nameguard, ignorecase=ignorecase, **kwargs) return ast if __name__ == '__main__': import json ast = generic_main(main, signatureParser, name='signature') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
def VARIANT_IDENTIFIER(self, ast): return ast def IDENTIFIER(self, ast): return ast def LIST_SEPARATOR(self, ast): return ast def SEP(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = GnomicParser(parseinfo=False) return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json ast = generic_main(main, GnomicParser, name='Gnomic') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
return ast def complex_expr(self, ast): return ast def line(self, ast): return ast def start(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = CropParser() return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json from grako.util import asjson ast = generic_main(main, CropParser, name='Crop') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def number(self, ast): return ast def INT(self, ast): return ast def NAME(self, ast): return ast def NEWLINE(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = WhileLangParser(parseinfo=False) return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json ast = generic_main(main, WhileLangParser, name='WhileLang') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
def multimap(self, ast): return ast def type(self, ast): return ast def turnstile(self, ast): return ast def sequent(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = SequentsParser(parseinfo=False) return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json ast = generic_main(main, SequentsParser, name='Sequents') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
return ast def signextend(self, ast): return ast def not_(self, ast): return ast def issecure(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = pcodeParser() return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json from grako.util import asjson ast = generic_main(main, pcodeParser, name='pcode') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
comments_re=None, eol_comments_re=None, ignorecase=None, left_recursion=True, **kwargs): with open(filename) as f: text = f.read() whitespace = whitespace or None parser = LilyParser(parseinfo=False) ast = parser.parse( text, startrule, filename=filename, trace=trace, whitespace=whitespace, nameguard=nameguard, ignorecase=ignorecase, **kwargs) return ast if __name__ == '__main__': import json ast = generic_main(main, LilyParser, name='Lily') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
def division(self, ast): return ast def factor(self, ast): return ast def subexpression(self, ast): return ast def number(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = CalcParser(parseinfo=False) return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json ast = generic_main(main, CalcParser, name='Calc') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
return ast def uint(self, ast): return ast def int(self, ast): return ast def float(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = NetlistParser() return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json from grako.util import asjson ast = generic_main(main, NetlistParser, name='Netlist') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
return ast def literal_int(self, ast): return ast def nondigit(self, ast): return ast def pointer_or_ref_chars(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = SignatureParser() return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json from grako.util import asjson ast = generic_main(main, SignatureParser, name='Signature') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
return ast def digits(self, ast): return ast def letters(self, ast): return ast def whitespace(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() parser = ForestParser() return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json from grako.util import asjson ast = generic_main(main, ForestParser, name='Forest') print('AST:') print(ast) print() print('JSON:') print(json.dumps(asjson(ast), indent=2)) print()
def string(self, ast): return ast def STRING(self, ast): return ast def NEWLINE(self, ast): return ast def main(filename, startrule, **kwargs): with open(filename) as f: text = f.read() print( 'got text', text) print( 'startrule', startrule) parser = PythonParser(parseinfo=False) print 'made this', parser.parse(text, startrule, filename=filename, **kwargs) return parser.parse(text, startrule, filename=filename, **kwargs) if __name__ == '__main__': import json ast = generic_main(main, PythonParser, name='Python') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()
comments_re='/\\*[\\s\\S]*?\\*/', eol_comments_re='--.*?$', ignorecase=True, left_recursion=True, **kwargs): with open(filename) as f: text = f.read() whitespace = whitespace or re.compile('\\s+', RE_FLAGS | re.DOTALL) parser = SqlParser(parseinfo=False) ast = parser.parse( text, startrule, filename=filename, trace=trace, whitespace=whitespace, nameguard=nameguard, ignorecase=ignorecase, **kwargs) return ast if __name__ == '__main__': import json ast = generic_main(main, SqlParser, name='Sql') print('AST:') print(ast) print() print('JSON:') print(json.dumps(ast, indent=2)) print()