public class STRINGValueConverter extends AbstractLexerBasedConverter<java.lang.String>
IValueConverter.RuleSpecific
NO_OP_CONVERTER
Constructor and Description |
---|
STRINGValueConverter() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
convertFromString(java.lang.String literal,
INode node)
Converts a string literal (including leading and trailing single or double quote) to a semantic
string value.
|
protected java.lang.String |
getInvalidEscapeSequenceMessage() |
protected java.lang.String |
getStringNotClosedMessage() |
protected boolean |
isHexSequence(char[] in,
int off,
int chars) |
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, assertValidValue, createTokenContentMismatchException, createTokenTypeMismatchException, getLexer, getLexerProvider, getRule, getRuleName, getRuleName, getTokenDefMap, getTokenDefProvider, getTokenSource, setLexerProvider, setRule, setTokenDefProvider, toString
protected java.lang.String toEscapedString(java.lang.String value)
toEscapedString
in class AbstractLexerBasedConverter<java.lang.String>
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 java.lang.String convertFromString(java.lang.String literal, INode node) throws ValueConverterWithValueException
ValueConverterWithValueException
.ValueConverterWithValueException
- if the given string is syntactically invalid.Strings.convertFromJavaString(String, boolean)
protected java.lang.String getInvalidEscapeSequenceMessage()
protected java.lang.String getStringNotClosedMessage()
protected boolean isHexSequence(char[] in, int off, int chars)