示例#1
0
    def visitAssign_stmt(self, ctx: BKITParser.Assign_stmtContext):
        param1 = None
        param2 = None
        if ctx.ID():
            param1 = Id(ctx.ID().getText())
        elif ctx.expr7():
            param1 = ArrayCell(ctx.expr7().accept(self), ctx.index_op().accept(self))


        param2 = ctx.expr().accept(self)

        return Assign(param1, param2)
示例#2
0
 def visitAssign_stmt(self, ctx:BKITParser.Assign_stmtContext):
     lhs = Id(ctx.ID().getText()) if ctx.ID() else self.visit( ctx.array_cell())
     rhs = self.visitExpr(ctx.expr())
     return Assign(lhs, rhs)
示例#3
0
 def visitAssign_stmt(self, ctx: BKITParser.Assign_stmtContext):
     lhs = Id(ctx.ID().getText()) if ctx.ID() else self.visitComposite_var(
         ctx.composite_var())
     rhs = self.visitExpr(ctx.expr())
     return [AssignStmt(lhs, rhs)]