LRGen: LR(1) parser generator

A.M.D.G.

Home Downloads Feedback Comparison Theory Papers Documentation Contact

LRGen: LR(1) parser generator v 9.2

  • Creates Canonical LR(1) parsers in
  • C++
  • Handles context-sensitivity (e.g. typedef in C)
  • yes
  • Reads grammar notation with EBNF operators (+,*,?)
  • yes
  • Parsers have a symbol-table builder
  • yes
  • Parsers can do AST construction and traversal
  • yes
  • Grammars are separate from code
  • yes
  • Includes Visual Studio IDE Community projects
  • 1 project
  • BNF grammars included
  • C grammar
  • Single-user license fee
  • free

    DFA: fast lexer generator v 9.2 (included with LRGen)

  • Creates DFA lexical analyzers in
  • C++
  • Lexers do keyword recognition
  • yes
  • Single-user license fee
  • free

    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.

    Context Sensitivity

    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.