Example #1
0
 def visitVardecls(self, ctx: MCParser.VardeclsContext):
     if ctx.getChildCount() == 2:
         return self.visit(ctx.vardecl()) + self.visit(ctx.vardecls(
         ))  # return number of leaf nodes from the first right hand side
     else:
         return self.visit(ctx.vardecl(
         ))  # return number of leaf nodes from the first right hand side
Example #2
0
 def visitVardecls(self, ctx: MCParser.VardeclsContext):
     if ctx.getChildCount() == 2:
         return [self.visit(ctx.vardecl())] + self.visit(ctx.vardecls(
         ))  # return the list of VarDecl for the first right hand side
     else:
         return [
             self.visit(ctx.vardecl())
         ]  # return the list of VarDecl for the second right hand side