antlr - ANTLR4 custom tokens -


i using c# version generating antlr4 files. have used custom tokens using option tokenlabeltype=token. fine c# compiler gives error in match(..) , input(...) because not type cast custom tokens. whereas antlr3 gives proper casting functions. extending own token class antlr4.runtime.commontoken.

c# compiler throws error

cannot implicitly convert type 'antlr4.runtime.itoken' 'grammar.actionparser.token'. explicit conversion exists (are missing cast?)". 

please tell how resolve issue.

is custom token class named 'token'? if so, check using statements make sure parser not confusing antlr4.runtime.token class token class. if not, change actual type of custom token class.


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -