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
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