|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.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. |
protected String |
getStreamAsString(Reader reader)
Uses a reader to read a stream and returns the content as a string. |
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 |
|---|
clone, equals, finalize, 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 INRLParserreader - the reader to use
Exception
public IRuleFile parse(InputStream stream)
throws Exception
parse(Reader) for more
information.
parse in interface INRLParserstream - 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 INRLParserruleFile - the rule file to decoratemodels - the models to use
public void resolveOperatorReferences(IRuleFile ruleFile,
IOperators[] operators)
resolveOperatorReferences in interface INRLParserruleFile - the file to resolveoperators - the collection of operator filesXmlOperatorPersistencepublic List<NRLError> getErrors()
getErrors in interface INRLParser
protected String getStreamAsString(Reader reader)
throws Exception
reader - the reader
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||