def _ifBlock1(ib, if_, lp, c0, rp, lcb, sl, rcb, else_, ib0): if "node" not in ib: ib.node = ASTNode("ifBlock", c0.node, sl.node) else: ib.node.addChild(c0.node) ib.node.addChild(sl.node) ib0.node = ib.node
def _id1(id_, id_0, assg, c0): id_.node = ASTNode("assign", ASTNode(id_0.getContent(), actionID="id_var"), c0.node)
def _c33(c3, c30, eq, c4): c3.node = ASTNode("le", c30.node, c4.node)
def _c31(c3, c30, eq, c4): c3.node = ASTNode("lt", c30.node, c4.node)
def _c20(c2, not_, c3): c2.node = ASTNode("not", c3.node)
def _c00(c0, c00, and_, c1): c0.node = ASTNode("and", c00.node, c1.node)
def _continue0(flc, cont, semi): flc.node = ASTNode("continue")
def _val1(value, constant): value.node = ASTNode(constant.val, actionID="const") value.node.type = constant.type
def _whileBlock0(wb, while_, lp, c0, rp, lcb, sl, rcb): wb.node = ASTNode("whileBlock", c0.node, sl.node)
def _alarr1(alarr, lo, c0, ro): alarr.node = ASTNode("dimensions", c0.node)
def _alloc1(alloc, new, basicType, arr): alloc.node = ASTNode("newArr", basicType.node, arr.node)
def _alloc0(alloc, new, func): alloc.node = ASTNode("newObj", func.node)
def _defp0(defp, type_, id_): defp.node = ASTNode("defParam", type_.node, ASTNode(id_.getContent(), actionID="id_func_var"))
def _defpl1(defpl, defp): defpl.node = ASTNode("defParamList", defp.node)
def _funcdec0(funcDec, type_, id_, lp, defParamList, rp, lcb, stmtl, rcb): funcDec.node = ASTNode("funcDec", type_.node, ASTNode(id_.getContent(), actionID="id_func"), defParamList.node, stmtl.node)
def _stmtl1(stmtl, stmt): stmtl.node = ASTNode("stmtList", stmt.node)
def _pal2(paraml): paraml.node = ASTNode("parameterList")
def _empty(a): a.node = ASTNode("none")
def _val2(value, id_): value.node = ASTNode(id_.getContent(), actionID="id_var")
def _forblock0(forBlock, for_, lp, forinit, semi0, forexpr0, semi1, forexpr1, rp, lcb, stmtl, rcb): forBlock.node = ASTNode("forBlock", forinit.node, forexpr0.node, stmtl.node, forexpr1.node)
def _continue1(flc, brk, semi): flc.node = ASTNode("break")
def _rs0(rs, ret, c0, semi): rs.node = ASTNode("return", c0.node)
def _c10(c1, c10, or_, c2): c1.node = ASTNode("or", c10.node, c2.node)
def _basicType0(bt, typ): bt.node = ASTNode(typ.getContent(), actionID="type")
def _c30(c3, c30, eq, c4): c3.node = ASTNode("eq", c30.node, c4.node)
def _func0(func, id_, lp, pal, rp): func.node = ASTNode("functionCall", ASTNode(id_.getContent(), actionID="noAction"), pal.node)
def _c32(c3, c30, eq, c4): c3.node = ASTNode("gt", c30.node, c4.node)
def _pal1(paraml, param): paraml.node = ASTNode("parameterList", param.node)
def _c34(c3, c30, eq, c4): c3.node = ASTNode("ge", c30.node, c4.node)
def _id0(id_, id_0): id_.node = ASTNode(id_0.getContent(), actionID="id_var")