java.lang.Object
io.jenetics.ext.grammar.Cfg.Expression.Builder<T>
- Type Parameters:
T
- the terminal symbol value type
- Enclosing class:
Cfg.Expression<T>
Builder class for building rule expressions.
- Since:
- 8.2
-
Method Summary
Modifier and TypeMethodDescriptionadd
(Cfg.Symbol<T> symbol) Add the givensymbol
to the expression.Set the expression annotation.build()
Create a new rule object.Add a non-terminal symbol to the expression.Add a non-terminal symbol to the expression.Add a non-terminal symbol to the expression.Add a non-terminal symbol to the expression.Add a non-terminal symbol to the expression.
-
Method Details
-
add
Add the givensymbol
to the expression.- Parameters:
symbol
- the expression symbol- Returns:
this
builder for method chaining
-
N
Add a non-terminal symbol to the expression.- Parameters:
name
- the symbol nameannotation
- the symbol annotation- Returns:
this
builder for method chaining
-
N
Add a non-terminal symbol to the expression.- Parameters:
name
- the symbol name- Returns:
this
builder for method chaining
-
T
Add a non-terminal symbol to the expression.- Parameters:
name
- the symbol namevalue
- the symbol valueannotation
- the symbol annotation- Returns:
this
builder for method chaining
-
T
Add a non-terminal symbol to the expression.- Parameters:
name
- the symbol namevalue
- the symbol value- Returns:
this
builder for method chaining
-
T
Add a non-terminal symbol to the expression.- Parameters:
name
- the symbol name- Returns:
this
builder for method chaining- Throws:
ClassCastException
- ifT
is not a string
-
at
Set the expression annotation.- Parameters:
annotation
- the expression annotation- Returns:
this
builder for method chaining
-
build
Create a new rule object.- Returns:
- a new rule object
-