parsing - ANTLR for IntelliJ 15 -
i trying use antlr4 plug-in intellij create simple expression analyzer. have seen few websites , questions don't seem able running. have watched this video still error
can't load hello lexer or parser
does have way of using antlr create grammar , using standard input or text file input test grammar , print out. trying take infix expression , convert postfix expression.
also there way use intellij write, compile , run program rather swapping command line?
thank you.
i ran same problem. installed antlr plugin intellij 15. created java project called antlr, , created example hello.g4 text file right-clicking on src directory node , selecting new->file. once grammar typed hello.g4, compiled right-clicking on hello.g4 tab , selecting compile "hello.g4", created template files in directory "gen".
i wasn't able figure out how run grun example in antlr4 reference, "hello parrt" parsed , analyzed. instead, turns out if right click on rule ('r') in hello.g4, there option called "test rule r". select that, , couple of small windows @ bottom of ide. can either type in "hello parrt" , parse it; or create new text file right clicking on src directory node , selecting new->file, add "hello parrt" file, compile file put in production/antlr directory, , right click on rule ('r') again select "test rule r'. you'll see parse tree right.
Comments
Post a Comment