diff options
Diffstat (limited to 'src/ast/nodes/ExprNode.java')
-rw-r--r-- | src/ast/nodes/ExprNode.java | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/ast/nodes/ExprNode.java b/src/ast/nodes/ExprNode.java index 344f3c0..4bb67f7 100644 --- a/src/ast/nodes/ExprNode.java +++ b/src/ast/nodes/ExprNode.java @@ -106,30 +106,23 @@ public class ExprNode implements Node { @Override public ArrayList<SemanticError> checkSemantics(SymbolTable ST, int _nesting) { ArrayList<SemanticError> errors = new ArrayList<SemanticError>(); - if (atom != null && !trailers.isEmpty()) { - // function call - if (!Arrays.asList(bif).contains(atom.getId())) { - errors.addAll(atom.checkSemantics(ST, _nesting)); - } - } else { - // butto tutto quello che c'era prima nell'else così non rischio di perdere niente di utile - if (atom != null) { - errors.addAll(atom.checkSemantics(ST, _nesting)); - } - - if (compOp != null) { - errors.addAll(compOp.checkSemantics(ST, _nesting)); - } - - for (var expr : exprs) { - errors.addAll(expr.checkSemantics(ST, _nesting)); - } - + + if (atom != null && !Arrays.asList(bif).contains(atom.getId())) { + errors.addAll(atom.checkSemantics(ST, _nesting)); + for (var trailer : trailers) { errors.addAll(trailer.checkSemantics(ST, _nesting)); } } + + if (compOp != null) { + errors.addAll(compOp.checkSemantics(ST, _nesting)); + } + for (var expr : exprs) { + errors.addAll(expr.checkSemantics(ST, _nesting)); + } + return errors; } |