def visitStatement(self,ctx:MPParser.StatementContext):
     return self.visit(ctx.getChild(0))
Exemple #2
0
 def visitStatement(self, ctx: MPParser.StatementContext):
     if ctx.assignment_statement():
         return self.visit(ctx.assignment_statement())
     elif ctx.if_statement():
         return [self.visit(ctx.if_statement())]
     elif ctx.for_statement():
         return [self.visit(ctx.for_statement())]
     elif ctx.while_statement():
         return [self.visit(ctx.while_statement())]
     elif ctx.break_statement():
         return [self.visit(ctx.break_statement())]
     elif ctx.continue_statement():
         return [self.visit(ctx.continue_statement())]
     elif ctx.return_statement():
         return [self.visit(ctx.return_statement())]
     elif ctx.call_statement():
         return [self.visit(ctx.call_statement())]
     elif ctx.with_statement():
         return [self.visit(ctx.with_statement())]
     else:
         return self.visit(ctx.compound_statement())
 def visitStatement(self, ctx: MPParser.StatementContext):
     if ctx.assignStatement():
         return self.visit(ctx.assignStatement())
     elif ctx.ifStatement():
         return self.visit(ctx.ifStatement())
     elif ctx.whileStatement():
         return self.visit(ctx.whileStatement())
     elif ctx.forStatement():
         return self.visit(ctx.forStatement())
     elif ctx.withStatement():
         return self.visit(ctx.withStatement())
     elif ctx.callStatement():
         return self.visit(ctx.callStatement())
     elif ctx.breakStatement():
         return self.visit(ctx.breakStatement())
     elif ctx.continueStatement():
         return self.visit(ctx.continueStatement())
     elif ctx.returnStatement():
         return self.visit(ctx.returnStatement())
     else:
         return ["Unknown Statement"]
Exemple #4
0
 def visitStatement(self, ctx: MPParser.StatementContext):
     if ctx.assignmentstatement():
         return self.visit(ctx.assignmentstatement())
     elif ctx.ifstatement():
         return [self.visit(ctx.ifstatement())]
     elif ctx.whilestatement():
         return [self.visit(ctx.whilestatement())]
     elif ctx.forstatement():
         return [self.visit(ctx.forstatement())]
     elif ctx.compoundstatement():
         return self.visit(ctx.compoundstatement())
     elif ctx.withstatement():
         return [self.visit(ctx.withstatement())]
     elif ctx.callstatement():
         return [self.visit(ctx.callstatement())]
     elif ctx.breakstatement():
         return [self.visit(ctx.breakstatement())]
     elif ctx.continuestatement():
         return [self.visit(ctx.continuestatement())]
     else:
         return [self.visit(ctx.returnstatement())]
Exemple #5
0
 def visitStatement(self, ctx: MPParser.StatementContext):
     if (ctx.semistatement()):
         return self.visit(ctx.semistatement())
     else:
         return self.visit(ctx.nomistatement())
Exemple #6
0
 def visitStatement(self, ctx: MPParser.StatementContext):
     #statement:  match_statement | unmatch_statement ;
     if ctx.match_statement():
         return self.visit(ctx.match_statement())
     elif ctx.unmatch_statement():
         return self.visit(ctx.unmatch_statement())