Support StringTemplate, ANTLR Project by making a donation! Terence often pays for things like the antlr.org server, conference travel, and this site design (that alone cost US$1000). Buy him a beer and pizza remotely ;)
|
Design and implementation principles
- Much faster, more efficient lexing, tree construction.
Inline single-char tokens into nextToken etc.. backtrack on hard tokens to distinguish.
- Consistent
- Testable, tested.
- Good clean obvious code.
Might mean more DSL's for say the analysis etc...
- Make it as easy as possible to do common tasks.
- Make as language independent as possible.
Don't make people use a Token subclass to add properties when it's an ANTLR object. Then, we can't assume we have reflection (like not in C++). Make the abstraction in ANTLR and then leave implementation to code generation.
This way C++ could generate a Token object that makes a small 32-bit int.
We need to keep all antlr associated action code in antlr syntax not in actions...impossible to make independent and also hard to do analysis etc...
|