2009-12-10 63 views
0

ANTLR 3似乎在其规则中使用了某种类似于正则表达式的正则表达式,有谁知道它是否使用自定义语法以及该文档的位置?ANTLR如何执行其角色操作?

+0

你或许应该刚才编辑您刚才的问题(http://stackoverflow.com/questions/1879394/how-to-exclude-more-than-one-character-in-rule)将其展开,而不是创造第二个。 – Amber 2009-12-10 08:34:31

回答

2

从ANTLR维基:


ANTLR Symbols

又见GrammarsSpecial 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 
+0

我不能相信我看了那几页后错过了,谢谢! – RCIX 2009-12-10 21:18:46