Drools :: Compiler 6.0.0.CR5

org.drools.compiler.compiler
Class DrlParser

java.lang.Object
  extended by org.drools.compiler.compiler.DrlParser

public class DrlParser
extends Object

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
static org.kie.internal.builder.conf.LanguageLevelOption DEFAULT_LANGUAGE_LEVEL
           
 
Constructor Summary
DrlParser()
           
DrlParser(org.kie.internal.builder.conf.LanguageLevelOption languageLevel)
           
 
Method Summary
 DefaultExpanderResolver getDefaultResolver(Reader dsl)
           
 List<DroolsSentence> getEditorSentences()
           
 List<DroolsError> getErrors()
           
 String getExpandedDRL(String source, DefaultExpanderResolver resolver)
          This will expand the DRL using the given expander resolver. useful for debugging.
 String getExpandedDRL(String source, Reader dsl)
          This will expand the DRL. useful for debugging.
 Location getLocation()
           
 boolean hasErrors()
           
 PackageDescr parse(boolean isEditor, Reader reader)
           
 PackageDescr parse(boolean isEditor, Reader drl, Reader dsl)
           
 PackageDescr parse(boolean isEditor, org.kie.api.io.Resource resource)
           
 PackageDescr parse(boolean isEditor, String text)
           
 PackageDescr parse(boolean isEditor, String source, Reader dsl)
          Parse and build a rule package from a DRL source with a domain specific language.
 PackageDescr parse(Reader reader)
           
 PackageDescr parse(Reader drl, Reader dsl)
          Parse and build a rule package from a DRL source with a domain specific language.
 PackageDescr parse(org.kie.api.io.Resource resource)
           
 PackageDescr parse(org.kie.api.io.Resource resource, Reader reader)
           
 PackageDescr parse(org.kie.api.io.Resource resource, String text)
          Parse a rule from text
 PackageDescr parse(String source, Reader dsl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LANGUAGE_LEVEL

public static final org.kie.internal.builder.conf.LanguageLevelOption DEFAULT_LANGUAGE_LEVEL
Constructor Detail

DrlParser

public DrlParser()

DrlParser

public DrlParser(org.kie.internal.builder.conf.LanguageLevelOption languageLevel)
Method Detail

parse

public PackageDescr parse(org.kie.api.io.Resource resource,
                          String text)
                   throws DroolsParserException
Parse a rule from text

Throws:
DroolsParserException

parse

public PackageDescr parse(boolean isEditor,
                          String text)
                   throws DroolsParserException
Throws:
DroolsParserException

parse

public PackageDescr parse(boolean isEditor,
                          Reader reader)
                   throws DroolsParserException
Throws:
DroolsParserException

parse

public PackageDescr parse(org.kie.api.io.Resource resource,
                          Reader reader)
                   throws DroolsParserException
Throws:
DroolsParserException

parse

public PackageDescr parse(Reader reader)
                   throws DroolsParserException
Throws:
DroolsParserException

parse

public PackageDescr parse(Reader drl,
                          Reader dsl)
                   throws DroolsParserException,
                          IOException
Parse and build a rule package from a DRL source with a domain specific language.

Throws:
DroolsParserException
IOException

parse

public PackageDescr parse(boolean isEditor,
                          Reader drl,
                          Reader dsl)
                   throws DroolsParserException,
                          IOException
Throws:
DroolsParserException
IOException

parse

public PackageDescr parse(boolean isEditor,
                          String source,
                          Reader dsl)
                   throws DroolsParserException
Parse and build a rule package from a DRL source with a domain specific language.

Parameters:
source - As Text.
dsl -
Returns:
Throws:
DroolsParserException

parse

public PackageDescr parse(String source,
                          Reader dsl)
                   throws DroolsParserException
Throws:
DroolsParserException

parse

public PackageDescr parse(org.kie.api.io.Resource resource)
                   throws DroolsParserException,
                          IOException
Throws:
DroolsParserException
IOException

parse

public PackageDescr parse(boolean isEditor,
                          org.kie.api.io.Resource resource)
                   throws DroolsParserException,
                          IOException
Throws:
DroolsParserException
IOException

getExpandedDRL

public String getExpandedDRL(String source,
                             Reader dsl)
                      throws DroolsParserException
This will expand the DRL. useful for debugging.

Parameters:
source - - the source which use a DSL
dsl - - 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 DSL
resolver - - 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

public List<DroolsError> getErrors()
Returns:
a list of errors found while parsing. DroolsError: either ParserError, or ExpanderException

getLocation

public Location getLocation()

getDefaultResolver

public DefaultExpanderResolver getDefaultResolver(Reader dsl)
                                           throws DroolsParserException
Throws:
DroolsParserException

getEditorSentences

public List<DroolsSentence> getEditorSentences()

Drools :: Compiler 6.0.0.CR5

Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.