...
The following sections are some terse notes to remind myself later when I implement this stuff.
Grammar composition
...
No Format |
---|
class JavaParser extends Parser { JavaDecl delegate = new JavaDecl(...); // probably set in ctor actually public void type() { ... } public void decl() { int alt = predict-alt-of-decl; // DFA changed; must copy whole rule here switch (alt) { case 1 : type(); match(ID); match(';'); case 2 : type(); match(ID); init(); match(';'); } } void init() { delegate.init(); } } |
...