Skip to content

Commit

Permalink
Merge pull request #21 from DanielVenturini/análise_semantica
Browse files Browse the repository at this point in the history
Fix erro de OU e E lógico na expressão do IF
  • Loading branch information
DanielVenturini authored Nov 19, 2018
2 parents efb7326 + 77517d6 commit 0956c5b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions semantic/poda.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ TreeNode *get_expressao_simples(TreeNode *exp_simples) {

TreeNode *get_expressao_logica(TreeNode *exp_logico) {

if(exp_logico->filhos[0]->bnfval == EXPRESSAO_LOGICA && exp_logico->filhos[1]->bnfval == EXPRESSAO_LOGICA) {
exp_logico = exp_logico->filhos[0];
}

if(!exp_logico->filhos[1]) { // se não for um operador_logico, então é uma expressao_simples
return get_expressao_simples(exp_logico->filhos[0]);
}
Expand Down

0 comments on commit 0956c5b

Please sign in to comment.