Пример #1
0
 public Expresiones Addexp_prime(Expresiones E)
 {
     if (currentToken.Tipo == Lexico.TipoToken.TK_SUMA)
     {
         currentToken = lex.NextToken();
         Suma sum = new Suma(E, Addexp_prime(Addexp()));
         return sum;
     }
     else if (currentToken.Tipo == Lexico.TipoToken.TK_RESTA)
     {
         currentToken = lex.NextToken();
         Resta rest = new Resta(E, Addexp_prime(Addexp()));
         return rest;
     }
     return E;
 }
Пример #2
0
        public Expresiones AddExprP(Expresiones E)
        {
            if (currentToken.Tipo == TipoToken.TK_SUMA)
            {
                currentToken = lex.NextToken();
                Suma Sum = new Suma(E, AddExprP(AddExpr()));

                return Sum;
            }
            else if (currentToken.Tipo == TipoToken.TK_RESTA)
            {
                currentToken = lex.NextToken();
                Resta Res = new Resta(E, AddExprP(AddExpr()));

                return Res;
            }
            else
            {
                return E;
            }
        }