Example #1
0
 def visitExpr8(self, ctx: MCParser.Expr8Context):
     if ctx.LSB() and ctx.RSB():
         arr = self.visitExpr9(ctx.expr9())
         idx = self.visitExpr0(ctx.expr0())
         return ArrayCell(arr, idx)
     else:
         return self.visitExpr9(ctx.expr9())
Example #2
0
 def visitExpr8(self, ctx: MCParser.Expr8Context):
     if (ctx.getChildCount() == 1):
         return self.visit(ctx.expr9())
     else:
         arr = self.visit(ctx.expr9())
         idx = self.visit(ctx.expr())
         return ArrayCell(arr, idx)
Example #3
0
 def visitExpr8(self, ctx: MCParser.Expr8Context):
     if ctx.getChildCount() == 3:
         return UnaryOp("[]", self.visit(expr9()))
     else:
         return self.visit(ctx.expr9())
Example #4
0
 def visitExpr8(self, ctx: MCParser.Expr8Context):
     return self.visit(ctx.operands()) if ctx.getChildCount() == 1 else ArrayCell(self.visit(ctx.operands()), self.visit(ctx.expr()))
Example #5
0
 def visitExpr8(self, ctx:MCParser.Expr8Context):
     # expr8 : expr9 LSB expr RSB | expr9;
     if ctx.getChildCount() == 4:
         return ArrayCell(self.visit(ctx.expr9()),self.visit(ctx.expr()))
     else:
         return self.visit(ctx.expr9())