开发者

How does ANTLR perform its character manipulation? [closed]

开发者 https://www.devze.com 2022-12-13 13:20 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. 开发者_运维百科

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 4 years ago.

Improve this question

ANTLR 3 seems to use some sort of regex like manipulation in its rules, does anyone know if it uses a custom syntax and where the documentation for that is?


From the ANTLR wiki:


ANTLR Symbols

See also Grammars and 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 
0

精彩评论

暂无评论...
验证码 换一张
取 消