Search This Blog

Tuesday, January 6, 2009

Parser and Lexer

There are 3 types of commonly used lexer/parsers i.e.

LL - Top down recursive parsers. Example: Antlr (
LR - Bottom up parser using tables. Example: Visual Parse++
GLR - Bottom up parser with lot more for handling ambiguities. Example: DParser

For Interactive environments like IDE: An incremental parser is the preferred choice.
Any of the above can come with Incremental parsing features, depends on which one we are using.

For batch conversions and ease of writing Grammars, LL would be the best.
Performance would be better with LR because of tables.
For good error handling and handling ambiguity, GLR would be good.

Moreover these can be with arbitrary lookaheads.
Example: LL(k) - k means infinite lookahead capability.
LL(1) - 1 is only 1 token lookahead capability.

No comments: