|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.nrl.parser.NRLParser
public class NRLParser
The main parser interface for creating an NRL AST. This supports both the action and constraint language, and is based on ANTLR.
INRLParser
Constructor Summary | |
---|---|
NRLParser()
|
Method Summary | |
---|---|
List<NRLError> |
getErrors()
After any call to the parse or resolve methods, this method returns a list of errors, if any. |
IRuleFile |
parse(InputStream stream)
Parse an NRL file using a stream. |
IRuleFile |
parse(Reader reader)
Parse an NRL file using a reader, and return an AST. |
void |
resolveModelReferences(IRuleFile ruleFile,
IModelCollection models)
Attach model information to a parsed rule file AST. |
void |
resolveOperatorReferences(IRuleFile ruleFile,
IOperators[] operators)
Resolve reference to operator invocations given an operator collection. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NRLParser()
Method Detail |
---|
public IRuleFile parse(Reader reader) throws Exception
IMPORTANT: Call getErrors()
after calling this method to
check if any syntax or semantic errors occurred.
Use resolveModelReferences(IRuleFile, IModelCollection)
to
attach model information.
parse
in interface INRLParser
reader
- the reader to use
Exception
public IRuleFile parse(InputStream stream) throws Exception
parse(Reader)
for more
information.
parse
in interface INRLParser
stream
- the stream
Exception
- if a severe error occurred. The result is that even
INRLParser.getErrors()
will not return a meaningful result.public void resolveModelReferences(IRuleFile ruleFile, IModelCollection models)
After calling this, you must call getErrors()
to check
if any errors occurred. If so, the AST may be unstable.
resolveModelReferences
in interface INRLParser
ruleFile
- the rule file to decoratemodels
- the models to usepublic void resolveOperatorReferences(IRuleFile ruleFile, IOperators[] operators)
resolveOperatorReferences
in interface INRLParser
ruleFile
- the file to resolveoperators
- the collection of operator filesXmlOperatorPersistence
public List<NRLError> getErrors()
getErrors
in interface INRLParser
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |