The Boa Programming Guide - Domain-Specific Types
Custom domain-specific types for Boa are described in this section. Note that
when a type is shown for an attribute, the type might contain a question mark
("?"). This indicates that field may or may not be defined. When accessing
these fields, be sure to first check if the given attr exists for
a given object o: if (def(o.attr))
| Project Top-level type, represents a single project on the forge | ||
| Attribute | Type | Description |
|---|---|---|
| audiences | array of string | A list of the target audiences for the project |
| code_repositories | array of CodeRepository | A list of all code repositories associated with this project |
| created_date | time? | The time the project was created |
| databases | array of string | A list of all databases used by the project |
| description | string? | A description of the project |
| developers | array of Person | A list of all software developers currently on the project |
| donations | bool? | If true, this project explicitly states it accepts donations |
| homepage_url | string? | A URL to the project's homepage |
| id | string | Unique identifier for the project |
| interfaces | array of string | A list of all interfaces supported by the project |
| licenses | array of string | A list of all licenses used by the project |
| maintainers | array of Person | A list of all people currently maintaining the project |
| name | string | The name of the project |
| operating_systems | array of string | A list of all OSes supported by the project |
| programming_languages | array of string | A list of all programming languages used by the project |
| project_url | string | A URL to the project's page on the forge |
| topics | array of string | A list of self-categorized topics the project belongs to |
| enum ForgeKind Describes the kind of forge | |
| Attribute | Description |
|---|---|
| APACHE | Apache |
| GITHUB | GitHub.com |
| OTHER | Any other kind of forge |
| QUALITAS | Qualitas Corpus |
| SOURCEFORGE | SourceForge.net |
| CodeRepository A source code repository (SVN, CVS, Git, etc) | ||
| Attribute | Type | Description |
|---|---|---|
| kind | RepositoryKind | The kind of code repository (SVN, GIT, etc) |
| revisions | array of Revision | All of the revisions contained in the code repository |
| url | string | The URL to access the code repository |
| Revision A single revision inside a CodeRepository | ||
| Attribute | Type | Description |
|---|---|---|
| author | Person | The person who authored the revision, if known, otherwise the same as committer |
| commit_date | time | The time the revision was committed |
| committer | Person | The person who committed the revision |
| files | array of ChangedFile | A list of all files committed in the revision |
| id | string | A unique identifier for the revision |
| log | string | The log message attached to the revision |
| enum RepositoryKind Describes the kind of code repository | |
| Attribute | Description |
|---|---|
| BZR | For Bazaar code repositories |
| CVS | For CVS code repositories |
| GIT | For Git code repositories |
| HG | For Mercurial code repositories |
| OTHER | Any other code repository |
| SVN | For Subversion code repositories |
| ChangedFile A file committed in a Revision | ||
| Attribute | Type | Description |
|---|---|---|
| change | ChangeKind | The kind of change for this file |
| kind | FileKind | The kind of file |
| name | string | The full name and path of the file |
| enum FileKind Describes the kind of the file | |
| Attribute | Description |
|---|---|
| BINARY | The file represents a binary file |
| OTHER | The file's type was unknown |
| SOURCE_JAVA_ERROR | The file represents a Java source file that had a parse error |
| SOURCE_JAVA_JLS2 | The file represents a Java source file that parsed without error as JLS2 |
| SOURCE_JAVA_JLS3 | The file represents a Java source file that parsed without error as JLS3 |
| SOURCE_JAVA_JLS4 | The file represents a Java source file that parsed without error as JLS4 |
| SOURCE_JAVA_JLS8 | The file represents a Java source file that parsed without error as JLS8 |
| TEXT | The file represents a text file |
| XML | The file represents an XML file |
| ASTRoot Container class that holds a file's parsed AST | ||
| Attribute | Type | Description |
|---|---|---|
| imports | array of string | The imported namespaces and types |
| namespaces | array of Namespace | The top-level namespaces in the file |
| Namespace A namespace (aka, package) in a source file | ||
| Attribute | Type | Description |
|---|---|---|
| declarations | array of Declaration | Declarations contained in this namespace |
| modifiers | array of Modifier | Any modifiers/annotations on the namespace |
| name | string | The name of the namespace |
| Declaration A type declaration, such as a class or interface | ||
| Attribute | Type | Description |
|---|---|---|
| fields | array of Variable | The fields in the declaration |
| generic_parameters | array of Type | Any generic parameters to this declaration |
| kind | TypeKind | The kind of this declaration |
| methods | array of Method | The methods in the declaration |
| modifiers | array of Modifier | The modifiers/annotations on this declaration |
| name | string | The name of this declaration |
| nested_declarations | array of Declaration | Any nested declarations |
| parents | array of Type | The explicitly named parent type(s) of this declaration |
| Type A type in an AST | ||
| Attribute | Type | Description |
|---|---|---|
| kind | TypeKind | The kind of the type |
| name | string | The name of the type |
| Method A method declaration | ||
| Attribute | Type | Description |
|---|---|---|
| arguments | array of Variable | The arguments the method takes |
| exception_types | array of Type | The list of exceptions thrown by this method |
| generic_parameters | array of Type | The list of generic parameters for this method |
| modifiers | array of Modifier | A list of all modifiers on the variable |
| name | string? | The name of the method |
| return_type | Type | The type returned from the method; if the method returns nothing, this type will be void |
| statements | array of Statement | The statements in the method body. Note that most methods (in C-like languages, such as Java) contain a single statement of type BLOCK, which contains the list of statements within it! |
| Variable A variable declaration - can be a field, local, parameter, etc | ||
| Attribute | Type | Description |
|---|---|---|
| initializer | Expression? | If the variable has an initial assignment, the expression is stored here |
| modifiers | array of Modifier | A list of all modifiers on the variable |
| name | string | The name of the variable |
| variable_type | Type | The type of the variable |
| Statement A single statement | ||
| Attribute | Type | Description |
|---|---|---|
| condition | Expression? | |
| expression | Expression? | |
| initializations | array of Expression | |
| kind | StatementKind | The kind of statement |
| statements | array of Statement | |
| type_declaration | Declaration? | |
| updates | array of Expression | |
| variable_declaration | Variable? | |
| Expression A single expression | ||
| Attribute | Type | Description |
|---|---|---|
| annotation | Modifier? | |
| anon_declaration | Declaration? | |
| expressions | array of Expression | |
| generic_parameters | array of Type | |
| is_postfix | bool? | |
| kind | ExpressionKind | The kind of expression |
| literal | string? | |
| method | string? | |
| method_args | array of Expression | |
| new_type | Type? | |
| variable | string? | |
| variable_decls | array of Variable | |
| Modifier A single modifier | ||
| Attribute | Type | Description |
|---|---|---|
| annotation_members | array of string | If the kind is ANNOTATION, then a list of all members explicitly assigned values |
| annotation_name | string? | If the kind is ANNOTATION, then the name of the annotation |
| annotation_values | array of Expression | If the kind is ANNOTATION, then a list of all values that were assigned to members |
| kind | ModifierKind | The kind of modifier |
| other | string? | If the kind is OTHER, the modifier string from the source code |
| visibility | Visibility? | A kind of visibility modifier |
| enum StatementKind The kind of statement | |
| Attribute | Description |
|---|---|
| ASSERT | |
| BLOCK | |
| BREAK | |
| CASE | |
| CATCH | |
| CONTINUE | |
| DO | |
| EMPTY | |
| EXPRESSION | |
| FOR | |
| IF | |
| LABEL | |
| OTHER | Any other statement |
| RETURN | |
| SWITCH | |
| SYNCHRONIZED | |
| THROW | |
| TRY | |
| TYPEDECL | |
| WHILE | |
| enum ExpressionKind The kind of expression | |
| Attribute | Description |
|---|---|
| ANNOTATION | |
| ARRAYINDEX | |
| ARRAYINIT | |
| ASSIGN | |
| ASSIGN_ADD | |
| ASSIGN_BITAND | |
| ASSIGN_BITOR | |
| ASSIGN_BITXOR | |
| ASSIGN_DIV | |
| ASSIGN_LSHIFT | |
| ASSIGN_MOD | |
| ASSIGN_MULT | |
| ASSIGN_RSHIFT | |
| ASSIGN_SUB | |
| ASSIGN_UNSIGNEDRSHIFT | |
| BIT_AND | |
| BIT_LSHIFT | |
| BIT_NOT | |
| BIT_OR | |
| BIT_RSHIFT | |
| BIT_UNSIGNEDRSHIFT | |
| BIT_XOR | |
| CAST | |
| CONDITIONAL | |
| EQ | |
| GT | |
| GTEQ | |
| LITERAL | |
| LOGICAL_AND | |
| LOGICAL_NOT | |
| LOGICAL_OR | |
| LT | |
| LTEQ | |
| METHODCALL | |
| NEQ | |
| NEW | |
| NEWARRAY | |
| NULLCOALESCE | |
| OP_ADD | |
| OP_DEC | |
| OP_DIV | |
| OP_INC | |
| OP_MOD | |
| OP_MULT | |
| OP_SUB | |
| OTHER | Any other expression |
| PAREN | |
| TYPECOMPARE | |
| VARACCESS | |
| VARDECL | |
| enum ModifierKind The kind of modifier | |
| Attribute | Description |
|---|---|
| ABSTRACT | An abstract modifier |
| ANNOTATION | An annotation modifier |
| FINAL | A final modifier |
| OTHER | Any other modifier - the value is in the Modifier's other attribute |
| STATIC | A static modifier |
| SYNCHRONIZED | A synchronized modifier |
| VISIBILITY | A Visibility modifier - the value is in the Modifier's visibility attribute |
| enum Visibility A visibility modifier | |
| Attribute | Description |
|---|---|
| NAMESPACE | A namespace (aka, default, aka package) visibility modifier |
| PRIVATE | A private modifier |
| PROTECTED | A protected modifier |
| PUBLIC | A public modifier |
| enum TypeKind The kinds of types in an AST | |
| Attribute | Description |
|---|---|
| ANNOTATION | An annotation type |
| ANONYMOUS | An anonymous type |
| CLASS | A class type |
| DELEGATE | A delegate type |
| ENUM | An enumerated type |
| GENERIC | A generic type |
| INTERFACE | An interface type |
| OTHER | Any other kind of Type |
| STRUCT | A C-style struct |
| Person A unique person's information | ||
| Attribute | Type | Description |
|---|---|---|
| string | The person's email address, if known | |
| real_name | string | The person's real name, if known, otherwise the same as username |
| username | string | The person's username |
| enum ChangeKind Describes the kind of change for the file | |
| Attribute | Description |
|---|---|
| ADDED | The file did not already exist and was added |
| DELETED | The file was deleted |
| MODIFIED | The file already existed and was modified |
| CFG @since 2019-10 - A control-flow graph | ||
| Attribute | Type | Description |
|---|---|---|
| nodes | set of CFGNode | The set of nodes in the graph |
| CDG @since 2019-10 - A control-dependence graph | ||
| Attribute | Type | Description |
|---|---|---|
| nodes | set of CDGNode | The set of nodes in the graph |
| DDG @since 2019-10 - A data-dependence graph | ||
| Attribute | Type | Description |
|---|---|---|
| nodes | set of DDGNode | The set of nodes in the graph |
| PDG @since 2019-10 - A program-dependence graph | ||
| Attribute | Type | Description |
|---|---|---|
| nodes | set of PDGNode | The set of nodes in the graph |
| CFGNode @since 2019-10 - A single node in a control-flow graph | ||
| Attribute | Type | Description |
|---|---|---|
| kind | NodeType | The kind of node |
| id | int | The node's unique ID in the graph |
| name | string | A name for the node, derived from the statement/expression it represents |
| stmt | Statement? | The statement, if any, this ndoe is associated with in the original AST. |
| expr | Expression? | The expression, if any, this ndoe is associated with in the original AST. |
| predecessors | array of CFGNode | A list of all predecessor nodes - nodes with an out edge to the curernt node |
| successors | arary of CFGNode | A list of all successor nodes - nodes with an in edge from the current node |
| useVariables | set of string | The set of all variables used by this node |
| defVariables | string | The variables defined by this node |
| CDGNode @since 2019-10 - A single node in a control-dependence graph | ||
| Attribute | Type | Description |
|---|---|---|
| kind | NodeType | The kind of node |
| id | int | The node's unique ID in the graph |
| stmt | Statement? | The statement, if any, this ndoe is associated with in the original AST. |
| expr | Expression? | The expression, if any, this ndoe is associated with in the original AST. |
| predecessors | array of CDGNode | A list of all predecessor nodes - nodes with an out edge to the curernt node |
| successors | arary of CDGNode | A list of all successor nodes - nodes with an in edge from the current node |
| cfg_node | CFGNode? | The CFGNode related to this CDGNode, if any |
| DDGNode @since 2019-10 - A single node in a data-dependence graph | ||
| Attribute | Type | Description |
|---|---|---|
| kind | NodeType | The kind of node |
| id | int | The node's unique ID in the graph |
| stmt | Statement? | The statement, if any, this ndoe is associated with in the original AST. |
| expr | Expression? | The expression, if any, this ndoe is associated with in the original AST. |
| predecessors | array of DDGNode | A list of all predecessor nodes - nodes with an out edge to the curernt node |
| successors | arary of DDGNode | A list of all successor nodes - nodes with an in edge from the current node |
| PDGNode @since 2019-10 - A single node in a program-dependence graph | ||
| Attribute | Type | Description |
|---|---|---|
| kind | NodeType | The kind of node |
| id | int | The node's unique ID in the graph |
| stmt | Statement? | The statement, if any, this ndoe is associated with in the original AST. |
| expr | Expression? | The expression, if any, this ndoe is associated with in the original AST. |
| predecessors | array of PDGNode | A list of all predecessor nodes - nodes with an out edge to the curernt node |
| successors | arary of PDGNode | A list of all successor nodes - nodes with an in edge from the current node |
| CFGEdge @since 2019-10 - A single edge in a control-flow graph | ||
| Attribute | Type | Description |
|---|---|---|
| label | EdgeLabel | The edge's label, indicating what kind of edge it is |
| src | CFGNode | The edge's source node |
| dest | CFGNode | The edge's destination node |
| CDGEdge @since 2019-10 - A single edge in a control-dependence graph | ||
| Attribute | Type | Description |
|---|---|---|
| label | EdgeLabel | The edge's label, indicating what kind of edge it is |
| src | CDGNode | The edge's source node |
| dest | CDGNode | The edge's destination node |
| DDGEdge @since 2019-10 - A single edge in a data-dependence graph | ||
| Attribute | Type | Description |
|---|---|---|
| label | EdgeLabel | The edge's label, indicating what kind of edge it is |
| src | DDGNode | The edge's source node |
| dest | DDGNode | The edge's destination node |
| PDGEdge @since 2019-10 - A single edge in a program-dependence graph | ||
| Attribute | Type | Description |
|---|---|---|
| label | EdgeLabel | The edge's label, indicating what kind of edge it is |
| src | PDGNode | The edge's source node |
| dest | PDGNode | The edge's destination node |
| enum NodeType @since 2019-10 - The type of a graph node | |
| Attribute | Description |
|---|---|
| CONTROL | A node with a control statement (such as if or loops) |
| ENTRY | Nodes added to the graph to indicate entry or exit |
| METHOD | Includes a method call (may lead to external graphs) |
| OTHER | A normal/sequential node |
| enum EdgeType @since 2019-10 - The type of a graph edge | |
| Attribute | Description |
|---|---|
| CONTROL | A control dependency edge |
| DATA | A data dependency edge |
| enum EdgeLabel @since 2019-10 - The label added to a graph edge | |
| Attribute | Description |
|---|---|
| NIL | No label - a normal edge |
| DEFAULT | A normal, sequential edge |
| TRUE | Indicates a true branch from a control node |
| FALSE | Indicates a false branch from a control node |
| BACKEDGE | A loop back-edge |
| EXITEDGE | An exit edge from a loop |
| VARDEF | A variable definition edge |
| enum TraversalDirection @since 2019-10 - The direction data flows in a program analysis traversal | |
| Attribute | Description |
|---|---|
| FORWARD | Data flows forwards in the graph |
| BACKWARD | Data flows backwards in the graph |
| enum TraversalKind @since 2019-10 - The kind of graph traversal to perform | |
| Attribute | Description |
|---|---|
| DFS | |
| POSTORDER | |
| REVERSEPOSTORDER | |
| WORKLIST_POSTORDER | |
| WORKLIST_REVERSEPOSTORDER | |
| ITERATIVE | |
| RANDOM | |
| HYBRID | |
