|LRGen: LR(1) parser generator|
|Home Downloads Feedback Comparison Theory Papers Documentation Contact|
Canonical LR(1) Parsers
Why Canonical LR(1) parsers? They have the simplest parsing algorithm, easiest to understand, and follow in a debugger. The size of the Canonical LR(1) parser table can be large, but in 2018, who cares? The Canonical LR(1) parser table for my C grammar is 75K. The LALR(1) parser table for the same C grammar is 6K.
The "typedef" declaration in the C and C++ languages is a context sensitive issue. This cannot be solved by upgrading from LALR(1) to LR(1) or LR(k). It requires making use of a symbol table while parsing and this allows even an LALR(1) parser to handle this context sensitive issue. LRGen has this feature built into the grammar notation, making life easy for a user.
DFA Lexical Analyzers
A DFA lexer is a finite-state automata without a pushdown stack (i.e. not a PDA). DFA is the fastest recognition algorithm (5 times the speed of PDA's). A DFA algorithm does not use any lookahead characters. Because it is not a PDA, it cannot handle "nested" comments or any type of "nested" input (e.g. [[a]]). However, DFA's work fine for most programming languages. Afterall, the job of handling "nested" types of input usually belongs to the parser.
|(c) Copyright Paul B Mann 2018. All rights reserved.|