public abstract class AbstractIDValueConverter extends AbstractLexerBasedConverter<java.lang.String>
IValueConverter.RuleSpecific
NO_OP_CONVERTER
Modifier | Constructor and Description |
---|---|
protected |
AbstractIDValueConverter() |
Modifier and Type | Method and Description |
---|---|
protected void |
assertValidValue(java.lang.String value) |
protected java.util.Set<java.lang.Character> |
collectInvalidCharacters(java.lang.String value) |
protected abstract java.util.Set<java.lang.String> |
computeValuesToEscape(Grammar grammar) |
protected ValueConverterException |
createTokenContentMismatchException(java.lang.String value,
java.lang.String escapedString,
org.antlr.runtime.Token token) |
protected IGrammarAccess |
getGrammarAccess() |
protected java.lang.String |
getInvalidCharactersMessage(java.lang.String value,
java.util.Set<java.lang.Character> invalidChars) |
protected java.util.Set<java.lang.String> |
getValuesToEscape() |
protected abstract boolean |
mustEscape(java.lang.String value) |
void |
setGrammarAccess(IGrammarAccess grammarAccess) |
protected java.lang.String |
toEscapedString(java.lang.String value) |
java.lang.String |
toValue(java.lang.String string,
INode node)
Creates a value from the given input.
|
assertTokens, assertTokens, createTokenTypeMismatchException, getLexer, getLexerProvider, getRule, getRuleName, getRuleName, getTokenDefMap, getTokenDefProvider, getTokenSource, setLexerProvider, setRule, setTokenDefProvider, toString
protected abstract java.util.Set<java.lang.String> computeValuesToEscape(Grammar grammar)
protected java.util.Set<java.lang.String> getValuesToEscape()
protected abstract boolean mustEscape(java.lang.String value)
protected java.lang.String toEscapedString(java.lang.String value)
toEscapedString
in class AbstractLexerBasedConverter<java.lang.String>
protected void assertValidValue(java.lang.String value)
assertValidValue
in class AbstractLexerBasedConverter<java.lang.String>
protected ValueConverterException createTokenContentMismatchException(java.lang.String value, java.lang.String escapedString, org.antlr.runtime.Token token)
createTokenContentMismatchException
in class AbstractLexerBasedConverter<java.lang.String>
protected java.lang.String getInvalidCharactersMessage(java.lang.String value, java.util.Set<java.lang.Character> invalidChars)
protected java.util.Set<java.lang.Character> collectInvalidCharacters(java.lang.String value)
public java.lang.String toValue(java.lang.String string, INode node)
IValueConverter
Creates a value from the given input. The input is conformant to a data type or terminal rule.
The given string
or node
may be null but not both of them.
string
- the string that was inferred from the node. Usually the node's text
but may be reduced to the parts of the node that are not
hidden
.node
- the parsed node including hidden parts.null
.protected IGrammarAccess getGrammarAccess()
public void setGrammarAccess(IGrammarAccess grammarAccess)