コード例 #1
0
        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));
            }
        }
コード例 #2
0
 public termSinMulopFactorAST(factorAST f)
 {
     this.factor = f;
 }
コード例 #3
0
ファイル: unMulopTermAST.cs プロジェクト: jerivemo/Compilador
 public unMulopTermAST(mulopAST m, factorAST f)
 {
     mulop = m;
     factor = f;
 }
コード例 #4
0
 public termConMulopFactorAST(factorAST f, listMulopFactorAST l)
 {
     factor           = f;
     listMuloppFactor = l;
 }
コード例 #5
0
 public termSinMulopFactorAST(factorAST f)
 {
     this.factor = f;
 }
コード例 #6
0
 public unMulopTermAST(mulopAST m, factorAST f)
 {
     mulop  = m;
     factor = f;
 }