diff options
author | HombreLaser <sebastian-440@live.com> | 2022-04-10 13:58:26 -0500 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2022-04-10 13:58:26 -0500 |
commit | da8027bf2a3d632d3b03279300eb04627b22c05e (patch) | |
tree | 86bb3912a48c9f376a38988123be18fee276d6e3 | |
parent | 531f8f2f1adc1c6777920f0a8c68caaee30b0fc4 (diff) |
Eliminado bloque try catch
-rw-r--r-- | parser.cpp | 12 |
1 files changed, 0 insertions, 12 deletions
@@ -69,12 +69,7 @@ void Parser::parsePrimeExpr() { if(tokenizer.getCurrentToken().type == sum || tokenizer.getCurrentToken().type == substraction) { current = tokenizer.getCurrentToken().type; - - try { tokenizer.nextToken(); - } catch(const LexerException &e) { - panic(); - } if(checkToken()) panic(); @@ -96,7 +91,6 @@ void Parser::parsePrimeTerm() { if(tokenizer.getCurrentToken().type == multiplication || tokenizer.getCurrentToken().type == division) { current = tokenizer.getCurrentToken().type; - tokenizer.nextToken(); if(checkToken()) @@ -115,7 +109,6 @@ void Parser::parsePower() { void Parser::parsePrimePower() { if(tokenizer.getCurrentToken().type == power) { - tokenizer.nextToken(); if(tokenizer.getCurrentToken().type != number) @@ -134,7 +127,6 @@ void Parser::parseFactor() { switch(tokenizer.getCurrentToken().type) { case substraction: - tokenizer.nextToken(); parseExpr(); @@ -172,14 +164,12 @@ void Parser::parseFactor() { panic(); tokenizer.nextToken(); - parseExpr(); if(tokenizer.getCurrentToken().type != right_parens) panic(); tokenizer.nextToken(); - tree_stack.push_back(new Function(popStack(), name)); break; @@ -192,13 +182,11 @@ void Parser::parseFactor() { panic(); // Se introdujeron dos variables en la expresión. tree_stack.push_back(new Variable(tokenizer.getCurrentToken().value[0])); - tokenizer.nextToken(); break; case number: tree_stack.push_back(new Literal(stoi(tokenizer.getCurrentToken().value))); - tokenizer.nextToken(); break; |