public termAST parseTerm() { listMulopFactorAST temp = null; listMulopFactorAST result = null; factorAST fact = null; mulopAST mul = null; factorAST fact2 = null; fact = parseFactor(); Boolean ind = false; while (currentToken.sym == sym.POR | currentToken.sym == sym.DIV | currentToken.sym == sym.PORC) { if (ind == false) { mul = parseMulop(); fact2 = parseFactor(); result = new unMulopTermAST(mul, fact2); ind = true; } else { mul = parseMulop(); fact2 = parseFactor(); temp = new unMulopTermAST(mul, fact2); result = new varMulopTermAST(result, temp); } } if (ind == false) { return(new termSinMulopFactorAST(fact)); } else { return(new termConMulopFactorAST(fact, result)); } }
public varMulopTermAST(listMulopFactorAST hh1, listMulopFactorAST hh2) { h1 = hh1; h2 = hh2; }
public termConMulopFactorAST(factorAST f, listMulopFactorAST l) { factor = f; listMuloppFactor = l; }