ANTLR问题临时记录3

1. ANTLR 3的if~else~歧义警告问题

ANTLR - Introduction 

(ANother Tool for Language Recognition) 

VB HC4  http://fmt.cs.utwente.nl/courses/vertalerbouw/

http://fmt.cs.utwente.nl/courses/vertalerbouw/sheets/vb-04-antlr-1-4up.pdf

(这个ppt对ANTLR的原理和技巧总结得很好,很值得一看)

另外,官方教程称,此警告其实可以无视掉(不需要消除),原文见

http://www.antlr.org/wiki/display/ANTLR3/Pie

 

To build this interpreter, run ANTLR on Pie.g and then compile all of the Java files in the directory:

$ java org.antlr.Tool Pie.g
warning(200): Pie.g:51:39: Decision can match input such as "'else'"
using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
$ javac *.java
$
You can ignore the warning message from ANTLR; it's the standard if-then-else ambiguity. (See Subsection Nondeterministic Decisions of Section 11.5 in The Definitive ANTLR Reference for more details.)
 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值