|
||||||||||
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)
Deprecated. Use parse(URI, IResolverFactory) |
IRuleFile |
parse(Reader reader)
Deprecated. Use parse(URI, IResolverFactory) |
IRuleFile |
parse(URI uri,
IResolverFactory resolverFactory)
Parse an NRL file using a reader, and return an AST. |
void |
resolveModelReferences(IRuleFile ruleFile,
IModelCollection models)
Deprecated. |
void |
resolveOperatorReferences(IRuleFile ruleFile,
IOperators[] operators)
Deprecated. |
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 List<NRLError> getErrors()
getErrors
in interface INRLParser
protected String getStreamAsString(Reader reader) throws IOException
reader
- the reader
IOException
@Deprecated public IRuleFile parse(InputStream stream) throws Exception
parse(URI, IResolverFactory)
parse
in interface INRLParser
Exception
@Deprecated public IRuleFile parse(Reader reader) throws Exception
parse(URI, IResolverFactory)
parse
in interface INRLParser
Exception
public IRuleFile parse(URI uri, IResolverFactory resolverFactory) throws IOException, org.antlr.runtime.RecognitionException, ModelLoadingException, ResolverException, OperatorLoadingException
IMPORTANT: Call getErrors()
after calling this method to check if any syntax
or semantic errors occurred.
parse
in interface INRLParser
reader
- the reader to useresolverFactory
- the resolver factory to use to load resources
IOException
org.antlr.runtime.RecognitionException
ModelLoadingException
ResolverException
OperatorLoadingException
@Deprecated 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 use@Deprecated public void resolveOperatorReferences(IRuleFile ruleFile, IOperators[] operators)
resolveOperatorReferences
in interface INRLParser
ruleFile
- the file to resolveoperators
- the collection of operator filesXmlOperatorPersistence
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |