Role is the main UAST annotation. It indicates that a node in an AST can be interpreted as acting with certain language-independent role.
Role | Go | Java | JavaScript | PHP | Python | Ruby |
---|---|---|---|---|---|---|
Add | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Alias | ✓ | ✓ | ✓ | ✓ | ||
And | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Annotation | ✓ | ✓ | ||||
Anonymous | ✓ | ✓ | ✓ | ✓ | ||
ArgsList | ✓ | ✓ | ✓ | ✓ | ✓ | |
Argument | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Arithmetic | ✓ | ✓ | ✓ | ✓ | ✓ | |
Assert | ✓ | ✓ | ||||
Assignment | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Base | ✓ | ✓ | ✓ | ✓ | ||
Binary | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Bitwise | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Block | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Body | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Boolean | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Break | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Byte | ||||||
ByteString | ✓ | |||||
Call | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Callee | ✓ | ✓ | ✓ | ✓ | ||
Case | ✓ | ✓ | ✓ | ✓ | ✓ | |
Catch | ✓ | ✓ | ✓ | ✓ | ✓ | |
Character | ✓ | ✓ | ||||
Comment | ✓ | ✓ | ✓ | ✓ | ✓ | |
Condition | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Contains | ✓ | |||||
Continue | ✓ | ✓ | ✓ | ✓ | ✓ | |
Declaration | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Decrement | ✓ | ✓ | ✓ | ✓ | ||
Default | ✓ | ✓ | ✓ | |||
Dereference | ✓ | |||||
Divide | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
DoWhile | ✓ | ✓ | ✓ | |||
Documentation | ✓ | ✓ | ||||
Else | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Entry | ✓ | ✓ | ||||
Enumeration | ✓ | |||||
Equal | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Expression | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
File | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Finally | ✓ | ✓ | ✓ | ✓ | ✓ | |
For | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Friend | ||||||
Function | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Goto | ✓ | ✓ | ||||
GreaterThan | ✓ | ✓ | ✓ | ✓ | ✓ | |
GreaterThanOrEqual | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Identical | ✓ | ✓ | ✓ | ✓ | ||
Identifier | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
If | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Implements | ✓ | |||||
Import | ✓ | ✓ | ✓ | ✓ | ✓ | |
Incomplete | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Increment | ✓ | ✓ | ✓ | ✓ | ||
Infix | ||||||
Initialization | ✓ | ✓ | ✓ | ✓ | ||
Instance | ✓ | ✓ | ✓ | |||
Invalid | ||||||
Iterator | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Key | ✓ | ✓ | ✓ | |||
Left | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
LeftShift | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
LessThan | ✓ | ✓ | ✓ | ✓ | ✓ | |
LessThanOrEqual | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
List | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Literal | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Map | ✓ | ✓ | ✓ | ✓ | ✓ | |
Module | ✓ | ✓ | ✓ | ✓ | ||
Modulo | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Multiply | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Name | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Negative | ✓ | ✓ | ✓ | ✓ | ||
Noop | ✓ | ✓ | ||||
Not | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Null | ✓ | ✓ | ✓ | ✓ | ✓ | |
Number | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Operator | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Or | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Package | ✓ | |||||
Pathname | ✓ | ✓ | ✓ | ✓ | ✓ | |
Positional | ✓ | ✓ | ✓ | |||
Positive | ✓ | ✓ | ✓ | ✓ | ||
Postfix | ✓ | ✓ | ✓ | |||
Primitive | ✓ | ✓ | ✓ | ✓ | ||
Qualified | ✓ | ✓ | ✓ | ✓ | ✓ | |
Receiver | ✓ | ✓ | ✓ | ✓ | ||
Regexp | ✓ | ✓ | ||||
Relational | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Return | ✓ | ✓ | ✓ | ✓ | ✓ | |
Right | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
RightShift | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Role | ✓ | |||||
Scope | ✓ | ✓ | ✓ | ✓ | ||
Set | ✓ | |||||
Statement | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
String | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Subpackage | ||||||
Substract | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Subtype | ✓ | |||||
Switch | ✓ | ✓ | ✓ | ✓ | ✓ | |
TakeAddress | ✓ | |||||
Then | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
This | ✓ | ✓ | ✓ | |||
Throw | ✓ | ✓ | ✓ | ✓ | ✓ | |
Try | ✓ | ✓ | ✓ | ✓ | ✓ | |
Tuple | ✓ | ✓ | ||||
Type | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Unannotated | ||||||
Unary | ✓ | ✓ | ✓ | ✓ | ✓ | |
Unsigned | ✓ | ✓ | ||||
Update | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Value | ✓ | ✓ | ✓ | ✓ | ||
Variable | ✓ | ✓ | ✓ | ✓ | ||
Visibility | ✓ | ✓ | ✓ | ✓ | ✓ | |
While | ✓ | ✓ | ✓ | ✓ | ✓ | |
Whitespace | ✓ | |||||
World | ✓ | ✓ | ✓ | ✓ | ||
Xor | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Add is an arithmetic operator (i.e. +
.)
Supported by: Go, Java, Javascript, Php, Python, Ruby
Alias is an alternative name for some construct.
Supported by: Go, Php, Python, Ruby
And is an AND operation (i.e. &&
, &
, and
, etc.)
Supported by: Go, Java, Javascript, Php, Python, Ruby
Annotation is syntactic metadata
Anonymous is an unbound construct
Supported by: Java, Php, Python, Ruby
ArgsList is variable number of arguments (i.e. ...
, Object...
, *args
, etc.)
Supported by: Go, Java, Javascript, Php, Python
Argument is variable used as input/output in a function.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Arithmetic is a type of operation
Supported by: Go, Java, Javascript, Python, Ruby
Assert checks if an expression is true and if it is not, it signals an error/exception, possibly stopping the execution.
Assignment is an assignment operator.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Base is the parent type of which another type inherits.
Supported by: Java, Javascript, Php, Python
Binary is any form of binary operator, in contrast with unary operators.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Bitwise is any form of bitwise operation.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Block is a group of statements. If the source language has block scope, it should be annotated both with Block and BlockScope.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Body is a sequence of instructions in a block.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Boolean is any form of boolean operation.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Break is a construct for early exiting a block.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Byte is a single-byte element.
Supported by:
ByteString is a raw byte string.
Supported by: Python
Call is any call, whether it is a function, procedure, method or macro. In its simplest form, a call will have a single child with a function name (callee). Arguments are marked with Argument and Positional or Name. In OO languages there is usually a Receiver too.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Callee is the callable being called. It might be the name of a function or procedure, it might be a method, it might a simple name or qualified with a namespace.
Supported by: Go, Java, Javascript, Python
Case is a clause whose expression is compared with the condition.
Supported by: Go, Java, Javascript, Php, Ruby
Catch is a clause to capture exceptions.
Supported by: Java, Javascript, Php, Python, Ruby
Character is an encoded character.
Comment is a code comment.
Supported by: Go, Java, Javascript, Php, Python
Condition is a condition in an IfStatement or IfExpression.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Contains is a membership predicate that checks if the lhs value is a member of the rhs container (i.e. in
in Python.)
Supported by: Python
Continue is a construct for continuation with the next iteration of a loop.
Supported by: Go, Javascript, Php, Python, Ruby
Declaration is a construct to specify properties of an identifier.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Decrement is an arithmetic operator that decrements a value (i. e. --i
.)
Supported by: Go, Java, Javascript, Php
Default is a clause that is called when no other clause is matches.
Dereference is an operation that gets the actual value of a pointer or reference (i.e. *x
.)
Supported by: Go
Divide is an arithmetic operator (i.e. /
.)
Supported by: Go, Java, Javascript, Php, Python, Ruby
DoWhile is a loop construct with a body and a condition.
Supported by: Java, Javascript, Php
Documentation is a node that represents documentation of another node, such as function or package. Documentation is usually in the form of a string in certain position (e.g. Python docstring) or comment (e.g. Javadoc, godoc).
Else is the clause executed when the Condition is false.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Entry is a collection element.
Enumeration is a distinct type that represents a set of named constants
Supported by: Java
Equal is an equality predicate (i.e. =
, ==
, etc.)
Supported by: Go, Java, Javascript, Php, Python, Ruby
Expression is a construct computed to produce some value.
Supported by: Go, Java, Javascript, Php, Python, Ruby
File is the root node of a single file AST.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Finally is a clause for a block executed after a block with exception handling.
Supported by: Java, Javascript, Php, Python, Ruby
For is a loop with an initialization, a condition, an update and a body.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Friend is an access granter for some private resources.
Supported by:
Function is a sequence of instructions packaged as a unit.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Goto is an unconditional transfer of control statement.
GreaterThan is a comparison predicate that checks if the lhs value is greater than the rhs value (i. e. >
.)
Supported by: Go, Java, Javascript, Php, Python
GreaterThanOrEqual is a comparison predicate that checks if the lhs value is greater than or equal to the rhs value (i.e. 1>=`.)
Supported by: Go, Java, Javascript, Php, Python, Ruby
Identical is an identity predicate (i. e. ===
, is
, etc.)
Supported by: Javascript, Php, Python, Ruby
Identifier is any form of identifier, used for variable names, functions, packages, etc.
Supported by: Go, Java, Javascript, Php, Python, Ruby
If is used for if-then[-else] statements or expressions. An if-then tree will look like:
If, Statement {
**[non-If nodes] {
If, Condition {
[...]
}
}
**[non-If* nodes] {
If, Then {
[...]
}
}
**[non-If* nodes] {
If, Else {
[...]
}
}
}
The Else node is optional. The order of Condition, Then and Else is not defined.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Implements is the type (usually an interface) that another type implements.
Supported by: Php
Import indicates an import level property.
Supported by: Go, Java, Javascript, Php, Python
Incomplete express that the semantic meaning of the node roles doesn't express the full semantic information. Added in BIP-002.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Increment is an arithmetic operator that increments a value (i. e. ++i
.)
Supported by: Go, Java, Javascript, Php
Infix should mark the nodes which are parents of expression nodes using infix notation, e.g.: a+b. Nodes without Infix or Postfix mark are considered in prefix order by default.
Supported by:
Initialization is the assignment of an initial value to a variable (i.e. a for loop variable initialization.)
Supported by: Go, Java, Javascript, Php
Instance is a concrete occurrence of an object.
Supported by: Java, Javascript, Ruby
Invalid Role is assigned as a zero value since protobuf enum definition must start at 0.
Supported by:
Iterator is the element that iterates over something.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Key is the index value of a map.
Supported by: Go, Javascript, Python
Left is a left hand side in a binary expression.
Supported by: Go, Java, Javascript, Php, Python, Ruby
LeftShift is a left shift operation (i.e. <<
, rol
, etc.)
Supported by: Go, Java, Javascript, Php, Python, Ruby
LessThan is a comparison predicate that checks if the lhs value is smaller than the rhs value (i. e. <
.)
Supported by: Go, Java, Javascript, Php, Python
LessThanOrEqual is a comparison predicate that checks if the lhs value is smaller or equal to the rhs value (i.e. <=
.)
Supported by: Go, Java, Javascript, Php, Python, Ruby
List is a sequence.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Literal is a literal value.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Map is a collection of key, value pairs.
Supported by: Go, Javascript, Php, Python, Ruby
Module is a set of functionality grouped.
Supported by: Javascript, Php, Python, Ruby
Modulo is an arithmetic operator (i.e. %
, mod
, etc.)
Supported by: Go, Java, Javascript, Php, Python, Ruby
Multiply is an arithmetic operator (i.e. *
.)
Supported by: Go, Java, Javascript, Php, Python, Ruby
Name is an identifier used to reference a value.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Negative is an arithmetic operator that negates a value (i.e. -x
.)
Supported by: Go, Java, Javascript, Python
Noop is a construct that does nothing.
Not is a negation operation. It may be used to annotate a complement of an operator.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Null is an empty value.
Supported by: Java, Javascript, Php, Python, Ruby
Number is a numeric value. This applies to any numeric value whether it is integer or float, any base, scientific notation or not, etc.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Operator is any form of operator.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Or is an OR operation (i.e. ||
, or
, |
, etc.)
Supported by: Go, Java, Javascript, Php, Python, Ruby
Package indicates that a package level property.
Supported by: Java
Pathname is a qualified name of some construct.
Supported by: Go, Java, Javascript, Php, Python
Positional is an element which position has meaning (i.e. a positional argument in a call).
Supported by: Go, Java, Python
Positive is an arithmetic operator that makes a value positive. It's usually redundant (i.e. +x
.)
Supported by: Go, Java, Javascript, Python
Postfix should mark the nodes which are parents of nodes using postfix notation, e.g.: ab+. Nodes without Infix or Postfix mark are considered in prefix order by default.
Supported by: Java, Javascript, Php
Primitive is a language builtin.
Supported by: Go, Java, Python, Ruby
Qualified is a kind of property identifiers may have, when it's composed of multiple simple identifiers.
Supported by: Java, Javascript, Php, Python, Ruby
Receiver is the target of a construct (message, function, etc.)
Supported by: Go, Java, Php, Python
Regexp is a regular expression.
Supported by: Javascript, Ruby
Relational is a type of operation
Supported by: Go, Java, Javascript, Php, Python, Ruby
Return is a return statement. It might have a child expression or not as with naked returns in Go or return in void methods in Java.
Supported by: Go, Java, Javascript, Php, Python
Right is a right hand side if a binary expression.
Supported by: Go, Java, Javascript, Php, Python, Ruby
RightShift is a right shift operation (i.e. >>
, ror
, etc.)
Supported by: Go, Java, Javascript, Php, Python, Ruby
Supported by: Go
Scope is a range in which a variable can be referred.
Supported by: Go, Java, Javascript, Python
Set is a collection of values.
Supported by: Python
Statement is some action to be carried out.
Supported by: Go, Java, Javascript, Php, Python, Ruby
String is a sequence of characters.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Subpackage is a package that is below another package in the hierarchy.
Supported by:
Substract in an arithmetic operator (i.e. -
.)
Supported by: Go, Java, Javascript, Php, Python, Ruby
Subtype is a type that can be used to substitute another type.
Supported by: Java
Switch is used to represent a broad of switch flavors. An expression is evaluated and then compared to the values returned by different case expressions, executing a body associated to the first case that matches. Similar constructions that go beyond expression comparison (such as pattern matching in Scala's match) should not be annotated with Switch.
Supported by: Go, Java, Javascript, Php, Ruby
TakeAddress is an operation that gets the memory address of a value (i. e. &x
.)
Supported by: Go
Then is the clause executed when the Condition is true.
Supported by: Go, Java, Javascript, Php, Python, Ruby
This represents the self-reference of an object instance in one of its methods. This corresponds to the this
keyword (e.g. Java, C++, PHP), self
(e.g. Smalltalk, Perl, Swift) and Me
(e.g. Visual Basic).
Supported by: Java, Javascript, Ruby
Throw is a statement that creates an exception.
Supported by: Java, Javascript, Php, Python, Ruby
Try is a statement for exception handling.
Supported by: Java, Javascript, Php, Python, Ruby
Tuple is an finite ordered sequence of elements.
Type is a classification of data.
Supported by: Go, Java, Javascript, Php, Python, Ruby
Unannotated will be automatically added by the SDK for nodes that did not receive any annotations with the current version of the driver's annotations.go
file. Added in BIP-002.
Supported by:
Unary is any form of unary operator, in contrast with binary operators.
Supported by: Go, Java, Javascript, Php, Python
Unsigned is an form of unsigned operation.
Supported by: Java, Javascript
Update is the assignment of a new value to a variable (i.e. a for loop variable update.)
Supported by: Go, Java, Javascript, Php, Python, Ruby
Value is an expression that cannot be evaluated any further.
Supported by: Go, Javascript, Php, Python
Variable is a symbolic name associated with a value
Supported by: Go, Java, Javascript, Php
Visibility is an access granter role, usually together with an specifier role
Supported by: Java, Javascript, Php, Python, Ruby
While is a loop construct with a condition and a body.
Supported by: Java, Javascript, Php, Python, Ruby
Whitespace.
Supported by: Python
World is a set of every component.
Supported by: Java, Php, Python, Ruby
Xor is an exclusive OR operation (i.e. ~
, ^
, etc.)