示例#1
0
 def visitStmt(self, ctx: MPParser.StmtContext):
     if ctx.breakstmt():
         return Break()
     elif ctx.continuestmt():
         return Continue()
     else:
         return self.visit(ctx.getChild(0))
示例#2
0
 def visitStmt(self, ctx: MPParser.StmtContext):
     stmt = []
     for x in ctx.stmtsingle():
         x = self.visit(x)
         #Kiểm tra x có phải list không
         if isinstance(x, list):
             for i in x:
                 stmt.append(i)
         else:
             stmt.append(x)
     return stmt  #[self.visit(x) for x in ctx.stmtsingle()]#list(map(self.visit,ctx.stmtsingle()))
示例#3
0
 def visitStmt(self, ctx: MPParser.StmtContext):
     return self.visit(ctx.funcall())
示例#4
0
 def visitStmt(self, ctx: MPParser.StmtContext):
     if ctx.compound_stmt() or ctx.assign_stmt():
         return self.visitChildren(ctx)
     else:
         return [self.visitChildren(ctx)]
示例#5
0
 def visitStmt(self, ctx: MPParser.StmtContext):
     return self.visit(ctx.getChild(0))
 def visitStmt(self, ctx: MPParser.StmtContext):
     # if ctx.stmtAssign():
     #     return self.visit(ctx.stmtAssign())
     return self.visit(ctx.getChild(0))
示例#7
0
 def visitStmt(self, ctx: MPParser.StmtContext):
     if ctx.assignState() is not None:
         return self.visit(ctx.assignState())
     elif ctx.ifState() is not None:
         return self.visit(ctx.ifState())
     elif ctx.forState() is not None:
         return self.visit(ctx.forState())
     elif ctx.whileState() is not None:
         return self.visit(ctx.whileState())
     elif ctx.breakState() is not None:
         return self.visit(ctx.breakState())
     elif ctx.continueState() is not None:
         return self.visit(ctx.continueState())
     elif ctx.returnState() is not None:
         return self.visit(ctx.returnState())
     elif ctx.callState() is not None:
         return self.visit(ctx.callState())
     elif ctx.cpstate() is not None:
         return self.visit(ctx.cpstate())
     elif ctx.withState() is not None:
         return self.visit(ctx.withState())
 def visitStmt(self, ctx: MPParser.StmtContext):
     '''stmt: assignstmt | ifstmt | whilestmt | forstmt | breakstmt | continuestmt | returnstmt | compoundstmt | withstmt | callstmt;'''
     return self.visit(ctx.getChild(0))