我有以下规则:
terminal MIDI_VALUE:
( '0'..'9') |
( '1'..'9' '0'..'9') |
('1' '0'..'1' '0'..'9') |
('1' '2' '0'..'7');
此规则旨在从 [0..127] 读取值。
但是,它不接受 [1..16] 中的值,而接受 0 和 17 到 127。
当我将鼠标悬停在错误上时,我得到:
mismatched input: '16' expecting RULE_MIDI_VALUE.
我怎样才能解决这个问题?
第二个例子
这个例子可能更简单:
DmxDelayTimeSubCommand:
'DelayTime' time=Time;
Time:
time=INT type=('ms' | 's' );
而输入
AllFrontBlue AllGroupsAll Mode loop DelayTime 255 ms;
将鼠标悬停在 255 上方时显示错误:
Mismatched input '255' expecting RULE_INT
虽然 RULE_INT 是预定义的终端:
terminal INT returns ecore::EInt: ('0'..'9')+;
对于低于 256 的所有值(来自 [0..255] 的所有值),我都会收到此错误。