【问题】
在折腾:
【记录】尝试使用ANTLRWorks 2.0去进行ANTLR开发
的过程中,用ANTLRWorks 2.0编译运行Hello.g4,结果出现警告和错误:
全部log为:
Compiling grammar files… warning: Supported source version ‘RELEASE_6’ from annotation processor ‘org.netbeans.modules.openide.modules.PatchedPublicProcessor’ less than -source ‘1.7’ warning: Supported source version ‘RELEASE_6’ from annotation processor ‘org.netbeans.modules.openide.util.ServiceProviderProcessor’ less than -source ‘1.7’ warning: Supported source version ‘RELEASE_6’ from annotation processor ‘org.netbeans.modules.openide.util.NamedServiceProcessor’ less than -source ‘1.7’ warning: Supported source version ‘RELEASE_6’ from annotation processor ‘org.netbeans.modules.openide.util.NbBundleProcessor’ less than -source ‘1.7’ 4 warnings Arguments: [Hello, r, -tokens, -tree, -gui, D:\DevRoot\IndustrialMobileAutomation\HandheldDataSetter\ANTLR\projects\demo2Hello\Hello.tokens] line 1:0 token recognition error at: ‘W’ line 1:1 token recognition error at: ‘S’ line 1:2 token recognition error at: ‘=’ line 1:3 token recognition error at: ‘3’ line 1:4 token recognition error at: ‘\r’ line 2:0 token recognition error at: ‘I’ line 2:1 token recognition error at: ‘D’ line 2:2 token recognition error at: ‘=’ line 2:3 token recognition error at: ‘2’ line 2:4 token recognition error at: ‘\r’ line 3:0 token recognition error at: ‘T’ line 3:1 token recognition error at: ‘_’ line 3:2 token recognition error at: ‘_’ line 3:3 token recognition error at: ‘0’ line 3:4 token recognition error at: ‘=’ line 3:5 token recognition error at: ‘1’ line 3:6 token recognition error at: ‘\r’ line 4:0 token recognition error at: ”’ line 4:6 token recognition error at: ”’ line 4:7 token recognition error at: ‘=’ line 4:8 token recognition error at: ‘1’ line 4:9 token recognition error at: ‘\r’ [@0,21:25=’hello’,<1>,4:1] [@1,31:30='<EOF>’,<-1>,5:0] line 5:0 missing ID at ‘<EOF>’ (r hello <missing ID>) |
【解决过程】
1.很明显,看起来像是,不支持JAVA7,希望的版本是JAVA6。
2.所以去:
卸载当前的JDK7
3.去
http://www.oracle.com/technetwork/java/javase/archive-139210.html
下载到:
重新安装JDK 6。
4.然后再次运行,此警告就消失了。
【总结】
貌似ANTLRWorks 2.0,不支持JDK 7?
不过后来的结果证实,貌似JDK 7,好像没有对antlrworks产生本质的影响,即
不论是jdk6还是jdk7,其实都不影响antlrworks的使用的。
接下来,就是去解决对应的error了:
【未解决】ANTLRWorks 2.0编译Hello.g4文件结果出错:line 1:0 token recognition error at: ‘W’
转载请注明:在路上 » 【已解决】ANTLRWorks 2.0编译g4文件出现警告:warning: Supported source version ‘RELEASE_6’ from annotation processor