Package ca.uqac.lif.cep.dsl
Class GrammarObjectBuilder<T>
- java.lang.Object
-
- ca.uqac.lif.bullwinkle.ParseTreeObjectBuilder<T>
-
- ca.uqac.lif.cep.dsl.GrammarObjectBuilder<T>
-
- All Implemented Interfaces:
ca.uqac.lif.bullwinkle.ParseNodeVisitor
- Direct Known Subclasses:
GroupProcessorBuilder
public class GrammarObjectBuilder<T> extends ca.uqac.lif.bullwinkle.ParseTreeObjectBuilder<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected ca.uqac.lif.bullwinkle.BnfParser
m_parser
The parser used to parse expressions
-
Constructor Summary
Constructors Constructor Description GrammarObjectBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
build(java.lang.String expression)
Builds an object from an expressionGrammarObjectBuilder<T>
setGrammar(java.io.InputStream is)
GrammarObjectBuilder<T>
setGrammar(java.lang.String grammar)
-
-
-
Method Detail
-
setGrammar
public GrammarObjectBuilder<T> setGrammar(java.io.InputStream is) throws ca.uqac.lif.bullwinkle.BnfParser.InvalidGrammarException
- Throws:
ca.uqac.lif.bullwinkle.BnfParser.InvalidGrammarException
-
setGrammar
public GrammarObjectBuilder<T> setGrammar(java.lang.String grammar) throws ca.uqac.lif.bullwinkle.BnfParser.InvalidGrammarException
- Throws:
ca.uqac.lif.bullwinkle.BnfParser.InvalidGrammarException
-
build
public T build(java.lang.String expression) throws ca.uqac.lif.bullwinkle.ParseTreeObjectBuilder.BuildException
Builds an object from an expression- Parameters:
expression
- The expression to parse- Returns:
- The returned object
- Throws:
ca.uqac.lif.bullwinkle.ParseTreeObjectBuilder.BuildException
- Thrown when no object could be built. This generally happens due to a parsing error.
-
-