Class Parser

java.lang.Object
org.moeaframework.util.grammar.Parser

public class Parser extends Object
Parses simple context-free grammars in Backus-Naur form (BNF). The following example demonstrates the accepted syntax. Newlines indicate the end of a rule; single and double quotes can be used to escape the control characters (":", "=", "|", "//", etc.); C and C++ style comments are supported.

   <expr> ::= <expr> <op> <expr> | "func(" <expr> ")" | <val>
   <op> ::= + | - | * | '/'
   <val> ::= x | y | z
 
  • Method Details