Exemple #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
Exemple #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
Exemple #3
0
 def visitVardecls(self, ctx:MCParser.VardeclsContext):
     return self.visitVardecl(ctx.vardecl()) + self.visitVardecls(ctx.vardecls()) if ctx.vardecls() else self.visitVardecl(ctx.vardecl())
Exemple #4
0
 def visitVardecls(self,ctx:MCParser.VardeclsContext):
     return [self.visit(ctx.vardecl())] + self.visit(ctx.vardecls()) if (ctx.vardecls()) else [self.visit(ctx.vardecl())]