Beispiel #1
0
 def visitDefaultBranch(self, ctx: GrammarParser.DefaultBranchContext):
     my_ast = AST.CaseBranch()
     self.add_child_block(my_ast, ctx.block())
     my_ast.set_source_loc(source_from_ctx(ctx))
     return my_ast
Beispiel #2
0
 def visitCaseBranch(self, ctx: GrammarParser.CaseBranchContext):
     my_ast = AST.CaseBranch()
     my_ast.set_constant(self.visit(ctx.literal()))
     self.add_child_block(my_ast, ctx.block())
     my_ast.set_source_loc(source_from_ctx(ctx))
     return my_ast