I'm looking for a tool that will be able to build a parser (in C#) if I give it a BNF grammar (eg. http://savage.net.au/SQL/sql-2003-2.bnf)
Does such a generator exist?
Java Compiler Compiler (JavaCC) is the most popular parser generator for use with Java applications. A parser generator is a tool that reads a grammar specification and converts it to a Java program that can recognize matches to the grammar.
The C/C++ parser is used for C and C++ language source files. The C/C++ parser uses syntax highlighting to identify language elements, including the following elements: Identifiers. Operators.
The output of the parser is the parsed text which can be obtained in one of its three forms such as reduced graph, parse tree...
Bison is a general-purpose parser generator that converts an annotated context-free grammar into a deterministic LR or generalized LR (GLR) parser employing LALR (1) parser tables. As an experimental feature, Bison can also generate IELR (1) or canonical LR(1) parser tables.
Normally BNF grammars are too ambiguous. ANTLR will be probably good for what you are looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With