org.eclipse.xtext.conversion.impl
Class AbstractLexerBasedConverter<T>
java.lang.Object
org.eclipse.xtext.conversion.impl.AbstractValueConverter<T>
org.eclipse.xtext.conversion.impl.AbstractLexerBasedConverter<T>
- All Implemented Interfaces:
- IValueConverter<T>, IValueConverter.RuleSpecific
- Direct Known Subclasses:
- AbstractIDValueConverter, AbstractRichTextValueConverter, DefaultTerminalConverter, INTValueConverter, STRINGValueConverter
public abstract class AbstractLexerBasedConverter<T>
- extends AbstractValueConverter<T>
- implements IValueConverter.RuleSpecific
- Author:
- Sebastian Zarnekow - Initial contribution and API
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractLexerBasedConverter
public AbstractLexerBasedConverter()
toString
public java.lang.String toString(T value)
- Description copied from interface:
IValueConverter
- Transforms the given value to a string that is conformant to the expected
terminal or data type rule.
- Specified by:
toString
in interface IValueConverter<T>
- Parameters:
value
- the to-be-transformed value
- Returns:
- a string represenation for that value.
assertTokens
protected void assertTokens(T value,
org.antlr.runtime.TokenSource tokenSource,
java.lang.String escapedString)
createTokenTypeMismatchException
protected ValueConverterException createTokenTypeMismatchException(T value,
java.lang.String escapedString,
org.antlr.runtime.Token token)
createTokenContentMismatchException
protected ValueConverterException createTokenContentMismatchException(T value,
java.lang.String escapedString,
org.antlr.runtime.Token token)
getTokenSource
protected org.antlr.runtime.TokenSource getTokenSource(java.lang.String escapedValue)
assertValidValue
protected void assertValidValue(T value)
getRuleName
protected java.lang.String getRuleName()
toEscapedString
protected java.lang.String toEscapedString(T value)
getLexer
protected Lexer getLexer()
getRuleName
protected java.lang.String getRuleName(org.antlr.runtime.Token token)
getTokenDefMap
protected java.util.Map<java.lang.Integer,java.lang.String> getTokenDefMap()
getRule
protected AbstractRule getRule()
setRule
public void setRule(AbstractRule rule)
- Specified by:
setRule
in interface IValueConverter.RuleSpecific
setLexerProvider
public void setLexerProvider(com.google.inject.Provider<Lexer> lexerProvider)
setTokenDefProvider
public void setTokenDefProvider(ITokenDefProvider tokenDefProvider)
getTokenDefProvider
protected ITokenDefProvider getTokenDefProvider()
getLexerProvider
protected com.google.inject.Provider<Lexer> getLexerProvider()