javac lexer parser rewrite
Per Bothner
per.bothner at oracle.com
Tue Feb 7 08:35:51 PST 2012
On 02/07/2012 02:27 AM, Maurizio Cimadamore wrote:
> So, is it messy? Sure - is it fast? Yes, like hell. So, to summarise, I
> think that any effort to try to improve our parser/lexer architecture is
> definitively welcome - however, anyone embarking on such a project
> should keep the above numbers in mind - if you can achieve the same
> speed (well, even marginally slower would be acceptable) than it'd be an
> option well worth considering.
Another advantage of a hard-written parser/lexer, besides speed, is that
it is flexible (if you need to handle special cases).
Furthermore, it is easy to understand what is going on, and easier to debug.
Imagine trying to set breakpoints in a generated parser or otherwise try
to figure out why something is parsed the way it is. A hard-written
parser/lexer is more verbose and shows all the details - but at least
what you see is plain debuggable Java code, and you don't need a special
tool or understanding.
--
--Per Bothner
per.bothner at oracle.com per at bothner.com http://per.bothner.com/
More information about the compiler-dev
mailing list