def parse(self, expr): """Uses the parser to convert a program to an AST Always ignores the top-level Program AST """ tokens = lexer.tokenize(expr) return parser.parse(tokens)[0]
def mark(self, expr): """Returns a marked AST for the specified expression""" ast = parser.parse(lexer.tokenize(expr)) analyzers.markTailContexts(ast) return ast[0]