antlr-ast
antlr-ast copied to clipboard
Function for mapping visitor -> AstNode classmethods
Currently, a common pattern is to repeat visitor methods like below. But could be collapsed easily.
def visitQuery_specification(self, ctx):
return SelectStmt._from_fields(self, ctx)
def visitInsert_statement(self, ctx):
return InsertStmt._from_fields(self, ctx)
def visitDelete_statement(self, ctx):
return DeleteStmt._from_fields(self, ctx)
def visitUpdate_statement(self, ctx):
return UpdateStmt._from_fields(self, ctx)
def visitUnion_query_expression(self, ctx):
return Union._from_fields(self, ctx)