public class ParserHelper extends Object
Modifier and Type | Field and Description |
---|---|
LinkedList<DroolsSentence> |
editorInterface |
List<DroolsParserException> |
errors |
boolean |
isEditorInterfaceEnabled |
boolean |
lookaheadTest |
String[] |
statementKeywords |
Constructor and Description |
---|
ParserHelper(org.antlr.runtime.TokenStream input,
org.antlr.runtime.RecognizerSharedState state,
org.kie.internal.builder.conf.LanguageLevelOption languageLevel) |
Modifier and Type | Method and Description |
---|---|
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() |
<T extends DescrBuilder<?,?>> |
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.
|
<T extends DescrBuilder<?,?>> |
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) |
public final String[] statementKeywords
public List<DroolsParserException> errors
public LinkedList<DroolsSentence> editorInterface
public boolean isEditorInterfaceEnabled
public boolean lookaheadTest
public ParserHelper(org.antlr.runtime.TokenStream input, org.antlr.runtime.RecognizerSharedState state, org.kie.internal.builder.conf.LanguageLevelOption languageLevel)
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 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 listprotected 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)
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.