Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Latest commit

 

History

History
860 lines (499 loc) · 66.8 KB

roles.md

File metadata and controls

860 lines (499 loc) · 66.8 KB

Roles

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

Add is an arithmetic operator (i.e. +.)

Supported by: Go, Java, Javascript, Php, Python, Ruby

Alias

Alias is an alternative name for some construct.

Supported by: Go, Php, Python, Ruby

And

And is an AND operation (i.e. &&, &, and, etc.)

Supported by: Go, Java, Javascript, Php, Python, Ruby

Annotation

Annotation is syntactic metadata

Supported by: Java, Python

Anonymous

Anonymous is an unbound construct

Supported by: Java, Php, Python, Ruby

ArgsList

ArgsList is variable number of arguments (i.e. ..., Object..., *args, etc.)

Supported by: Go, Java, Javascript, Php, Python

Argument

Argument is variable used as input/output in a function.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Arithmetic

Arithmetic is a type of operation

Supported by: Go, Java, Javascript, Python, Ruby

Assert

Assert checks if an expression is true and if it is not, it signals an error/exception, possibly stopping the execution.

Supported by: Java, Python

Assignment

Assignment is an assignment operator.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Base

Base is the parent type of which another type inherits.

Supported by: Java, Javascript, Php, Python

Binary

Binary is any form of binary operator, in contrast with unary operators.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Bitwise

Bitwise is any form of bitwise operation.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Block

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

Body is a sequence of instructions in a block.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Boolean

Boolean is any form of boolean operation.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Break

Break is a construct for early exiting a block.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Byte

Byte is a single-byte element.

Supported by:

ByteString

ByteString is a raw byte string.

Supported by: Python

Call

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

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

Case is a clause whose expression is compared with the condition.

Supported by: Go, Java, Javascript, Php, Ruby

Catch

Catch is a clause to capture exceptions.

Supported by: Java, Javascript, Php, Python, Ruby

Character

Character is an encoded character.

Supported by: Go, Java

Comment

Comment is a code comment.

Supported by: Go, Java, Javascript, Php, Python

Condition

Condition is a condition in an IfStatement or IfExpression.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Contains

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

Continue is a construct for continuation with the next iteration of a loop.

Supported by: Go, Javascript, Php, Python, Ruby

Declaration

Declaration is a construct to specify properties of an identifier.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Decrement

Decrement is an arithmetic operator that decrements a value (i. e. --i.)

Supported by: Go, Java, Javascript, Php

Default

Default is a clause that is called when no other clause is matches.

Supported by: Java, Php, Ruby

Dereference

Dereference is an operation that gets the actual value of a pointer or reference (i.e. *x.)

Supported by: Go

Divide

Divide is an arithmetic operator (i.e. /.)

Supported by: Go, Java, Javascript, Php, Python, Ruby

DoWhile

DoWhile is a loop construct with a body and a condition.

Supported by: Java, Javascript, Php

Documentation

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).

Supported by: Java, Php

Else

Else is the clause executed when the Condition is false.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Entry

Entry is a collection element.

Supported by: Go, Php

Enumeration

Enumeration is a distinct type that represents a set of named constants

Supported by: Java

Equal

Equal is an equality predicate (i.e. =, ==, etc.)

Supported by: Go, Java, Javascript, Php, Python, Ruby

Expression

Expression is a construct computed to produce some value.

Supported by: Go, Java, Javascript, Php, Python, Ruby

File

File is the root node of a single file AST.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Finally

Finally is a clause for a block executed after a block with exception handling.

Supported by: Java, Javascript, Php, Python, Ruby

For

For is a loop with an initialization, a condition, an update and a body.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Friend

Friend is an access granter for some private resources.

Supported by:

Function

Function is a sequence of instructions packaged as a unit.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Goto

Goto is an unconditional transfer of control statement.

Supported by: Go, Php

GreaterThan

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

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

Identical is an identity predicate (i. e. ===, is, etc.)

Supported by: Javascript, Php, Python, Ruby

Identifier

Identifier is any form of identifier, used for variable names, functions, packages, etc.

Supported by: Go, Java, Javascript, Php, Python, Ruby

If

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

Implements is the type (usually an interface) that another type implements.

Supported by: Php

Import

Import indicates an import level property.

Supported by: Go, Java, Javascript, Php, Python

Incomplete

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

Increment is an arithmetic operator that increments a value (i. e. ++i.)

Supported by: Go, Java, Javascript, Php

Infix

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

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

Instance is a concrete occurrence of an object.

Supported by: Java, Javascript, Ruby

Invalid

Invalid Role is assigned as a zero value since protobuf enum definition must start at 0.

Supported by:

Iterator

Iterator is the element that iterates over something.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Key

Key is the index value of a map.

Supported by: Go, Javascript, Python

Left

Left is a left hand side in a binary expression.

Supported by: Go, Java, Javascript, Php, Python, Ruby

LeftShift

LeftShift is a left shift operation (i.e. <<, rol, etc.)

Supported by: Go, Java, Javascript, Php, Python, Ruby

LessThan

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

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

List is a sequence.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Literal

Literal is a literal value.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Map

Map is a collection of key, value pairs.

Supported by: Go, Javascript, Php, Python, Ruby

Module

Module is a set of functionality grouped.

Supported by: Javascript, Php, Python, Ruby

Modulo

Modulo is an arithmetic operator (i.e. %, mod, etc.)

Supported by: Go, Java, Javascript, Php, Python, Ruby

Multiply

Multiply is an arithmetic operator (i.e. *.)

Supported by: Go, Java, Javascript, Php, Python, Ruby

Name

Name is an identifier used to reference a value.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Negative

Negative is an arithmetic operator that negates a value (i.e. -x.)

Supported by: Go, Java, Javascript, Python

Noop

Noop is a construct that does nothing.

Supported by: Php, Python

Not

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

Null is an empty value.

Supported by: Java, Javascript, Php, Python, Ruby

Number

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

Operator is any form of operator.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Or

Or is an OR operation (i.e. ||, or, |, etc.)

Supported by: Go, Java, Javascript, Php, Python, Ruby

Package

Package indicates that a package level property.

Supported by: Java

Pathname

Pathname is a qualified name of some construct.

Supported by: Go, Java, Javascript, Php, Python

Positional

Positional is an element which position has meaning (i.e. a positional argument in a call).

Supported by: Go, Java, Python

Positive

Positive is an arithmetic operator that makes a value positive. It's usually redundant (i.e. +x.)

Supported by: Go, Java, Javascript, Python

Postfix

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

Primitive is a language builtin.

Supported by: Go, Java, Python, Ruby

Qualified

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

Receiver is the target of a construct (message, function, etc.)

Supported by: Go, Java, Php, Python

Regexp

Regexp is a regular expression.

Supported by: Javascript, Ruby

Relational

Relational is a type of operation

Supported by: Go, Java, Javascript, Php, Python, Ruby

Return

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

Right is a right hand side if a binary expression.

Supported by: Go, Java, Javascript, Php, Python, Ruby

RightShift

RightShift is a right shift operation (i.e. >>, ror, etc.)

Supported by: Go, Java, Javascript, Php, Python, Ruby

Role

Supported by: Go

Scope

Scope is a range in which a variable can be referred.

Supported by: Go, Java, Javascript, Python

Set

Set is a collection of values.

Supported by: Python

Statement

Statement is some action to be carried out.

Supported by: Go, Java, Javascript, Php, Python, Ruby

String

String is a sequence of characters.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Subpackage

Subpackage is a package that is below another package in the hierarchy.

Supported by:

Substract

Substract in an arithmetic operator (i.e. -.)

Supported by: Go, Java, Javascript, Php, Python, Ruby

Subtype

Subtype is a type that can be used to substitute another type.

Supported by: Java

Switch

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

TakeAddress is an operation that gets the memory address of a value (i. e. &x.)

Supported by: Go

Then

Then is the clause executed when the Condition is true.

Supported by: Go, Java, Javascript, Php, Python, Ruby

This

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

Throw is a statement that creates an exception.

Supported by: Java, Javascript, Php, Python, Ruby

Try

Try is a statement for exception handling.

Supported by: Java, Javascript, Php, Python, Ruby

Tuple

Tuple is an finite ordered sequence of elements.

Supported by: Python, Ruby

Type

Type is a classification of data.

Supported by: Go, Java, Javascript, Php, Python, Ruby

Unannotated

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

Unary is any form of unary operator, in contrast with binary operators.

Supported by: Go, Java, Javascript, Php, Python

Unsigned

Unsigned is an form of unsigned operation.

Supported by: Java, Javascript

Update

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

Value is an expression that cannot be evaluated any further.

Supported by: Go, Javascript, Php, Python

Variable

Variable is a symbolic name associated with a value

Supported by: Go, Java, Javascript, Php

Visibility

Visibility is an access granter role, usually together with an specifier role

Supported by: Java, Javascript, Php, Python, Ruby

While

While is a loop construct with a condition and a body.

Supported by: Java, Javascript, Php, Python, Ruby

Whitespace

Whitespace.

Supported by: Python

World

World is a set of every component.

Supported by: Java, Php, Python, Ruby

Xor

Xor is an exclusive OR operation (i.e. ~, ^, etc.)

Supported by: Go, Java, Javascript, Php, Python, Ruby