Linguist Parsing System
Home Page
Categories: Miscellaneous
Author: Fred Mellender
Latest version: 1.0
Added 2007-03-12
The Linguist Parsing System (LPS) supplies the C# programmer with many of the facilities of the popular Unix utilities Lex and Yacc. LPS has a different interface, which handles a superset of Yacc’s grammars and returns all valid parses of its input when the grammar is ambiguous.
Instead of embedding programming statements in the grammar specification, the programmer will construct and then invoke the LPS parser from her C# program. LPS will return all valid parses of the input as parse trees (one at a time, via an iterator). The application program then operates on each parse tree to do a translation, generate machine code, invoke an interpreter, or similar functions.
You can use LPS to parse program source files, data files, and natural language text. Any grammar that can be expressed in BNF, even ambiguous ones, can be given to LPS. These include (but are not limited to) LALR(k), LL(k), and LR(k).
There are five components to LPS. First is the LexRuleBuilder which takes a text file and makes the lexer’s rules. The second is the ParseRuleBuilder which makes the rules (productions) for the parser. Third is the Lexer (a lexical analyzer), which takes an input file of text to be parsed, builds tokens, and passes these to the fourth component: the Parser. The first three of these components can be replaced by your own objects.
The last component is a test facility. This allows text (or a file) to be input and the resulting parse tree to be displayed. Because the LPS system does not generate a C# program, testing can be rapid and easy. No recompilation is required when your grammar changes.
 Built for .NET 2 |
 Library |
 Free or free version available |
 Source code provided |