I am using C# version for generating ANTLR4 files. I have used custom tokens by using this option TokenLabelType=Token. Everything is fine but c# compiler gives error in MAtch(..) and input(...) because this does not type cast to my custom tokens. Whereas ANTLR3 gives the proper casting for this functions. I am extending my own token from this class Antlr4.Runtime.CommonToken.
C# compiler throws this error
Cannot implicitly convert type 'Antlr4.Runtime.IToken' to 'Grammar.ActionParser.Token'. An explicit conversion exists (are you missing a cast?)".
Please tell how to resolve this issue.