5. LKQL Language Reference

LKQL (short for LangKit Query Language) is a query language enabling users to run queries on top of source code.

LKQL today is the mixture of two language subsets:

  • The first is a dynamically typed, functional, small but general purpose programming language, including function definitions, common expressions, very basic support for numeric types and computations, list comprehensions, etc.

  • The second is a tree query language, allowing the user to express very concisely predicates over a node and its syntactic and semantic relatives, and tree traversal logics.

Those two subsets will be documented separately. The general language will be documented first, because its knowledge is needed for understanding the tree query language.

LKQL is based upon the langkit technology. As such, it is theoretically capable of running queries on any language with a Langkit frontend. In practice for the moment, LKQL is hardwired for Ada (and Libadalang).

Attention

While mostly stable, LKQL is not completely done yet. The language will keep being extended with new constructs, and from time to time syntax might change to accommodate new language constructs/enhance the language ergonomics/fix design mistakes. Read the Language Changes section for more information.

5.1. General Purpose Language Subset

This language subset is composed of a reduced set of declarations and expressions that forms a minimal but turing complete language.

For the time being, it has no side effects, which is intended since the purpose of LKQL is strictly to express queries.

5.1.1. Data Types

LKQL has a very limited number of data types for the moment. Here are the current data types:

5.1.1.1. Basic Data Types

Unit

A type used to represents empty values.

Int

Basic integer type, supporting arbitrary sized values. Supports simple arithmetic.

Str

Built-in string type, that supports concatenation.

Bool

Built-in boolean type, that supports the usual expected boolean relational operators.

Node

Coming from the queried language (in the common case, Ada). Nodes correspond to the syntax nodes of the source files being queried. They can be explored as part of the general language subset, through Field access, or via the Query language subset.

Token

Also coming from the queried language. Tokens correspond to lexical units of the queried source files.

Pattern

Values of this type are compiled regular expressions that can be used in a few contexts to match a string against, notably in the string built-in functions contains and find.

Function

LKQL functions are first class citizens, thus, any expression can has this type which represents values that can be called with a call expression.

5.1.1.2. Composite Data Types

Tuple

Tuples are heterogeneous groups of values with a fixed size. They can be indexed to access inner values, a bit like Python tuples.

List

Lists are contiguous immutable sequences of items that can be indexed. Lists also support concatenation.

Stream

Streams are lazy sequences of items, which means an element will not be computed until it is observed. They can also be indexed (which will force the computation until the indexed item).

Attention

Tuples, Lists and Streams are indexed starting from 1, like in Lua/R/.., unlike in Python/Java/..

Object

Objects are heterogeneous records that can contain any number of key to value mappings, where keys are labels and values are any valid LKQL value.

5.1.2. Declarations

Declarations in LKQL only belong at the top level. There is no support currently for nested declarations, except in the block expression.

5.1.2.1. Function Declaration

fun_decl decl_annotation 'fun' id '(' param ',' ')' '=' doc_node expr param id ':' id '=' expr

Allows the user to declare an LKQL function that can be used to factor some computation:

fun add(x, y) = x + y

The syntax is simple, you only declare argument names and an expression after the =.

If you need to declare temporary named values in the body of your function, you can use a block expression:

fun add(x, y) = {
    |" Add two integers
    val ret = x + y;
    ret
}

Note

A function can have annotations. For the moment, this is used only in the context of LKQL checkers:

@check(message="Bla detected")
fun is_bla() = node is Bla

Functions can also be nested in other functions, and closures are allowed, ie. you can return a function that references the environment in which it was declared:

fun make_closure(closure_var) = {
    fun use_closure() = closure_var + 1;
    use_closure
}

# This will display the functional value "use_closure"
print(make_closure(12))

Note

Functions can be memoized via the @memoized annotation. In a language such as lkql that is purely functional, this will give a way for users to express/optimize computationally expensive things. Here is a simple example:

@memoized
fun fib(a) =
    if a == 0 then 0
    else (if a == 1 then 1
          else fib(a - 1) + fib (a - 2))

print(fib(30))

5.1.2.2. Value Declaration

val_decl decl_annotation doc_node 'val' id '=' expr

Declare a named value (often called a variable or constant in other languages):

val a = 12 + 15

Note that the value is immutable.

5.1.2.3. Docstrings

Declarations can have assorted docstrings. They’re part of the AST and are directly attached to the declaration:

# Docstrings

fun make_closure(closure_var) =
|" Make a function that will capture ``closure_var`` and return the sum of
|" it plus its first argument
{
    fun use_closure(x) = closure_var + x;
    use_closure
}

|" Function that will add 12 to its first argument
val adder = make_closure(12)

print(make_closure(12))

5.1.3. Expressions

5.1.3.1. Block Expression

block_expr '{' decl ';' expr ';' expr '}'

The block expression is useful to declare temporary named values and execute intermediate expressions. This can be useful to share the result of a temporary calculation, to name an intermediate value to make the code more readable, or to print debug values:

{
    val x = 40;
    val y = 2;
    print("DEBUG : " & (x + y).img);
    x + y
}

As you can see in the example above, value declarations and intermediate expressions are ended by semicolons. After the last one, you write the block’s result expression, without an ending semicolon.

5.1.3.2. Field Access

A field access returns the contents of a field. In the following example, we get the content of the f_type_expr syntax field on a node of type ObjectDecl:

object_decl.f_type_expr

A regular field access on a nullable variable is illegal and leads to a runtime error, which is why field access has a variant, which is called a “safe access”:

object_decl?.f_type_expr

The safe access will return null if the left hand side is null. This allows users to chain accesses without having to checks for nulls at every step.

In the context of rewriting features usage, you may want to get a reference to a field of a node. You can access such references with a dot-access notation on node kinds:

val ref_to_f_child = MyNodeKind.f_child

Such values can be used when calling RewritingContext’s methods.

5.1.3.3. Unwrap Expression

When you have a nullable object and you want to make it non nullable, you can use the unwrap expression. This is useful after a chain of safe accesses/calls, for example:

object_decl?.p_type_expr()?.p_designated_type_decl()!!

Unwrap will raise an error if the value is null.

5.1.3.4. Call Expression

fun_call id '?' '(' arg_list ')'

LKQL values of the Function type can be invoked with the call expression:

fun add(a, b) = a + b

val c = add(12, 15)
val d = add(a=12, b=15)

Parameters can be passed via positional or named associations.

Calls have a “safe” variant, that will return () (Unit) if the callee is null:

fun add(a, b) = a + b
val fn = if true then null else add
fn?(1, 2) # Returns ()

Additionally, you can also call selectors via the call syntax. Selector calls take only one argument, which is the starting point of the selector call chain:

children(select first AdaNode)

5.1.3.5. Constructor call

constructor_call 'new' upper_id '(' arg ',' ')'

You can call node constructors to create new nodes possibly used for the tree rewriting layer of LKQL. The result of a constructor call is a value of the RewritingNode type.

val token_node = new BooleanLiteral("Hello!")
val list_node = new SomeListNode(child_1, child_2)
val composite_node = new CompositeNode(
    f_child_1=token_node,
    f_child_2=list_node
)

As function calls, you can pass arguments via positional or named associations for composite nodes. About token and list nodes, you may only pass arguments through the positional format.

To know whether a node is a token, list or composite one, you may refer to the Langkit specification of the language you’re querying.

5.1.3.6. Indexing Expression

Indexing expression allows the user to access elements of a Tuple, List, Stream, or Node.

When using the indexing expression on a node value:

  • for list nodes, it will access the different elements of the list

  • for regular nodes, it will access children in lexical order

Here are some examples of indexing expressions:

# Indexing a tuple
(1, 2, 3)[1]

# Indexing a list
list[1]

# Indexing a node with an arbitrary index
{
    val x = 2;
    node[x]
}

Indexing also has a safe variant, that will return unit instead of raising when an out of bound access is done:

val lst = [1, 2, 3]

# This will display "()"
print(lst?[5])

5.1.3.7. Comparison Expression

comp_expr comp_expr 'is' pattern comp_expr 'in' expr comp_expr '==' '!=' '<' '<=' '>' '>=' plus_expr plus_expr

Comparison expressions are used to compare an object to another object, or pattern. All those constructions are evaluated as booleans.

5.1.3.7.1. Membership Expression

The membership expression verifies that a collection (List/Stream) contains the given value:

12 in list
5.1.3.7.2. Is Expression

The is expression verifies if a value matches a given pattern:

val a = select AdaNode
val b = a[1] is ObjectDecl
5.1.3.7.3. Comparison Operators

The usual comparison operators are available:

12 < 15
a == b
b != c

Order dependent operators (</>/…) are only usable on integers.

5.1.3.8. Object Literal

objectlit '{' object_assoc ',' '}'

An object literal is a literal representation of an object value:

# Object literal
{a: 1, b: "foo", c: null, d: [1, 2, 3, 4]}
at_object_lit '@' '{' at_object_assoc ',' '}'

“@” object literals are quite the same as standard objects literals, but each associated value is wrapped in a list (if not already one). You are also allowed to omit the associated expression when adding a key in the object. The default associated value is a list with only one element: an empty object.

# @-object literal
@{a: "Hello", b, c: 42, d}

# Is similar to
{a: ["Hello"], b: [{}], c: [42], d: [{}]}

This “@” object notation are mainly used to express coding standards in LKQL rule configuration files, however, you can use it in any context.

Object keys may contain upper-case characters at declaration, but the LKQL engine will lower them. This means that object keys are case-insensitive:

val o = {lower: "Hello", UPPER: "World"}

# This will display "Hello World"
print(o.lower & " " & o.upper)

Please note that objects are immutable.

5.1.3.9. List Literal

listlit '[' expr ',' ']'

A list literal is simply a literal representation of a list:

# Simple list literal
[1, 2, 3, 4]

Lists being immutable, lists literals are the primary way to create new lists from nothing, with list comprehension being the way to create new lists from existing lists.

5.1.3.10. List Comprehension

listcomp '[' expr 'for' id 'in' expr ',' 'if' expr ']'

A list comprehension allows the user to create a new list by iterating on an existing collection, applying a mapping operation, and eventually a filtering logic:

# Simple list comprehension that'll double every number in int_list if it
# is prime
[a * 2 for a in int_list if is_prime(a)]

# Complex example interleaving two collections
val subtypes = select SubtypeIndication
val objects = select ObjectDecl
print(
    [
        o.image & " " & st.image
        for o in objects, st in subtypes
        if (o.image & " " & st.image).length != 64
    ].to_list
)

A list comprehension is a basic language construct, that, since LKQL is purely functional, replaces traditional for loops. A list comprehension expression returns a value of the Stream type, meaning that elements in the result aren’t computed until queried:

val lazy = [a * 2 for a in int_list if is_prime(a)]

# This will display "Stream"
print(lazy)

# To display all elements of a stream, you have to convert it to a list
print(lazy.to_list)

5.1.3.11. If Expression

if_then_else 'if' expr 'then' expr 'else' expr

If expressions are traditional conditional expressions composed of a condition, an expression executed when the condition is true, and and expression executed when the condition is false:

# No parentheses required
val x = if b < 12 then c() else d()

The else branch is optional and its default value is true, this can be useful to express an implication logic:

# Without "else" expression
val y = if b < 12 then a == 0

5.1.3.12. Match Expression

match_expr 'match' expr match_arm

This expression is a pattern matching expression, and reuses the same patterns as the query part of the language. Matchers will be evaluated in order against the match’s target expression. The first matcher to match the object will trigger the evaluation of the associated expression in the match arm:

match nodes[1]
| ObjectDecl(p_has_aliased(): aliased @ *) => aliased
| ParamSpec(p_has_aliased(): aliased @ *) => aliased
| * => false

Note

For the moment, there is no static check that the matcher is complete. A match expression where no arm has matched will raise an exception at runtime.

5.1.3.13. Tuple Literal

tuple_expr '(' expr ',' ')'

The tuple literal is used to create a value of the Tuple composite type:

val t = (1, 2)
val tt = ("hello", "world")
val ttt = (t[1], tt[1])
print(t)
print(tt)
print(ttt)

Tuples are useful as function return values, or to aggregate data, since LKQL doesn’t have structs yet.

5.1.3.14. Anonymous Function

anonymous_function '(' param ',' ')' '=>' expr

LKQL supports first class functions, and anonymous functions expressions (or lambdas). Thus, you can create anonymous functional values:

fun mul_y(y) = (x) => x * y
val mul_2 = mul_y (2)
val four = mul_2 (2)

5.1.3.15. Literals and Operators

LKQL has literals for booleans, integers, strings, unit, and null values:

val a = true     # Boolean
val b = 12       # Integer
val c = "hello"  # String
val d = ()       # Unit
val e = null     # Null

Note

The LKQL null literal is used to represent a null node value, thus, it is different from the () (unit) value.

LKQL has multi-line string literals, called block-strings but they’re a bit different than in Python or other languages:

val a = |" Hello
        |" This is a multi line string
        |" Bue

Note

The first character after the " should be a whitespace. This is not enforced at parse-time but at run-time, so |"hello is still a syntactically valid block-string, but will raise an error when evaluated.

LKQL has a few built-in operators available:

  • Basic arithmetic operators on integers

val calc = a + 2 * 3 / 4 == b
val smaller_or_eq = a <= b
val greater_or_eq = b >= c
  • Basic relational operators on booleans

true and false or (a == b) and (not c)
  • Value concatenation

# Strings concatenation
"Hello " & name
# Lists concatenation
[1, 2, 3] & [4, 5, 6]

5.1.3.16. Module Importation

LKQL has a very simple module system. Basically every file in LKQL is a module, and you can import modules from other files with the import clause. When importing a module, you are associating its name to the namespace produced by the evaluation of its source (all declarations in its top-level):

# foo.lkql
fun bar() = 12

# bar.lkql
import foo

print(foo.bar())

LKQL will search for files:

  1. That are in the same directory as the current file

  2. That are in the LKQL_PATH environment variable

In case of multiple LKQL modules with the same name (two LKQL files named the same), an error is raised by the interpreter.

Note

There is no way to create hierarchies of modules for now, only flat modules are supported.

Attention

Circular dependencies are forbidden, thus the following files will raise an error at runtime:

# foo.lkql
import bar

# bar.lkql
import foo

Attention

In case of an ambiguous importation, the LKQL engine will raise a runtime error. For example, the following example will raise an error if the subdir directory is in the LKQL_PATH environment variable:

# foo.lkql
val x = 42

# subdir/foo.lkql
val y = 50

# bar.lkql
import foo
print(foo.x)

5.2. Query Language Subset

The query language subset is mainly composed of three language constructs: patterns, queries and selectors.

Patterns allow the user to express filtering logic on trees and graphs, akin to what regular expressions allow for strings.

A lot of the ideas behind patterns are similar to ideas in XPath, or even in CSS selectors

However, unlike in CSS or xpath, a pattern is just the filtering logic, not the traversal, even though filtering might contain sub traversals via selectors.

Here is a very simple example of a query expression, that will select object declarations that have the aliased qualifier:

# Queries are expressions, so their result can be stored in a named value
val a = select ObjectDecl(p_has_aliased(): true)

This will query every source file in the LKQL context, filter their nodes according to the provided pattern, and return the List containing all nodes matching the pattern.

Finally, selectors are a way to express “traversal” logic on the node graph. Syntactic nodes, when explored through their syntactic children, form a tree. However:

  • There are different ways to traverse this tree (for example, you can explore the parents starting from a node)

  • There are non syntactic ways to explore nodes, for example using semantic properties such as going from references to their declarations, or going up the tree of base types for a given tagged type.

All those traversals, including the most simple built-in one, use what is called selectors in LKQL. Those are a way to specify a traversal, which will return a Stream of nodes as a result. Here is an example of a selector that will go up the parent chain:

selector parent
| AdaNode => rec(*this.parent, this)
| *       => ()

Read the Selector Declaration section for more information about selectors.

5.2.1. Query Expression

query 'from' '*' expr 'through' expr 'select' Identifier pattern 'through' expr 'select' Identifier pattern

The query expression is extremely simple, and most of the complexity lies in the upcoming sections about patterns.

A query traverses one or several trees, from one or several root nodes, applying the pattern on every node, and then returns a List containing all nodes that matched the pattern:

# Will select all non null nodes
select AdaNode

By default the query’s roots are implicit and set by the context. However, you can specify them with the from keyword, followed either by a Node value, or a List of nodes:

# Select all non null nodes starting from node a
from a select AdaNode

# Select all non null nodes starting from all nodes in list
from [a, b, c] select AdaNode

You can also run a query that will only select the first element, this can be useful to avoid visiting all the parsing tree:

# Select first basic declaration
select first BasicDecl

5.2.1.1. Specifying the selector

By default, queries traverse the syntactic tree from the root node to leaves. This behavior is equivalent to going through the nodes returned via the children built-in selector (read the Built-in Selectors section for more information).

But you can also specify which selector you’re using to do the traversal, and even use your custom defined selectors. This is done using the through keyword:

# Selects the parents of the first basic declaration
from (select first BasicDecl) through parent select *

Attention

There is a special case for Ada, where you can specify follow_generics as a selector name, even though follow_generics is not a selector. This allows traversal of the tree going through instantiated generic trees, but is directly hard-coded into the engine for performance reasons.

# Selects all nodes following generic instantiations
through follow_generics select *

5.2.2. Pattern

pattern 'not' pattern complex_pattern value_pattern upper_id '*' 'null' regex_pattern bool_pattern integer_pattern list_pattern object_pattern '(' or_pattern ')' tuple_pattern

Patterns are by far the most complex part of the query language subset, but at its core, the concept of a pattern is very simple: it is a construction that you will match against a value. LKQL will check that the value matches the pattern, and produce true if it does. In the context of a query, that will add the value to the result of the query.

todo

Patterns are not yet expressions, but they certainly could be and should be, so we’re planning on improving that at a later stage.

5.2.2.1. Node patterns

5.2.2.1.1. Simple Node Patterns

Matching one or many node kinds is the simplest atom for node patterns. It can be either:

  • a node kind name, matching all nodes of this kind

  • an or pattern, matching on multiple node kinds

  • a wildcard pattern, matching on all node kinds

select *                           # Will select every node
select BasicDecl                   # Will select every basic declaration
select (ObjectDecl | BaseTypeDecl) # Will select every object and type declaration

In a more complex form, those can have sub-patterns in an optional part between parentheses, which brings us to the next section.

5.2.2.1.2. Nested Sub Patterns
pattern_arg selector_call pattern_detail_delimiter or_pattern id pattern_detail_delimiter or_pattern fun_call pattern_detail_delimiter or_pattern

Inside the optional parentheses of node patterns, the user can add sub-patterns that will help refine the query. Those patterns can be of three different kinds:

5.2.2.1.3. Selector Predicate

A selector predicate is a sub-pattern that allows you to run a sub-query and to match its results:

select Body(any children: ForLoopStmt)

The quantifier part (any in the previous example) can be either any or all, which will alter how the sub-pattern matches:

  • all will match only if all nodes returned by the selector match the condition

  • any will match as soon as at least one child matches the condition

Any of the built-in selectors can be used, or even custom selectors.

Note

All selectors have three optional parameters that allows controlling the depth of the traversal, depth, max_depth and min_depth. Read Selector Declaration section for more information.

5.2.2.1.4. Field Predicate

A field predicate is a sub-pattern that allows you to match a sub-pattern against a specific field in the parent object. We have already seen such a construct in the introduction, and it’s one of the simplest kind of patterns:

select ObjectDecl(f_default_expr: IntLiteral)
5.2.2.1.5. Property Call Predicate

A property predicate is very similar to a field predicate, except that a property of the node is called, instead of a field accessed. Syntactically, this is denoted by the parentheses after the property name:

select BaseId(p_referenced_decl(): ObjectDecl)

5.2.2.2. Regular Values Patterns

Not only nodes can be matched in LKQL: Any value can be matched via a pattern, including basic and composite data types.

5.2.2.2.1. Integer Pattern
integer_pattern Integer

You can match simple integer values with this pattern:

v is 12
5.2.2.2.2. Bool Pattern
bool_pattern 'true' 'false'

You can match simple boolean values with this pattern:

v is true
5.2.2.2.3. Regex Pattern
regex_pattern String

You can match simple string values with this pattern, but you can also do more complicated matching based on regular expressions. The regex syntax follows Python’s re module flavor.

v is "hello"
v is "hello.*?world"
5.2.2.2.4. Tuple Pattern
tuple_pattern '(' pattern ',' ')'

You can match tuple values with this pattern, elements being matched with component patterns:

match i
| (1, 2, 3) => print("un, dos, tres")
| *         => print("un pasito adelante maria")

match i
| (1, a@*, b@*, 4) => { print(a); print(b) }
5.2.2.2.5. List Pattern
list_pattern '[' splat_pattern pattern ',' ']'

You can match list values with this pattern, destructuring them and matching their elements against arbitrary value patterns:

match lst
| [1, 2, 3]   => "[1, 2, 3]"
| [1, a@*, 3] => "[1, a@*, 3], with a = " & img(a)

You can use the splat pattern at the end of a list pattern to match remaining elements:

match lst
| [11, 12, ...] => "[11, 12, ...]"
| [1, c@...]    => "[1, c@...] with b = " & img(b) & " & c = " & img(c)
| [...]         => "Any list"
5.2.2.2.6. Object Pattern
object_pattern '{' object_pattern_assoc splat_pattern ',' '}'

You can match object values with this pattern, associating each object key with an arbitrary value pattern:

match obj
| {a: 12}  => "{a: 12}"
| {a: a@*} => "Any object with an a key. Bind the result to a"

You can use the “splat” pattern anywhere in an object pattern to match remaining elements:

match obj
| {a@..., b: "hello"} => "Bind keys that are not b to var a"
| {a@...}             => "Bind all the object to a"

5.2.2.3. Special and Composite Patterns

5.2.2.3.1. Null Pattern

You can match all null nodes with this pattern:

match node
| BasicDecl => "A BasicDecl node"
| null      => "Node is null!"
5.2.2.3.2. Wildcard Pattern

You can match all values with this pattern, it will always return true:

match any_val
| BasicDecl => "A BasicDecl node"
| *         => "Any other value"
5.2.2.3.3. Splat Pattern

This pattern is used inside List Pattern and Object Pattern as a pattern to match all remaining values, collecting them in a collection of the same type as it is used in:

match v
| [1, rem@...]    => "A list with 1 as first element followed by " & img(rem)
| {a: 1, rem@...} => "An object with a=1 and " & img(rem)
5.2.2.3.4. Not Pattern

You can use this pattern to negate another one:

match v
| not BasicDecl => "Everything except a BasicDecl node"
| *             => "A BasicDecl node"
5.2.2.3.5. Or Pattern

You can use this pattern to combine any number of other patterns, and match any value matching one of those:

match v
| (BasicDecl | 1) => "A BasicDecl node or 1"
| *               => "Any other value"

5.2.2.4. Filtered Patterns and Binding Patterns

While you can express a lot of things via the regular pattern syntax mentioned above, sometimes it is necessary to be able to express an arbitrary boolean condition in patterns; this is done via the when clause:

select BasicDecl when bool_condition

However, in order to be able to express conditions on the currently matched objects, or arbitrary objects in the query, naming those objects is necessary. This is done via binding patterns:

select b @ BaseId # Same as "select BaseId", but now every BaseId object
                  # that is matched has a name that can be used in the whole
                  # pattern clause.

# Example usage:
val a = select first BasicDecl
select b @ BaseId when b.p_referenced_decl() == a

5.2.3. Selector Declaration

selector_decl decl_annotation 'selector' id doc_node selector_arm selector_arm '|' pattern '=>' expr

Selectors are a special form of functions that return a Stream of values. They’re widely used in the query subset of LKQL, allowing the easy expression of traversal blueprints.

For example, by default, a query expression explores the tree via the children built-in selector.

While you can’t add parameters to the definition of a selector, selector calls (a call expression or a selector predicate) can take three optional arguments that allows the control of depth:

  • min_depth allows you to filter nodes for which the traversal depth is lower than a certain value

  • max_depth allows you to filter nodes for which the traversal depth is higher than a certain value

  • depth allows you to only receive nodes that are exactly at the given traversal depth

Here are some examples of calling selectors with those parameters:

# Calling a selectors directly
val c = children(node, depth=3)

# Calling a selector in a nested sub-pattern
select AdaNode(any children(min_depth=3): BasicDecl)

You’ve already seen selectors used in previous sections, and, most of the time, you might not need to define your own, but in case you need to, here is how they work.

5.2.3.1. Defining a Selector

A selector is a recursive function. In the body of the selector, there is a binding from this to the current node. A selector has an implicit top level match expression matching on this.

In the branch of a selector, you can express whatever computation you want for the current node. There is a high-level requirement though, which is that the expression returned by a selector branch must be a RecExpr , which can be created via the call to the rec built-in operation.

The rec built-in operation looks like a function call.

selector_expr 'rec' '(' '*' expr ',' '*' expr ')' 'rec' '(' '*' expr ')'

It takes one or two expressions, which can be prefixed by the splat operator *.

  • The first expression represents what has to be added to the recurse list (either an item, or a list of items, if prefixed by *). The recurse list is the list of items on which the selector will be called next. Items are added at the end of the list

  • The second expression represents what has to be added to the result list (either an item, or a list of items, if prefixed by *). The result list is the list of items that will be yielded, piece-by-piece, to the user.

  • You can pass only one expression, in which case it is used both for the result list and for the recurse list.

Attention

Please note that selector call results are Stream, thus, their elements are computed on demand (when accessed).

Here is for example how the super_types selector is expressed in LKQL:

selector super_types
| BaseTypeDecl => rec(*this.p_base_types())
| *            => ()

While selectors are in the vast majority of cases used to express tree traversals of graph of nodes, you can use selectors to generate or process more general sequences:

selector infinite_sequence
|" Infinite sequence generator
| nb => rec(
    nb + 1, # Recurse with value nb + 1
    nb # Add nb to the result list
)

fun my_map(lst, fn) =
|" User defined map function. Uses an inner selector to return a lazy
|" iterator result
{
    selector internal
    | idx => rec(
        idx + 1,     # Recurse with value idx + 1
        fn(lst[idx]) # Add the result of calling fn on list[idx] to the result list
    );

    internal(1)
}

val mpd = my_map(infinite_sequence(0), (x) => x * 4)
print(mpd)
print(mpd[51])

Attention

The user interface for selectors is not optimal at the moment, so we might change it again soon.

5.2.3.2. Built-in Selectors

The built-in selectors are:

  • parent: parent nodes

  • children: child nodes

  • prev_siblings: sibling nodes that are before the current node

  • next_siblings: sibling nodes that are after the current node

  • super_types: if the current node is a type, then all its parent types

5.3. Language changes

Under this section, we’ll document language changes chronologically, and categorize them by AdaCore GNATcheck release.

Note

Changes marked as “breaking” indicates that your LKQL code bases need to be migrated when moving to the referred GNATcheck version. The LKQL executable provides a sub-command named refactor to help you doing this (run lkql refactor --help for more information).

5.3.1. 25.0

5.3.1.1. Conditional expression alternatives are now optional

Now you can write a conditional expression without providing any alternative expression. This way, if the condition is evaluated as true, then the consequence expression is evaluated, else the true value is returned. You can use this feature to express logical implication when performing boolean operation, example:

if node.p_has_something() then node.p_check_something_else()

5.3.1.2. Syntax of pattern details (breaking)

Pattern details were specified with the syntax <left_part> is <pattern>, and are now specified with the syntax <left_part>: <pattern>.

5.3.1.3. Syntax of selectors recursion definition (breaking)

The syntax for defining a recursion in selectors has completely changed. The old rec and skip keywords have been replaced by a single rec construct that allows to specify what elements will be recursed upon, and what elements will be yielded by the selector:

selector parent
| AdaNode => rec(*this.parent, this)
#                ^ Add parent to the recurse list
#                ^             ^ Add this to the return list
| *       => ()

Warning

This syntax is more general than the previous one, but is still not optimal, and might change again in a further release. Please take that into account when using selectors in your own code.

More details in the Selector Declaration section.

5.3.1.4. Or patterns syntax (breaking)

Or patterns were defined with the <pattern> or <pattern> syntax, and are now defined with the <pattern> | <pattern> syntax.

5.3.1.5. Binding patterns without value pattern

Patterns binding any value to a name can simply be expressed with a binding name now:

match d
| BasicDecl(p_doc(): doc) => print(doc)

5.3.1.6. More patterns

So far, only node values had corresponding patterns to match them. Now, patterns can be used to match other values:

v is 12
v is true
v is "hello"
v is "hello.*?world"

match i
| (1, 2, 3) => print("un, dos, tres")
| *         => print("un pasito adelante maria")

match i
| (1, a@*, b@*, 4) => { print(a); print(b) }

match lst
| [1, 2, 3]   => "[1, 2, 3]"
| [1, a@*, 3] => "[1, a@*, 3], with a = " & img(a)

match lst
| [11, 12, ...] => "[11, 12, ...]"
| [1, c@...]    => "[1, c@...] with b = " & img(b) & " & c = " & img(c)
| [...]         => "Any list"

match obj
| {a: 12}  => "{a: 12}"
| {a: a@*} => "Any object with an a key. Bind the result to a"

match obj
| {a@..., b: "hello"} => "Bind keys that are not b to var a"
| {a@...}             => "Bind all the object to a"

5.4. LKQL API

5.4.1. Libadalang API

The Libadalang API can be called from LKQL and is the basis for most of the GNATcheck rules.

In addition, LKQL comes with a built-in standard library described in Standard library, as well as a LKQL stdlib module described in stdlib’s API doc.

The Libadalang API is available from LKQL rules and is the foundation of most GNATcheck built-in rules. This section lists all types and their members.

5.4.1.1. Node types

5.4.1.1.1. AbortAbsent

Derives from: AbortNode

5.4.1.1.2. AbortNode (abstract)

Derives from: AdaNode

Derived by: AbortAbsent, AbortPresent

Properties

AbortNode.p_as_bool()
Returns:

Bool

Return whether this node is present

5.4.1.1.3. AbortPresent

Derives from: AbortNode

5.4.1.1.4. AbortStmt

Derives from: SimpleStmt

Fields

AbortStmt.f_names
Type:

NameList

This field contains a list that itself contains one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.5. AbstractAbsent

Derives from: AbstractNode

5.4.1.1.6. AbstractFormalSubpDecl

Derives from: FormalSubpDecl

5.4.1.1.7. AbstractNode (abstract)

Derives from: AdaNode

Derived by: AbstractAbsent, AbstractPresent

Properties

AbstractNode.p_as_bool()
Returns:

Bool

Return whether this node is present

5.4.1.1.8. AbstractPresent

Derives from: AbstractNode

5.4.1.1.9. AbstractStateDecl

Derives from: BasicDecl

Fields

AbstractStateDecl.f_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

5.4.1.1.10. AbstractStateDeclExpr

Derives from: Expr

Fields

AbstractStateDeclExpr.f_state_decl
Type:

AdaNode

This field can contain one of the following nodes: AbstractStateDecl, MultiAbstractStateDecl, ParenAbstractStateDecl

When there are no parsing errors, this field is never null.

5.4.1.1.11. AbstractStateDeclList

Derives from: AdaNodeList

5.4.1.1.12. AbstractSubpDecl

Derives from: ClassicSubpDecl

5.4.1.1.13. AcceptStmt

Derives from: CompositeStmt

Derived by: AcceptStmtWithStmts

Fields

AcceptStmt.f_body_decl
Type:

AcceptStmtBody

When there are no parsing errors, this field is never null.

AcceptStmt.f_entry_index_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

This field may be null even when there are no parsing errors.

AcceptStmt.f_params
Type:

EntryCompletionFormalParams

When there are no parsing errors, this field is never null.

Properties

AcceptStmt.p_corresponding_entry(origin: AdaNode)
Returns:

EntryDecl

Return the entry which corresponds to this accept statement.

Origin: Origin for this property’s request. See The origin parameter for more details.

5.4.1.1.14. AcceptStmtBody

Derives from: BodyNode

Fields

AcceptStmtBody.f_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

5.4.1.1.15. AcceptStmtWithStmts

Derives from: AcceptStmt

Fields

AcceptStmtWithStmts.f_stmts
Type:

HandledStmts

When there are no parsing errors, this field is never null.

AcceptStmtWithStmts.f_end_name
Type:

EndName

This field may be null even when there are no parsing errors.

5.4.1.1.16. AccessDef (abstract)

Derives from: TypeDef

Derived by: AccessToSubpDef, BaseTypeAccessDef

Fields

AccessDef.f_has_not_null
Type:

NotNull

This field may be null even when there are no parsing errors.

5.4.1.1.17. AccessToSubpDef

Derives from: AccessDef

Fields

AccessToSubpDef.f_has_protected
Type:

ProtectedNode

When there are no parsing errors, this field is never null.

AccessToSubpDef.f_subp_spec
Type:

SubpSpec

When there are no parsing errors, this field is never null.

5.4.1.1.18. AdaList (abstract)

Derives from: AdaNode

Derived by: AdaNodeList, AspectAssocList, BaseAssocList, BasicAssocList, CaseExprAlternativeList, CaseStmtAlternativeList, CompilationUnitList, ConcatOperandList, ContractCaseAssocList, DefiningNameList, DiscriminantSpecList, ElsifExprPartList, ElsifStmtPartList, EnumLiteralDeclList, ExprList, FormatStringChunkList, IdentifierList, NameList, ParamSpecList, PragmaNodeList, SelectWhenPartList, UnconstrainedArrayIndexList, VariantList

Properties

AdaList.is_empty_list()
Returns:

Bool

Return whether this list node has no children.

5.4.1.1.19. AdaNode (abstract)

Derived by: AbortNode, AbstractNode, AdaList, AliasedNode, AllNode, ArrayIndices, AspectAssoc, AspectClause, AspectSpec, BaseAssoc, BaseFormalParamHolder, BaseRecordDef, BasicAssoc, BasicDecl, CaseStmtAlternative, CompilationUnit, ComponentClause, ComponentDef, ConstantNode, Constraint, DeclarativePart, ElsePart, ElsifExprPart, ElsifStmtPart, Expr, FinallyPart, ForLoopIterFilter, FormatStringChunk, FormatStringTokNode, HandledStmts, InterfaceKind, IterType, LibraryItem, LimitedNode, LoopSpec, Mode, MultiAbstractStateDecl, NotNull, NullComponentDecl, OthersDesignator, OverridingNode, Params, ParenAbstractStateDecl, PpDirective, PpThenKw, PragmaNode, PrivateNode, ProtectedDef, ProtectedNode, Quantifier, RangeSpec, RenamingClause, ReverseNode, SelectWhenPart, Stmt, SubpKind, Subunit, SynchronizedNode, TaggedNode, TaskDef, ThenAbortPart, TypeAttributesRepository, TypeDef, TypeExpr, UnconstrainedArrayIndex, UntilNode, UseClause, ValueSequence, Variant, VariantPart, WithClause, WithPrivate

Properties

AdaNode.parent()
Returns:

AdaNode

Return the syntactic parent for this node. Return null for the root node.

AdaNode.parents(withSelf: Bool)
Returns:

List[AdaNode]

Return an array that contains the lexical parents, this node included iff with_self is True. Nearer parents are first in the list.

AdaNode.children()
Returns:

List[AdaNode]

Return an array that contains the direct lexical children.

Warning

This constructs a whole array every-time you call it, and as such is less efficient than calling the Child built-in.

AdaNode.token_start()
Returns:

Token

Return the first token used to parse this node.

AdaNode.token_end()
Returns:

Token

Return the last token used to parse this node.

AdaNode.child_index()
Returns:

Int

Return the 0-based index for Node in its parent’s children.

AdaNode.previous_sibling()
Returns:

AdaNode

Return the node’s previous sibling, or null if there is no such sibling.

AdaNode.next_sibling()
Returns:

AdaNode

Return the node’s next sibling, or null if there is no such sibling.

AdaNode.unit()
Returns:

AnalysisUnit

Return the analysis unit owning this node.

AdaNode.is_ghost()
Returns:

Bool

Return whether the node is a ghost.

Unlike regular nodes, ghost nodes cover no token in the input source: they are logically located instead between two tokens. Both the token_start and the token_end of all ghost nodes is the token right after this logical position.

AdaNode.full_sloc_image()
Returns:

Str

Return a string containing the filename + the sloc in GNU conformant format. Useful to create diagnostics from a node.

AdaNode.completion_item_kind_to_int(kind: CompletionItemKind)
Returns:

Int

Convert a CompletionItemKind enum to its corresponding integer value.

AdaNode.p_declarative_scope()
Returns:

DeclarativePart

Return the scope of definition of this basic declaration.

AdaNode.p_enclosing_compilation_unit()
Returns:

CompilationUnit

Return the compilation unit containing this node.

Note

This returns the CompilationUnit node, which is different from the AnalysisUnit. In particular, an analysis unit can contain multiple compilation units.

AdaNode.p_get_uninstantiated_node()
Returns:

AdaNode

Assuming this node comes from an instantiated generic declaration, return its non-instantiated counterpart lying in the generic declaration.

AdaNode.p_complete()
Returns:

Iterator[CompletionItem]

Return possible completions at this point in the file.

AdaNode.p_valid_keywords()
Returns:

List[Symbol]

Return the list of keywords that are valid at this point in the file.

Note

This is work in progress. It will return all keywords for now, without looking at the context.

AdaNode.p_generic_instantiations()
Returns:

List[GenericInstantiation]

Return the potentially empty list of generic package/subprogram instantiations that led to the creation of this entity. Outer-most instantiations appear last.

AdaNode.p_semantic_parent()
Returns:

AdaNode

Return the semantic parent for this node, if applicable, null otherwise.

Note

A node lying outside of a library item’s declaration or subunit’s body does not have a parent environment, meaning that this property will return null.

AdaNode.p_parent_basic_decl()
Returns:

BasicDecl

Return the parent basic decl for this node, if applicable, null otherwise.

Note

If the parent BasicDecl of the given node is a generic declaration, this call will return the instantiation from which the node was retrieved instead, if any. This also applies to bodies of generic declarations.

Note

When called on a subunit’s body, this property will return its corresponding body stub.

Note

When called on a node lying outside of a library item’s declaration or subunit’s body this property will return null.

Note

Even though inherited primitive subprograms are represented using the node of their base subprogram, this property will be able to return the parent basic decl of the inherited primitive as if it was defined next to the derived type, by exploiting the metadata carried by the node.

AdaNode.p_has_spark_mode_on()
Returns:

Bool

Returns whether this subprogram has explicitly been set as having Spark_Mode to On, directly or indirectly.

Doesn’t include subprograms that can be inferred by GNATprove as being SPARK.

AdaNode.p_is_subject_to_proof()
Returns:

Bool

Returns whether this subprogram body is subject to proof in the context of the SPARK/GNATprove tools.

AdaNode.p_filter_is_imported_by(units: List[AnalysisUnit], transitive: Bool)
Returns:

List[AnalysisUnit]

Filters out among the list of given units those that cannot refer to the unit in which this node lies. If transitive is True, the whole transitive closure of imports will be used to find a reference to the unit of this node.

AdaNode.p_resolve_names()
Returns:

Bool

This will resolve names for this node. If the operation is successful, then type_var and ref_var will be bound on appropriate subnodes of the statement.

AdaNode.p_nameres_diagnostics()
Returns:

List[SolverDiagnostic]

If name resolution on this xref entry point fails, this returns all the diagnostics that were produced while resolving it.

AdaNode.p_is_nameres_ambiguous()
Returns:

Bool

Return whether this name resolution context is ambiguous, i.e. whether it allows multiple valid interpretations.

AdaNode.p_standard_unit()
Returns:

AnalysisUnit

Static method. Return the analysis unit corresponding to the Standard package.

AdaNode.p_is_keyword(token: Token, languageVersion: Symbol)
Returns:

Bool

Static method. Return whether the given token is considered a keyword in the given version of Ada. Supported values for the language version argument are: “Ada_83”, “Ada_95”, “Ada_2005”, “Ada_2012”, “Ada_2022”.

AdaNode.p_std_entity(sym: Symbol)
Returns:

AdaNode

Static property. Return an entity from the standard package with name sym.

AdaNode.p_bool_type()
Returns:

BaseTypeDecl

Static method. Return the standard Boolean type.

AdaNode.p_int_type()
Returns:

BaseTypeDecl

Static method. Return the standard Integer type.

AdaNode.p_universal_int_type()
Returns:

BaseTypeDecl

Static method. Return the standard Universal Integer type.

AdaNode.p_universal_real_type()
Returns:

BaseTypeDecl

Static method. Return the standard Universal Real type.

AdaNode.p_std_char_type()
Returns:

BaseTypeDecl

Static method. Return the standard Character type.

AdaNode.p_std_wide_char_type()
Returns:

BaseTypeDecl

Static method. Return the standard Wide_Character type.

AdaNode.p_std_wide_wide_char_type()
Returns:

BaseTypeDecl

Static method. Return the standard Wide_Wide_Character type.

AdaNode.p_std_string_type()
Returns:

BaseTypeDecl

Static method. Return the standard String type.

AdaNode.p_std_wide_string_type()
Returns:

BaseTypeDecl

Static method. Return the standard Wide_String type.

AdaNode.p_std_wide_wide_string_type()
Returns:

BaseTypeDecl

Static method. Return the standard Wide_Wide_String type.

AdaNode.p_top_level_decl(unit: AnalysisUnit)
Returns:

BasicDecl

Static method. Get the top-level decl in unit. This is the body of a Subunit, or the item of a LibraryItem.

AdaNode.p_choice_match(value: Int)
Returns:

Bool

Assuming that self is a choice expression (such as what can appear in an alternative of a case statement or in the RHS of a membership expression, this property returns whether the given value satisfies it.

Attention

This is an experimental feature, so even if it is exposed to allow experiments, it is totally unsupported and the API and behavior are very likely to change in the future.

AdaNode.p_gnat_xref(impreciseFallback: Bool)
Returns:

DefiningName

Return a cross reference from this name to a defining identifier, trying to mimic GNAT’s xrefs as much as possible.

AdaNode.p_spark_mode_aspect()
Returns:

Aspect

Helper for the has_spark_mode_on and is_subject_to_proof properties.

This property will get the applicable aspect defining the SPARK_Mode for the given node, recursing syntactically and taking into account configuration files.

This only implements the base logic for recursing up the tree: nodes that need a specific logic must override it. See for example BasicDecl.spark_mode_aspect.

AdaNode.p_xref_entry_point()
Returns:

Bool

Designates entities that are entry point for the xref solving infrastructure. If this returns true, then resolve_names can be called on it.

Note

For convenience, and unlike what is defined in the ARM wrt. complete contexts for name resolution, xref_entry_points can be nested.

AdaNode.p_matching_with_use_clause()
Returns:

Bool

Return whether this node is a UsePackageClause that follows a WithClause for the same unit.

5.4.1.1.20. AdaNodeList

Derives from: AdaList

Derived by: AbstractStateDeclList, AlternativesList, ConstraintList, DeclList, StmtList

5.4.1.1.21. Aggregate

Derives from: BaseAggregate

Derived by: BracketAggregate

5.4.1.1.22. AggregateAssoc

Derives from: BasicAssoc

Derived by: MultiDimArrayAssoc

Fields

AggregateAssoc.f_designators
Type:

AlternativesList

This field contains a list that itself contains one of the following nodes: Allocator, ArraySubcomponentChoiceName, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DiscreteSubtypeIndication, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, OthersDesignator, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

AggregateAssoc.f_r_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, BoxExpr, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.23. AliasedAbsent

Derives from: AliasedNode

5.4.1.1.24. AliasedNode (abstract)

Derives from: AdaNode

Derived by: AliasedAbsent, AliasedPresent

Properties

AliasedNode.p_as_bool()
Returns:

Bool

Return whether this node is present

5.4.1.1.25. AliasedPresent

Derives from: AliasedNode

5.4.1.1.26. AllAbsent

Derives from: AllNode

5.4.1.1.27. AllNode (abstract)

Derives from: AdaNode

Derived by: AllAbsent, AllPresent

Properties

AllNode.p_as_bool()
Returns:

Bool

Return whether this node is present

5.4.1.1.28. AllPresent

Derives from: AllNode

5.4.1.1.29. Allocator

Derives from: Expr

Fields

Allocator.f_subpool
Type:

Name

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

This field may be null even when there are no parsing errors.

Allocator.f_type_or_expr
Type:

AdaNode

This field can contain one of the following nodes: QualExpr, SubtypeIndication

When there are no parsing errors, this field is never null.

Properties

Allocator.p_get_allocated_type()
Returns:

BaseTypeDecl

Return the allocated type for this allocator.

5.4.1.1.30. AlternativesList

Derives from: AdaNodeList

5.4.1.1.31. AnonymousExprDecl

Derives from: BasicDecl

Fields

AnonymousExprDecl.f_name
Type:

SyntheticDefiningName

When there are no parsing errors, this field is never null.

AnonymousExprDecl.f_expr
Type:

Expr

The expression wrapped by this declaration.

When there are no parsing errors, this field is never null.

Properties

AnonymousExprDecl.p_get_formal(impreciseFallback: Bool)
Returns:

DefiningName

Return the generic formal object declaration corresponding to this actual.

5.4.1.1.32. AnonymousType

Derives from: TypeExpr

Fields

AnonymousType.f_type_decl
Type:

AnonymousTypeDecl

When there are no parsing errors, this field is never null.

5.4.1.1.33. AnonymousTypeAccessDef

Derives from: BaseTypeAccessDef

Fields

AnonymousTypeAccessDef.f_type_decl
Type:

BaseTypeDecl

When there are no parsing errors, this field is never null.

5.4.1.1.34. AnonymousTypeDecl

Derives from: TypeDecl

Derived by: SynthAnonymousTypeDecl

5.4.1.1.35. ArrayIndices (abstract)

Derives from: AdaNode

Derived by: ConstrainedArrayIndices, UnconstrainedArrayIndices

5.4.1.1.36. ArraySubcomponentChoiceName

Derives from: Name

Fields

ArraySubcomponentChoiceName.f_name
Type:

Name

This field can contain one of the following nodes: ArraySubcomponentChoiceName, DottedName

This field may be null even when there are no parsing errors.

ArraySubcomponentChoiceName.f_suffix
Type:

AdaNode

This field can contain one of the following nodes: AttributeRef, BasicAssocList, BinOp, CallExpr, CharLiteral, DiscreteSubtypeIndication, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.37. ArrayTypeDef

Derives from: TypeDef

Fields

ArrayTypeDef.f_indices
Type:

ArrayIndices

When there are no parsing errors, this field is never null.

ArrayTypeDef.f_component_type
Type:

ComponentDef

When there are no parsing errors, this field is never null.

5.4.1.1.38. AspectAssoc

Derives from: AdaNode

Fields

AspectAssoc.f_id
Type:

Name

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

AspectAssoc.f_expr
Type:

Expr

This field can contain one of the following nodes: AbstractStateDeclExpr, Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, ContractCases, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

This field may be null even when there are no parsing errors.

Properties

AspectAssoc.p_is_ghost_code()
Returns:

Bool

Return whether this aspect is ghost code or not. See SPARK RM 6.9.

5.4.1.1.39. AspectAssocList

Derives from: AdaList

5.4.1.1.40. AspectClause (abstract)

Derives from: AdaNode

Derived by: AtClause, AttributeDefClause, EnumRepClause, RecordRepClause

5.4.1.1.41. AspectSpec

Derives from: AdaNode

Fields

AspectSpec.f_aspect_assocs
Type:

AspectAssocList

When there are no parsing errors, this field is never null.

5.4.1.1.42. AssertionLevelDecl

Derives from: BasicDecl

Fields

AssertionLevelDecl.f_name
Type:

SyntheticDefiningName

When there are no parsing errors, this field is never null.

5.4.1.1.43. AssignStmt

Derives from: SimpleStmt

Fields

AssignStmt.f_dest
Type:

Name

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

AssignStmt.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.44. AssocList

Derives from: BasicAssocList

Properties

AssocList.p_zip_with_params(impreciseFallback: Bool)
Returns:

List[ParamActual]

Returns an array of pairs, associating formal parameters to actual expressions. The formals to match are retrieved by resolving the call which this AssocList represents the actuals of.

5.4.1.1.45. AtClause

Derives from: AspectClause

Fields

AtClause.f_name
Type:

BaseId

This field can contain one of the following nodes: CharLiteral, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

AtClause.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.46. AttributeDefClause

Derives from: AspectClause

Fields

AttributeDefClause.f_attribute_expr
Type:

Name

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

AttributeDefClause.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.47. AttributeRef

Derives from: Name

Fields

AttributeRef.f_prefix
Type:

Name

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

AttributeRef.f_attribute
Type:

Identifier

When there are no parsing errors, this field is never null.

AttributeRef.f_args
Type:

AssocList

This field contains a list that itself contains one of the following nodes: ParamAssoc

When there are no parsing errors, this field is never null.

5.4.1.1.48. BaseAggregate (abstract)

Derives from: Expr

Derived by: Aggregate, DeltaAggregate, NullRecordAggregate

Fields

BaseAggregate.f_ancestor_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

This field may be null even when there are no parsing errors.

BaseAggregate.f_assocs
Type:

AssocList

This field contains a list that itself contains one of the following nodes: AggregateAssoc, IteratedAssoc

When there are no parsing errors, this field is never null.

Properties

BaseAggregate.p_aggregate_params()
Returns:

List[ParamActual]

Returns an array of pairs, associating formal parameters to actual expressions. See zip_with_params.

BaseAggregate.p_is_subaggregate()
Returns:

Bool

Return whether this aggregate is actually a subaggregate of a multidimensional array aggregate, as described in ARM 4.3.3.

BaseAggregate.p_subaggregate_array_type()
Returns:

BaseTypeDecl

If this aggregate instance is a subaggregate of a multidimensional array aggregate, return the overall array type.

BaseAggregate.p_subaggregate_dimension()
Returns:

Int

If this aggregate instance is a subaggregate of a multidimensional array aggregate, return the index of its matching dimension.

Note

the returned index is 0-based, where index 0 designates the the first dimension of the array type. However, since this property works on subaggregates, the returned index will necessarily always be greater or equal to 1.

5.4.1.1.49. BaseAssoc (abstract)

Derives from: AdaNode

Derived by: ContractCaseAssoc, PragmaArgumentAssoc

Properties

BaseAssoc.p_assoc_expr()
Returns:

Expr

Returns the expression side of this assoc node.

5.4.1.1.50. BaseAssocList

Derives from: AdaList

5.4.1.1.51. BaseFormalParamDecl (abstract)

Derives from: BasicDecl

Derived by: ComponentDecl, DiscriminantSpec, GenericFormal, ParamSpec, SyntheticFormalParamDecl

Properties

BaseFormalParamDecl.p_formal_type(origin: AdaNode)
Returns:

BaseTypeDecl

Return the type for this formal.

Origin: Origin for this property’s request. See The origin parameter for more details.

5.4.1.1.52. BaseFormalParamHolder (abstract)

Derives from: AdaNode

Derived by: BaseSubpSpec, ComponentList, DiscriminantPart, EntryCompletionFormalParams, GenericFormalPart

Properties

BaseFormalParamHolder.p_abstract_formal_params()
Returns:

List[BaseFormalParamDecl]

Return the list of abstract formal parameters for this holder.

BaseFormalParamHolder.p_formal_params()
Returns:

List[DefiningName]

Return all parameters as a DefiningName array. This property doesn’t return record discriminants nor variants when called on a record component list.

BaseFormalParamHolder.p_nb_min_params()
Returns:

Int

Return the minimum number of parameters this subprogram can be called while still being a legal call.

BaseFormalParamHolder.p_nb_max_params()
Returns:

Int

Return the maximum number of parameters this subprogram can be called while still being a legal call.

BaseFormalParamHolder.p_param_types(origin: AdaNode)
Returns:

List[BaseTypeDecl]

Returns the type of each parameter of self.

Origin: Origin for this property’s request. See The origin parameter for more details.

5.4.1.1.53. BaseId (abstract)

Derives from: SingleTokNode

Derived by: CharLiteral, Identifier, Op, StringLiteral

5.4.1.1.54. BaseLoopStmt (abstract)

Derives from: CompositeStmt

Derived by: ForLoopStmt, LoopStmt, WhileLoopStmt

Fields

BaseLoopStmt.f_spec
Type:

LoopSpec

This field may be null even when there are no parsing errors.

BaseLoopStmt.f_stmts
Type:

StmtList

This field contains a list that itself contains one of the following nodes: PragmaNode, Stmt

When there are no parsing errors, this field is never null.

BaseLoopStmt.f_end_name
Type:

EndName

This field may be null even when there are no parsing errors.

5.4.1.1.55. BasePackageDecl (abstract)

Derives from: BasicDecl

Derived by: GenericPackageInternal, PackageDecl

Fields

BasePackageDecl.f_package_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

BasePackageDecl.f_public_part
Type:

PublicPart

When there are no parsing errors, this field is never null.

BasePackageDecl.f_private_part
Type:

PrivatePart

This field may be null even when there are no parsing errors.

BasePackageDecl.f_end_name
Type:

EndName

This field may be null even when there are no parsing errors.

Properties

BasePackageDecl.p_body_part()
Returns:

PackageBody

Return the PackageBody corresponding to this node.

5.4.1.1.56. BaseRecordDef (abstract)

Derives from: AdaNode

Derived by: NullRecordDef, RecordDef

Fields

BaseRecordDef.f_components
Type:

ComponentList

When there are no parsing errors, this field is never null.

5.4.1.1.57. BaseSubpBody (abstract)

Derives from: BodyNode

Derived by: ExprFunction, NullSubpDecl, SubpBody, SubpRenamingDecl

Fields

BaseSubpBody.f_overriding
Type:

OverridingNode

When there are no parsing errors, this field is never null.

BaseSubpBody.f_subp_spec
Type:

SubpSpec

When there are no parsing errors, this field is never null.

5.4.1.1.58. BaseSubpSpec (abstract)

Derives from: BaseFormalParamHolder

Derived by: EntrySpec, EnumSubpSpec, SubpSpec, SyntheticBinarySpec, SyntheticUnarySpec

Properties

BaseSubpSpec.p_name()
Returns:

DefiningName

Syntax property. Return the name of the subprogram defined by this specification.

BaseSubpSpec.p_returns()
Returns:

TypeExpr

Syntax property. Return the type expression node corresponding to the return of this subprogram spec.

BaseSubpSpec.p_primitive_subp_types(impreciseFallback: Bool)
Returns:

List[BaseTypeDecl]

Return the types of which this subprogram is a primitive of.

BaseSubpSpec.p_primitive_subp_first_type(impreciseFallback: Bool)
Returns:

BaseTypeDecl

Return the first type of which this subprogram is a primitive of.

BaseSubpSpec.p_primitive_subp_tagged_type(impreciseFallback: Bool)
Returns:

BaseTypeDecl

If this subprogram is a primitive for a tagged type, then return this type.

BaseSubpSpec.p_return_type(origin: AdaNode)
Returns:

BaseTypeDecl

Returns the return type of self, if applicable (e.g. if self is a subprogram). Else, returns null.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseSubpSpec.p_params()
Returns:

List[ParamSpec]

Returns the array of parameters specification for this subprogram spec.

5.4.1.1.59. BaseSubtypeDecl (abstract)

Derives from: BaseTypeDecl

Derived by: DiscreteBaseSubtypeDecl, SubtypeDecl

Properties

BaseSubtypeDecl.p_get_type(origin: AdaNode)
Returns:

BaseTypeDecl

Get the type for this subtype.

Origin: Origin for this property’s request. See The origin parameter for more details.

5.4.1.1.60. BaseTypeAccessDef (abstract)

Derives from: AccessDef

Derived by: AnonymousTypeAccessDef, TypeAccessDef

5.4.1.1.61. BaseTypeDecl (abstract)

Derives from: BasicDecl

Derived by: BaseSubtypeDecl, ClasswideTypeDecl, IncompleteTypeDecl, ProtectedTypeDecl, TaskTypeDecl, TypeDecl

Fields

BaseTypeDecl.f_name
Type:

DefiningName

This field may be null even when there are no parsing errors.

Properties

BaseTypeDecl.p_base_subtype(origin: AdaNode)
Returns:

BaseTypeDecl

If this type decl is a subtype decl, return the base subtype. If not, return self.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_attribute_subprogram(attrName: Symbol)
Returns:

BasicDecl

Return the subprogram declaration denoted by this attribute name and defined on this type.

BaseTypeDecl.p_private_completion()
Returns:

BaseTypeDecl

Return the private completion for this type, if there is one.

BaseTypeDecl.p_is_inherited_primitive(p: BasicDecl)
Returns:

Bool

Assuming that P is a primitive of self, return whether the given primitive P is inherited from one of self’s parents.

BaseTypeDecl.p_get_record_representation_clause(impreciseFallback: Bool)
Returns:

RecordRepClause

Return the record representation clause associated to this type decl, if applicable (i.e. this type decl defines a record type).

BaseTypeDecl.p_get_enum_representation_clause(impreciseFallback: Bool)
Returns:

EnumRepClause

Return the enum representation clause associated to this type decl, if applicable (i.e. this type decl defines an enum type).

BaseTypeDecl.p_get_primitives(onlyInherited: Bool, includePredefinedOperators: Bool)
Returns:

List[BasicDecl]

Return the list of all primitive operations that are available on this type. If only_inherited is True, it will only return the primitives that are implicitly inherited by this type, discarding those explicitly defined on this type. Predefined operators are included in the result iff include_predefined_operators is True. It defaults to False.

BaseTypeDecl.p_is_array_type(origin: AdaNode)
Returns:

Bool

Return whether this type is an array type.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_find_derived_types(root: AdaNode, origin: AdaNode, impreciseFallback: Bool)
Returns:

List[TypeDecl]

Find types derived from self in the given root and its children. Self is assumed to be canonicalized.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_scalar_type(origin: AdaNode)
Returns:

Bool

Whether self is a scalar type (ARM 3.5).

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_numeric_type(origin: AdaNode)
Returns:

Bool

Whether self is a numeric type (ARM 3.5).

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_specific_type()
Returns:

BaseTypeDecl

Return the specific type under a class-wide type. Consider for example:

subtype S1 is T'Class
subtype S2 is S1'Class

Calling this property on S2 will return T.

BaseTypeDecl.p_is_statically_predicated(origin: AdaNode)
Returns:

Bool

Return whether a static predicate is defined for this type. The static predicate can be defined either by a Static_Predicate aspect or by a Predicate pragma whose expression is static.

This property considers all parts of the type, as well as all its parent subtypes, in order to determine if a static predicate applies to it.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_find_all_derived_types(units: List[AnalysisUnit], impreciseFallback: Bool)
Returns:

List[TypeDecl]

Return the list of all types that inherit (directly or indirectly) from self among the given units.

BaseTypeDecl.p_comp_type(isSubscript: Bool, origin: AdaNode)
Returns:

BaseTypeDecl

Return the component type of self, if applicable. The component type is the type you’ll get if you call a value whose type is self. So it can either be:

  1. The component type for an array.

  2. The return type for an access to function.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_index_type(dim: Int, origin: AdaNode)
Returns:

BaseTypeDecl

Return the index type for dimension dim for this type, if applicable.

Warning

dim is 0-based, so the first index_type is at index 0.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_derived_type(otherType: BaseTypeDecl, origin: AdaNode)
Returns:

Bool

Whether self is derived from other_type.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_limited_type()
Returns:

Bool

Return True iff this type is limited, either because it is explicitly marked as such, or because it inherits from a limited type or has a component of a limited type. Also note that protected types and task types are limited by definition. Moreover, note that Ada requires all parts of a type to agree of its limitedness (e.g. the public view of a type must indicate that it is limited if its private completion ends up being limited), hence this property does not require looking at any other part of the type to determine its limitedness, excepted for incomplete type declarations. This implies that for illegal code where several parts don’t agree, this property will return the result for the particular view of the type on which this property is called.

BaseTypeDecl.p_matching_type(expectedType: BaseTypeDecl, origin: AdaNode)
Returns:

Bool

Return whether self matches expected_type.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_previous_part(goToIncomplete: Bool)
Returns:

BaseTypeDecl

Returns the previous part for this type decl.

BaseTypeDecl.p_next_part()
Returns:

BaseTypeDecl

Returns the next part for this type decl.

Note

Since this property returns a BaseTypeDecl, it cannot be used to retrieve the next part of TaskTypeDecl and ProtectedTypeDecl nodes as their next part is actually a Body. Use BasicDecl.next_part_for_decl for those instead.

BaseTypeDecl.p_full_view()
Returns:

BaseTypeDecl

Return the full completion of this type.

BaseTypeDecl.p_is_definite_subtype(origin: AdaNode)
Returns:

Bool

Returns whether this is a definite subtype.

For convenience, this will return False for incomplete types, even though the correct answer is more akin to “non applicable”.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_statically_constrained()
Returns:

Bool

Returns whether this is a statically constained subtype (i.e., its size is known at compile time).

All types are statically constrained, except for records and arrays when they are either unconstrained or dynamically constrained.

For convenience, this will return False for incomplete types, even though the correct answer is more akin to “non applicable”.

BaseTypeDecl.p_discriminants_list(stopRecurseAt: BaseTypeDecl, origin: AdaNode)
Returns:

List[BaseFormalParamDecl]

Return the list of all discriminants of this type. If this type has no discriminant or only unknown discriminants, an empty list is returned.

In order to obtain all the discriminants of an extended type, this property looks on parents, recursively.

Extended aggregates can be build from any intermediate parent of an extended type. In that case, this property shouldn’t recurse to the root type, but the one used as the aggregate’s ancestor, designated by stop_recurse_at.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_shapes(includeDiscriminants: Bool, origin: AdaNode)
Returns:

List[Shape]

Must be called on a record (sub-)type declaration. Return all the possible shapes that a value of this record type can take. For example, consider the following record definition:

type R (A : Integer; B : Integer) is record
    X : Integer;
    case A is
        when 1 .. 10 =>
            Y_1 : Integer;
            case B is
                when 1 .. 10 =>
                    Z_1 : Integer;
                when others => null;
            end case;
        when 11 .. 20 =>
            Y_2 : Integer;
            case B is
                when 1 .. 10 =>
                    Z_2 : Integer;
                when others => null;
            end case;
        when others => null;
    end case;
end record;

For this instance, this property will return the following results:

[
    [X, Y_1, Z_1],
    [X, Y_1],
    [X, Y_2, Z_2],
    [X, Y_2],
    [X]
]

Attention

This property is inaccurate when called on a record extension which defines components under a certain condition C, and this same condition is used to define some components in the parent record: in that case, any feasible shape will in practice contain either both the components defined under condition C in the child record and the parent record, or none of them.

However, due to the simplified algorithm we use here to compute the feasible shapes, we will also return shapes that include the components of the child record but not the parent record, and conversely.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_record_type(origin: AdaNode)
Returns:

Bool

Return whether this type is a record type.

Attention

Private tagged types extending public tagged records are not considered as record types.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_real_type(origin: AdaNode)
Returns:

Bool

Whether type is a real type or not.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_float_type(origin: AdaNode)
Returns:

Bool

Whether type is a float type or not.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_fixed_point(origin: AdaNode)
Returns:

Bool

Whether type is a fixed point type or not.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_enum_type(origin: AdaNode)
Returns:

Bool

Whether type is an enum type

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_classwide()
Returns:

Bool

Whether self is a classwide type.

BaseTypeDecl.p_is_access_type(origin: AdaNode)
Returns:

Bool

Whether self is an access type or not

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_char_type(origin: AdaNode)
Returns:

Bool

Whether type is a character type or not

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_classwide_type()
Returns:

ClasswideTypeDecl

Return the classwide type for this type, if applicable

BaseTypeDecl.p_discrete_range()
Returns:

DiscreteRange

Return the discrete range for this type decl, if applicable.

BaseTypeDecl.p_discrete_static_values()
Returns:

List[EvalDiscreteRange]

If applicable, return the values that this discrete subtype can take as an array of concrete ranges, by taking into account static predicates that apply to this subtype.

BaseTypeDecl.p_is_discrete_type(origin: AdaNode)
Returns:

Bool

Whether type is a discrete type or not.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_int_type(origin: AdaNode)
Returns:

Bool

Whether type is an integer type or not.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_accessed_type(origin: AdaNode)
Returns:

BaseTypeDecl

If this type is an access type, or a type with an Implicit_Dereference aspect, return the type of a dereference of an instance of this type.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_tagged_type(origin: AdaNode)
Returns:

Bool

Whether type is tagged or not

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_abstract_type()
Returns:

Bool

Whether the type is abstract or not.

BaseTypeDecl.p_base_type(origin: AdaNode)
Returns:

BaseTypeDecl

Return the base type entity for this derived type declaration

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_base_types(origin: AdaNode)
Returns:

List[BaseTypeDecl]

Return the list of base types for self.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_interface_type(origin: AdaNode)
Returns:

Bool

Return True iff this type declaration is an interface definition.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_canonical_type(origin: AdaNode)
Returns:

BaseTypeDecl

Return the canonical type declaration for this type declaration. For subtypes, it will return the base type declaration.

Origin: Origin for this property’s request. See The origin parameter for more details.

BaseTypeDecl.p_is_private()
Returns:

Bool

Whether node is a private view of corresponding type.

BaseTypeDecl.p_root_type(origin: AdaNode)
Returns:

BaseTypeDecl

Return the type that is at the root of the derivation hierarchy (ignoring secondary interfaces derivations for tagged types)

Origin: Origin for this property’s request. See The origin parameter for more details.

5.4.1.1.62. BasicAssoc (abstract)

Derives from: AdaNode

Derived by: AggregateAssoc, CompositeConstraintAssoc, IteratedAssoc, ParamAssoc

Properties

BasicAssoc.p_get_params(impreciseFallback: Bool)
Returns:

List[DefiningName]

Return the list of parameters that this association refers to.

5.4.1.1.63. BasicAssocList (abstract)

Derives from: AdaList

Derived by: AssocList

5.4.1.1.64. BasicDecl (abstract)

Derives from: AdaNode

Derived by: AbstractStateDecl, AnonymousExprDecl, AssertionLevelDecl, BaseFormalParamDecl, BasePackageDecl, BaseTypeDecl, BasicSubpDecl, BodyNode, EntryIndexSpec, ErrorDecl, ExceptionDecl, ExceptionHandler, ForLoopVarDecl, GenericDecl, GenericInstantiation, GenericRenamingDecl, LabelDecl, NamedStmtDecl, NumberDecl, ObjectDecl, PackageRenamingDecl, SingleProtectedDecl, SingleTaskDecl, SyntheticObjectDecl

Fields

BasicDecl.f_aspects
Type:

AspectSpec

This field may be null even when there are no parsing errors.

Properties

BasicDecl.p_is_formal()
Returns:

Bool

Whether this decl is the nested decl of a generic formal declaration.

BasicDecl.p_doc_annotations()
Returns:

List[DocAnnotation]

Return the documentation annotations associated with this decl. Annotations are any comment line of the form:

--  @annotation_name [annotation]

Valueless annotations (e.g. --  @exclude) get the boolean value True.

Raises a property error if the doc is incorrectly formatted.

Attention

This is an experimental feature, so even if it is exposed to allow experiments, it is totally unsupported and the API and behavior are very likely to change in the future.

BasicDecl.p_doc()
Returns:

Str

Return the documentation associated with this decl. Raises a property error if the doc is incorrectly formatted.

Attention

This is an experimental feature, so even if it is exposed to allow experiments, it is totally unsupported and the API and behavior are very likely to change in the future.

BasicDecl.p_canonical_part(impreciseFallback: Bool)
Returns:

BasicDecl

Return the canonical part for this decl. In the case of decls composed of several parts, the canonical part will be the first part.

BasicDecl.p_all_parts(impreciseFallback: Bool)
Returns:

List[BasicDecl]

Return all parts that define this entity, sorted from first part to last part.

BasicDecl.p_get_aspect_assoc(name: Symbol)
Returns:

AspectAssoc

Return the aspect with name name for this entity.

BasicDecl.p_get_aspect_spec_expr(name: Symbol)
Returns:

Expr

Return the expression associated to the aspect with name name for this entity.

BasicDecl.p_get_aspect(name: Symbol, previousPartsOnly: Bool, impreciseFallback: Bool)
Returns:

Aspect

Return the aspect with name name associated to this entity.

Aspects are properties of entities that can be specified by the Ada program, either via aspect specifications, pragmas, or attributes.

See DefiningName.P_Get_Aspect for more details.

BasicDecl.p_has_aspect(name: Symbol, previousPartsOnly: Bool, impreciseFallback: Bool)
Returns:

Bool

Returns whether the boolean aspect named name is set on the entity represented by this node.

Aspects are properties of entities that can be specified by the Ada program, either via aspect specifications, pragmas, or attributes.

“Aspect” is used as in RM terminology (see ARM 13).

BasicDecl.p_get_pragma(name: Symbol)
Returns:

PragmaNode

Return the pragma with name name associated to this entity.

Please use the p_get_aspect property instead if you are interested in aspects, i.e. information that can be represented by either aspect specification nodes, pragma nodes or attribute definition nodes.

BasicDecl.p_get_representation_clause(name: Symbol, impreciseFallback: Bool)
Returns:

AttributeDefClause

Return the representation clause associated to this type decl that defines the given attribute name.

BasicDecl.p_get_at_clause(impreciseFallback: Bool)
Returns:

AtClause

Return the at clause associated to this declaration.

BasicDecl.p_get_annotations(impreciseFallback: Bool)
Returns:

List[Aspect]

Return all the Annotate aspects defined on this entity, both through pragmas and aspect specifications. For a type declaration, this also includes all annotations defined on its from a base type, when relevant (the field inherited will be set for those). See DefiningName.P_Get_Annotations for more details.

BasicDecl.p_is_ghost_code()
Returns:

Bool

Return whether this declaration is ghost code or not. See SPARK RM 6.9.

BasicDecl.p_is_compilation_unit_root()
Returns:

Bool

Whether a BasicDecl is the root decl for its unit.

BasicDecl.p_is_visible(fromNode: AdaNode)
Returns:

Bool

Return whether this declaration is visible from the point of view of the given origin node.

Attention

Only package-level (public or private) declarations are supported for now.

BasicDecl.p_base_subp_declarations(impreciseFallback: Bool)
Returns:

List[BasicDecl]

If self declares a primitive subprogram of some tagged type T, return the set of all subprogram declarations that it overrides (including itself).

BasicDecl.p_root_subp_declarations(origin: AdaNode, impreciseFallback: Bool)
Returns:

List[BasicDecl]

If self declares a primitive subprogram of some type T, return the root subprogram declarations that it overrides. There can be several, as in the following scenario:

  • package Root defines the root tagged type T and subprogram Foo.

  • package Itf defines interface I and abstract subprogram Foo.

  • package D defines “type U is new Root.T and Itf.I” and an overriding subprogram Foo.

Here, root_subp_declarations of Foo defined in package D will return both Foo from package Root and Foo from package Itf.

Origin: Origin for this property’s request. See The origin parameter for more details.

BasicDecl.p_find_all_overrides(units: List[AnalysisUnit], impreciseFallback: Bool)
Returns:

List[BasicDecl]

If self is the declaration of a primitive of some type T, return the list of all subprogram that override this subprogram among the given units.

BasicDecl.p_defining_names()
Returns:

List[DefiningName]

Get all the names of this basic declaration.

BasicDecl.p_defining_name()
Returns:

DefiningName

Get the name of this declaration. If this declaration has several names, it will return the first one.

BasicDecl.p_subp_spec_or_null(followGeneric: Bool)
Returns:

BaseSubpSpec

If self is a Subp, returns the specification of this subprogram.

If follow_generic is True, will also work for instances of GenericSubpDecl.

BasicDecl.p_is_subprogram()
Returns:

Bool

Return True if self is a subprogram node in the general sense (which is, an entity that can be called). This includes separates and entries.

BasicDecl.p_is_predefined_operator()
Returns:

Bool

Return whether this declaration corresponds to a subprogram that represents a predefined operator.

BasicDecl.p_relative_name()
Returns:

Name

Return the relative name for self. If self’s defining name is A.B.C, return C as a node.

BasicDecl.p_relative_name_text()
Returns:

Symbol

Return the relative name for self, as text.

BasicDecl.p_body_part_for_decl(impreciseFallback: Bool)
Returns:

BodyNode

Return the body corresponding to this declaration, if applicable.

Note

It is not named body_part, subclasses have more precise versions named body_part and returning a more precise result. Probably, we want to rename the specific versions, and have the root property be named body_part. (TODO R925-008)

BasicDecl.p_most_visible_part(origin: AdaNode, impreciseFallback: Bool)
Returns:

BasicDecl

Given an origin node and the entity represented by self, this property returns the most visible completion of self that can be seen by origin, according to Ada’s visibility rules.

Origin: Origin for this property’s request. See The origin parameter for more details.

BasicDecl.p_fully_qualified_name_array(includeProfile: Bool)
Returns:

List[Symbol]

Return the fully qualified name corresponding to this declaration, as an array of symbols.

Note

See BasicDecl.fully_qualified_name to know which kind of declarations are supported.

BasicDecl.p_fully_qualified_name()
Returns:

Str

Return the fully qualified name corresponding to this declaration.

Note

This property should only be called on declarations that have exactly one defining name (excepted for anonymous declarations of access types), otherwise a PreconditionFailure will be raised.

BasicDecl.p_canonical_fully_qualified_name()
Returns:

Str

Return a canonical representation of the fully qualified name corresponding to this declaration.

Note

See BasicDecl.fully_qualified_name to know which kind of declarations are supported.

BasicDecl.p_unique_identifying_name()
Returns:

Str

Return a unique identifying name for this declaration, provided this declaration is a public declaration. In the case of subprograms, this will include the profile.

Note

This property should only be called on declarations that have exactly one defining name (excepted for anonymous declarations of access types), otherwise a PreconditionFailure will be raised.

Attention

This will only return a unique name for public declarations. Notably, anything nested in an unnamed declare block won’t be handled correctly.

BasicDecl.p_previous_part_for_decl(impreciseFallback: Bool)
Returns:

BasicDecl

Return the previous part for this decl, if applicable.

Note

It is not named previous_part, because BaseTypeDecl has a more precise version of previous_part that returns a BaseTypeDecl. Probably, we want to rename the specific versions, and have the root property be named previous_part. (TODO R925-008)

BasicDecl.p_is_static_decl(impreciseFallback: Bool)
Returns:

Bool

Return whether this declaration is static.

BasicDecl.p_is_imported()
Returns:

Bool

Whether this declaration is imported from another language.

BasicDecl.p_type_expression()
Returns:

TypeExpr

Return the type expression for this BasicDecl if applicable, a null otherwise.

BasicDecl.p_next_part_for_decl(impreciseFallback: Bool)
Returns:

BasicDecl

Return the next part of this declaration, if applicable.

Note

It is not named next_part, because BaseTypeDecl has a more precise version of next_part that returns a BaseTypeDecl. Probably, we want to rename the specific versions, and have the root property be named next_part. (TODO R925-008)

BasicDecl.p_is_constant_object()
Returns:

Bool

Return whether this object is constant or not.

BasicDecl.p_corresponding_neq_subprogram()
Returns:

BasicSubpDecl

Return the corresponding "/=" synthesized subprogram of a "=" subprogram.

Note

This property should only be called on a subprogram with the name "=", otherwise a PreconditionFailure will be raised.

5.4.1.1.65. BasicSubpDecl (abstract)

Derives from: BasicDecl

Derived by: ClassicSubpDecl, EntryDecl, EnumLiteralDecl, GenericSubpInternal, SyntheticSubpDecl

Properties

BasicSubpDecl.p_subp_decl_spec()
Returns:

BaseSubpSpec

Return the specification for this subprogram

5.4.1.1.66. BeginBlock

Derives from: BlockStmt

Fields

BeginBlock.f_stmts
Type:

HandledStmts

When there are no parsing errors, this field is never null.

BeginBlock.f_end_name
Type:

EndName

This field may be null even when there are no parsing errors.

5.4.1.1.67. BinOp

Derives from: Expr

Derived by: RelationOp

Fields

BinOp.f_left
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

BinOp.f_op
Type:

Op

This field can contain one of the following nodes: OpAndThen, OpAnd, OpDiv, OpDoubleDot, OpEq, OpGt, OpGte, OpLt, OpLte, OpMinus, OpMod, OpMult, OpNeq, OpOrElse, OpOr, OpPlus, OpPow, OpRem, OpXor

When there are no parsing errors, this field is never null.

BinOp.f_right
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, BoxExpr, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.68. BlockStmt (abstract)

Derives from: CompositeStmt

Derived by: BeginBlock, DeclBlock

5.4.1.1.69. BodyNode (abstract)

Derives from: BasicDecl

Derived by: AcceptStmtBody, BaseSubpBody, BodyStub, EntryBody, PackageBody, ProtectedBody, TaskBody

Properties

BodyNode.p_previous_part(impreciseFallback: Bool)
Returns:

BasicDecl

Return the previous part for this body. Might be a declaration or a body stub.

BodyNode.p_decl_part(impreciseFallback: Bool)
Returns:

BasicDecl

Return the decl corresponding to this node if applicable.

BodyNode.p_subunit_root()
Returns:

BasicDecl

If self is a subunit, return the body in which it is rooted.

5.4.1.1.70. BodyStub (abstract)

Derives from: BodyNode

Derived by: PackageBodyStub, ProtectedBodyStub, SubpBodyStub, TaskBodyStub

Properties

BodyStub.p_syntactic_fully_qualified_name()
Returns:

List[Symbol]

Return the syntactic fully qualified name to refer to this body.

Note that this can raise a Property_Error when the stub is in an illegal place (too nested, in a declare block, etc.).

5.4.1.1.71. BoxExpr

Derives from: Expr

5.4.1.1.72. BracketAggregate

Derives from: Aggregate

5.4.1.1.73. BracketDeltaAggregate

Derives from: DeltaAggregate

5.4.1.1.74. CallExpr

Derives from: Name

Fields

CallExpr.f_name
Type:

Name

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

CallExpr.f_suffix
Type:

AdaNode

This field can contain one of the following nodes: AttributeRef, BasicAssocList, BinOp, CallExpr, CharLiteral, DiscreteSubtypeIndication, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

Properties

CallExpr.p_kind()
Returns:

CallExprKind

Return whether this expression is a subprogram call, an array subcomponent access expression, an array slice, a generalized indexing or a type conversion.

CallExpr.p_is_array_slice()
Returns:

Bool

Return whether this CallExpr is actually an access to a slice of the array denoted by the prefix of this CallExpr.

5.4.1.1.75. CallStmt

Derives from: SimpleStmt

Fields

CallStmt.f_call
Type:

Name

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.76. CaseExpr

Derives from: CondExpr

Fields

CaseExpr.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

CaseExpr.f_cases
Type:

CaseExprAlternativeList

When there are no parsing errors, this field is never null.

5.4.1.1.77. CaseExprAlternative

Derives from: Expr

Fields

CaseExprAlternative.f_choices
Type:

AlternativesList

This field contains a list that itself contains one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DiscreteSubtypeIndication, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, OthersDesignator, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

CaseExprAlternative.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.78. CaseExprAlternativeList

Derives from: AdaList

5.4.1.1.79. CaseStmt

Derives from: CompositeStmt

Fields

CaseStmt.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

CaseStmt.f_pragmas
Type:

PragmaNodeList

When there are no parsing errors, this field is never null.

CaseStmt.f_alternatives
Type:

CaseStmtAlternativeList

When there are no parsing errors, this field is never null.

5.4.1.1.80. CaseStmtAlternative

Derives from: AdaNode

Fields

CaseStmtAlternative.f_choices
Type:

AlternativesList

This field contains a list that itself contains one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DiscreteSubtypeIndication, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, OthersDesignator, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

CaseStmtAlternative.f_stmts
Type:

StmtList

This field contains a list that itself contains one of the following nodes: PragmaNode, Stmt

When there are no parsing errors, this field is never null.

5.4.1.1.81. CaseStmtAlternativeList

Derives from: AdaList

5.4.1.1.82. CharLiteral

Derives from: BaseId

Properties

CharLiteral.p_denoted_value()
Returns:

Str

Return the value that this literal denotes.

5.4.1.1.83. ClassicSubpDecl (abstract)

Derives from: BasicSubpDecl

Derived by: AbstractSubpDecl, FormalSubpDecl, SubpDecl

Fields

ClassicSubpDecl.f_overriding
Type:

OverridingNode

When there are no parsing errors, this field is never null.

ClassicSubpDecl.f_subp_spec
Type:

SubpSpec

When there are no parsing errors, this field is never null.

Properties

ClassicSubpDecl.p_body_part(impreciseFallback: Bool)
Returns:

BaseSubpBody

Return the BaseSubpBody corresponding to this node.

5.4.1.1.84. ClasswideTypeDecl

Derives from: BaseTypeDecl

5.4.1.1.85. CompilationUnit

Derives from: AdaNode

Fields

CompilationUnit.f_prelude
Type:

AdaNodeList

with, use or pragma statements.

This field contains a list that itself contains one of the following nodes: PragmaNode, UseClause, WithClause

When there are no parsing errors, this field is never null.

CompilationUnit.f_body
Type:

AdaNode

This field can contain one of the following nodes: LibraryItem, Subunit

When there are no parsing errors, this field is never null.

CompilationUnit.f_pragmas
Type:

PragmaNodeList

When there are no parsing errors, this field is never null.

Properties

CompilationUnit.p_syntactic_fully_qualified_name()
Returns:

List[Symbol]

Return the syntactic fully qualified name of this compilation unit.

CompilationUnit.p_unit_kind()
Returns:

AnalysisUnitKind

Return the kind corresponding to this analysis unit.

CompilationUnit.p_withed_units(includePrivates: Bool)
Returns:

List[CompilationUnit]

Look for all “with” clauses at the top of this compilation unit and return all the compilation units designated by them. For the complete dependencies list of compilation units, see the unit_dependencies property. Units imported with a “private with” are included in this list only if include_privates is True.

CompilationUnit.p_imported_units(includePrivates: Bool)
Returns:

List[CompilationUnit]

Return all the compilation units that are directly imported by this one. This includes “with”ed units as well as the direct parent unit. Units imported with a “private with” are included in this list only if include_privates is True.

CompilationUnit.p_unit_dependencies()
Returns:

List[CompilationUnit]

Return the list of all the compilation units that are (direct and indirect) dependencies of this one. See the withed_units/imported_units properties to only get the direct dependencies of this unit.

CompilationUnit.p_decl()
Returns:

BasicDecl

Get the root basic decl defined in this compilation unit.

CompilationUnit.p_is_preelaborable(impreciseFallback: Bool)
Returns:

Bool

Whether this compilation unit is preelaborable or not.

CompilationUnit.p_other_part()
Returns:

CompilationUnit

If this compilation unit is of kind UnitSpecification, return its corresponding body unit, and conversely.

CompilationUnit.p_has_restriction(name: Symbol)
Returns:

Bool

Whether this compilation unit is affected by the restriction with the given name.

Warning

This property only supports the No_Elaboration_Code restriction for now.

CompilationUnit.p_all_config_pragmas()
Returns:

List[PragmaNode]

Return the list of configuration pragmas that apply to the current unit.

CompilationUnit.p_config_pragmas(name: Symbol)
Returns:

List[PragmaNode]

Return the list of configuration pragmas with the given name that apply to the current unit.

5.4.1.1.86. CompilationUnitList

Derives from: AdaList

5.4.1.1.87. ComponentClause

Derives from: AdaNode

Fields

ComponentClause.f_id
Type:

Identifier

When there are no parsing errors, this field is never null.

ComponentClause.f_position
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

ComponentClause.f_range
Type:

RangeSpec

When there are no parsing errors, this field is never null.

5.4.1.1.88. ComponentDecl

Derives from: BaseFormalParamDecl

Fields

ComponentDecl.f_ids
Type:

DefiningNameList

When there are no parsing errors, this field is never null.

ComponentDecl.f_component_def
Type:

ComponentDef

When there are no parsing errors, this field is never null.

ComponentDecl.f_default_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

This field may be null even when there are no parsing errors.

5.4.1.1.89. ComponentDef

Derives from: AdaNode

Fields

ComponentDef.f_has_aliased
Type:

AliasedNode

When there are no parsing errors, this field is never null.

ComponentDef.f_has_constant
Type:

ConstantNode

When there are no parsing errors, this field is never null.

ComponentDef.f_type_expr
Type:

TypeExpr

This field can contain one of the following nodes: AnonymousType, SubtypeIndication

When there are no parsing errors, this field is never null.

5.4.1.1.90. ComponentList

Derives from: BaseFormalParamHolder

Fields

ComponentList.f_components
Type:

AdaNodeList

This field contains a list that itself contains one of the following nodes: AspectClause, ComponentDecl, NullComponentDecl, PragmaNode

When there are no parsing errors, this field is never null.

ComponentList.f_variant_part
Type:

VariantPart

This field may be null even when there are no parsing errors.

5.4.1.1.91. CompositeConstraint

Derives from: Constraint

Fields

CompositeConstraint.f_constraints
Type:

AssocList

This field contains a list that itself contains one of the following nodes: CompositeConstraintAssoc

When there are no parsing errors, this field is never null.

Properties

CompositeConstraint.p_is_index_constraint()
Returns:

Bool

Whether this composite constraint is an index constraint.

CompositeConstraint.p_is_discriminant_constraint()
Returns:

Bool

Whether this composite constraint is a discriminant constraint.

CompositeConstraint.p_discriminant_params()
Returns:

List[ParamActual]

Returns an array of pairs, associating each discriminant to its actual or default expression.

5.4.1.1.92. CompositeConstraintAssoc

Derives from: BasicAssoc

Fields

CompositeConstraintAssoc.f_ids
Type:

DiscriminantChoiceList

This field can contain one of the following nodes: IdentifierList

When there are no parsing errors, this field is never null.

CompositeConstraintAssoc.f_constraint_expr
Type:

AdaNode

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DiscreteSubtypeIndication, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.93. CompositeStmt (abstract)

Derives from: Stmt

Derived by: AcceptStmt, BaseLoopStmt, BlockStmt, CaseStmt, ExtendedReturnStmt, IfStmt, NamedStmt, SelectStmt

5.4.1.1.94. ConcatOp

Derives from: Expr

Fields

ConcatOp.f_first_operand
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

ConcatOp.f_other_operands
Type:

ConcatOperandList

When there are no parsing errors, this field is never null.

Properties

ConcatOp.p_operands()
Returns:

List[Expr]

Return the operands of this concatenation expression

5.4.1.1.95. ConcatOperand

Derives from: Expr

Fields

ConcatOperand.f_operator
Type:

OpConcat

When there are no parsing errors, this field is never null.

ConcatOperand.f_operand
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.96. ConcatOperandList

Derives from: AdaList

5.4.1.1.97. ConcreteFormalSubpDecl

Derives from: FormalSubpDecl

5.4.1.1.98. ConcreteTypeDecl

Derives from: TypeDecl

5.4.1.1.99. CondExpr (abstract)

Derives from: Expr

Derived by: CaseExpr, IfExpr

Properties

CondExpr.p_dependent_exprs()
Returns:

List[Expr]

Return the dependent expressions for this conditional expression.

5.4.1.1.100. ConstantAbsent

Derives from: ConstantNode

5.4.1.1.101. ConstantNode (abstract)

Derives from: AdaNode

Derived by: ConstantAbsent, ConstantPresent

Properties

ConstantNode.p_as_bool()
Returns:

Bool

Return whether this node is present

5.4.1.1.102. ConstantPresent

Derives from: ConstantNode

5.4.1.1.103. ConstrainedArrayIndices

Derives from: ArrayIndices

Fields

ConstrainedArrayIndices.f_list
Type:

ConstraintList

This field contains a list that itself contains one of the following nodes: AttributeRef, BinOp, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, SubtypeIndication, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.104. ConstrainedSubtypeIndication

Derives from: SubtypeIndication

5.4.1.1.105. Constraint (abstract)

Derives from: AdaNode

Derived by: CompositeConstraint, DeltaConstraint, DigitsConstraint, RangeConstraint

5.4.1.1.106. ConstraintList

Derives from: AdaNodeList

5.4.1.1.107. ContractCaseAssoc

Derives from: BaseAssoc

Fields

ContractCaseAssoc.f_guard
Type:

AdaNode

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, OthersDesignator, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

ContractCaseAssoc.f_consequence
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.108. ContractCaseAssocList

Derives from: AdaList

5.4.1.1.109. ContractCases

Derives from: Expr

Fields

ContractCases.f_contract_cases
Type:

ContractCaseAssocList

When there are no parsing errors, this field is never null.

5.4.1.1.110. DecimalFixedPointDef

Derives from: RealTypeDef

Fields

DecimalFixedPointDef.f_delta
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, BoxExpr, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

DecimalFixedPointDef.f_digits
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, BoxExpr, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

DecimalFixedPointDef.f_range
Type:

RangeSpec

This field may be null even when there are no parsing errors.

5.4.1.1.111. DeclBlock

Derives from: BlockStmt

Fields

DeclBlock.f_decls
Type:

DeclarativePart

When there are no parsing errors, this field is never null.

DeclBlock.f_stmts
Type:

HandledStmts

When there are no parsing errors, this field is never null.

DeclBlock.f_end_name
Type:

EndName

This field may be null even when there are no parsing errors.

5.4.1.1.112. DeclExpr

Derives from: Expr

Fields

DeclExpr.f_decls
Type:

AdaNodeList

This field contains a list that itself contains one of the following nodes: ObjectDecl, PragmaNode

When there are no parsing errors, this field is never null.

DeclExpr.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.113. DeclList

Derives from: AdaNodeList

5.4.1.1.114. DeclarativePart

Derives from: AdaNode

Derived by: PrivatePart, PublicPart

Fields

DeclarativePart.f_decls
Type:

AdaNodeList

This field contains a list that itself contains one of the following nodes: AbstractSubpDecl, AspectClause, BaseSubpBody, BodyStub, ComponentDecl, ConcreteTypeDecl, EntryBody, EntryDecl, ErrorDecl, ExceptionDecl, GenericDecl, GenericInstantiation, GenericRenamingDecl, IncompleteTypeDecl, NumberDecl, ObjectDecl, PackageBody, PackageDecl, PackageRenamingDecl, PragmaNode, ProtectedBody, ProtectedTypeDecl, SingleProtectedDecl, SingleTaskDecl, SubpDecl, SubtypeDecl, TaskBody, TaskTypeDecl, UseClause

When there are no parsing errors, this field is never null.

5.4.1.1.115. DefiningName

Derives from: Name

Derived by: SyntheticDefiningName

Fields

DefiningName.f_name
Type:

Name

This field can contain one of the following nodes: CharLiteral, DottedName, Identifier, StringLiteral, SyntheticIdentifier

When there are no parsing errors, this field is never null.

Properties

DefiningName.p_canonical_fully_qualified_name()
Returns:

Str

Return a canonical representation of the fully qualified name corresponding to this defining name.

See P_Fully_Qualified_Name documentation for details on how Libadalang handles generic instantiations.

DefiningName.p_unique_identifying_name()
Returns:

Str

Return a unique identifying name for this defining name, provided this declaration is a public declaration. In the case of subprograms, this will include the profile.

See P_Fully_Qualified_Name documentation for details on how Libadalang handles generic instantiations.

Attention

This will only return a unique name for public declarations. Notably, anything nested in an unnamed declare block won’t be handled correctly.

DefiningName.p_fully_qualified_name_array()
Returns:

List[Symbol]

Return the fully qualified name corresponding to this defining name, as an array of symbols.

See P_Fully_Qualified_Name documentation for details on how Libadalang handles generic instantiations.

DefiningName.p_fully_qualified_name()
Returns:

Str

Return the fully qualified name corresponding to this defining name.

When navigating inside a generic, Libadalang behaves as if you were inside the instantiated generic. Thus, declarations inside of it are prefixed by the fully qualified name of the instantiation and not by that of the generic.

Hence, this property returns the fully qualified name of the instantiation, and if one wants the fully qualified name of the generic (while inside an instantiation), one should call P_Get_Uninstantiated_Node first.

Example:

generic
package My_Generic is
   X : Integer;
end My_Generic;

package My_Instance is new My_Generic;

When analyzing X inside My_Instance:

  • X.P_Fully_Qualified_Name returns My_Instance.X.

  • X.P_Get_Uninstantiated_Node.P_Fully_Qualified_Name returns My_Generic.X.

DefiningName.p_basic_decl()
Returns:

BasicDecl

Return this DefiningName’s basic declaration, discarding internal nodes such as Generic*Internal wrappers.

DefiningName.p_find_refs(root: AdaNode, impreciseFallback: Bool)
Returns:

List[RefResult]

Find all references to this defining name in the given root and its children.

DefiningName.p_find_all_references(units: List[AnalysisUnit], followRenamings: Bool, impreciseFallback: Bool)
Returns:

List[RefResult]

Searches all references to this defining name in the given list of units.

If follow_renamings is True, also this also includes references that ultimately refer to this defining name, by unwinding renaming clauses.

DefiningName.p_find_all_calls(units: List[AnalysisUnit], followRenamings: Bool, impreciseFallback: Bool)
Returns:

List[RefResult]

Return the list of all possible calls to the subprogram which self is the defining name of.

This will return the name corresponding to the call, excluding the parameters if there are any. For instance, it will return A for the A (B) call.

Note

When invoked on a subprogram used as actual of a generic formal subprogram, this property will not return the calls to that subprogram done inside the generic code through the formal subprogram.

DefiningName.p_next_part(impreciseFallback: Bool)
Returns:

DefiningName

Like BasicDecl.next_part_for_decl on a defining name

DefiningName.p_previous_part(impreciseFallback: Bool)
Returns:

DefiningName

Like BasicDecl.previous_part_for_decl on a defining name

DefiningName.p_canonical_part(impreciseFallback: Bool)
Returns:

DefiningName

Like BasicDecl.canonical_part on a defining name

DefiningName.p_most_visible_part(origin: AdaNode, impreciseFallback: Bool)
Returns:

DefiningName

Given an origin node and the entity represented by self, this property returns the most visible completion of self that can be seen by origin, according to Ada’s visibility rules.

Origin: Origin for this property’s request. See The origin parameter for more details.

DefiningName.p_all_parts(impreciseFallback: Bool)
Returns:

List[DefiningName]

Return all parts that define this entity, sorted from first part to last part.

DefiningName.p_get_aspect(name: Symbol, previousPartsOnly: Bool, impreciseFallback: Bool)
Returns:

Aspect

Return the aspect with name name associated to entity that this name defines.

Aspects are properties of entities that can be specified by the Ada program, either via aspect specifications, pragmas, or attributes.

Note: by default, Libadalang will check if the aspect is defined on any part of the entity. However, the previous_parts_only parameter can be set to True to limit the search to the current entity and its previous parts in order to comply with visibilily rules. That way, if an aspect is defined on the private part of a type, calling this property on its corresponding public view won’t return the aspect unlike the call on the private view.

Moreover, since aspects can be inherited, if none was found for the current entity, Libadalang will also search for the aspect on the parents of entity (in that case the inherited field will be set to True in the returned result).

DefiningName.p_has_aspect(name: Symbol, previousPartsOnly: Bool, impreciseFallback: Bool)
Returns:

Bool

Returns whether the boolean aspect named name is set on the entity represented by this node.

Note: The previous_parts_only parameter controls how aspects are retrieved. See DefiningName.get_aspect for more information.

Aspects are properties of entities that can be specified by the Ada program, either via aspect specifications, pragmas, or attributes.

“Aspect” is used as in RM terminology (see ARM 13.1).

DefiningName.p_get_pragma(name: Symbol)
Returns:

PragmaNode

Return the pragma with name name associated to this entity.

Please use the p_get_aspect property instead if you are interested in aspects, i.e. information that can be represented by either aspect specification nodes, pragma nodes or attribute definition nodes.

DefiningName.p_get_representation_clause(name: Symbol, impreciseFallback: Bool)
Returns:

AttributeDefClause

Return the representation clause associated to this entity that defines the given attribute name.

DefiningName.p_get_at_clause(impreciseFallback: Bool)
Returns:

AtClause

Return the at clause associated to this entity.

DefiningName.p_get_annotations(impreciseFallback: Bool)
Returns:

List[Aspect]

Return all the Annotate aspects defined on this entity, both through pragmas and aspect specifications. For a type declaration, this also includes all annotations defined on its base type, when relevant (the field inherited will be set for those).

The value field of each returned Aspect will be set to be the identifier that designates the tool which is concerned by the annotation.

Note: Libadalang will look for the Annotate aspects on any part of the entity.

DefiningName.p_is_imported()
Returns:

Bool

Whether this entity defined by this name is imported from another language.

DefiningName.p_is_ghost_code()
Returns:

Bool

Return whether the entity defined by this name is ghost or not. See SPARK RM 6.9.

5.4.1.1.116. DefiningNameList

Derives from: AdaList

5.4.1.1.117. DelayStmt

Derives from: SimpleStmt

Fields

DelayStmt.f_has_until
Type:

UntilNode

When there are no parsing errors, this field is never null.

DelayStmt.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.118. DeltaAggregate

Derives from: BaseAggregate

Derived by: BracketDeltaAggregate

5.4.1.1.119. DeltaConstraint

Derives from: Constraint

Fields

DeltaConstraint.f_delta
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

DeltaConstraint.f_range
Type:

RangeSpec

This field may be null even when there are no parsing errors.

5.4.1.1.120. DerivedTypeDef

Derives from: TypeDef

Fields

DerivedTypeDef.f_has_abstract
Type:

AbstractNode

When there are no parsing errors, this field is never null.

DerivedTypeDef.f_has_limited
Type:

LimitedNode

When there are no parsing errors, this field is never null.

DerivedTypeDef.f_has_synchronized
Type:

SynchronizedNode

When there are no parsing errors, this field is never null.

DerivedTypeDef.f_subtype_indication
Type:

SubtypeIndication

When there are no parsing errors, this field is never null.

DerivedTypeDef.f_interfaces
Type:

ParentList

This field contains a list that itself contains one of the following nodes: CharLiteral, DottedName, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

DerivedTypeDef.f_record_extension
Type:

BaseRecordDef

This field may be null even when there are no parsing errors.

DerivedTypeDef.f_has_with_private
Type:

WithPrivate

When there are no parsing errors, this field is never null.

5.4.1.1.121. DigitsConstraint

Derives from: Constraint

Fields

DigitsConstraint.f_digits
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

DigitsConstraint.f_range
Type:

RangeSpec

This field may be null even when there are no parsing errors.

5.4.1.1.122. DiscreteBaseSubtypeDecl

Derives from: BaseSubtypeDecl

5.4.1.1.123. DiscreteSubtypeIndication

Derives from: SubtypeIndication

5.4.1.1.124. DiscreteSubtypeName

Derives from: Name

Fields

DiscreteSubtypeName.f_subtype
Type:

DiscreteSubtypeIndication

When there are no parsing errors, this field is never null.

5.4.1.1.125. DiscriminantChoiceList

Derives from: IdentifierList

5.4.1.1.126. DiscriminantPart (abstract)

Derives from: BaseFormalParamHolder

Derived by: KnownDiscriminantPart, UnknownDiscriminantPart

5.4.1.1.127. DiscriminantSpec

Derives from: BaseFormalParamDecl

Fields

DiscriminantSpec.f_ids
Type:

DefiningNameList

When there are no parsing errors, this field is never null.

DiscriminantSpec.f_type_expr
Type:

TypeExpr

This field can contain one of the following nodes: AnonymousType, SubtypeIndication

When there are no parsing errors, this field is never null.

DiscriminantSpec.f_default_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

This field may be null even when there are no parsing errors.

5.4.1.1.128. DiscriminantSpecList

Derives from: AdaList

5.4.1.1.129. DottedName

Derives from: Name

Fields

DottedName.f_prefix
Type:

Name

This field can contain one of the following nodes: ArraySubcomponentChoiceName, AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

DottedName.f_suffix
Type:

BaseId

This field can contain one of the following nodes: CharLiteral, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

5.4.1.1.130. ElsePart

Derives from: AdaNode

Fields

ElsePart.f_stmts
Type:

StmtList

This field contains a list that itself contains one of the following nodes: PragmaNode, Stmt

When there are no parsing errors, this field is never null.

5.4.1.1.131. ElsifExprPart

Derives from: AdaNode

Fields

ElsifExprPart.f_cond_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

ElsifExprPart.f_then_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.132. ElsifExprPartList

Derives from: AdaList

5.4.1.1.133. ElsifStmtPart

Derives from: AdaNode

Fields

ElsifStmtPart.f_cond_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

ElsifStmtPart.f_stmts
Type:

StmtList

This field contains a list that itself contains one of the following nodes: PragmaNode, Stmt

When there are no parsing errors, this field is never null.

5.4.1.1.134. ElsifStmtPartList

Derives from: AdaList

5.4.1.1.135. EndName

Derives from: Name

Fields

EndName.f_name
Type:

Name

This field can contain one of the following nodes: CharLiteral, DottedName, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

Properties

EndName.p_basic_decl()
Returns:

BasicDecl

Returns this EndName’s basic declaration

5.4.1.1.136. EntryBody

Derives from: BodyNode

Fields

EntryBody.f_entry_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

EntryBody.f_index_spec
Type:

EntryIndexSpec

This field may be null even when there are no parsing errors.

EntryBody.f_params
Type:

EntryCompletionFormalParams

When there are no parsing errors, this field is never null.

EntryBody.f_barrier
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

EntryBody.f_decls
Type:

DeclarativePart

When there are no parsing errors, this field is never null.

EntryBody.f_stmts
Type:

HandledStmts

When there are no parsing errors, this field is never null.

EntryBody.f_end_name
Type:

EndName

This field may be null even when there are no parsing errors.

5.4.1.1.137. EntryCompletionFormalParams

Derives from: BaseFormalParamHolder

Fields

EntryCompletionFormalParams.f_params
Type:

Params

This field may be null even when there are no parsing errors.

5.4.1.1.138. EntryDecl

Derives from: BasicSubpDecl

Fields

EntryDecl.f_overriding
Type:

OverridingNode

When there are no parsing errors, this field is never null.

EntryDecl.f_spec
Type:

EntrySpec

When there are no parsing errors, this field is never null.

Properties

EntryDecl.p_body_part(impreciseFallback: Bool)
Returns:

BodyNode

Return the entry body associated to this entry declaration.

EntryDecl.p_accept_stmts()
Returns:

List[AcceptStmt]

Return an array of accept statements corresponding to this entry.

5.4.1.1.139. EntryIndexSpec

Derives from: BasicDecl

Fields

EntryIndexSpec.f_id
Type:

DefiningName

When there are no parsing errors, this field is never null.

EntryIndexSpec.f_subtype
Type:

AdaNode

This field can contain one of the following nodes: AttributeRef, BinOp, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, SubtypeIndication, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.140. EntrySpec

Derives from: BaseSubpSpec

Fields

EntrySpec.f_entry_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

EntrySpec.f_family_type
Type:

AdaNode

This field can contain one of the following nodes: AttributeRef, BinOp, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, SubtypeIndication, TargetName, UpdateAttributeRef

This field may be null even when there are no parsing errors.

EntrySpec.f_entry_params
Type:

Params

This field may be null even when there are no parsing errors.

5.4.1.1.141. EnumLitSynthTypeExpr

Derives from: TypeExpr

5.4.1.1.142. EnumLiteralDecl

Derives from: BasicSubpDecl

Derived by: SyntheticCharEnumLit

Fields

EnumLiteralDecl.f_name
Type:

DefiningName

This field may be null even when there are no parsing errors.

Properties

EnumLiteralDecl.p_enum_rep()
Returns:

Int

Return the integer used to encode this enum literal.

Note

This property is equivalent to GNAT’s Enum_Rep attribute.

EnumLiteralDecl.p_enum_type()
Returns:

TypeDecl

Return the enum type corresponding to this enum literal.

5.4.1.1.143. EnumLiteralDeclList

Derives from: AdaList

5.4.1.1.144. EnumRepClause

Derives from: AspectClause

Fields

EnumRepClause.f_type_name
Type:

Name

This field can contain one of the following nodes: CharLiteral, DottedName, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

EnumRepClause.f_aggregate
Type:

BaseAggregate

When there are no parsing errors, this field is never null.

Properties

EnumRepClause.p_params()
Returns:

List[ParamActual]

Returns an array of pairs, associating enum literals to representation clause actuals.

5.4.1.1.145. EnumSubpSpec

Derives from: BaseSubpSpec

5.4.1.1.146. EnumTypeDef

Derives from: TypeDef

Fields

EnumTypeDef.f_enum_literals
Type:

EnumLiteralDeclList

When there are no parsing errors, this field is never null.

5.4.1.1.147. ErrorDecl

Derives from: BasicDecl

5.4.1.1.148. ErrorStmt

Derives from: Stmt

5.4.1.1.149. ExceptionDecl

Derives from: BasicDecl

Fields

ExceptionDecl.f_ids
Type:

DefiningNameList

When there are no parsing errors, this field is never null.

ExceptionDecl.f_renames
Type:

RenamingClause

This field may be null even when there are no parsing errors.

5.4.1.1.150. ExceptionHandler

Derives from: BasicDecl

Fields

ExceptionHandler.f_exception_name
Type:

DefiningName

This field may be null even when there are no parsing errors.

ExceptionHandler.f_handled_exceptions
Type:

AlternativesList

This field contains a list that itself contains one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, OthersDesignator, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

ExceptionHandler.f_stmts
Type:

StmtList

This field contains a list that itself contains one of the following nodes: PragmaNode, Stmt

When there are no parsing errors, this field is never null.

5.4.1.1.151. ExitStmt

Derives from: SimpleStmt

Fields

ExitStmt.f_loop_name
Type:

Name

This field can contain one of the following nodes: CharLiteral, DottedName, Identifier, StringLiteral

This field may be null even when there are no parsing errors.

ExitStmt.f_cond_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

This field may be null even when there are no parsing errors.

5.4.1.1.152. ExplicitDeref

Derives from: Name

Fields

ExplicitDeref.f_prefix
Type:

Name

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.153. Expr (abstract)

Derives from: AdaNode

Derived by: AbstractStateDeclExpr, Allocator, BaseAggregate, BinOp, BoxExpr, CaseExprAlternative, ConcatOp, ConcatOperand, CondExpr, ContractCases, DeclExpr, FormatStringLiteral, MembershipExpr, Name, ParenExpr, QuantifiedExpr, RaiseExpr, UnOp

Properties

Expr.p_expression_type()
Returns:

BaseTypeDecl

Return the declaration corresponding to the type of this expression after name resolution.

Expr.p_expected_expression_type()
Returns:

BaseTypeDecl

Return the declaration corresponding to the expected type of this expression after name resolution.

Expr.p_is_dynamically_tagged(impreciseFallback: Bool)
Returns:

Bool

Returns whether this expression is dynamically tagged (See ARM 3.9.2).

Expr.p_is_static_expr(impreciseFallback: Bool)
Returns:

Bool

Return whether this expression is static according to the ARM definition of static. See ARM 4.9.

Expr.p_eval_as_int()
Returns:

Int

Statically evaluates self, and returns the value of the evaluation as an integer.

Note

In order for a call to this not to raise, the expression needs to be a static expression, as specified in ARM 4.9. You can verify whether an expression is static with the is_static_expr property.

Attention

This is an experimental feature, so even if it is exposed to allow experiments, it is totally unsupported and the API and behavior are very likely to change in the future.

Expr.p_eval_as_int_in_env(env: List[Substitution])
Returns:

Int

Statically evaluates self, and returns the value of the evaluation as an integer. The given environment is used to substitute references to declarations by actual values.

Note

In order for a call to this not to raise, the expression needs to be a static expression, as specified in ARM 4.9. You can verify whether an expression is static with the is_static_expr property.

Attention

This is an experimental feature, so even if it is exposed to allow experiments, it is totally unsupported and the API and behavior are very likely to change in the future.

Expr.p_eval_as_string()
Returns:

Str

Statically evaluates self, and returns the value of the evaluation as a string.

Note

In order for a call to this not to raise, the expression needs to be a static expression, as specified in ARM 4.9. You can verify whether an expression is static with the is_static_expr property.

Attention

This is an experimental feature, so even if it is exposed to allow experiments, it is totally unsupported and the API and behavior are very likely to change in the future.

Expr.p_eval_as_string_in_env(env: List[Substitution])
Returns:

Str

Statically evaluates self, and returns the value of the evaluation as a string. The given environment is used to substitute references to declarations by actual values.

Note

In order for a call to this not to raise, the expression needs to be a static expression, as specified in ARM 4.9. You can verify whether an expression is static with the is_static_expr property.

Attention

This is an experimental feature, so even if it is exposed to allow experiments, it is totally unsupported and the API and behavior are very likely to change in the future.

Expr.p_matching_nodes()
Returns:

List[AdaNode]

Return the list of AST nodes that can be a match for this expression before overloading analysis.

Expr.p_is_dispatching_call(impreciseFallback: Bool)
Returns:

Bool

Returns True if this Name corresponds to a dispatching call, including:

  • Calls done through subprogram access types.

  • Calls to dispatching subprograms, in the object-oriented sense.

Note

This is an experimental feature. There might be some discrepancy with the GNAT concept of “dispatching call”.

Note

This should only be called on a Name and UnOp or a BinOp.

Attention

There is a known bug, where the ConcatOp node is not supported, so calling is_dispatching_call on operators nested inside of a concat operator will always return false. (Internal TN: VC08-029)

Expr.p_first_corresponding_decl()
Returns:

BasicDecl

Return the first decl that is lexically named like self in self’s scope.

5.4.1.1.154. ExprAlternativesList

Derives from: ExprList

5.4.1.1.155. ExprFunction

Derives from: BaseSubpBody

Fields

ExprFunction.f_expr
Type:

Expr

This field can contain one of the following nodes: BaseAggregate, ParenExpr

When there are no parsing errors, this field is never null.

5.4.1.1.156. ExprList (abstract)

Derives from: AdaList

Derived by: ExprAlternativesList

5.4.1.1.157. ExtendedReturnStmt

Derives from: CompositeStmt

Fields

ExtendedReturnStmt.f_decl
Type:

ExtendedReturnStmtObjectDecl

When there are no parsing errors, this field is never null.

ExtendedReturnStmt.f_stmts
Type:

HandledStmts

This field may be null even when there are no parsing errors.

5.4.1.1.158. ExtendedReturnStmtObjectDecl

Derives from: ObjectDecl

5.4.1.1.159. FinallyPart

Derives from: AdaNode

Fields

FinallyPart.f_stmts
Type:

StmtList

This field contains a list that itself contains one of the following nodes: PragmaNode, Stmt

When there are no parsing errors, this field is never null.

5.4.1.1.160. FloatingPointDef

Derives from: RealTypeDef

Fields

FloatingPointDef.f_num_digits
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, BoxExpr, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

FloatingPointDef.f_range
Type:

RangeSpec

This field may be null even when there are no parsing errors.

5.4.1.1.161. ForLoopIterFilter

Derives from: AdaNode

Fields

ForLoopIterFilter.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.162. ForLoopSpec

Derives from: LoopSpec

Fields

ForLoopSpec.f_var_decl
Type:

ForLoopVarDecl

When there are no parsing errors, this field is never null.

ForLoopSpec.f_loop_type
Type:

IterType

When there are no parsing errors, this field is never null.

ForLoopSpec.f_has_reverse
Type:

ReverseNode

When there are no parsing errors, this field is never null.

ForLoopSpec.f_iter_expr
Type:

AdaNode

This field can contain one of the following nodes: AttributeRef, BinOp, CallExpr, CharLiteral, DiscreteSubtypeIndication, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

ForLoopSpec.f_iter_filter
Type:

ForLoopIterFilter

This field may be null even when there are no parsing errors.

5.4.1.1.163. ForLoopStmt

Derives from: BaseLoopStmt

5.4.1.1.164. ForLoopVarDecl

Derives from: BasicDecl

Fields

ForLoopVarDecl.f_id
Type:

DefiningName

When there are no parsing errors, this field is never null.

ForLoopVarDecl.f_id_type
Type:

TypeExpr

This field can contain one of the following nodes: AnonymousType, SubtypeIndication

This field may be null even when there are no parsing errors.

5.4.1.1.165. FormalDiscreteTypeDef

Derives from: TypeDef

5.4.1.1.166. FormalSubpDecl (abstract)

Derives from: ClassicSubpDecl

Derived by: AbstractFormalSubpDecl, ConcreteFormalSubpDecl

Fields

FormalSubpDecl.f_default_expr
Type:

Expr

This field can contain one of the following nodes: AttributeRef, BoxExpr, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, NullLiteral, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

This field may be null even when there are no parsing errors.

5.4.1.1.167. FormalTypeDecl

Derives from: TypeDecl

Fields

FormalTypeDecl.f_default_type
Type:

Name

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

This field may be null even when there are no parsing errors.

5.4.1.1.168. FormatStringChunk

Derives from: AdaNode

Fields

FormatStringChunk.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

FormatStringChunk.f_string_tok
Type:

FormatStringTokNode

This field can contain one of the following nodes: FormatStringTokEnd, FormatStringTokMid

When there are no parsing errors, this field is never null.

Properties

FormatStringChunk.p_image_subprogram()
Returns:

BasicDecl

Return the Image subprogram declaration referred by this format string chunk expression.

5.4.1.1.169. FormatStringChunkList

Derives from: AdaList

5.4.1.1.170. FormatStringLiteral

Derives from: Expr

Fields

FormatStringLiteral.f_opening_chunk
Type:

FormatStringTokStart

When there are no parsing errors, this field is never null.

FormatStringLiteral.f_mid_exprs
Type:

FormatStringChunkList

When there are no parsing errors, this field is never null.

FormatStringLiteral.f_trailing_expr
Type:

FormatStringChunk

This field may be null even when there are no parsing errors.

5.4.1.1.171. FormatStringTokEnd

Derives from: FormatStringTokNode

5.4.1.1.172. FormatStringTokMid

Derives from: FormatStringTokNode

5.4.1.1.173. FormatStringTokNode (abstract)

Derives from: AdaNode

Derived by: FormatStringTokEnd, FormatStringTokMid, FormatStringTokStart

Properties

FormatStringTokNode.p_denoted_value()
Returns:

Str

Return the value that this literal denotes.

5.4.1.1.174. FormatStringTokStart

Derives from: FormatStringTokNode

Derived by: FormatStringTokString

5.4.1.1.175. FormatStringTokString

Derives from: FormatStringTokStart

5.4.1.1.176. GenericDecl (abstract)

Derives from: BasicDecl

Derived by: GenericPackageDecl, GenericSubpDecl

Fields

GenericDecl.f_formal_part
Type:

GenericFormalPart

When there are no parsing errors, this field is never null.

5.4.1.1.177. GenericFormal (abstract)

Derives from: BaseFormalParamDecl

Derived by: GenericFormalObjDecl, GenericFormalPackage, GenericFormalSubpDecl, GenericFormalTypeDecl

Fields

GenericFormal.f_decl
Type:

BasicDecl

This field can contain one of the following nodes: ExprFunction, FormalSubpDecl, FormalTypeDecl, GenericInstantiation, IncompleteFormalTypeDecl, ObjectDecl

When there are no parsing errors, this field is never null.

5.4.1.1.178. GenericFormalObjDecl

Derives from: GenericFormal

5.4.1.1.179. GenericFormalPackage

Derives from: GenericFormal

5.4.1.1.180. GenericFormalPart

Derives from: BaseFormalParamHolder

Fields

GenericFormalPart.f_decls
Type:

AdaNodeList

This field contains a list that itself contains one of the following nodes: GenericFormal, PragmaNode, UseClause

When there are no parsing errors, this field is never null.

5.4.1.1.181. GenericFormalSubpDecl

Derives from: GenericFormal

5.4.1.1.182. GenericFormalTypeDecl

Derives from: GenericFormal

5.4.1.1.183. GenericInstantiation (abstract)

Derives from: BasicDecl

Derived by: GenericPackageInstantiation, GenericSubpInstantiation

Properties

GenericInstantiation.p_designated_generic_decl()
Returns:

GenericDecl

Return the generic decl entity designated by this instantiation, including instantiation information. This is equivalent to the expanded generic unit in GNAT.

GenericInstantiation.p_inst_params()
Returns:

List[ParamActual]

Returns an array of pairs, associating formal parameters to actual or default expressions.

5.4.1.1.184. GenericPackageDecl

Derives from: GenericDecl

Fields

GenericPackageDecl.f_package_decl
Type:

GenericPackageInternal

When there are no parsing errors, this field is never null.

Properties

GenericPackageDecl.p_body_part()
Returns:

PackageBody

Return the PackageBody corresponding to this node, or null if there is none.

5.4.1.1.185. GenericPackageInstantiation

Derives from: GenericInstantiation

Fields

GenericPackageInstantiation.f_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

GenericPackageInstantiation.f_generic_pkg_name
Type:

Name

This field can contain one of the following nodes: CharLiteral, DottedName, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

GenericPackageInstantiation.f_params
Type:

AssocList

This field contains a list that itself contains one of the following nodes: ParamAssoc

When there are no parsing errors, this field is never null.

5.4.1.1.186. GenericPackageInternal

Derives from: BasePackageDecl

5.4.1.1.187. GenericPackageRenamingDecl

Derives from: GenericRenamingDecl

Fields

GenericPackageRenamingDecl.f_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

GenericPackageRenamingDecl.f_renames
Type:

RenamingClause

When there are no parsing errors, this field is never null.

5.4.1.1.188. GenericRenamingDecl (abstract)

Derives from: BasicDecl

Derived by: GenericPackageRenamingDecl, GenericSubpRenamingDecl

5.4.1.1.189. GenericSubpDecl

Derives from: GenericDecl

Fields

GenericSubpDecl.f_subp_decl
Type:

GenericSubpInternal

When there are no parsing errors, this field is never null.

Properties

GenericSubpDecl.p_body_part(impreciseFallback: Bool)
Returns:

BaseSubpBody

Return the BaseSubpBody corresponding to this node.

5.4.1.1.190. GenericSubpInstantiation

Derives from: GenericInstantiation

Fields

GenericSubpInstantiation.f_overriding
Type:

OverridingNode

When there are no parsing errors, this field is never null.

GenericSubpInstantiation.f_kind
Type:

SubpKind

When there are no parsing errors, this field is never null.

GenericSubpInstantiation.f_subp_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

GenericSubpInstantiation.f_generic_subp_name
Type:

Name

This field can contain one of the following nodes: CharLiteral, DottedName, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

GenericSubpInstantiation.f_params
Type:

AssocList

This field contains a list that itself contains one of the following nodes: ParamAssoc

When there are no parsing errors, this field is never null.

5.4.1.1.191. GenericSubpInternal

Derives from: BasicSubpDecl

Fields

GenericSubpInternal.f_subp_spec
Type:

SubpSpec

When there are no parsing errors, this field is never null.

5.4.1.1.192. GenericSubpRenamingDecl

Derives from: GenericRenamingDecl

Fields

GenericSubpRenamingDecl.f_kind
Type:

SubpKind

When there are no parsing errors, this field is never null.

GenericSubpRenamingDecl.f_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

GenericSubpRenamingDecl.f_renames
Type:

RenamingClause

When there are no parsing errors, this field is never null.

5.4.1.1.193. GotoStmt

Derives from: SimpleStmt

Fields

GotoStmt.f_label_name
Type:

Name

This field can contain one of the following nodes: CharLiteral, DottedName, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

5.4.1.1.194. HandledStmts

Derives from: AdaNode

Fields

HandledStmts.f_stmts
Type:

StmtList

This field contains a list that itself contains one of the following nodes: PragmaNode, Stmt

When there are no parsing errors, this field is never null.

HandledStmts.f_exceptions
Type:

AdaNodeList

This field contains a list that itself contains one of the following nodes: ExceptionHandler, PragmaNode

When there are no parsing errors, this field is never null.

HandledStmts.f_finally_part
Type:

FinallyPart

This field may be null even when there are no parsing errors.

5.4.1.1.195. Identifier

Derives from: BaseId

5.4.1.1.196. IdentifierList (abstract)

Derives from: AdaList

Derived by: DiscriminantChoiceList

5.4.1.1.197. IfExpr

Derives from: CondExpr

Fields

IfExpr.f_cond_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

IfExpr.f_then_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

IfExpr.f_alternatives
Type:

ElsifExprPartList

When there are no parsing errors, this field is never null.

IfExpr.f_else_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

This field may be null even when there are no parsing errors.

5.4.1.1.198. IfStmt

Derives from: CompositeStmt

Fields

IfStmt.f_cond_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

IfStmt.f_then_stmts
Type:

StmtList

This field contains a list that itself contains one of the following nodes: PragmaNode, Stmt

When there are no parsing errors, this field is never null.

IfStmt.f_alternatives
Type:

ElsifStmtPartList

When there are no parsing errors, this field is never null.

IfStmt.f_else_part
Type:

ElsePart

This field may be null even when there are no parsing errors.

5.4.1.1.199. IncompleteFormalTypeDecl

Derives from: IncompleteTypeDecl

Fields

IncompleteFormalTypeDecl.f_is_tagged
Type:

TaggedNode

This field may be null even when there are no parsing errors.

IncompleteFormalTypeDecl.f_default_type
Type:

Name

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

This field may be null even when there are no parsing errors.

5.4.1.1.200. IncompleteTaggedTypeDecl

Derives from: IncompleteTypeDecl

Fields

IncompleteTaggedTypeDecl.f_has_abstract
Type:

AbstractNode

When there are no parsing errors, this field is never null.

5.4.1.1.201. IncompleteTypeDecl

Derives from: BaseTypeDecl

Derived by: IncompleteFormalTypeDecl, IncompleteTaggedTypeDecl

Fields

IncompleteTypeDecl.f_discriminants
Type:

DiscriminantPart

This field may be null even when there are no parsing errors.

5.4.1.1.202. IntLiteral

Derives from: NumLiteral

Properties

IntLiteral.p_denoted_value()
Returns:

Int

Return the value that this literal denotes.

5.4.1.1.203. InterfaceKind (abstract)

Derives from: AdaNode

Derived by: InterfaceKindLimited, InterfaceKindProtected, InterfaceKindSynchronized, InterfaceKindTask

5.4.1.1.204. InterfaceKindLimited

Derives from: InterfaceKind

5.4.1.1.205. InterfaceKindProtected

Derives from: InterfaceKind

5.4.1.1.206. InterfaceKindSynchronized

Derives from: InterfaceKind

5.4.1.1.207. InterfaceKindTask

Derives from: InterfaceKind

5.4.1.1.208. InterfaceTypeDef

Derives from: TypeDef

Fields

InterfaceTypeDef.f_interface_kind
Type:

InterfaceKind

This field may be null even when there are no parsing errors.

InterfaceTypeDef.f_interfaces
Type:

ParentList

This field contains a list that itself contains one of the following nodes: CharLiteral, DottedName, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

5.4.1.1.209. IterType (abstract)

Derives from: AdaNode

Derived by: IterTypeIn, IterTypeOf

5.4.1.1.210. IterTypeIn

Derives from: IterType

5.4.1.1.211. IterTypeOf

Derives from: IterType

5.4.1.1.212. IteratedAssoc

Derives from: BasicAssoc

Fields

IteratedAssoc.f_spec
Type:

ForLoopSpec

When there are no parsing errors, this field is never null.

IteratedAssoc.f_key_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

This field may be null even when there are no parsing errors.

IteratedAssoc.f_r_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.213. KnownDiscriminantPart

Derives from: DiscriminantPart

Fields

KnownDiscriminantPart.f_discr_specs
Type:

DiscriminantSpecList

When there are no parsing errors, this field is never null.

5.4.1.1.214. Label

Derives from: SimpleStmt

Fields

Label.f_decl
Type:

LabelDecl

When there are no parsing errors, this field is never null.

5.4.1.1.215. LabelDecl

Derives from: BasicDecl

Fields

LabelDecl.f_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

5.4.1.1.216. LibraryItem

Derives from: AdaNode

Fields

LibraryItem.f_has_private
Type:

PrivateNode

When there are no parsing errors, this field is never null.

LibraryItem.f_item
Type:

BasicDecl

This field can contain one of the following nodes: AbstractSubpDecl, BaseSubpBody, ErrorDecl, GenericDecl, GenericInstantiation, GenericRenamingDecl, PackageBody, PackageDecl, PackageRenamingDecl, SubpDecl

When there are no parsing errors, this field is never null.

5.4.1.1.217. LimitedAbsent

Derives from: LimitedNode

5.4.1.1.218. LimitedNode (abstract)

Derives from: AdaNode

Derived by: LimitedAbsent, LimitedPresent

Properties

LimitedNode.p_as_bool()
Returns:

Bool

Return whether this node is present

5.4.1.1.219. LimitedPresent

Derives from: LimitedNode

5.4.1.1.220. LoopSpec (abstract)

Derives from: AdaNode

Derived by: ForLoopSpec, WhileLoopSpec

5.4.1.1.221. LoopStmt

Derives from: BaseLoopStmt

5.4.1.1.222. MembershipExpr

Derives from: Expr

Fields

MembershipExpr.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

MembershipExpr.f_op
Type:

Op

This field can contain one of the following nodes: OpIn, OpNotIn

When there are no parsing errors, this field is never null.

MembershipExpr.f_membership_exprs
Type:

ExprAlternativesList

This field contains a list that itself contains one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DiscreteSubtypeName, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.223. ModIntTypeDef

Derives from: TypeDef

Fields

ModIntTypeDef.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, BoxExpr, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.224. Mode (abstract)

Derives from: AdaNode

Derived by: ModeDefault, ModeIn, ModeInOut, ModeOut

5.4.1.1.225. ModeDefault

Derives from: Mode

5.4.1.1.226. ModeIn

Derives from: Mode

5.4.1.1.227. ModeInOut

Derives from: Mode

5.4.1.1.228. ModeOut

Derives from: Mode

5.4.1.1.229. MultiAbstractStateDecl

Derives from: AdaNode

Fields

MultiAbstractStateDecl.f_decls
Type:

AbstractStateDeclList

This field contains a list that itself contains one of the following nodes: AbstractStateDecl, ParenAbstractStateDecl

When there are no parsing errors, this field is never null.

5.4.1.1.230. MultiDimArrayAssoc

Derives from: AggregateAssoc

5.4.1.1.231. Name (abstract)

Derives from: Expr

Derived by: ArraySubcomponentChoiceName, AttributeRef, CallExpr, DefiningName, DiscreteSubtypeName, DottedName, EndName, ExplicitDeref, QualExpr, ReduceAttributeRef, SingleTokNode, SyntheticIdentifier, TargetName, UpdateAttributeRef

Properties

Name.p_enclosing_defining_name()
Returns:

DefiningName

If this name is part of a defining name, return the enclosing defining name node.

Name.p_is_defining()
Returns:

Bool

Return True if this name is part of a defining name.

Name.p_name_is(sym: Symbol)
Returns:

Bool

Helper. Check that this name matches sym.

Name.p_is_direct_call()
Returns:

Bool

Return True iff this name represents a call to a subprogram which is referred by its defining name. (i.e. not through a subprogram access).

Name.p_is_access_call()
Returns:

Bool

Return True iff this name represents a call to subprogram through an access type.

Name.p_is_call()
Returns:

Bool

Returns True if this Name corresponds to a call.

Name.p_is_dot_call(impreciseFallback: Bool)
Returns:

Bool

Returns True if this Name corresponds to a dot notation call.

Name.p_is_prefix_call()
Returns:

Bool

Return whether this call uses its prefix as the first argument. This returns True for dot calls, generalized indexing, and some attribute references (such as X'Image).

Name.p_all_env_elements(seq: Bool, seqFrom: AdaNode)
Returns:

List[AdaNode]

Return all elements in self’s scope that are lexically named like self. By setting seq to true, the lookup is performed from the location of self (or from seq_from if the latter is set to a non-null node), meaning that elements declared after it won’t be returned.

Name.p_called_subp_spec()
Returns:

BaseFormalParamHolder

Return the subprogram specification of the subprogram or subprogram access that is being called by this exact Name, if relevant. Note that when inside an instantiated generic, this will return the spec of the actual subprogram.

Name.p_referenced_decl(impreciseFallback: Bool)
Returns:

BasicDecl

Return the declaration this node references after name resolution. If imprecise_fallback is True, errors raised during resolution of the xref equation are caught and a fallback mechanism is triggered, which tries to find the referenced declaration in an ad-hoc way.

Name.p_referenced_defining_name(impreciseFallback: Bool)
Returns:

DefiningName

Like referenced_decl, but will return the defining identifier for the decl, rather than the basic declaration node itself.

Name.p_failsafe_referenced_decl(impreciseFallback: Bool)
Returns:

RefdDecl

Failsafe version of referenced_decl. Returns a RefdDecl, which can be precise, imprecise, or error.

Name.p_name_designated_type()
Returns:

BaseTypeDecl

Like SubtypeIndication.designated_type, but on names, since because of Ada’s ambiguous grammar, some subtype indications will be parsed as names.

Name.p_is_static_subtype(impreciseFallback: Bool)
Returns:

Bool

Returns whether self denotes a static subtype or not.

Name.p_name_matches(n: Name)
Returns:

Bool

Return whether two names match each other.

This compares the symbol for Identifier and StringLiteral nodes. We consider that there is no match for all other node kinds.

Name.p_is_operator_name()
Returns:

Bool

Return whether the name that self designates is an operator.

Name.p_is_write_reference(impreciseFallback: Bool)
Returns:

Bool

Whether this name is a write reference.

For example, X is a write reference in the following cases:

  1. X := 2;

  2. X (2) := 2;

  3. P(F => X) where F is declared out or in out.

  4. P(F => T (X)) where F is declared out or in out

  5. X'Access.

  6. X.C := 2, R.X := 2

  7. X.P where the formal for X is declared out or in out.

Note

This is an experimental feature. There might be some discrepancy with the GNAT concept of “write reference”.

Name.p_is_static_call(impreciseFallback: Bool)
Returns:

Bool

Returns True if this Name corresponds to a static non-dispatching call. In other words, this will return True if and only if the target of the call is known statically.

Note

This is an experimental feature. There might be some discrepancy with the GNAT concept of “static call”.

Name.p_call_params()
Returns:

List[ParamActual]

Returns an array of pairs, associating formal parameters to actual or default expressions.

Name.p_relative_name()
Returns:

Name

Returns the relative name of this instance. For example, for a prefix A.B.C, this will return C.

Name.p_as_symbol_array()
Returns:

List[Symbol]

Turn this name into an array of symbols.

For instance, a node with name A.B.C is turned into ['A', 'B', 'C'].

Only simple name kinds are allowed: Identifier, DottedName and DefiningName. Any other kind will trigger a PreconditionFailure.

Name.p_canonical_text()
Returns:

Symbol

Return a canonicalized version of this name’s text.

Only simple name kinds are allowed: Identifier, DottedName and DefiningName. Any other kind will trigger a PreconditionFailure.

Name.p_is_constant()
Returns:

Bool

Return whether this name denotes a constant value.

5.4.1.1.232. NameList

Derives from: AdaList

Derived by: ParentList

5.4.1.1.233. NamedStmt

Derives from: CompositeStmt

Fields

NamedStmt.f_decl
Type:

NamedStmtDecl

When there are no parsing errors, this field is never null.

NamedStmt.f_stmt
Type:

CompositeStmt

This field can contain one of the following nodes: BaseLoopStmt, BlockStmt

When there are no parsing errors, this field is never null.

5.4.1.1.234. NamedStmtDecl

Derives from: BasicDecl

Fields

NamedStmtDecl.f_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

5.4.1.1.235. NoTypeObjectRenamingDecl

Derives from: ObjectDecl

5.4.1.1.236. NotNull (abstract)

Derives from: AdaNode

Derived by: NotNullAbsent, NotNullPresent

Properties

NotNull.p_as_bool()
Returns:

Bool

Return whether this node is present

5.4.1.1.237. NotNullAbsent

Derives from: NotNull

5.4.1.1.238. NotNullPresent

Derives from: NotNull

5.4.1.1.239. NullComponentDecl

Derives from: AdaNode

5.4.1.1.240. NullLiteral

Derives from: SingleTokNode

5.4.1.1.241. NullRecordAggregate

Derives from: BaseAggregate

5.4.1.1.242. NullRecordDef

Derives from: BaseRecordDef

5.4.1.1.243. NullStmt

Derives from: SimpleStmt

5.4.1.1.244. NullSubpDecl

Derives from: BaseSubpBody

5.4.1.1.245. NumLiteral (abstract)

Derives from: SingleTokNode

Derived by: IntLiteral, RealLiteral

5.4.1.1.246. NumberDecl

Derives from: BasicDecl

Fields

NumberDecl.f_ids
Type:

DefiningNameList

When there are no parsing errors, this field is never null.

NumberDecl.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.247. ObjectDecl

Derives from: BasicDecl

Derived by: ExtendedReturnStmtObjectDecl, NoTypeObjectRenamingDecl

Fields

ObjectDecl.f_ids
Type:

DefiningNameList

When there are no parsing errors, this field is never null.

ObjectDecl.f_has_aliased
Type:

AliasedNode

When there are no parsing errors, this field is never null.

ObjectDecl.f_has_constant
Type:

ConstantNode

When there are no parsing errors, this field is never null.

ObjectDecl.f_mode
Type:

Mode

This field may be null even when there are no parsing errors.

ObjectDecl.f_type_expr
Type:

TypeExpr

This field can contain one of the following nodes: AnonymousType, SubtypeIndication

This field may be null even when there are no parsing errors.

ObjectDecl.f_default_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

This field may be null even when there are no parsing errors.

ObjectDecl.f_renaming_clause
Type:

RenamingClause

This field may be null even when there are no parsing errors.

Properties

ObjectDecl.p_is_statically_constrained()
Returns:

Bool

Returns whether this designates a statically constrained object. An object is statically constrained if its nominal subtype is statically constrained, or if it is a static string constant.

ObjectDecl.p_private_part_decl()
Returns:

BasicDecl

If this object decl is the constant completion of an object decl in the public part, return the object decl from the public part.

ObjectDecl.p_public_part_decl()
Returns:

BasicDecl

If this object decl is the incomplete declaration of a constant in a public part, return its completion in the private part.

5.4.1.1.248. Op (abstract)

Derives from: BaseId

Derived by: OpAbs, OpAnd, OpAndThen, OpConcat, OpDiv, OpDoubleDot, OpEq, OpGt, OpGte, OpIn, OpLt, OpLte, OpMinus, OpMod, OpMult, OpNeq, OpNot, OpNotIn, OpOr, OpOrElse, OpPlus, OpPow, OpRem, OpXor

5.4.1.1.249. OpAbs

Derives from: Op

5.4.1.1.250. OpAnd

Derives from: Op

5.4.1.1.251. OpAndThen

Derives from: Op

5.4.1.1.252. OpConcat

Derives from: Op

5.4.1.1.253. OpDiv

Derives from: Op

5.4.1.1.254. OpDoubleDot

Derives from: Op

5.4.1.1.255. OpEq

Derives from: Op

5.4.1.1.256. OpGt

Derives from: Op

5.4.1.1.257. OpGte

Derives from: Op

5.4.1.1.258. OpIn

Derives from: Op

5.4.1.1.259. OpLt

Derives from: Op

5.4.1.1.260. OpLte

Derives from: Op

5.4.1.1.261. OpMinus

Derives from: Op

5.4.1.1.262. OpMod

Derives from: Op

5.4.1.1.263. OpMult

Derives from: Op

5.4.1.1.264. OpNeq

Derives from: Op

5.4.1.1.265. OpNot

Derives from: Op

5.4.1.1.266. OpNotIn

Derives from: Op

5.4.1.1.267. OpOr

Derives from: Op

5.4.1.1.268. OpOrElse

Derives from: Op

5.4.1.1.269. OpPlus

Derives from: Op

5.4.1.1.270. OpPow

Derives from: Op

5.4.1.1.271. OpRem

Derives from: Op

5.4.1.1.272. OpXor

Derives from: Op

5.4.1.1.273. OrdinaryFixedPointDef

Derives from: RealTypeDef

Fields

OrdinaryFixedPointDef.f_delta
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, BoxExpr, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

OrdinaryFixedPointDef.f_range
Type:

RangeSpec

This field may be null even when there are no parsing errors.

5.4.1.1.274. OthersDesignator

Derives from: AdaNode

5.4.1.1.275. OverridingNode (abstract)

Derives from: AdaNode

Derived by: OverridingNotOverriding, OverridingOverriding, OverridingUnspecified

5.4.1.1.276. OverridingNotOverriding

Derives from: OverridingNode

5.4.1.1.277. OverridingOverriding

Derives from: OverridingNode

5.4.1.1.278. OverridingUnspecified

Derives from: OverridingNode

5.4.1.1.279. PackageBody

Derives from: BodyNode

Fields

PackageBody.f_package_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

PackageBody.f_decls
Type:

DeclarativePart

When there are no parsing errors, this field is never null.

PackageBody.f_stmts
Type:

HandledStmts

This field may be null even when there are no parsing errors.

PackageBody.f_end_name
Type:

EndName

This field may be null even when there are no parsing errors.

5.4.1.1.280. PackageBodyStub

Derives from: BodyStub

Fields

PackageBodyStub.f_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

5.4.1.1.281. PackageDecl

Derives from: BasePackageDecl

5.4.1.1.282. PackageRenamingDecl

Derives from: BasicDecl

Fields

PackageRenamingDecl.f_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

PackageRenamingDecl.f_renames
Type:

RenamingClause

When there are no parsing errors, this field is never null.

Properties

PackageRenamingDecl.p_renamed_package()
Returns:

BasicDecl

Return the declaration of the package that is renamed by self.

PackageRenamingDecl.p_final_renamed_package()
Returns:

BasicDecl

Return the declaration of the package that is ultimately renamed by self, skipping through all intermediate package renamings.

5.4.1.1.283. ParamAssoc

Derives from: BasicAssoc

Fields

ParamAssoc.f_designator
Type:

AdaNode

This field can contain one of the following nodes: Identifier, OthersDesignator, StringLiteral

This field may be null even when there are no parsing errors.

ParamAssoc.f_r_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, BoxExpr, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.284. ParamSpec

Derives from: BaseFormalParamDecl

Fields

ParamSpec.f_ids
Type:

DefiningNameList

When there are no parsing errors, this field is never null.

ParamSpec.f_has_aliased
Type:

AliasedNode

When there are no parsing errors, this field is never null.

ParamSpec.f_mode
Type:

Mode

This field may be null even when there are no parsing errors.

ParamSpec.f_type_expr
Type:

TypeExpr

This field can contain one of the following nodes: AnonymousType, SubtypeIndication

When there are no parsing errors, this field is never null.

ParamSpec.f_default_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

This field may be null even when there are no parsing errors.

5.4.1.1.285. ParamSpecList

Derives from: AdaList

5.4.1.1.286. Params

Derives from: AdaNode

Fields

Params.f_params
Type:

ParamSpecList

When there are no parsing errors, this field is never null.

5.4.1.1.287. ParenAbstractStateDecl

Derives from: AdaNode

Fields

ParenAbstractStateDecl.f_decl
Type:

AdaNode

This field can contain one of the following nodes: AbstractStateDecl, ParenAbstractStateDecl

When there are no parsing errors, this field is never null.

5.4.1.1.288. ParenExpr

Derives from: Expr

Fields

ParenExpr.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.289. ParentList

Derives from: NameList

5.4.1.1.290. PpDirective (abstract)

Derives from: AdaNode

Derived by: PpElseDirective, PpElsifDirective, PpEndIfDirective, PpIfDirective

5.4.1.1.291. PpElseDirective

Derives from: PpDirective

5.4.1.1.292. PpElsifDirective

Derives from: PpDirective

Fields

PpElsifDirective.f_expr
Type:

Expr

This field can contain one of the following nodes: AttributeRef, BinOp, Identifier, ParenExpr, UnOp

When there are no parsing errors, this field is never null.

PpElsifDirective.f_then_kw
Type:

PpThenKw

This field may be null even when there are no parsing errors.

5.4.1.1.293. PpEndIfDirective

Derives from: PpDirective

5.4.1.1.294. PpIfDirective

Derives from: PpDirective

Fields

PpIfDirective.f_expr
Type:

Expr

This field can contain one of the following nodes: AttributeRef, BinOp, Identifier, ParenExpr, UnOp

When there are no parsing errors, this field is never null.

PpIfDirective.f_then_kw
Type:

PpThenKw

This field may be null even when there are no parsing errors.

5.4.1.1.295. PpThenKw

Derives from: AdaNode

5.4.1.1.296. PragmaArgumentAssoc

Derives from: BaseAssoc

Fields

PragmaArgumentAssoc.f_name
Type:

Name

This field can contain one of the following nodes: AttributeRef, Identifier

This field may be null even when there are no parsing errors.

PragmaArgumentAssoc.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.297. PragmaNode

Derives from: AdaNode

Fields

PragmaNode.f_id
Type:

Identifier

When there are no parsing errors, this field is never null.

PragmaNode.f_args
Type:

BaseAssocList

When there are no parsing errors, this field is never null.

Properties

PragmaNode.p_is_ghost_code()
Returns:

Bool

Return whether this pragma is ghost code or not. See SPARK RM 6.9.

PragmaNode.p_associated_entities()
Returns:

List[DefiningName]

Return an array of BasicDecl instances associated with this pragma, or an empty array if non applicable.

5.4.1.1.298. PragmaNodeList

Derives from: AdaList

5.4.1.1.299. PrivateAbsent

Derives from: PrivateNode

5.4.1.1.300. PrivateNode (abstract)

Derives from: AdaNode

Derived by: PrivateAbsent, PrivatePresent

Properties

PrivateNode.p_as_bool()
Returns:

Bool

Return whether this node is present

5.4.1.1.301. PrivatePart

Derives from: DeclarativePart

5.4.1.1.302. PrivatePresent

Derives from: PrivateNode

5.4.1.1.303. PrivateTypeDef

Derives from: TypeDef

Fields

PrivateTypeDef.f_has_abstract
Type:

AbstractNode

When there are no parsing errors, this field is never null.

PrivateTypeDef.f_has_tagged
Type:

TaggedNode

When there are no parsing errors, this field is never null.

PrivateTypeDef.f_has_limited
Type:

LimitedNode

When there are no parsing errors, this field is never null.

5.4.1.1.304. ProtectedAbsent

Derives from: ProtectedNode

5.4.1.1.305. ProtectedBody

Derives from: BodyNode

Fields

ProtectedBody.f_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

ProtectedBody.f_decls
Type:

DeclarativePart

When there are no parsing errors, this field is never null.

ProtectedBody.f_end_name
Type:

EndName

This field may be null even when there are no parsing errors.

5.4.1.1.306. ProtectedBodyStub

Derives from: BodyStub

Fields

ProtectedBodyStub.f_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

5.4.1.1.307. ProtectedDef

Derives from: AdaNode

Fields

ProtectedDef.f_public_part
Type:

PublicPart

When there are no parsing errors, this field is never null.

ProtectedDef.f_private_part
Type:

PrivatePart

This field may be null even when there are no parsing errors.

ProtectedDef.f_end_name
Type:

EndName

This field may be null even when there are no parsing errors.

5.4.1.1.308. ProtectedNode (abstract)

Derives from: AdaNode

Derived by: ProtectedAbsent, ProtectedPresent

Properties

ProtectedNode.p_as_bool()
Returns:

Bool

Return whether this node is present

5.4.1.1.309. ProtectedPresent

Derives from: ProtectedNode

5.4.1.1.310. ProtectedTypeDecl

Derives from: BaseTypeDecl

Fields

ProtectedTypeDecl.f_discriminants
Type:

DiscriminantPart

This field may be null even when there are no parsing errors.

ProtectedTypeDecl.f_interfaces
Type:

ParentList

This field contains a list that itself contains one of the following nodes: CharLiteral, DottedName, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

ProtectedTypeDecl.f_definition
Type:

ProtectedDef

When there are no parsing errors, this field is never null.

5.4.1.1.311. PublicPart

Derives from: DeclarativePart

5.4.1.1.312. QualExpr

Derives from: Name

Fields

QualExpr.f_prefix
Type:

Name

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

QualExpr.f_suffix
Type:

Expr

This field can contain one of the following nodes: BaseAggregate, ParenExpr

When there are no parsing errors, this field is never null.

5.4.1.1.313. QuantifiedExpr

Derives from: Expr

Fields

QuantifiedExpr.f_quantifier
Type:

Quantifier

When there are no parsing errors, this field is never null.

QuantifiedExpr.f_loop_spec
Type:

ForLoopSpec

When there are no parsing errors, this field is never null.

QuantifiedExpr.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.314. Quantifier (abstract)

Derives from: AdaNode

Derived by: QuantifierAll, QuantifierSome

5.4.1.1.315. QuantifierAll

Derives from: Quantifier

5.4.1.1.316. QuantifierSome

Derives from: Quantifier

5.4.1.1.317. RaiseExpr

Derives from: Expr

Fields

RaiseExpr.f_exception_name
Type:

Name

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

This field may be null even when there are no parsing errors.

RaiseExpr.f_error_message
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

This field may be null even when there are no parsing errors.

5.4.1.1.318. RaiseStmt

Derives from: SimpleStmt

Fields

RaiseStmt.f_exception_name
Type:

Name

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

This field may be null even when there are no parsing errors.

RaiseStmt.f_error_message
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

This field may be null even when there are no parsing errors.

5.4.1.1.319. RangeConstraint

Derives from: Constraint

Fields

RangeConstraint.f_range
Type:

RangeSpec

When there are no parsing errors, this field is never null.

5.4.1.1.320. RangeSpec

Derives from: AdaNode

Fields

RangeSpec.f_range
Type:

Expr

This field can contain one of the following nodes: AttributeRef, BinOp, BoxExpr, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.321. RealLiteral

Derives from: NumLiteral

5.4.1.1.322. RealTypeDef (abstract)

Derives from: TypeDef

Derived by: DecimalFixedPointDef, FloatingPointDef, OrdinaryFixedPointDef

5.4.1.1.323. RecordDef

Derives from: BaseRecordDef

5.4.1.1.324. RecordRepClause

Derives from: AspectClause

Fields

RecordRepClause.f_name
Type:

Name

This field can contain one of the following nodes: CharLiteral, DottedName, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

RecordRepClause.f_at_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

This field may be null even when there are no parsing errors.

RecordRepClause.f_components
Type:

AdaNodeList

This field contains a list that itself contains one of the following nodes: ComponentClause, PragmaNode

When there are no parsing errors, this field is never null.

5.4.1.1.325. RecordTypeDef

Derives from: TypeDef

Fields

RecordTypeDef.f_has_abstract
Type:

AbstractNode

When there are no parsing errors, this field is never null.

RecordTypeDef.f_has_tagged
Type:

TaggedNode

When there are no parsing errors, this field is never null.

RecordTypeDef.f_has_limited
Type:

LimitedNode

When there are no parsing errors, this field is never null.

RecordTypeDef.f_record_def
Type:

BaseRecordDef

When there are no parsing errors, this field is never null.

5.4.1.1.326. ReduceAttributeRef

Derives from: Name

Fields

ReduceAttributeRef.f_prefix
Type:

AdaNode

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef, ValueSequence

When there are no parsing errors, this field is never null.

ReduceAttributeRef.f_attribute
Type:

Identifier

When there are no parsing errors, this field is never null.

ReduceAttributeRef.f_args
Type:

AssocList

This field contains a list that itself contains one of the following nodes: ParamAssoc

When there are no parsing errors, this field is never null.

5.4.1.1.327. RelationOp

Derives from: BinOp

5.4.1.1.328. RenamingClause

Derives from: AdaNode

Derived by: SyntheticRenamingClause

Fields

RenamingClause.f_renamed_object
Type:

Name

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.329. RequeueStmt

Derives from: SimpleStmt

Fields

RequeueStmt.f_call_name
Type:

Name

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

RequeueStmt.f_has_abort
Type:

AbortNode

When there are no parsing errors, this field is never null.

5.4.1.1.330. ReturnStmt

Derives from: SimpleStmt

Fields

ReturnStmt.f_return_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

This field may be null even when there are no parsing errors.

5.4.1.1.331. ReverseAbsent

Derives from: ReverseNode

5.4.1.1.332. ReverseNode (abstract)

Derives from: AdaNode

Derived by: ReverseAbsent, ReversePresent

Properties

ReverseNode.p_as_bool()
Returns:

Bool

Return whether this node is present

5.4.1.1.333. ReversePresent

Derives from: ReverseNode

5.4.1.1.334. SelectStmt

Derives from: CompositeStmt

Fields

SelectStmt.f_guards
Type:

SelectWhenPartList

When there are no parsing errors, this field is never null.

SelectStmt.f_else_part
Type:

ElsePart

This field may be null even when there are no parsing errors.

SelectStmt.f_then_abort_part
Type:

ThenAbortPart

This field may be null even when there are no parsing errors.

5.4.1.1.335. SelectWhenPart

Derives from: AdaNode

Fields

SelectWhenPart.f_cond_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

This field may be null even when there are no parsing errors.

SelectWhenPart.f_stmts
Type:

StmtList

This field contains a list that itself contains one of the following nodes: PragmaNode, Stmt

When there are no parsing errors, this field is never null.

5.4.1.1.336. SelectWhenPartList

Derives from: AdaList

5.4.1.1.337. SignedIntTypeDef

Derives from: TypeDef

Fields

SignedIntTypeDef.f_range
Type:

RangeSpec

When there are no parsing errors, this field is never null.

5.4.1.1.338. SimpleDeclStmt

Derives from: SimpleStmt

Fields

SimpleDeclStmt.f_decl
Type:

ObjectDecl

When there are no parsing errors, this field is never null.

5.4.1.1.339. SimpleStmt (abstract)

Derives from: Stmt

Derived by: AbortStmt, AssignStmt, CallStmt, DelayStmt, ExitStmt, GotoStmt, Label, NullStmt, RaiseStmt, RequeueStmt, ReturnStmt, SimpleDeclStmt, TerminateAlternative

5.4.1.1.340. SingleProtectedDecl

Derives from: BasicDecl

Fields

SingleProtectedDecl.f_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

SingleProtectedDecl.f_interfaces
Type:

ParentList

This field contains a list that itself contains one of the following nodes: CharLiteral, DottedName, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

SingleProtectedDecl.f_definition
Type:

ProtectedDef

When there are no parsing errors, this field is never null.

5.4.1.1.341. SingleTaskDecl

Derives from: BasicDecl

Fields

SingleTaskDecl.f_task_type
Type:

SingleTaskTypeDecl

When there are no parsing errors, this field is never null.

5.4.1.1.342. SingleTaskTypeDecl

Derives from: TaskTypeDecl

5.4.1.1.343. SingleTokNode (abstract)

Derives from: Name

Derived by: BaseId, NullLiteral, NumLiteral

5.4.1.1.344. Stmt (abstract)

Derives from: AdaNode

Derived by: CompositeStmt, ErrorStmt, SimpleStmt

Properties

Stmt.p_is_ghost_code()
Returns:

Bool

Return whether this statement is ghost code or not. See SPARK RM 6.9.

5.4.1.1.345. StmtList

Derives from: AdaNodeList

5.4.1.1.346. StringLiteral

Derives from: BaseId

Properties

StringLiteral.p_denoted_value()
Returns:

Str

Return the value that this literal denotes.

5.4.1.1.347. SubpBody

Derives from: BaseSubpBody

Fields

SubpBody.f_decls
Type:

DeclarativePart

When there are no parsing errors, this field is never null.

SubpBody.f_stmts
Type:

HandledStmts

When there are no parsing errors, this field is never null.

SubpBody.f_end_name
Type:

EndName

This field may be null even when there are no parsing errors.

5.4.1.1.348. SubpBodyStub

Derives from: BodyStub

Fields

SubpBodyStub.f_overriding
Type:

OverridingNode

When there are no parsing errors, this field is never null.

SubpBodyStub.f_subp_spec
Type:

SubpSpec

When there are no parsing errors, this field is never null.

5.4.1.1.349. SubpDecl

Derives from: ClassicSubpDecl

5.4.1.1.350. SubpKind (abstract)

Derives from: AdaNode

Derived by: SubpKindFunction, SubpKindProcedure

5.4.1.1.351. SubpKindFunction

Derives from: SubpKind

5.4.1.1.352. SubpKindProcedure

Derives from: SubpKind

5.4.1.1.353. SubpRenamingDecl

Derives from: BaseSubpBody

Fields

SubpRenamingDecl.f_renames
Type:

RenamingClause

When there are no parsing errors, this field is never null.

5.4.1.1.354. SubpSpec

Derives from: BaseSubpSpec

Fields

SubpSpec.f_subp_kind
Type:

SubpKind

When there are no parsing errors, this field is never null.

SubpSpec.f_subp_name
Type:

DefiningName

This field may be null even when there are no parsing errors.

SubpSpec.f_subp_params
Type:

Params

This field may be null even when there are no parsing errors.

SubpSpec.f_subp_returns
Type:

TypeExpr

This field can contain one of the following nodes: AnonymousType, SubtypeIndication

This field may be null even when there are no parsing errors.

5.4.1.1.355. SubtypeDecl

Derives from: BaseSubtypeDecl

Fields

SubtypeDecl.f_subtype
Type:

SubtypeIndication

When there are no parsing errors, this field is never null.

5.4.1.1.356. SubtypeIndication

Derives from: TypeExpr

Derived by: ConstrainedSubtypeIndication, DiscreteSubtypeIndication

Fields

SubtypeIndication.f_has_not_null
Type:

NotNull

When there are no parsing errors, this field is never null.

SubtypeIndication.f_name
Type:

Name

This field can contain one of the following nodes: AttributeRef, CharLiteral, DottedName, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

SubtypeIndication.f_constraint
Type:

Constraint

This field may be null even when there are no parsing errors.

Properties

SubtypeIndication.p_is_static_subtype(impreciseFallback: Bool)
Returns:

Bool

Returns whether self denotes a static subtype or not (i.e. determinable at compile time, see ARM 4.9).

5.4.1.1.357. Subunit

Derives from: AdaNode

Fields

Subunit.f_name
Type:

Name

This field can contain one of the following nodes: CharLiteral, DottedName, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

Subunit.f_body
Type:

BodyNode

This field can contain one of the following nodes: PackageBody, ProtectedBody, SubpBody, TaskBody

When there are no parsing errors, this field is never null.

Properties

Subunit.p_body_root()
Returns:

BasicDecl

Return the body in which this subunit is rooted.

5.4.1.1.358. SynchronizedAbsent

Derives from: SynchronizedNode

5.4.1.1.359. SynchronizedNode (abstract)

Derives from: AdaNode

Derived by: SynchronizedAbsent, SynchronizedPresent

Properties

SynchronizedNode.p_as_bool()
Returns:

Bool

Return whether this node is present

5.4.1.1.360. SynchronizedPresent

Derives from: SynchronizedNode

5.4.1.1.361. SynthAnonymousTypeDecl

Derives from: AnonymousTypeDecl

5.4.1.1.362. SyntheticBinarySpec

Derives from: BaseSubpSpec

Fields

SyntheticBinarySpec.f_left_param
Type:

SyntheticFormalParamDecl

When there are no parsing errors, this field is never null.

SyntheticBinarySpec.f_right_param
Type:

SyntheticFormalParamDecl

When there are no parsing errors, this field is never null.

SyntheticBinarySpec.f_return_type_expr
Type:

TypeExpr

This field may be null even when there are no parsing errors.

5.4.1.1.363. SyntheticCharEnumLit

Derives from: EnumLiteralDecl

Properties

SyntheticCharEnumLit.p_expr()
Returns:

DefiningName

Return the CharLiteral expression corresponding to this enum literal.

5.4.1.1.364. SyntheticDefiningName

Derives from: DefiningName

5.4.1.1.365. SyntheticFormalParamDecl

Derives from: BaseFormalParamDecl

Fields

SyntheticFormalParamDecl.f_param_type
Type:

TypeExpr

When there are no parsing errors, this field is never null.

5.4.1.1.366. SyntheticIdentifier

Derives from: Name

5.4.1.1.367. SyntheticObjectDecl

Derives from: BasicDecl

5.4.1.1.368. SyntheticRenamingClause

Derives from: RenamingClause

5.4.1.1.369. SyntheticSubpDecl

Derives from: BasicSubpDecl

Fields

SyntheticSubpDecl.f_spec
Type:

BaseSubpSpec

This field can contain one of the following nodes: SyntheticBinarySpec, SyntheticUnarySpec

When there are no parsing errors, this field is never null.

5.4.1.1.370. SyntheticTypeExpr

Derives from: TypeExpr

5.4.1.1.371. SyntheticUnarySpec

Derives from: BaseSubpSpec

Fields

SyntheticUnarySpec.f_right_param
Type:

SyntheticFormalParamDecl

When there are no parsing errors, this field is never null.

SyntheticUnarySpec.f_return_type_expr
Type:

SyntheticTypeExpr

When there are no parsing errors, this field is never null.

5.4.1.1.372. TaggedAbsent

Derives from: TaggedNode

5.4.1.1.373. TaggedNode (abstract)

Derives from: AdaNode

Derived by: TaggedAbsent, TaggedPresent

Properties

TaggedNode.p_as_bool()
Returns:

Bool

Return whether this node is present

5.4.1.1.374. TaggedPresent

Derives from: TaggedNode

5.4.1.1.375. TargetName

Derives from: Name

5.4.1.1.376. TaskBody

Derives from: BodyNode

Fields

TaskBody.f_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

TaskBody.f_decls
Type:

DeclarativePart

When there are no parsing errors, this field is never null.

TaskBody.f_stmts
Type:

HandledStmts

When there are no parsing errors, this field is never null.

TaskBody.f_end_name
Type:

EndName

This field may be null even when there are no parsing errors.

5.4.1.1.377. TaskBodyStub

Derives from: BodyStub

Fields

TaskBodyStub.f_name
Type:

DefiningName

When there are no parsing errors, this field is never null.

5.4.1.1.378. TaskDef

Derives from: AdaNode

Fields

TaskDef.f_interfaces
Type:

ParentList

This field contains a list that itself contains one of the following nodes: CharLiteral, DottedName, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

TaskDef.f_public_part
Type:

PublicPart

When there are no parsing errors, this field is never null.

TaskDef.f_private_part
Type:

PrivatePart

This field may be null even when there are no parsing errors.

TaskDef.f_end_name
Type:

EndName

This field may be null even when there are no parsing errors.

5.4.1.1.379. TaskTypeDecl

Derives from: BaseTypeDecl

Derived by: SingleTaskTypeDecl

Fields

TaskTypeDecl.f_discriminants
Type:

DiscriminantPart

This field may be null even when there are no parsing errors.

TaskTypeDecl.f_definition
Type:

TaskDef

This field may be null even when there are no parsing errors.

5.4.1.1.380. TerminateAlternative

Derives from: SimpleStmt

5.4.1.1.381. ThenAbortPart

Derives from: AdaNode

Fields

ThenAbortPart.f_stmts
Type:

StmtList

This field contains a list that itself contains one of the following nodes: PragmaNode, Stmt

When there are no parsing errors, this field is never null.

5.4.1.1.382. TypeAccessDef

Derives from: BaseTypeAccessDef

Fields

TypeAccessDef.f_has_all
Type:

AllNode

When there are no parsing errors, this field is never null.

TypeAccessDef.f_has_constant
Type:

ConstantNode

When there are no parsing errors, this field is never null.

TypeAccessDef.f_subtype_indication
Type:

SubtypeIndication

When there are no parsing errors, this field is never null.

5.4.1.1.383. TypeAttributesRepository

Derives from: AdaNode

5.4.1.1.384. TypeDecl (abstract)

Derives from: BaseTypeDecl

Derived by: AnonymousTypeDecl, ConcreteTypeDecl, FormalTypeDecl

Fields

TypeDecl.f_discriminants
Type:

DiscriminantPart

This field may be null even when there are no parsing errors.

TypeDecl.f_type_def
Type:

TypeDef

When there are no parsing errors, this field is never null.

5.4.1.1.385. TypeDef (abstract)

Derives from: AdaNode

Derived by: AccessDef, ArrayTypeDef, DerivedTypeDef, EnumTypeDef, FormalDiscreteTypeDef, InterfaceTypeDef, ModIntTypeDef, PrivateTypeDef, RealTypeDef, RecordTypeDef, SignedIntTypeDef

5.4.1.1.386. TypeExpr (abstract)

Derives from: AdaNode

Derived by: AnonymousType, EnumLitSynthTypeExpr, SubtypeIndication, SyntheticTypeExpr

Properties

TypeExpr.p_type_name()
Returns:

Name

Return the name node for this type expression, if applicable, else null

TypeExpr.p_designated_type_decl()
Returns:

BaseTypeDecl

Returns the type declaration designated by this type expression.

TypeExpr.p_designated_type_decl_from(originNode: AdaNode)
Returns:

BaseTypeDecl

Return the type declaration designated by this type expression as viewed from the node given by origin_node.

TypeExpr.p_subtype_constraint(origin: AdaNode)
Returns:

Constraint

Return the constraint that this type expression defines on its designated subtype, if any.

Origin: Origin for this property’s request. See The origin parameter for more details.

TypeExpr.p_discriminant_constraints()
Returns:

List[ParamActual]

If this type expression designates a constrained discriminated type, return an array of pairs, associating each discriminant to its actual or default expression.

TypeExpr.p_is_definite_subtype()
Returns:

Bool

Returns whether this designates a definite subtype.

TypeExpr.p_is_statically_constrained()
Returns:

Bool

Returns whether this designates a statically constrained subtype.

5.4.1.1.387. UnOp

Derives from: Expr

Fields

UnOp.f_op
Type:

Op

This field can contain one of the following nodes: OpAbs, OpMinus, OpNot, OpPlus

When there are no parsing errors, this field is never null.

UnOp.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.388. UnconstrainedArrayIndex

Derives from: AdaNode

Fields

UnconstrainedArrayIndex.f_subtype_name
Type:

Name

This field can contain one of the following nodes: AttributeRef, CharLiteral, DottedName, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

UnconstrainedArrayIndex.f_lower_bound
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

This field may be null even when there are no parsing errors.

5.4.1.1.389. UnconstrainedArrayIndexList

Derives from: AdaList

5.4.1.1.390. UnconstrainedArrayIndices

Derives from: ArrayIndices

Fields

UnconstrainedArrayIndices.f_types
Type:

UnconstrainedArrayIndexList

When there are no parsing errors, this field is never null.

5.4.1.1.391. UnknownDiscriminantPart

Derives from: DiscriminantPart

5.4.1.1.392. UntilAbsent

Derives from: UntilNode

5.4.1.1.393. UntilNode (abstract)

Derives from: AdaNode

Derived by: UntilAbsent, UntilPresent

Properties

UntilNode.p_as_bool()
Returns:

Bool

Return whether this node is present

5.4.1.1.394. UntilPresent

Derives from: UntilNode

5.4.1.1.395. UpdateAttributeRef

Derives from: Name

Fields

UpdateAttributeRef.f_prefix
Type:

Name

This field can contain one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

UpdateAttributeRef.f_attribute
Type:

Identifier

When there are no parsing errors, this field is never null.

UpdateAttributeRef.f_values
Type:

BaseAggregate

When there are no parsing errors, this field is never null.

5.4.1.1.396. UseClause (abstract)

Derives from: AdaNode

Derived by: UsePackageClause, UseTypeClause

5.4.1.1.397. UsePackageClause

Derives from: UseClause

Fields

UsePackageClause.f_packages
Type:

NameList

This field contains a list that itself contains one of the following nodes: CharLiteral, DottedName, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

5.4.1.1.398. UseTypeClause

Derives from: UseClause

Fields

UseTypeClause.f_has_all
Type:

AllNode

When there are no parsing errors, this field is never null.

UseTypeClause.f_types
Type:

NameList

This field contains a list that itself contains one of the following nodes: AttributeRef, CallExpr, CharLiteral, DottedName, ExplicitDeref, Identifier, QualExpr, ReduceAttributeRef, StringLiteral, TargetName, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.399. ValueSequence

Derives from: AdaNode

Fields

ValueSequence.f_iter_assoc
Type:

IteratedAssoc

When there are no parsing errors, this field is never null.

5.4.1.1.400. Variant

Derives from: AdaNode

Fields

Variant.f_choices
Type:

AlternativesList

This field contains a list that itself contains one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DiscreteSubtypeIndication, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, OthersDesignator, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

Variant.f_components
Type:

ComponentList

When there are no parsing errors, this field is never null.

5.4.1.1.401. VariantList

Derives from: AdaList

5.4.1.1.402. VariantPart

Derives from: AdaNode

Fields

VariantPart.f_discr_name
Type:

Identifier

When there are no parsing errors, this field is never null.

VariantPart.f_variant
Type:

VariantList

When there are no parsing errors, this field is never null.

5.4.1.1.403. WhileLoopSpec

Derives from: LoopSpec

Fields

WhileLoopSpec.f_expr
Type:

Expr

This field can contain one of the following nodes: Allocator, AttributeRef, BaseAggregate, BinOp, CallExpr, CharLiteral, ConcatOp, CondExpr, DeclExpr, DottedName, ExplicitDeref, FormatStringLiteral, Identifier, MembershipExpr, NullLiteral, NumLiteral, ParenExpr, QualExpr, QuantifiedExpr, RaiseExpr, ReduceAttributeRef, StringLiteral, TargetName, UnOp, UpdateAttributeRef

When there are no parsing errors, this field is never null.

5.4.1.1.404. WhileLoopStmt

Derives from: BaseLoopStmt

5.4.1.1.405. WithClause

Derives from: AdaNode

Fields

WithClause.f_has_limited
Type:

LimitedNode

When there are no parsing errors, this field is never null.

WithClause.f_has_private
Type:

PrivateNode

When there are no parsing errors, this field is never null.

WithClause.f_packages
Type:

NameList

This field contains a list that itself contains one of the following nodes: CharLiteral, DottedName, Identifier, StringLiteral

When there are no parsing errors, this field is never null.

5.4.1.1.406. WithPrivate (abstract)

Derives from: AdaNode

Derived by: WithPrivateAbsent, WithPrivatePresent

Properties

WithPrivate.p_as_bool()
Returns:

Bool

Return whether this node is present

5.4.1.1.407. WithPrivateAbsent

Derives from: WithPrivate

5.4.1.1.408. WithPrivatePresent

Derives from: WithPrivate

5.4.1.2. Symbol types

5.4.1.2.1. AnalysisUnitKind

Specify a kind of analysis unit. Specification units provide an interface to the outer world while body units provide an implementation for the corresponding interface.

Values: unit_specification, unit_body

5.4.1.2.2. CallExprKind

Kind of CallExpr type.

  • call is when the CallExpr is a procedure or function call.

  • array_slice, array_index is when the CallExpr is in fact an array slice or an array subcomponent access expression, respectively.

  • type_conversion is when the CallExpr is a type conversion.

  • family_index is for entry calls using a family index.

Values: call, array_slice, array_index, type_conversion, family_index, generalized_indexing

5.4.1.2.3. CompletionItemKind

Type of completion item. Refer to the official LSP specification.

Values: text_kind, method_kind, function_kind, constructor_kind, field_kind, variable_kind, class_kind, interface_kind, module_kind, property_kind, unit_kind, value_kind, enum_kind, keyword_kind, snippet_kind, color_kind, file_kind, reference_kind, folder_kind, enum_member_kind, constant_kind, struct_kind, event_kind, operator_kind, type_parameter_kind

5.4.1.2.4. DesignatedEnvKind

Discriminant for DesignatedEnv structures.

Values: none, current_env, named_env, direct_env

5.4.1.2.5. GrammarRule

Gramar rule to use for parsing.

Values: parent_list_rule, protected_type_decl_rule, protected_op_rule, protected_el_rule, protected_def_rule, protected_decl_rule, task_item_rule, task_def_rule, task_type_decl_rule, subtype_decl_rule, interface_type_def_rule, unconstrained_index_rule, array_type_def_rule, discrete_subtype_definition_rule, constraint_list_rule, signed_int_type_def_rule, mod_int_type_def_rule, derived_type_def_rule, composite_constraint_assoc_rule, composite_constraint_rule, digits_constraint_rule, delta_constraint_rule, range_constraint_rule, constraint_rule, discriminant_spec_rule, discr_spec_list_rule, discriminant_part_rule, enum_literal_decl_rule, formal_discrete_type_def_rule, record_def_rule, range_spec_rule, real_type_def_rule, sexpr_or_box_rule, ordinary_fixed_point_def_rule, decimal_fixed_point_def_rule, floating_point_def_rule, record_type_def_rule, access_def_rule, enum_type_def_rule, type_def_rule, variant_rule, anonymous_type_decl_rule, incomplete_type_decl_rule, type_decl_rule, variant_part_rule, component_def_rule, component_item_rule, component_decl_rule, component_list_rule, generic_decl_rule, generic_formal_part_rule, generic_formal_decl_rule, formal_type_decl_rule, formal_subp_decl_rule, renaming_clause_rule, generic_renaming_decl_rule, generic_instantiation_rule, exception_decl_rule, basic_decls_rule, package_renaming_decl_rule, package_decl_rule, basic_decl_rule, object_decl_rule, sub_object_decl_rule, no_type_object_renaming_decl_rule, ext_ret_stmt_object_decl_rule, defining_id_list_rule, number_decl_rule, contract_case_assoc_rule, contract_cases_expr_rule, abstract_state_decl_rule, multi_abstract_state_decl_rule, aspect_assoc_rule, aspect_spec_rule, single_task_decl_rule, overriding_indicator_rule, entry_decl_rule, component_clause_rule, aspect_clause_rule, param_spec_rule, param_specs_rule, subp_spec_rule, expr_fn_rule, null_subp_decl_rule, abstract_subp_decl_rule, subp_renaming_decl_rule, simple_subp_decl_rule, subp_decl_rule, with_clause_rule, context_item_rule, use_clause_rule, use_package_clause_rule, use_type_clause_rule, subtype_indication_rule, discrete_subtype_indication_rule, constrained_subtype_indication_rule, type_expr_rule, anonymous_type_rule, mode_rule, pragma_argument_rule, pragma_rule, subunit_rule, library_unit_body_rule, library_unit_renaming_decl_rule, library_item_rule, compilation_unit_rule, compilation_rule, decl_part_rule, entry_body_rule, protected_body_rule, protected_body_stub_rule, task_body_rule, task_body_stub_rule, package_body_stub_rule, package_body_rule, terminate_alternative_rule, select_stmt_rule, accept_stmt_rule, case_alt_rule, case_stmt_rule, ext_return_stmt_rule, iblock_stmt_rule, block_stmt_rule, while_loop_spec_rule, iloop_stmt_rule, loop_stmt_rule, compound_stmt_rule, elsif_part_rule, if_stmt_rule, raise_stmt_rule, delay_stmt_rule, abort_stmt_rule, body_rule, body_stub_rule, subp_body_stub_rule, recov_decl_part_rule, subp_body_rule, handled_stmts_rule, exception_handler_rule, stmts_rule, label_rule, stmt_rule, call_stmt_rule, simple_stmt_rule, simple_decl_stmt_rule, null_stmt_rule, assignment_stmt_rule, goto_stmt_rule, exit_stmt_rule, return_stmt_rule, requeue_stmt_rule, identifier_rule, char_literal_rule, string_literal_rule, format_string_literal_rule, defining_id_rule, dec_literal_rule, int_literal_rule, num_literal_rule, null_literal_rule, allocator_rule, for_loop_param_spec_rule, quantified_expr_rule, case_expr_rule, case_expr_alt_rule, raise_expr_rule, if_expr_rule, conditional_expr_rule, box_expr_rule, others_designator_rule, iterated_assoc_rule, aggregate_assoc_rule, regular_aggregate_rule, bracket_aggregate_rule, aggregate_rule, direct_name_rule, param_assoc_rule, call_suffix_rule, attr_suffix_rule, qualified_name_rule, qual_name_internal_rule, value_sequence_rule, name_rule, defining_name_rule, direct_name_or_target_name_rule, target_name_rule, update_attr_aggregate_rule, update_attr_content_rule, multidim_array_assoc_rule, subtype_name_rule, static_name_rule, primary_rule, paren_expr_rule, declare_expr_rule, factor_rule, term_rule, unop_term_rule, add_term_rule, simple_expr_rule, boolean_op_rule, discrete_range_rule, array_subcomponent_choice_rule, choice_rule, choice_list_rule, delta_choice_list_rule, rel_op_rule, membership_choice_rule, membership_choice_list_rule, relation_rule, expr_rule, pp_directive_rule, pp_then_rule, pp_expr_rule, pp_term_rule

5.4.1.2.6. LookupKind

Values: recursive, flat, minimal

5.4.1.2.7. RefResultKind

Kind for the result of a cross reference operation.

  • no_ref is for no reference, it is the null value for this enum.

  • precise is when the reference result is precise.

  • imprecise is when there was an error computing the precise result, and a result was gotten in an imprecise fashion.

  • error is for unrecoverable errors (either there is no imprecise path for the request you made, or the imprecise path errored out too).

Values: no_ref, precise, imprecise, error

5.4.1.3. List types

5.4.1.3.1. List[AcceptStmt]

List of AcceptStmt

5.4.1.3.2. List[AdaNode]

List of AdaNode

5.4.1.3.3. List[AnalysisUnit]

List of AnalysisUnit

5.4.1.3.4. List[Aspect]

List of Aspect

5.4.1.3.5. List[BaseFormalParamDecl]

List of BaseFormalParamDecl

5.4.1.3.6. List[BaseTypeDecl]

List of BaseTypeDecl

5.4.1.3.7. List[BasicDecl]

List of BasicDecl

5.4.1.3.8. List[CompilationUnit]

List of CompilationUnit

5.4.1.3.9. List[DefiningName]

List of DefiningName

5.4.1.3.10. List[DiscriminantValues]

List of DiscriminantValues

5.4.1.3.11. List[DocAnnotation]

List of DocAnnotation

5.4.1.3.12. List[EvalDiscreteRange]

List of EvalDiscreteRange

5.4.1.3.13. List[Expr]

List of Expr

5.4.1.3.14. List[GenericInstantiation]

List of GenericInstantiation

5.4.1.3.15. List[LogicContext]

List of LogicContext

5.4.1.3.16. List[ParamActual]

List of ParamActual

5.4.1.3.17. List[ParamSpec]

List of ParamSpec

5.4.1.3.18. List[PragmaNode]

List of PragmaNode

5.4.1.3.19. List[RefResult]

List of RefResult

5.4.1.3.20. List[Shape]

List of Shape

5.4.1.3.21. List[SolverDiagnostic]

List of SolverDiagnostic

5.4.1.3.22. List[Substitution]

List of Substitution

5.4.1.3.23. List[Symbol]

List of Symbol

5.4.1.3.24. List[TypeDecl]

List of TypeDecl

5.4.1.4. Object types

5.4.1.4.1. Aspect

Composite field representing the aspect of an entity (ARM 13).

Fields

Aspect.exists
Type:

Bool

Whether the aspect is defined or not

Aspect.node
Type:

AdaNode

Syntactic node that defines the aspect

Aspect.value
Type:

Expr

Expr node defining the value of the aspect

Aspect.inherited
Type:

Bool

Whether the aspect is inherited (it has been defined by a parent)

5.4.1.4.2. CompletionItem

Fields

CompletionItem.decl
Type:

BasicDecl

CompletionItem.is_dot_call
Type:

Bool

CompletionItem.is_visible
Type:

Bool

CompletionItem.weight
Type:

Int

The higher the weight, the more relevant the completion item is

5.4.1.4.3. DiscreteRange

Represent the range of a discrete type or subtype. The bounds are not evaluated, you need to call eval_as_int on them, if they’re static, to get their value.

Fields

DiscreteRange.range_type
Type:

BaseTypeDecl

DiscreteRange.low_bound
Type:

Expr

DiscreteRange.high_bound
Type:

Expr

5.4.1.4.4. DiscriminantValues

Represent a set of values (as a list of choices) on a discriminant.

Fields

DiscriminantValues.discriminant
Type:

Identifier

DiscriminantValues.values
Type:

AlternativesList

5.4.1.4.5. DocAnnotation

Documentation annotation.

Fields

DocAnnotation.key
Type:

Str

Annotation key

DocAnnotation.value
Type:

Str

Annotation value

5.4.1.4.6. EvalDiscreteRange

Represent the range of a discrete type or subtype. The bounds are already evaluated, so the type of the fields is BigInt.

Fields

EvalDiscreteRange.low_bound
Type:

Int

EvalDiscreteRange.high_bound
Type:

Int

5.4.1.4.7. LogicContext

Describes an interpretation of a reference. Can be attached to logic atoms (e.g. Binds) to indicate under which interpretation this particular atom was produced, which can in turn be used to produce informative diagnostics for resolution failures.

Fields

LogicContext.ref_node
Type:

AdaNode

LogicContext.decl_node
Type:

AdaNode

5.4.1.4.8. ParamActual

Data structure used by zip_with_params, Name.call_params, GenericInstantiation.inst_params, BaseAggregate.aggregate_params, SubtypeIndication.subtype_constraints, and EnumRepClause.params properties. Associates an expression (the actual) to a formal param declaration (the parameter).

Fields

ParamActual.param
Type:

DefiningName

ParamActual.actual
Type:

Expr

5.4.1.4.9. RefResult

Result for a cross reference query returning a reference.

Fields

RefResult.ref
Type:

BaseId

RefResult.kind
Type:

RefResultKind

5.4.1.4.10. RefdDecl

Result for a cross reference query returning a referenced decl.

Fields

RefdDecl.decl
Type:

BasicDecl

RefdDecl.def_name
Type:

DefiningName

RefdDecl.kind
Type:

RefResultKind

5.4.1.4.11. Shape

Represent one of the shapes that a variant record can have, as a list of the available components.

Fields

Shape.components
Type:

List[BaseFormalParamDecl]

Shape.discriminants_values
Type:

List[DiscriminantValues]

5.4.1.4.12. SolverDiagnostic

A raw diagnostic produced by a solver resolution failure. This contains as much information as possible to allow formatters down the chain to filter/choose which diagnostics to show among a set of diagnostics produced for a single equation.

  • Message_Template is a string explaining the error, which may contain holes represented by the {} characters. Literal opening braces are encoded as {{.

  • Args is an array of nodes, which are to be plugged in the holes of the template in the same order (i.e. the first argument goes into the first hole of the template, etc.).

  • Location is a node which indicates the location of the error.

  • Contexts is the array of contexts that were deemed relevant for this error.

  • Round is the solver round during which this diagnostic was emitted.

Fields

SolverDiagnostic.message_template
Type:

Str

SolverDiagnostic.args
Type:

List[AdaNode]

SolverDiagnostic.location
Type:

AdaNode

SolverDiagnostic.contexts
Type:

List[LogicContext]

SolverDiagnostic.round
Type:

Int

5.4.1.4.13. Substitution

Represent a substitution of a BasicDecl by a given value. This can then be used as part of an environment in the eval_as_*_in_env property. See the declaration of those properties for more details.

Fields

Substitution.from_decl
Type:

BasicDecl

The declaration to substitute.

Substitution.to_value
Type:

Int

The value by which to substitute the declaration.

Substitution.value_type
Type:

BaseTypeDecl

The type of the substituted value.

5.4.1.5. The origin parameter

Several Libadalang properties accept an origin parameter of type AdaNode. This parameter specifies the node from which the property is evaluated, allowing Libadalang to apply Ada visibility rules correctly: a declaration that is visible from one location in a program may not be visible from another. For example, BasicDecl.p_most_visible_part uses origin to determine which part of a declaration is visible from the call site.

For more details, see the Libadalang user guide.

5.4.2. Standard library

5.4.2.1. Builtin functions

base_name(file_name)

Given a string that represents a file name, returns the basename

concat(list)

Given a list, return the result of the concatenation of all its elements

context()

Return the analysis context used to parse units

doc(function)

Given any object, return the documentation associated with it

document_builtins()

Return a string in the RsT format containing documentation for all built-ins

get_unit(name, kind)

Use the context unit provider to get the analysis unit matching the provided name and kind

help(callable)

Print formatted help for the given object

img(string)

Return a string representation of an object

nil()

Return an empty stream

node_checker(root)

Given a root, execute all node checkers while traversing the tree

pattern(regex, case_sensitive)

Given a regex pattern string, create a pattern object

print(to_print, new_line)

Built-in print function. Prints the argument

profile(callable)

Given any object, if it is a callable, return its profile as text

reduce(iterable, function, init_value)

Given a collection, a reduction function, and an initial value reduce the result

repeat(times, function)

Call the given function N times

specified_units()

Return a list of units specified by the user

unique(iterable)

Given a collection, create a list with all duplicates removed

unit_checker(unit)

Given a unit, apply all the unit checkers on it

units()

Return a list of all units

5.4.2.2. Builtin methods

5.4.2.2.1. Methods for AnalysisUnit
AnalysisUnit.doc(this)

Given any object, return the documentation associated with it

AnalysisUnit.help(this)

Print formatted help for the given object

AnalysisUnit.img(this)

Return a string representation of an object

AnalysisUnit.name(this)

Return the name for this unit

AnalysisUnit.print(this)

Built-in print function. Prints the argument

AnalysisUnit.root(this)

Return the root for this unit

AnalysisUnit.text(this)

Return the text for this unit

AnalysisUnit.tokens(this)

Return the tokens for this unit

5.4.2.2.2. Methods for Bool
Bool.doc(this)

Given any object, return the documentation associated with it

Bool.help(this)

Print formatted help for the given object

Bool.img(this)

Return a string representation of an object

Bool.print(this)

Built-in print function. Prints the argument

5.4.2.2.3. Methods for Function
Function.doc(this)

Given any object, return the documentation associated with it

Function.help(this)

Print formatted help for the given object

Function.img(this)

Return a string representation of an object

Function.print(this)

Built-in print function. Prints the argument

5.4.2.2.4. Methods for Int
Int.doc(this)

Given any object, return the documentation associated with it

Int.help(this)

Print formatted help for the given object

Int.img(this)

Return a string representation of an object

Int.print(this)

Built-in print function. Prints the argument

5.4.2.2.5. Methods for List
List.all(this, predicate)

Given a collection and a predicate, returns true if all elements satisfies the predicate.

List.any(this, predicate)

Given a collection and a predicate, returns true if any element satisfies the predicate.

List.combine(this, right, recursive)

Combine two LKQL values if possible and return the result, recursively if required

List.doc(this)

Given any object, return the documentation associated with it

List.enumerate(this)

Return the content of the iterable object with each element associated to its index in a tuple: [(<index>, <elem>), …]

List.flat_map(this, function)

Given an iterable and a function that takes one argument and return another iterable value, return a new iterable, result of the function application on all elements, flatten in a sole iterable value. The returned iterable value is lazy.

List.flatten(this)

Given an iterable of iterables, flatten all of them in a resulting iterable value. The returned value is lazy.

List.help(this)

Print formatted help for the given object

List.img(this)

Return a string representation of an object

List.length(this)

Return the length of the list

List.map(this, function)

Given an iterable and a function that takes one argument and return a value, return a new iterable, result of the application of the function on all iterable elements. The returned iterable value is lazy.

List.print(this)

Built-in print function. Prints the argument

List.reduce(this, function, init_value)

Given a collection, a reduction function, and an initial value reduce the result

List.sublist(this, low, high)

Return a sublist of list from low_bound to high_bound

List.to_list(this)

Transform into a list. WARNING: This may never return in case of an infinite stream.

List.to_stream(this)

Transform into a stream

List.unique(this)

Given a collection, create a list with all duplicates removed

5.4.2.2.6. Methods for MemberReference
MemberReference.doc(this)

Given any object, return the documentation associated with it

MemberReference.help(this)

Print formatted help for the given object

MemberReference.img(this)

Return a string representation of an object

MemberReference.print(this)

Built-in print function. Prints the argument

5.4.2.2.7. Methods for Namespace
Namespace.doc(this)

Given any object, return the documentation associated with it

Namespace.help(this)

Print formatted help for the given object

Namespace.img(this)

Return a string representation of an object

Namespace.print(this)

Built-in print function. Prints the argument

5.4.2.2.8. Methods for Node
Node.children(this)

Return the node’s children

Node.children_count(this)

Return the node’s children count

Node.doc(this)

Given any object, return the documentation associated with it

Node.dump(this)

Dump the node’s content in a structured tree

Node.help(this)

Print formatted help for the given object

Node.image(this)

Return the node’s image

Node.img(this)

Return a string representation of an object

Node.kind(this)

Return the node’s kind

Node.parent(this)

Return the node’s parent

Node.print(this)

Built-in print function. Prints the argument

Node.same_tokens(this, right_node)

Return whether two nodes have the same tokens, ignoring trivias

Node.text(this)

Return the node’s text

Node.tokens(this)

Return the node’s tokens

Node.unit(this)

Return the node’s analysis unit

5.4.2.2.9. Methods for Object
Object.combine(this, right, recursive)

Combine two LKQL values if possible and return the result, recursively if required

Object.doc(this)

Given any object, return the documentation associated with it

Object.help(this)

Print formatted help for the given object

Object.img(this)

Return a string representation of an object

Object.print(this)

Built-in print function. Prints the argument

5.4.2.2.10. Methods for Pattern
Pattern.doc(this)

Given any object, return the documentation associated with it

Pattern.help(this)

Print formatted help for the given object

Pattern.img(this)

Return a string representation of an object

Pattern.print(this)

Built-in print function. Prints the argument

5.4.2.2.11. Methods for PropertyReference
PropertyReference.doc(this)

Given any object, return the documentation associated with it

PropertyReference.help(this)

Print formatted help for the given object

PropertyReference.img(this)

Return a string representation of an object

PropertyReference.print(this)

Built-in print function. Prints the argument

5.4.2.2.12. Methods for RecValue
RecValue.doc(this)

Given any object, return the documentation associated with it

RecValue.help(this)

Print formatted help for the given object

RecValue.img(this)

Return a string representation of an object

RecValue.print(this)

Built-in print function. Prints the argument

5.4.2.2.13. Methods for RewritingContext
RewritingContext.add_first(this, node, new_node)

Insert new_node at the beginning of list_node

RewritingContext.add_last(this, node, new_node)

Insert new_node at the end of list_node

RewritingContext.create_from_template(this, template, grammar_rule, arguments)

Create a new node from the provided template, filling ‘{}’ with provided argument, and parsing the template with the specified grammar rule. Example:

# Create a new BinOp node with OpAdd as operator, representing the addition of the value
# expressed by `my_other_node`, and "42".
ctx.create_from_template(
    "{} + 42",
    "expr_rule",
    [my_other_node]
)
RewritingContext.doc(this)

Given any object, return the documentation associated with it

RewritingContext.help(this)

Print formatted help for the given object

RewritingContext.img(this)

Return a string representation of an object

RewritingContext.insert_after(this, node, new_node)

Insert new_node after node (node’s parent needs to be a list node)

RewritingContext.insert_before(this, node, new_node)

Insert new_node before node (node’s parent needs to be a list node)

RewritingContext.print(this)

Built-in print function. Prints the argument

RewritingContext.remove(this, obj_to_remove)

Delete the given node from its parent (parent needs to be a list node)

RewritingContext.replace(this, old_node, new_node)

Replace old node by the new one

RewritingContext.set_child(this, node, member_ref, new_value)

Set the node child, following the given member reference, to the new value

5.4.2.2.14. Methods for RewritingNode
RewritingNode.clone(this)

Given a rewriting node, clone it and return its copy

RewritingNode.doc(this)

Given any object, return the documentation associated with it

RewritingNode.help(this)

Print formatted help for the given object

RewritingNode.img(this)

Return a string representation of an object

RewritingNode.print(this)

Built-in print function. Prints the argument

5.4.2.2.15. Methods for Str
Str.base_name(this)

Given a string that represents a file name, returns the basename

Str.combine(this, right, recursive)

Combine two LKQL values if possible and return the result, recursively if required

Str.contains(this, to_find)

Search for to_find in the given string. Return whether a match is found. to_find can be either a pattern or a string

Str.doc(this)

Given any object, return the documentation associated with it

Str.ends_with(this, suffix)

Returns whether string ends with given prefix

Str.find(this, to_find)

Search for to_find in the given string. Return position of the match, or -1 if no match. to_find can be either a pattern or a string

Str.help(this)

Print formatted help for the given object

Str.img(this)

Return a string representation of an object

Str.is_lower_case(this)

Return whether the string is in lowercase

Str.is_mixed_case(this)

Return whether the given string is written in mixed case, that is, with only lower case characters except the first one and every character following an underscore

Str.is_upper_case(this)

Return whether the string is in uppercase

Str.length(this)

Return the string’s length

Str.print(this)

Built-in print function. Prints the argument

Str.split(this, sep)

Given a string, split it on the given separator, and return an iterator on the parts

Str.starts_with(this, prefix)

Returns whether string starts with given prefix

Str.substring(this, start, end)

Given a string and two indices (from and to), return the substring contained between indices from and to (both included)

Str.to_lower_case(this)

Return the string in lowercase

Str.to_upper_case(this)

Return the string in uppercase

5.4.2.2.16. Methods for Stream
Stream.all(this, predicate)

Given a collection and a predicate, returns true if all elements satisfies the predicate.

Stream.any(this, predicate)

Given a collection and a predicate, returns true if any element satisfies the predicate.

Stream.doc(this)

Given any object, return the documentation associated with it

Stream.enumerate(this)

Return the content of the iterable object with each element associated to its index in a tuple: [(<index>, <elem>), …]

Stream.flat_map(this, function)

Given an iterable and a function that takes one argument and return another iterable value, return a new iterable, result of the function application on all elements, flatten in a sole iterable value. The returned iterable value is lazy.

Stream.flatten(this)

Given an iterable of iterables, flatten all of them in a resulting iterable value. The returned value is lazy.

Stream.head(this)

Return the head of the stream.

Stream.head_or(this, default_val)

Given a default value, return the head of the stream or the default value if the stream is empty.

Stream.help(this)

Print formatted help for the given object

Stream.img(this)

Return a string representation of an object

Stream.length(this)

Return the length of the stream. WARNING: This may never return in case of an infinite stream.

Stream.map(this, function)

Given an iterable and a function that takes one argument and return a value, return a new iterable, result of the application of the function on all iterable elements. The returned iterable value is lazy.

Stream.print(this)

Built-in print function. Prints the argument

Stream.reduce(this, function, init_value)

Given a collection, a reduction function, and an initial value reduce the result

Stream.tail(this)

Return the tail of the stream.

Stream.to_list(this)

Transform into a list. WARNING: This may never return in case of an infinite stream.

Stream.to_stream(this)

Transform into a stream

Stream.unique(this)

Given a collection, create a list with all duplicates removed

5.4.2.2.17. Methods for Token
Token.doc(this)

Given any object, return the documentation associated with it

Token.end_column(this)

Return the end column

Token.end_line(this)

Return the end line

Token.help(this)

Print formatted help for the given object

Token.img(this)

Return a string representation of an object

Token.is_equivalent(this, other)

Return whether two tokens are structurally equivalent

Token.is_trivia(this)

Return whether this token is a trivia

Token.kind(this)

Return the kind for this token

Token.next(this, ignore_trivia)

Return the next token

Token.previous(this, exclude_trivia)

Return the previous token

Token.print(this)

Built-in print function. Prints the argument

Token.start_column(this)

Return the start column

Token.start_line(this)

Return the start line

Token.text(this)

Return the text for this token

Token.unit(this)

Return the unit for this token

5.4.2.2.18. Methods for Tuple
Tuple.doc(this)

Given any object, return the documentation associated with it

Tuple.help(this)

Print formatted help for the given object

Tuple.img(this)

Return a string representation of an object

Tuple.print(this)

Built-in print function. Prints the argument

5.4.2.2.19. Methods for Unit
Unit.doc(this)

Given any object, return the documentation associated with it

Unit.help(this)

Print formatted help for the given object

Unit.img(this)

Return a string representation of an object

Unit.print(this)

Built-in print function. Prints the argument

5.4.3. stdlib’s API doc

5.4.3.1. Functions

all(iterable)

Return whether all elements in the given iterable are truthy

any(iterable)

Return whether at least one element in the given iterable is truthy

children_no_nested(node)

Return all children nodes starting from a base subprogram body, but not entering in nested bodies.

closest_enclosing_generic(n)

If n is part of a generic package or subprogram, whether it is instantiated or not, then return it.

complete_super_types(this, depth, min_depth, max_depth)

Yields the chain of super types of the given type in their most complete view. Hence, for a type T which public view derives from a type A but private view derives from a type B (which itself derives from A), invoking this selector on the public view of T will yield B and then A.

component_types(this, depth, min_depth, max_depth)

Return all the BaseTypeDecl corresponding to all fields of a given type, including their full views, base types and subtypes.

default_bit_order()

Return the value of System.Default_Bit_Order.

depends_on_mutable_discriminant(component_decl)

Given a ComponentDecl, return whether it depends on a mutable discriminant value coming from its parent record declaration. The component depends on a discriminant if it uses it in its subtype constraint or if it is a variant.

enclosing_block(n)

Return the first DeclBlock enclosing n if any, null otherwise.

enclosing_body(n)

Return the first BodyNode enclosing n if any, null otherwise

enclosing_package(n)

Return the first BasePackageDecl or PackageBody enclosing n if any, null otherwise

find_comment(token, name)

Return true if a comment token immediately following the previous “begin” keyword is found and contains only the provided name.

first_non_blank(s, ind=1)

Return the index of the first non blank character of s, starting at ind

full_parent_types(this, depth, min_depth, max_depth)

Return all base (sub)types full views

full_root_type(t)

Return the full view of the root type of t, traversing subtypes, derivations and privacy.

get_formals(subp_spec)

Given a SubpSpec node, return a list of all its formal parameter defining names, each one associated to its ParamSpec node.

get_parameter(params, actual)

Given a List[ParamActual], return the parameter corresponding to actual, null if actual is not found.

get_subp_body(node)

Return the SubpBody, TaskBody or ExprFunction corresponding to node, if any, null otherwise.

has_interfaces(n)

Return true if n is an interface or implements some interfaces

has_local_scope(n)

Return true if n is enclosed in a local scope

has_non_default_sso(decl)

Return true if decl has a Scalar_Storage_Order aspect whose value cannot be determined to be equal to System.Default_Storage_Order.

in_generic_instance(n)

Return true if n is part of a generic instantiation.

in_generic_template(n)

Return true if n is declared as part of a generic template (spec or body). Return false otherwise, including inside a generic instantiation.

is_assert_aspect(s)

Return true if the string s is the name of an assert aspect

is_assert_pragma(s)

Return true if the string s is the name of an assert pragma

is_by_copy(param)

Return true if param (a ParamActual) has a non aliased by-copy type

is_by_ref(param)

Get whether the provided parameter (a ParamActual) type is a by-reference” type as defined in the reference manual at 6.2(4-9).

is_classwide_type(t)

Return true if t is a classwide TypeDecl.

is_composite_type(decl)

Given a BaseTypeDecl, returns whether the declared type is a composite Ada type (record, array, task or protected).

is_constant_object(node)

Return true is node represents a constant object, false otherwise

is_constrained_subtype(type_decl)

Return whether the provided base type declaration declare a constrained type. This function also looks for constrains in parents of the type.

is_constructor(spec)

Return true if spec is a subprogram spec of a constructor, that is, has a controlling result and no controlling parameter.

is_controlling_param_type(t, spec)

Return true if t is a TypeExpr corresponding to a controlling parameter of the subprogram spec spec.

is_in_library_unit_body(o)

Return true if o is located in a library unit body

is_in_package_scope(o)

Return true if o is immediately in the scope of a package spec, body or generic package.

is_limited_type(type)

Return true if type is a limited type. This function expects type to be a BaseTypeDecl.

Warning

This function is deprecated. Call type.p_is_limited_type() instead.

is_local_object(o)

Return true if o represents a local ObjectDecl or ParamSpec

is_negated_op(node)

Return whether node is a “not” unary operation, returning a standard boolean, and having as operand a predefined RelationOp or UnOp with OpNeq as operator.

is_predefined_op(op, follow_renamings=false)

Return true if op is a predefined operator; op can be an Op or a CallExpr.

is_predefined_type(n)

Return true if n is the name of a type declared in a predefined package spec.

is_program_unit(n)

Return true if n is a program unit spec, body or stub

is_standard_boolean(n)

Return true if the root type of n is Standard.Boolean.

is_standard_false(node)

Get whether the given node is a Name representing the False literal of the standard Boolean type, or of any type deriving from it.

is_standard_numeric(n)

Return true if n is the name of a numeric type or subtype in Standard

is_standard_true(node)

Get whether the given node is a Name representing the True literal of the standard Boolean type, or of any type deriving from it.

is_subject_to_predicate(decl)

Return whether the provided declaration is subject to a dynamic or static predicate.

is_subtype_indication_constrained(subtype_indication)

Return whether the provided subtype indication declare constraints.

is_tasking_construct(node)

Returns whether the given node is a construct related to Ada tasking, in other words: All constructs described in the section 9 of Ada RM.

is_unchecked_conversion(node)

Return true if node represents an instantiation of the Ada.Unchecked_Conversion subprogram

is_unchecked_deallocation(node)

Return true if node represents an instantiation of the Ada.Unchecked_Deallocation subprogram

list_of_units()

Return a (cached) list of all known units

max(x, y)

Return the max value between x and y

negate_op(node)

Assumes that node is either a RelationOp or UnOp with the OpNot as operator. Returns the negated form of the operation as a rewriting node. Examples: negate_op("A = B") -> "A /= B" negate_op("A > B") -> "A <= B" negate_op("not A") -> "A"

next_non_blank_token_line(token)

Return the start line of the next non blank token, or the next line for a comment, or 0 if none.

number_of_values(type)

Return the number of values covered by a given BaseTypeDecl, -1 if this value cannot be determined.

param_pos(n, pos=0)

Return the position of node n in its current list of siblings

parent_decl_chain(this, depth, min_depth, max_depth)

Return all parent basic decl nodes starting from a given node, using semantic parent. When on a subprogram or package body, go to the declaration This allows us to, if in a generic template, always find back the generic formal.

previous_non_blank_token_line(token)

Return the end line of the previous non blank token, or the previous line for a comment, or 0 if none.

propagate_exceptions(body)

Return true if the given body may propagate an exception, namely if:

  • it has no exception handler with a when others choice;

  • or it has an exception handler containing a raise statement, or a call

to Ada.Exception.Raise_Exception or Ada.Exception.Reraise_Occurrence.

range_values(left, right)

Return the number of values covered between left and right expressions, -1 if it cannot be determined.

semantic_parent(this, depth, min_depth, max_depth)

Return all semantic parent nodes starting from a given node.

sloc_image(node)

Return a string with basename:line corresponding to node’s sloc

strip_conversions(node)

Strip ParenExpr, QualExpr and type conversions

strip_parenthesis(node)

Strip ParenExpr from the provided node.

super_types(this, depth, min_depth, max_depth)

Yields the chain of super types of the given type, as viewed from that type. Hence, for a type T which public view derives from a type A but private view derives from a type B (which itself derives from A), invoking this selector on the public view of T will yield A.

ultimate_alias(name, all_nodes=true, strip_component=false)

Return the ultimately designated ObjectDecl, going through renamings This will not go through generic instantiations. If all_nodes is true, consider all kinds of nodes, otherwise consider only BaseId and DottedName. If strip_component is true, go to the prefix when encountering a component, otherwise stop at the ComponentDecl.

ultimate_designated_generic_subp(subp_inst)

Given a node representing an instantiation of a generic subprogram, return that non-instantiated subprogram after resolving all renamings.

ultimate_exception_alias(name)

Return the ultimately designated ExceptionDecl, going through renamings

ultimate_generic_alias(name)

Return the ultimately designated GenericDecl, going through renamings

ultimate_prefix(n)

Return n.f_prefix as long as n is a DottedName and designates a ComponentDecl, n otherwise.

ultimate_subprogram_alias(name)

Return the ultimately designated BasicSubpDecl, going through renamings

within_assert(node)

Return true if node is part of an assertion-related pragma or aspect.