Ejemplo n.º 1
0
 def visitMctype(self, ctx: MCParser.MctypeContext):
     return 1 + self.visitMctype(ctx.mctype()) if ctx.mctype() else 0
Ejemplo n.º 2
0
 def visitMctype(self, ctx:MCParser.MctypeContext):
     return 5 + self.visitMctype(ctx.mctype()) if ctx.getChildCount() != 1 else 1
Ejemplo n.º 3
0
 def visitMctype(self, ctx: MCParser.MctypeContext):
     if ctx.getChildCount() == 6:
         return 5 + self.visit(ctx.mctype(
         ))  # return number of leaf nodes from the third right hand side
     else:
         return 1  # return number of leaf nodes from the first or second right hand side