2018-04-25 12:38:41 -04:00
|
|
|
[[painless-identifiers]]
|
|
|
|
=== Identifiers
|
|
|
|
|
2018-05-23 16:36:58 -04:00
|
|
|
Use an identifier as a named token to specify a
|
|
|
|
<<painless-variables, variable>>, <<painless-types, type>>,
|
|
|
|
<<dot-operator, field>>, <<dot-operator, method>>, or function.
|
|
|
|
<<painless-keywords, Keywords>> cannot be used as identifiers.
|
2018-04-25 12:38:41 -04:00
|
|
|
|
|
|
|
*Grammar*
|
|
|
|
[source,ANTLR4]
|
|
|
|
----
|
|
|
|
ID: [_a-zA-Z] [_a-zA-Z-0-9]*;
|
|
|
|
----
|
|
|
|
|
|
|
|
*Examples*
|
|
|
|
|
|
|
|
* Variations of identifiers.
|
|
|
|
+
|
|
|
|
[source,Painless]
|
|
|
|
----
|
|
|
|
a
|
|
|
|
Z
|
|
|
|
id
|
|
|
|
list
|
|
|
|
list0
|
|
|
|
MAP25
|
|
|
|
_map25
|
|
|
|
Map_25
|
|
|
|
----
|