0
有沒有獲得_LITERAL_NAMES行和位置的方法?獲取文字的行嗎?
例如:
constant returns [String typeS, int line, int pos]
: sign number {$typeS = "integer"; $line = $number.line; $pos = $number.pos;}
| 'true' {$typeS = "boolean"; $line = ????; $pos = ????}
| 'false' {$typeS = "boolean"; $line = ????; $pos = ????}
;
非常感謝您! :) – Damiii 2015-03-31 15:07:13