[06 - Top Down Parser] Fix program18ExprAll
Add left & right bracket parsing
This commit is contained in:
Binary file not shown.
@@ -223,6 +223,15 @@ public class XParser {
|
||||
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);
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user