|
MOEA Framework 2.5 API Specification |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectorg.moeaframework.util.grammar.Parser
public class Parser
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 Summary | |
|---|---|
static ContextFreeGrammar |
load(Reader reader)
Parses the context-free grammar. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ContextFreeGrammar load(Reader reader)
throws IOException
reader - the Reader containing the BNF context-free grammar
IOException - if an I/O error occurred
GrammarException - if an error occurred parsing the BNF
context-free grammar
|
MOEA Framework 2.5 API Specification |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||