public Expresiones Addexp_prime(Expresiones E) { try { 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; } catch (Exception ex) { throw ex; } }
public Expresiones AddExprP(Expresiones E) { try { 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; } } catch (Exception ex) { throw ex; } }