[06 - Top Down Parser] Fix program18ExprAll

Add left & right bracket parsing
This commit is contained in:
2020-05-13 11:54:33 +02:00
parent 9b8fc290ad
commit ecd5c8c915
2 changed files with 9 additions and 0 deletions

View File

@@ -223,6 +223,15 @@ public class XParser {
return tree; return tree;
} }
if (((lbr = parseToken(Token.LBR)) != null) && ((num = parseNumExpr()) != null)
&& ((rbr = parseToken(Token.RBR)) != null)) {
tree.addLastChild(lbr);
tree.addLastChild(num);
tree.addLastChild(rbr);
return tree;
}
in.setPosition(oldPosition); in.setPosition(oldPosition);
return null; return null;
} }