Package org.drools.drl.parser
Class DrlParser
java.lang.Object
org.drools.drl.parser.DrlParser
This is a low level parser API. This will return textual AST representations
of the DRL source, including with DSL expanders if appropriate.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDefaultResolver(Reader dsl) getExpandedDRL(String source, Reader dsl) This will expand the DRL.getExpandedDRL(String source, DefaultExpanderResolver resolver) This will expand the DRL using the given expander resolver.booleanParse and build a rule package from a DRL source with a domain specific language.parse(boolean isEditor, Resource resource, InputStream is) Parse and build a rule package from a DRL source with a domain specific language.parse(Resource resource, InputStream is) Parse a rule from text
-
Field Details
-
DEFAULT_LANGUAGE_LEVEL
-
-
Constructor Details
-
DrlParser
public DrlParser() -
DrlParser
-
-
Method Details
-
parse
Parse a rule from text- Throws:
DroolsParserException
-
parse
- Throws:
DroolsParserException
-
parse
- Throws:
DroolsParserException
-
parse
- Throws:
DroolsParserException
-
parse
- Throws:
DroolsParserException
-
parse
Parse and build a rule package from a DRL source with a domain specific language.- Throws:
DroolsParserExceptionIOException
-
parse
public PackageDescr parse(boolean isEditor, Reader drl, Reader dsl) throws DroolsParserException, IOException - Throws:
DroolsParserExceptionIOException
-
parse
Parse and build a rule package from a DRL source with a domain specific language.- Parameters:
source- As Text.dsl-- Returns:
- Throws:
DroolsParserException
-
parse
- Throws:
DroolsParserException
-
parse
- Throws:
DroolsParserExceptionIOException
-
parse
public PackageDescr parse(Resource resource, InputStream is) throws DroolsParserException, IOException - Throws:
DroolsParserExceptionIOException
-
parse
public PackageDescr parse(boolean isEditor, Resource resource) throws DroolsParserException, IOException - Throws:
DroolsParserExceptionIOException
-
parse
public PackageDescr parse(boolean isEditor, Resource resource, InputStream is) throws DroolsParserException, IOException - Throws:
DroolsParserExceptionIOException
-
getExpandedDRL
This will expand the DRL. useful for debugging.- Parameters:
source- - the source which use a DSLdsl- - the DSL itself.- Throws:
DroolsParserException- If unable to expand in any way.
-
getExpandedDRL
public String getExpandedDRL(String source, DefaultExpanderResolver resolver) throws DroolsParserException This will expand the DRL using the given expander resolver. useful for debugging.- Parameters:
source- - the source which use a DSLresolver- - the DSL expander resolver itself.- Throws:
DroolsParserException- If unable to expand in any way.
-
hasErrors
public boolean hasErrors()- Returns:
- true if there were parser errors.
-
getErrors
- Returns:
- a list of errors found while parsing. DroolsError: either ParserError, or ExpanderException
-
getLocation
-
getDefaultResolver
- Throws:
DroolsParserException
-
getEditorSentences
-