|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.lang.ParserHelper
public class ParserHelper
This is a class to hold all the helper functions/methods used by the DRL parser
Field Summary | |
---|---|
LinkedList<DroolsSentence> |
editorInterface
|
List<DroolsParserException> |
errors
|
boolean |
isEditorInterfaceEnabled
|
boolean |
lookaheadTest
|
String[] |
statementKeywords
|
Constructor Summary | |
---|---|
ParserHelper(org.antlr.runtime.TokenStream input,
org.antlr.runtime.RecognizerSharedState state)
|
Method Summary | ||
---|---|---|
void |
beginSentence(DroolsSentenceType sentenceType)
|
|
String |
buildStringFromTokens(List<org.antlr.runtime.Token> tokenList)
Helper method that creates a string from a token list. |
|
void |
checkTrailingSemicolon(String text,
org.antlr.runtime.Token token)
|
|
void |
disableEditorInterface()
|
|
void |
emit(boolean forceEmit,
int activeContext)
|
|
void |
emit(int activeContext)
|
|
void |
emit(List<?> tokens,
DroolsEditorType editorType)
|
|
void |
emit(org.antlr.runtime.Token token,
DroolsEditorType editorType)
|
|
void |
enableEditorInterface()
|
|
|
end(Class<T> clazz,
DescrBuilder<?,?> builder)
|
|
DroolsSentence |
getActiveSentence()
|
|
LinkedList<DroolsSentence> |
getEditorInterface()
|
|
List<String> |
getErrorMessages()
Return a list of pretty strings summarising the errors |
|
List<DroolsParserException> |
getErrors()
return the raw DroolsParserException errors |
|
boolean |
getHasOperator()
|
|
int |
getLastIntegerValue(LinkedList<?> list)
|
|
DroolsToken |
getLastTokenOnList(LinkedList<?> list)
|
|
String |
getLeftMostExpr()
|
|
String[] |
getStatementKeywords()
|
|
boolean |
hasErrors()
return true if any parser errors were accumulated |
|
boolean |
isPluggableEvaluator(boolean negated)
|
|
boolean |
isPluggableEvaluator(int offset,
boolean negated)
|
|
Map<DroolsParaphraseTypes,String> |
popParaphrases()
|
|
void |
pushParaphrases(DroolsParaphraseTypes type)
Method that adds a paraphrase type into paraphrases stack. |
|
void |
reportError(Exception e)
|
|
void |
reportError(org.antlr.runtime.RecognitionException ex)
|
|
String |
retrieveLT(int LTNumber)
|
|
String |
safeSubstring(String text,
int start,
int end)
|
|
void |
setHasOperator(boolean hasOperator)
|
|
void |
setLeftMostExpr(String value)
|
|
void |
setParaphrasesValue(DroolsParaphraseTypes type,
String value)
Method that sets paraphrase value for a type into paraphrases stack. |
|
|
start(DescrBuilder<?,?> ctxBuilder,
Class<T> clazz,
String param)
|
|
protected void |
syncToSet()
Use the current stacked followset to work out the valid tokens that can follow on from the current point in the parse, then recover by eating tokens that are not a member of the follow set we compute. |
|
protected void |
syncToSet(org.antlr.runtime.BitSet follow)
|
|
boolean |
validateAttribute(int index)
|
|
boolean |
validateCEKeyword(int index)
|
|
boolean |
validateIdentifierKey(String text)
|
|
boolean |
validateIdentifierSufix()
|
|
boolean |
validateKeyword(int i)
|
|
boolean |
validateLT(int LTNumber,
String text)
|
|
boolean |
validateSpecialID(int index)
|
|
boolean |
validateStatement(int index)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final String[] statementKeywords
public List<DroolsParserException> errors
public LinkedList<DroolsSentence> editorInterface
public boolean isEditorInterfaceEnabled
public boolean lookaheadTest
Constructor Detail |
---|
public ParserHelper(org.antlr.runtime.TokenStream input, org.antlr.runtime.RecognizerSharedState state)
Method Detail |
---|
public LinkedList<DroolsSentence> getEditorInterface()
public void setLeftMostExpr(String value)
public String getLeftMostExpr()
public void enableEditorInterface()
public void disableEditorInterface()
public void setHasOperator(boolean hasOperator)
public boolean getHasOperator()
public void beginSentence(DroolsSentenceType sentenceType)
public DroolsSentence getActiveSentence()
public void emit(List<?> tokens, DroolsEditorType editorType)
public void emit(org.antlr.runtime.Token token, DroolsEditorType editorType)
public void emit(boolean forceEmit, int activeContext)
public void emit(int activeContext)
public DroolsToken getLastTokenOnList(LinkedList<?> list)
public int getLastIntegerValue(LinkedList<?> list)
public String retrieveLT(int LTNumber)
public boolean validateLT(int LTNumber, String text)
public boolean isPluggableEvaluator(int offset, boolean negated)
public boolean isPluggableEvaluator(boolean negated)
public boolean validateIdentifierKey(String text)
public boolean validateSpecialID(int index)
public boolean validateCEKeyword(int index)
public boolean validateStatement(int index)
public boolean validateAttribute(int index)
public boolean validateIdentifierSufix()
public void checkTrailingSemicolon(String text, org.antlr.runtime.Token token)
public String safeSubstring(String text, int start, int end)
public void reportError(org.antlr.runtime.RecognitionException ex)
public void reportError(Exception e)
public List<DroolsParserException> getErrors()
public List<String> getErrorMessages()
public boolean hasErrors()
public void pushParaphrases(DroolsParaphraseTypes type)
type
- paraphrase typepublic Map<DroolsParaphraseTypes,String> popParaphrases()
public void setParaphrasesValue(DroolsParaphraseTypes type, String value)
type
- paraphrase typevalue
- paraphrase valuepublic String buildStringFromTokens(List<org.antlr.runtime.Token> tokenList)
tokenList
- token list
protected void syncToSet()
protected void syncToSet(org.antlr.runtime.BitSet follow)
public <T extends DescrBuilder<?,?>> T start(DescrBuilder<?,?> ctxBuilder, Class<T> clazz, String param)
public <T extends DescrBuilder<?,?>> T end(Class<T> clazz, DescrBuilder<?,?> builder)
public String[] getStatementKeywords()
public boolean validateKeyword(int i)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |