예제 #1
0
파일: Count.py 프로젝트: nhthang99/cse-ppl
 def visitMctype(self, ctx: MCParser.MctypeContext):
     return 1 + self.visitMctype(ctx.mctype()) if ctx.mctype() else 0
예제 #2
0
 def visitMctype(self, ctx:MCParser.MctypeContext):
     return 5 + self.visitMctype(ctx.mctype()) if ctx.getChildCount() != 1 else 1
예제 #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