public virtual LexerInterpreter CreateLexerInterpreter(ICharStream input)
{
if (this.IsParser())
{
throw new InvalidOperationException("A lexer interpreter can only be created for a lexer or combined grammar.");
}
if (this.IsCombined())
{
return implicitLexer.CreateLexerInterpreter(input);
}
char[] serializedAtn = ATNSerializer.GetSerializedAsChars(atn, GetRuleNames());
ATN deserialized = new ATNDeserializer().Deserialize(serializedAtn);
return new LexerInterpreter(fileName, GetVocabulary(), GetRuleNames(), ((LexerGrammar)this).modes.Keys, deserialized, input);
}