Exemplo n.º 1
0
 def visitExp5(self, ctx: BKITParser.ProgramContext):
     # index_exp
     if (ctx.getChildCount() == 1):
         return ctx.index_exp().accept(self)
     return UnaryOp(ctx.getChild(0).getText(), ctx.exp5().accept(self))
Exemplo n.º 2
0
 def visitExp4(self, ctx: BKITParser.ProgramContext):
     if (ctx.getChildCount() == 1):
         return ctx.exp5().accept(self)
         # return UnaryOp("[]", ArrayCell(None, [IntLiteral(value=34)]))
     return UnaryOp(ctx.getChild(0).getText(), ctx.exp4().accept(self))