...
Can we walk trees without creating buffer of entire tree? Perhaps we can make an on-demand buffer that doesn't go into subtrees unless the parser does. The wildcard would tell it to skip. Only problem is lookahead. Maybe we let LT (i) do the on-demand loading. We could add a skipOverSubtree() method to node stream so wildcard could avoid descending.
Patter ^( VAR . ID )
yields:
Code Block |
---|
match(input,VAR,FOLLOW_VAR_in_a13);
match(input, Token.DOWN, null);
matchAny(input);
match(input,ID,FOLLOW_ID_in_a17);
match(input, Token.UP, null);
|
On-demand serialization of a tree in java (no continuations) would be a pain. Would have to maintain a stack. Might be better for deep tree anyway. skip in node stream would skip over DOWN...UP sequence or just one token if not DOWN.