0
ANTLR 3似乎在其規則中使用了某種類似於正則表達式的正則表達式,有誰知道它是否使用自定義語法以及該文檔的位置?ANTLR如何執行其角色操作?
ANTLR 3似乎在其規則中使用了某種類似於正則表達式的正則表達式,有誰知道它是否使用自定義語法以及該文檔的位置?ANTLR如何執行其角色操作?
從ANTLR維基:
又見Grammars和Special symbols in actions。
Symbol | Description
----------------+--------------------------------------------------------
$ | Attribute
@ | Action
:: | action or dynamically-scoped attribute scope specifier
: | rule definition
; | end rule
| | alternative
's' | char or string literal
. | wildcard
= | label assignment
+= | list label assignment
[..] | argument or return value spec
{...} | action
... | forced action; execute even while backtracking
(...) | subrule
+ | 1 or more
* | 0 or more
? | optional or semantic predicate
~ | match not
! | don't include in AST
^ | make AST root node
=> | always execute predicate
-> | rewrite rule
<token options> | token option spec like ID<node=VarNode>
^(...) | tree grammar or rewrite element
// ... | single-line comment
/* ... */ | multi-line comment
我不能相信我看了那幾頁後錯過了,謝謝! – RCIX 2009-12-10 21:18:46
你或許應該剛纔編輯您剛纔的問題(http://stackoverflow.com/questions/1879394/how-to-exclude-more-than-one-character-in-rule)將其展開,而不是創造第二個。 – Amber 2009-12-10 08:34:31