[antlr-interest] Hand made lexer 600(!!!!!) times faster

Ian Kaplan iank at bearcave.com
Thu Feb 24 13:47:45 PST 2005


  Summary: writing a scanner is not a big deal

  ANTLR has a couple of core application areas.  One is a way to
  quickly bring up a scanner and parser for little languages or simple
  parsing tasks.  In many of these performance is not a huge
  consideration.

  Another use is for production quality parsers for demanding
  applications and for applications where performance is a concern.
  In these cases I don't see why it is a big deal to write your own
  scanner.  I just implemented a custom scanner for an ANTLR based
  query laguage parser.  It took a couple of days to do the scanner
  and related data structures (reserved word tables and support data
  structures).

  I know I keep writing this and you're all probably tired of reading
  it.  But as far as I'm concerned the power of ANTLR is as a parser
  generator.  I can bring up a parser much faster with ANTLR and the
  parser is more reliable.  I can also change the parser more
  rapidly.  The scanner generation is a nice feature, but I don't feel
  that it is core to why I use ANTLR.  I feel the same way about tree
  generation (I do my own tree generation too).

  Ian


More information about the antlr-interest mailing list