6.1. Core packages
6.1.1. Libadalang.Common
This package provides types and functions used in the whole Libadalang package tree.
- type Big_Integer
Shortcut for
GNATCOLL.GMP.Integers.Big_Integer
- Default_Charset : constant String
- Object type:
Standard.String
- Default value:
"iso-8859-1"
Default charset to use when creating analysis contexts
- File_Read_Error: exception
Subprograms may raise this when they cannot open a source file. Note that this does not concern analysis unit getters, which create diagnostic vectors for such errors.
- Invalid_Input: exception
Raised by lexing functions (
Libadalang.Lexer
) when the input contains an invalid byte sequence.
- Invalid_Symbol_Error: exception
Exception raise when an invalid symbol is passed to a subprogram.
- Invalid_Unit_Name_Error: exception
Raised when an invalid unit name is provided.
- Native_Exception: exception
Exception raised in language bindings when the underlying C API reports an unexpected error that occurred in the library.
This kind of exception is raised for internal errors: they should never happen in normal situations and if they are raised at some point, it means the library state is potentially corrupted.
Nevertheless, the library does its best not to crash the program, materializing internal errors using this kind of exception.
- Precondition_Failure: exception
Exception raised when an API is called while its preconditions are not satisfied.
- Property_Error: exception
Exception that is raised when an error occurs while evaluating any function whose name starts with
P_
. This is the only exceptions that such functions can raise.
- Stale_Reference_Error: exception
Exception raised while trying to access data that was deallocated. This happens when one tries to use a node whose unit has been reparsed, for instance.
- Syntax_Error: exception
Subprograms may raise this when they try to parse invalid syntax. Note that this does not concern analysis unit getters, which create diagnostic vectors for such errors.
- Unknown_Charset: exception
Raised by lexing functions (
Libadalang.Lexer
) when the input charset is not supported.
- Bad_Type_Error: exception
Raised when introspection functions (
Libadalang.Introspection
) are provided mismatching types/values.
- Out_Of_Bounds_Error: exception
Raised when introspection functions (
Libadalang.Introspection
) are passed an out of bounds index.
- Template_Args_Error: exception
Exception raised when the provided arguments for a template don’t match what the template expects.
- Template_Format_Error: exception
Exception raised when a template has an invalid syntax, such as badly formatted placeholders.
- Template_Instantiation_Error: exception
Exception raised when the instantiation of a template cannot be parsed.
- Malformed_Tree_Error: exception
Raised when unparsing functions working on rewritten trees (
Libadalang.Rewriting
) are called on malformed trees.
- type Analysis_Unit_Kind
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.
- function Trace_Image (Self : Analysis_Unit_Kind) Standard.String
- type Lookup_Kind
- function Trace_Image (Self : Lookup_Kind) Standard.String
- type Designated_Env_Kind
Discriminant for DesignatedEnv structures.
- function Trace_Image (Self : Designated_Env_Kind) Standard.String
- type Ref_Result_Kind
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).
- function Trace_Image (Self : Ref_Result_Kind) Standard.String
- type Call_Expr_Kind
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.
- function Trace_Image (Self : Call_Expr_Kind) Standard.String
- type Grammar_Rule
Gramar rule to use for parsing.
- function Trace_Image (Self : Grammar_Rule) Standard.String
- Default_Grammar_Rule : constant Grammar_Rule
- Object type:
- Default value:
Compilation_Rule
Default grammar rule to use when parsing analysis units
- type Ada_Node_Kind_Type
Type for concrete nodes
- function Is_Token_Node (Kind : Ada_Node_Kind_Type) Standard.Boolean
Return whether Kind corresponds to a token node
- function Is_List_Node (Kind : Ada_Node_Kind_Type) Standard.Boolean
Return whether Kind corresponds to a list node
- function Is_Error_Node (Kind : Ada_Node_Kind_Type) Standard.Boolean
Return whether Kind corresponds to an error node
- function Token_Node_Kind (Kind : Ada_Node_Kind_Type) Token_Kind
Return the token kind corresponding to the given token node kind
- type Synthetic_Nodes
Set of nodes that are synthetic.
Parsers cannot create synthetic nodes, so these correspond to no source text. These nodes are created dynamically for convenience during semantic analysis.
- type Lexer_Input_Kind
Kind of lexer input
- type Undecoded_Lexer_Input
- type Token_Kind
Kind of token: indentifier, string literal, …
- function Token_Kind_Name (Token_Id : Token_Kind) Standard.String
Return a human-readable name for a token kind.
- function Token_Kind_Literal (Token_Id : Token_Kind) Text_Type
Return the canonical literal corresponding to this token kind, or an empty string if this token has no literal.
- function Token_Error_Image (Token_Id : Token_Kind) Standard.String
Return a string representation of
Token_Id
that is suitable in error messages.
- function To_Token_Kind (Raw : Langkit_Support.Token_Data_Handlers.Raw_Token_Kind) Token_Kind
- function From_Token_Kind (Kind : Token_Kind) Langkit_Support.Token_Data_Handlers.Raw_Token_Kind
- type Token_Family
Groups of token kinds, to make the processing of some groups of token uniform.
- Token_Kind_To_Family : array (Token_Kind) of Token_Family
- Object type:
array (Token_Kind) of Token_Family
Associate a token family to all token kinds
- type Visit_Status
Helper type to control the node traversal process. See the
Libadalang.Analysis.Traverse
function.
- type Token_Reference
Reference to a token in an analysis unit.
- No_Token : constant Token_Reference
- Object type:
- function "<" (Left, Right : Token_Reference) Standard.Boolean
Assuming
Left
andRight
belong to the same analysis unit, return whetherLeft
came beforeRight
in the source file.
- function Next (Token : Token_Reference; Exclude_Trivia : Standard.Boolean) Token_Reference
Return a reference to the next token in the corresponding analysis unit.
- function Previous (Token : Token_Reference; Exclude_Trivia : Standard.Boolean) Token_Reference
Return a reference to the previous token in the corresponding analysis unit.
- function Data (Token : Token_Reference) Token_Data_Type
Return the data associated to
Token
- function Is_Equivalent (L, R : Token_Reference) Standard.Boolean
Return whether
L
andR
are structurally equivalent tokens. This means that their position in the stream won’t be taken into account, only the kind and text of the token.
- function Image (Token : Token_Reference) Standard.String
Debug helper: return a human-readable text to represent a token
- function Text (Token : Token_Reference) Text_Type
Return the text of the token as
Text_Type
- function Text (First, Last : Token_Reference) Text_Type
Compute the source buffer slice corresponding to the text that spans between the
First
andLast
tokens (both included). This yields an empty slice ifLast
actually appears beforeFirst
.This raises a
Constraint_Error
ifFirst
andLast
don’t belong to the same analysis unit.
- function Get_Symbol (Token : Token_Reference) Symbol_Type
Assuming that
Token
refers to a token that contains a symbol, return the corresponding symbol.
- function Is_Trivia (Token : Token_Reference) Standard.Boolean
Return whether this token is a trivia. If it’s not, it’s a regular token.
- function Index (Token : Token_Reference) Langkit_Support.Token_Data_Handlers.Token_Index
One-based index for this token/trivia. Tokens and trivias get their own index space.
- function Origin_Filename (Token : Token_Reference) Standard.String
Return the name of the file whose content was scanned to create Token. Return an empty string if the source comes from a memory buffer instead of a file.
- function Origin_Charset (Token : Token_Reference) Standard.String
Return the charset used to decode the source that was scanned to create Token. Return an empty string if the source was already decoded during the scan.
- function Convert (TDH : Langkit_Support.Token_Data_Handlers.Token_Data_Handler; Token : Token_Reference; Raw_Data : Langkit_Support.Token_Data_Handlers.Stored_Token_Data) Token_Data_Type
Turn data from
TDH
andRaw_Data
into a user-ready token data record.
- function Raw_Data (T : Token_Reference) Langkit_Support.Token_Data_Handlers.Stored_Token_Data
Return the raw token data for
T
- type Token_Data_Type
- function Kind (Token_Data : Token_Data_Type) Token_Kind
Kind for this token.
- function Is_Trivia (Token_Data : Token_Data_Type) Standard.Boolean
Return whether this token is a trivia. If it’s not, it’s a regular token.
- function Index (Token_Data : Token_Data_Type) Langkit_Support.Token_Data_Handlers.Token_Index
One-based index for this token/trivia. Tokens and trivias get their own index space.
- function Sloc_Range (Token_Data : Token_Data_Type) Source_Location_Range
Source location range for this token. Note that the end bound is exclusive.
- type Child_Or_Trivia
Discriminator for the
Child_Record
type
- type Language_Version
Enum representing a version of the Ada language
6.1.2. Libadalang.Analysis
This package provides types and primitives to analyze source files as analysis units.
This is the entry point to parse and process a unit:
First create an analysis context with
Create_Context
.Then get analysis units out of it using the
Get_From_*
functions. The most used of them isGet_From_File
, which allows you to get an analysis unit out of a file path.
with Libadalang.Analysis;
procedure Main is
package Lib renames Libadalang.Analysis;
Context : constant Lib.Analysis_Context := Lib.Create_Context;
Unit : constant Lib.Analysis_Unit :=
Context.Get_From_File ("/path/to/source/file");
begin
Unit.Print;
end Main;
- type Analysis_Context
This type represents a context for all source analysis. This is the first type you need to create to use Libadalang. It will contain the results of all analysis, and is the main holder for all the data.
You can create several analysis contexts if you need to, which enables you, for example to:
analyze several different projects at the same time;
analyze different parts of the same projects in parallel.
In the current design, contexts always keep all of their analysis units allocated. If you need to get this memory released, the only option at your disposal is to destroy your analysis context instance.
- No_Analysis_Context : constant Analysis_Context
- Object type:
Special value to mean the absence of analysis context
- function Create_Context (Charset : Standard.String; File_Reader : File_Reader_Reference; Unit_Provider : Unit_Provider_Reference; Event_Handler : Event_Handler_Reference; With_Trivia : Standard.Boolean; Tab_Stop : Standard.Positive) Analysis_Context
Create a new analysis context.
Charset
will be used as a default charset to decode input sources in analysis units. Please seeGNATCOLL.Iconv
for several supported charsets. Be careful: passing an unsupported charset is not guaranteed to raise an error here. If no charset is provided,"iso-8859-1"
is the default.When
With_Trivia
is true, the parsed analysis units will contain trivias.If provided,
File_Reader
will be used to fetch the contents of source files instead of the default, which is to just read it from the filesystem and decode it using the regular charset rules. Note that if provided, all parsing APIs that provide a buffer are forbidden, and any use of the rewriting API with the returned context is rejected.If provided,
Unit_Provider
will be used to query the file name that corresponds to a unit reference during semantic analysis. If it isnull
, the default one is used instead.If provided,
Event_Handler
will be notified when various events happen.Tab_Stop
is a positive number to describe the effect of tabulation characters on the column number in source files.
- function Unit_Provider (Context : Analysis_Context'Class) Unit_Provider_Reference
Return the unit provider for
Context
- function Hash (Context : Analysis_Context) Ada.Containers.Hash_Type
Return a hash for this context, to be used in hash tables.
- function Context (Unit : Analysis_Unit'Class) Analysis_Context
Return the context that owns this unit.
- function Create_Context_From_Project (Tree : GNATCOLL.Projects.Project_Tree_Access; Project : GNATCOLL.Projects.Project_Type; Env : GNATCOLL.Projects.Project_Environment_Access; Is_Project_Owner : Standard.Boolean; Event_Handler : Event_Handler_Reference; With_Trivia : Standard.Boolean; Tab_Stop : Standard.Positive) Analysis_Context
Create a new analysis context from a GPR project.
The unit provider, file reader, config pragmas and default charset are inferred from the designated project: see
Libadalang.Project_Provider.Create_Project_Unit_Provider
for the semantics of theTree
,Project
,Env
andIs_Project_Owner
arguments.See
Libadalang.Analysis.Create_Context
for the semantics of the other arguments.
- function Create_Context_From_Project (Tree : GPR2.Project.Tree.Object; Project : GPR2.Project.View.Object; Event_Handler : Event_Handler_Reference; With_Trivia : Standard.Boolean; Tab_Stop : Standard.Positive) Analysis_Context
Create a new analysis context from a GPR project.
The unit provider, file reader, config pragmas and default charset are inferred from the designated project: see
Libadalang.Project_Provider.Create_Project_Unit_Provider
for the semantics of theTree
andProject
arguments.See
Libadalang.Analysis.Create_Context
for the semantics of the other arguments.
- type Analysis_Unit
This type represents the analysis of a single file.
This type has strong-reference semantics and is ref-counted. Furthermore, a reference to a unit contains an implicit reference to the context that owns it. This means that keeping a reference to a unit will keep the context and all the unit it contains allocated.
- No_Analysis_Unit : constant Analysis_Unit
- Object type:
Special value to mean the absence of analysis unit. No analysis units can be passed this value.
- function Get_From_File (Context : Analysis_Context'Class; Filename : Standard.String; Charset : Standard.String; Reparse : Standard.Boolean; Rule : Grammar_Rule) Analysis_Unit
Create a new analysis unit for
Filename
or return the existing one if any. IfReparse
is true and the analysis unit already exists, reparse it fromFilename
.Rule
controls which grammar rule is used to parse the unit.Use
Charset
in order to decode the source. IfCharset
is empty then use the context’s default charset.If any failure occurs, such as file opening, decoding, lexing or parsing failure, return an analysis unit anyway: errors are described as diagnostics of the returned analysis unit.
It is invalid to pass
True
toReparse
if a rewriting context is active.
- function Get_From_Buffer (Context : Analysis_Context'Class; Filename : Standard.String; Charset : Standard.String; Buffer : Standard.String; Rule : Grammar_Rule) Analysis_Unit
Create a new analysis unit for
Filename
or return the existing one if any. Whether the analysis unit already exists or not, (re)parse it from the source code inBuffer
.Rule
controls which grammar rule is used to parse the unit.Use
Charset
in order to decode the source. IfCharset
is empty then use the context’s default charset.If any failure occurs, such as file opening, decoding, lexing or parsing failure, return an analysis unit anyway: errors are described as diagnostics of the returned analysis unit.
Calling this is invalid if a rewriting context is active.
- function Get_From_Buffer (Context : Analysis_Context'Class; Filename : Standard.String; Charset : Standard.String; Buffer : Ada.Strings.Unbounded.Unbounded_String; Rule : Grammar_Rule) Analysis_Unit
Likewise, but working on an unbounded string
- function Get_With_Error (Context : Analysis_Context'Class; Filename : Standard.String; Error : Text_Type; Charset : Standard.String; Rule : Grammar_Rule) Analysis_Unit
If a Unit for
Filename
already exists, return it unchanged. Otherwise, create an empty analysis unit forFilename
with a diagnostic that contains theError
message.
- function Get_From_Provider (Context : Analysis_Context'Class; Name : Text_Type; Kind : Analysis_Unit_Kind; Charset : Standard.String; Reparse : Standard.Boolean) Analysis_Unit
Create a new analysis unit for
Name
/Kind
or return the existing one if any. IfReparse
is true and the analysis unit already exists, reparse it from the on-disk source file.The
Name
andKind
arguments are forwarded directly to query the context’s unit provider and get the filename for the returned unit. See the documentation of the relevant unit provider for their exact semantics.Use
Charset
in order to decode the source. IfCharset
is empty then use the context’s default charset.If the unit name cannot be tuned into a file name, raise an
Invalid_Unit_Name_Error
exception. If any other failure occurs, such as file opening, decoding, lexing or parsing failure, return an analysis unit anyway: errors are described as diagnostics of the returned analysis unit.It is invalid to pass
True
toReparse
if a rewriting context is active.
- function Hash (Unit : Analysis_Unit) Ada.Containers.Hash_Type
Return a hash for this unit, to be used in hash tables.
- function Unit (Token : Token_Reference) Analysis_Unit
Return the analysis unit that owns
Token
- function Get_Line (Unit : Analysis_Unit; Line_Number : Standard.Positive) Text_Type
Return the line of text at line number
Line_Number
- type Ada_Node
Data type for all nodes. Nodes are assembled to make up a tree. See the node primitives below to inspect such trees.
Unlike for contexts and units, this type has weak-reference semantics: keeping a reference to a node has no effect on the decision to keep the unit that it owns allocated. This means that once all references to the context and units related to a node are dropped, the context and its units are deallocated and the node becomes a stale reference: most operations on it will raise a
Stale_Reference_Error
.Note that since reparsing an analysis unit deallocates all the nodes it contains, this operation makes all reference to these nodes stale as well.
Root node class for the Ada syntax tree.
- function Equals (L, R : Ada_Node) Standard.Boolean
Comparison function, meant to compare two nodes.
- No_Ada_Node : constant Ada_Node
- Object type:
Special value to represent the absence of a node. Note that every node type derived from the root type has a similar
No_Node
constant.
- function Root (Unit : Analysis_Unit'Class) Ada_Node
Return the root node for this unit, or
null
if there is none.
- function P_Declarative_Scope (Node : Ada_Node'Class) Declarative_Part
Return the scope of definition of this basic declaration.
- function P_Enclosing_Compilation_Unit (Node : Ada_Node'Class) Compilation_Unit
Return the compilation unit containing this node.
Note
This returns the
Compilation_Unit
node, which is different from theAnalysisUnit
. In particular, an analysis unit can contain multiple compilation units.
- function P_Get_Uninstantiated_Node (Node : Ada_Node'Class) Ada_Node
Assuming this node comes from an instantiated generic declaration, return its non-instantiated counterpart lying in the generic declaration.
- function P_Complete (Node : Ada_Node'Class) Completion_Item_Iterator
Return possible completions at this point in the file.
- function P_Valid_Keywords (Node : Ada_Node'Class) Unbounded_Text_Type_Array
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.
- function P_Generic_Instantiations (Node : Ada_Node'Class) Generic_Instantiation_Array
Return the potentially empty list of generic package/subprogram instantiations that led to the creation of this entity. Outer-most instantiations appear last.
- function P_Semantic_Parent (Node : Ada_Node'Class) Ada_Node
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.
- function P_Parent_Basic_Decl (Node : Ada_Node'Class) Basic_Decl
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.
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.
- function P_Has_Spark_Mode_On (Node : Ada_Node'Class) Standard.Boolean
Returns whether this subprogram has explicitly been set as having
Spark_Mode
toOn
, directly or indirectly.Doesn’t include subprograms that can be inferred by GNATprove as being SPARK.
- function P_Is_Subject_To_Proof (Node : Ada_Node'Class) Standard.Boolean
Returns whether this subprogram body is subject to proof in the context of the SPARK/GNATprove tools.
- function P_Filter_Is_Imported_By (Node : Ada_Node'Class; Units : Analysis_Unit_Array; Transitive : Standard.Boolean) Analysis_Unit_Array
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.
- function P_Xref_Entry_Point (Node : Ada_Node'Class) Standard.Boolean
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.
- function P_Resolve_Names (Node : Ada_Node'Class) Standard.Boolean
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.
- function P_Nameres_Diagnostics (Node : Ada_Node'Class) Solver_Diagnostic_Array
If name resolution on this xref entry point fails, this returns all the diagnostics that were produced while resolving it.
- function P_Standard_Unit (Node : Ada_Node'Class) Analysis_Unit
Static method. Return the analysis unit corresponding to the Standard package.
- function P_Is_Keyword (Node : Ada_Node'Class; Token : Token_Reference; Language_Version : Unbounded_Text_Type) Standard.Boolean
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”.
- function P_Std_Entity (Node : Ada_Node'Class; Sym : Unbounded_Text_Type) Ada_Node
Static property. Return an entity from the standard package with name
sym
.
- function P_Bool_Type (Node : Ada_Node'Class) Base_Type_Decl
Static method. Return the standard Boolean type.
- function P_Int_Type (Node : Ada_Node'Class) Base_Type_Decl
Static method. Return the standard Integer type.
- function P_Universal_Int_Type (Node : Ada_Node'Class) Ada_Node
Static method. Return the standard Universal Integer type.
- function P_Universal_Real_Type (Node : Ada_Node'Class) Ada_Node
Static method. Return the standard Universal Real type.
- function P_Std_Char_Type (Node : Ada_Node'Class) Base_Type_Decl
Static method. Return the standard Character type.
- function P_Std_Wide_Char_Type (Node : Ada_Node'Class) Base_Type_Decl
Static method. Return the standard Wide_Character type.
- function P_Std_Wide_Wide_Char_Type (Node : Ada_Node'Class) Base_Type_Decl
Static method. Return the standard Wide_Wide_Character type.
- function P_Std_String_Type (Node : Ada_Node'Class) Base_Type_Decl
Static method. Return the standard String type.
- function P_Std_Wide_String_Type (Node : Ada_Node'Class) Base_Type_Decl
Static method. Return the standard Wide_String type.
- function P_Std_Wide_Wide_String_Type (Node : Ada_Node'Class) Base_Type_Decl
Static method. Return the standard Wide_Wide_String type.
- function P_Top_Level_Decl (Node : Ada_Node'Class; Unit : Analysis_Unit'Class) Basic_Decl
Static method. Get the top-level decl in
unit
. This is the body of a Subunit, or the item of aLibraryItem
.
- function P_Choice_Match (Node : Ada_Node'Class; Value : Big_Integer) Standard.Boolean
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.
- function P_Gnat_Xref (Node : Ada_Node'Class; Imprecise_Fallback : Standard.Boolean) Defining_Name
Return a cross reference from this name to a defining identifier, trying to mimic GNAT’s xrefs as much as possible.
- function Parent (Node : Ada_Node'Class) Ada_Node
Return the syntactic parent for this node. Return null for the root node.
- function Parents (Node : Ada_Node'Class; With_Self : Standard.Boolean) Ada_Node_Array
Return an array that contains the lexical parents, this node included iff
with_self
is True. Nearer parents are first in the list.
- function Children (Node : Ada_Node'Class) Ada_Node_Array
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.
- function Token_Start (Node : Ada_Node'Class) Token_Reference
Return the first token used to parse this node.
- function Token_End (Node : Ada_Node'Class) Token_Reference
Return the last token used to parse this node.
- function Child_Index (Node : Ada_Node'Class) Standard.Integer
Return the 0-based index for Node in its parent’s children.
- function Previous_Sibling (Node : Ada_Node'Class) Ada_Node
Return the node’s previous sibling, or null if there is no such sibling.
- function Next_Sibling (Node : Ada_Node'Class) Ada_Node
Return the node’s next sibling, or null if there is no such sibling.
- function Unit (Node : Ada_Node'Class) Analysis_Unit
Return the analysis unit owning this node.
- function Is_Ghost (Node : Ada_Node'Class) Standard.Boolean
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 thetoken_end
of all ghost nodes is the token right after this logical position.
- function Full_Sloc_Image (Node : Ada_Node'Class) Text_Type
Return a string containing the filename + the sloc in GNU conformant format. Useful to create diagnostics from a node.
- procedure Get_Child (Node : Ada_Node'Class; Index : Standard.Positive; Index_In_Bounds : Standard.Boolean; Result : Ada_Node)
Return the
Index
’th child of node, storing it intoResult
.Child indexing is 1-based. Store in
Index_In_Bounds
whetherNode
had such a child: if not (i.e.Index
is out-of-bounds), setResult
to a null node.
- function Child (Node : Ada_Node'Class; Index : Standard.Positive) Ada_Node
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- function First_Child (Node : Ada_Node'Class) Ada_Node
Return the first child
Node
has, orNo_Ada_Node
if there is none.
- function Last_Child (Node : Ada_Node'Class) Ada_Node
Return the last child
Node
has, orNo_Ada_Node
if there is none.
- function Closest_Common_Parent (Self, Other : Ada_Node'Class) Ada_Node
If
Self
andOther
do not belong to the same analysis unit, returnNo_Ada_Node
. Otherwise, return the deepest node in the tree that is a parent for bothSelf
andOther
.
- function Lookup (Node : Ada_Node'Class; Sloc : Source_Location) Ada_Node
Look for the bottom-most AST node whose sloc range contains Sloc. Return it, or null if no such node was found.
- type Expr
Base class for expressions (RM 4.4).
- function P_Expression_Type (Node : Expr'Class) Base_Type_Decl
Return the declaration corresponding to the type of this expression after name resolution.
- function P_Expected_Expression_Type (Node : Expr'Class) Base_Type_Decl
Return the declaration corresponding to the expected type of this expression after name resolution.
- function P_Is_Dynamically_Tagged (Node : Expr'Class; Imprecise_Fallback : Standard.Boolean) Standard.Boolean
Returns whether this expression is dynamically tagged (See RM 3.9.2).
- function P_Is_Dispatching_Call (Node : Expr'Class; Imprecise_Fallback : Standard.Boolean) Standard.Boolean
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
andUnOp
or aBinOp
.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)
- function P_Is_Static_Expr (Node : Expr'Class; Imprecise_Fallback : Standard.Boolean) Standard.Boolean
Return whether this expression is static according to the ARM definition of static. See RM 4.9.
- function P_First_Corresponding_Decl (Node : Expr'Class) Basic_Decl
Return the first decl that is lexically named like self in self’s scope.
- function P_Eval_As_Int (Node : Expr'Class) Big_Integer
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 RM 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.
- function P_Eval_As_Int_In_Env (Node : Expr'Class; Env : Substitution_Array) Big_Integer
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 RM 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.
- function P_Eval_As_String (Node : Expr'Class) Text_Type
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 RM 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.
- function P_Eval_As_String_In_Env (Node : Expr'Class; Env : Substitution_Array) Text_Type
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 RM 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.
- function P_Matching_Nodes (Node : Expr'Class) Ada_Node_Array
Return the list of AST nodes that can be a match for this expression before overloading analysis.
- function List_Child (Node : Expr_List'Class; Index : Standard.Positive) Expr
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Basic_Decl
Root class for an Ada declaration (RM 3.1). A declaration associates a name with a language entity, for example a type or a variable.
- function F_Aspects (Node : Basic_Decl'Class) Aspect_Spec
Return the list of aspects that are attached to this node.
This field may be null even when there are no parsing errors.
- function P_Is_Formal (Node : Basic_Decl'Class) Standard.Boolean
Whether this decl is the nested decl of a generic formal declaration.
- function P_Doc_Annotations (Node : Basic_Decl'Class) Doc_Annotation_Array
Return the documentation annotations associated with this decl. Annotations are any comment line of the form:
--% [annotation_name]: [annotation]
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.
- function P_Doc (Node : Basic_Decl'Class) Text_Type
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.
- function P_Previous_Part_For_Decl (Node : Basic_Decl'Class; Imprecise_Fallback : Standard.Boolean) Basic_Decl
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)
- function P_Canonical_Part (Node : Basic_Decl'Class; Imprecise_Fallback : Standard.Boolean) Basic_Decl
Return the canonical part for this decl. In the case of decls composed of several parts, the canonical part will be the first part.
- function P_All_Parts (Node : Basic_Decl'Class; Imprecise_Fallback : Standard.Boolean) Basic_Decl_Array
Return all parts that define this entity, sorted from first part to last part.
- function P_Is_Static_Decl (Node : Basic_Decl'Class; Imprecise_Fallback : Standard.Boolean) Standard.Boolean
Return whether this declaration is static.
- function P_Get_Aspect_Assoc (Node : Basic_Decl'Class; Name : Unbounded_Text_Type) Aspect_Assoc
Return the aspect with name
name
for this entity.
- function P_Get_Aspect_Spec_Expr (Node : Basic_Decl'Class; Name : Unbounded_Text_Type) Expr
Return the expression associated to the aspect with name
name
for this entity.
- function P_Get_Aspect (Node : Basic_Decl'Class; Name : Unbounded_Text_Type; Previous_Parts_Only : Standard.Boolean; Imprecise_Fallback : Standard.Boolean) 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.
This will return the syntactic node corresponding to attribute directly. See
DefiningName.P_Get_Aspect
for more details.
- function P_Has_Aspect (Node : Basic_Decl'Class; Name : Unbounded_Text_Type; Previous_Parts_Only : Standard.Boolean; Imprecise_Fallback : Standard.Boolean) Standard.Boolean
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 RM 13).
- function P_Get_Pragma (Node : Basic_Decl'Class; Name : Unbounded_Text_Type) Pragma_Node
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.
- function P_Get_Representation_Clause (Node : Basic_Decl'Class; Name : Unbounded_Text_Type; Imprecise_Fallback : Standard.Boolean) Attribute_Def_Clause
Return the representation clause associated to this type decl that defines the given attribute name.
- function P_Get_At_Clause (Node : Basic_Decl'Class; Imprecise_Fallback : Standard.Boolean) At_Clause
Return the at clause associated to this declaration.
- function P_Is_Imported (Node : Basic_Decl'Class) Standard.Boolean
Whether this declaration is imported from another language.
- function P_Is_Ghost_Code (Node : Basic_Decl'Class) Standard.Boolean
Return whether this declaration is ghost code or not. See SPARK RM 6.9.
- function P_Is_Compilation_Unit_Root (Node : Basic_Decl'Class) Standard.Boolean
Whether a BasicDecl is the root decl for its unit.
- function P_Is_Visible (Node : Basic_Decl'Class; From_Node : Ada_Node'Class) Standard.Boolean
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.
- function P_Base_Subp_Declarations (Node : Basic_Decl'Class; Imprecise_Fallback : Standard.Boolean) Basic_Decl_Array
If Self declares a primitive subprogram of some tagged type T, return the set of all subprogram declarations that it overrides (including itself).
Note
for the moment this only works for tagged types. Remains to be seen if we need to extend it.
- function P_Root_Subp_Declarations (Node : Basic_Decl'Class; Origin : Ada_Node'Class; Imprecise_Fallback : Standard.Boolean) Basic_Decl_Array
If Self declares a primitive subprogram of some tagged 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
- function P_Find_All_Overrides (Node : Basic_Decl'Class; Units : Analysis_Unit_Array; Imprecise_Fallback : Standard.Boolean) Basic_Decl_Array
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.
- function P_Defining_Names (Node : Basic_Decl'Class) Defining_Name_Array
Get all the names of this basic declaration.
- function P_Defining_Name (Node : Basic_Decl'Class) Defining_Name
Get the name of this declaration. If this declaration has several names, it will return the first one.
- function P_Type_Expression (Node : Basic_Decl'Class) Type_Expr
Return the type expression for this BasicDecl if applicable, a null otherwise.
- function P_Subp_Spec_Or_Null (Node : Basic_Decl'Class; Follow_Generic : Standard.Boolean) Base_Subp_Spec
If Self is a Subp, returns the specification of this subprogram.
If
follow_generic
is True, will also work for instances ofGenericSubpDecl
.
- function P_Is_Subprogram (Node : Basic_Decl'Class) Standard.Boolean
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.
- function P_Relative_Name (Node : Basic_Decl'Class) Name
Return the relative name for Self. If Self’s defining name is
A.B.C
, returnC
as a node.
- function P_Relative_Name_Text (Node : Basic_Decl'Class) Unbounded_Text_Type
Return the relative name for Self, as text.
- function P_Next_Part_For_Decl (Node : Basic_Decl'Class; Imprecise_Fallback : Standard.Boolean) Basic_Decl
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)
- function P_Body_Part_For_Decl (Node : Basic_Decl'Class; Imprecise_Fallback : Standard.Boolean) Body_Node
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)
- function P_Most_Visible_Part (Node : Basic_Decl'Class; Origin : Ada_Node'Class; Imprecise_Fallback : Standard.Boolean) Basic_Decl
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
- function P_Fully_Qualified_Name_Array (Node : Basic_Decl'Class; Include_Profile : Standard.Boolean) Unbounded_Text_Type_Array
Return the fully qualified name corresponding to this declaration, as an array of symbols.
- function P_Fully_Qualified_Name (Node : Basic_Decl'Class) Text_Type
Return the fully qualified name corresponding to this declaration.
- function P_Canonical_Fully_Qualified_Name (Node : Basic_Decl'Class) Text_Type
Return a canonical representation of the fully qualified name corresponding to this declaration.
- function P_Unique_Identifying_Name (Node : Basic_Decl'Class) Text_Type
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.
Attention
This will only return a unique name for public declarations. Notably, anything nested in an unnamed declare block won’t be handled correctly.
- function P_Is_Constant_Object (Node : Basic_Decl'Class) Standard.Boolean
Return whether this object is constant or not.
- type Ada_List
- type Ada_Node_List
List of AdaNode.
This list node can contain one of the following nodes:
Abstract_State_Decl
,Abstract_Subp_Decl
,Allocator
,Aspect_Clause
,Attribute_Ref
,Base_Aggregate
,Base_Subp_Body
,Bin_Op
,Body_Stub
,Call_Expr
,Char_Literal
,Component_Clause
,Component_Decl
,Concat_Op
,Concrete_Type_Decl
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Entry_Body
,Entry_Decl
,Error_Decl
,Exception_Decl
,Exception_Handler
,Explicit_Deref
,Generic_Decl
,Generic_Formal
,Generic_Instantiation
,Generic_Renaming_Decl
,Identifier
,Incomplete_Type_Decl
,Membership_Expr
,Null_Component_Decl
,Null_Literal
,Num_Literal
,Number_Decl
,Object_Decl
,Others_Designator
,Package_Body
,Package_Decl
,Package_Renaming_Decl
,Paren_Abstract_State_Decl
,Paren_Expr
,Pragma_Node
,Protected_Body
,Protected_Type_Decl
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,Single_Protected_Decl
,Single_Task_Decl
,Stmt
,String_Literal
,Subp_Decl
,Subtype_Decl
,Subtype_Indication
,Target_Name
,Task_Body
,Task_Type_Decl
,Un_Op
,Update_Attribute_Ref
,Use_Clause
,With_Clause
- function Ada_Node_List_First (Node : Ada_Node_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Ada_Node_List_Next (Node : Ada_Node_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Ada_Node_List_Has_Element (Node : Ada_Node_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Ada_Node_List_Element (Node : Ada_Node_List; Cursor : Standard.Positive) Ada_Node'Class
Implementation detail for the Iterable aspect
- type Alternatives_List
List of alternatives in a
when ...
clause.This list node can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Discrete_Subtype_Indication
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Others_Designator
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
- type Name
Base class for names (RM 4.1).
- function P_Enclosing_Defining_Name (Node : Name'Class) Defining_Name
If this name is part of a defining name, return the enclosing defining name node.
- function P_Is_Defining (Node : Name'Class) Standard.Boolean
Return True if this name is part of a defining name.
- function P_Name_Is (Node : Name'Class; Sym : Unbounded_Text_Type) Standard.Boolean
Helper. Check that this name matches
sym
.
- function P_Is_Direct_Call (Node : Name'Class) Standard.Boolean
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).
- function P_Is_Access_Call (Node : Name'Class) Standard.Boolean
Return True iff this name represents a call to subprogram through an access type.
- function P_Is_Call (Node : Name'Class) Standard.Boolean
Returns True if this Name corresponds to a call.
- function P_Is_Dot_Call (Node : Name'Class; Imprecise_Fallback : Standard.Boolean) Standard.Boolean
Returns True if this Name corresponds to a dot notation call.
- function P_Failsafe_Referenced_Def_Name (Node : Name'Class; Imprecise_Fallback : Standard.Boolean) Refd_Def
Failsafe version of
referenced_defining_name
. Returns aRefdDef
, which can be precise, imprecise, or error.
- function P_Referenced_Defining_Name (Node : Name'Class; Imprecise_Fallback : Standard.Boolean) Defining_Name
Like
referenced_decl
, but will return the defining identifier for the decl, rather than the basic declaration node itself.
- function P_All_Env_Elements (Node : Name'Class; Seq : Standard.Boolean; Seq_From : Ada_Node'Class) Ada_Node_Array
Return all elements in self’s scope that are lexically named like Self.
- function P_Called_Subp_Spec (Node : Name'Class) Base_Formal_Param_Holder
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.
- function P_Referenced_Decl (Node : Name'Class; Imprecise_Fallback : Standard.Boolean) Basic_Decl
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.
- function P_Failsafe_Referenced_Decl (Node : Name'Class; Imprecise_Fallback : Standard.Boolean) Refd_Decl
Failsafe version of
referenced_decl
. Returns aRefdDecl
, which can be precise, imprecise, or error.
- function P_Name_Designated_Type (Node : Name'Class) Base_Type_Decl
Like SubtypeIndication.designated_type, but on names, since because of Ada’s ambiguous grammar, some subtype indications will be parsed as names.
- function P_Is_Static_Subtype (Node : Name'Class; Imprecise_Fallback : Standard.Boolean) Standard.Boolean
Returns whether Self denotes a static subtype or not.
- function P_Name_Matches (Node : Name'Class; N : Name'Class) Standard.Boolean
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.
- function P_Relative_Name (Node : Name'Class) Name
Returns the relative name of this instance. For example, for a prefix
A.B.C
, this will returnC
.
- function P_Is_Operator_Name (Node : Name'Class) Standard.Boolean
Return whether the name that Self designates is an operator.
- function P_Is_Write_Reference (Node : Name'Class; Imprecise_Fallback : Standard.Boolean) Standard.Boolean
Whether this name is a write reference.
For example,
X
is a write reference in the following cases:X := 2;
X (2) := 2;
P(F => X)
where F is declaredout
orin out
.P(F => T (X))
where F is declaredout
orin out
X'Access
.X.C := 2
,R.X := 2
X.P
where the formal for X is declaredout
orin out
.
Note
This is an experimental feature. There might be some discrepancy with the GNAT concept of “write reference”.
- function P_Is_Static_Call (Node : Name'Class; Imprecise_Fallback : Standard.Boolean) Standard.Boolean
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”.
- function P_As_Symbol_Array (Node : Name'Class) Unbounded_Text_Type_Array
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 PropertyError.
- function P_Canonical_Text (Node : Name'Class) Unbounded_Text_Type
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 PropertyError.
- function P_Is_Constant (Node : Name'Class) Standard.Boolean
Return whether this name denotes a constant value.
- function P_Call_Params (Node : Name'Class) Param_Actual_Array
Returns an array of pairs, associating formal parameters to actual or default expressions.
- function List_Child (Node : Name_List'Class; Index : Standard.Positive) Name
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Single_Tok_Node
Base class for nodes that are made up of a single token.
- type Base_Id
Base class for identifiers.
- type Identifier
Regular identifier (RM 2.3).
- function List_Child (Node : Identifier_List'Class; Index : Standard.Positive) Identifier
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Abort_Node
Qualifier for the
abort
keyword.- function P_As_Bool (Node : Abort_Node'Class) Standard.Boolean
Return whether this is an instance of AbortPresent
- type Abort_Absent
- type Abort_Present
- type Stmt
Bass class for statements (RM 5.1).
- function P_Is_Ghost_Code (Node : Stmt'Class) Standard.Boolean
Return whether this statement is ghost code or not. See SPARK RM 6.9.
- type Abort_Stmt
abort
statement (RM 9.8).- function F_Names (Node : Abort_Stmt'Class) Name_List
This field contains a list that itself contains one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Abstract_Node
Qualifier for the
abstract
keyword.- function P_As_Bool (Node : Abstract_Node'Class) Standard.Boolean
Return whether this is an instance of AbstractPresent
- type Abstract_Absent
- type Basic_Subp_Decl
Base class for subprogram declarations.
- function P_Subp_Decl_Spec (Node : Basic_Subp_Decl'Class) Base_Subp_Spec
Return the specification for this subprogram
- type Classic_Subp_Decl
This is an intermediate abstract class for subprogram declarations with a common structure: overriding indicator,
SubpSpec
, aspects, <other fields>.- function F_Overriding (Node : Classic_Subp_Decl'Class) Overriding_Node
When there are no parsing errors, this field is never null.
- function F_Overriding (Node : Classic_Subp_Decl'Class) Libadalang.Common.Ada_Overriding_Node
- function F_Subp_Spec (Node : Classic_Subp_Decl'Class) Subp_Spec
When there are no parsing errors, this field is never null.
- function P_Body_Part (Node : Classic_Subp_Decl'Class; Imprecise_Fallback : Standard.Boolean) Base_Subp_Body
Return the BaseSubpBody corresponding to this node.
- type Formal_Subp_Decl
Formal subprogram declarations, in generic declarations formal parts (RM 12.6).
- function F_Default_Expr (Node : Formal_Subp_Decl'Class) Expr
This field can contain one of the following nodes:
Attribute_Ref
,Box_Expr
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- type Abstract_Present
- type Abstract_State_Decl
Contained (directly or indirectly) in an AbstractStateDeclExpr, and is used to represent the BasicDecl associated with the abstract state introduced by the Abstract_State aspect. This node is necessary because all of our name resolution routines expect BasicDecls as environments’ values.
The only purpose of this node is to populate the env with the abstract state declared through this node, so it can be referred in SPARK aspects such as Global, Depends, Refined_State, etc.
- function F_Name (Node : Abstract_State_Decl'Class) Defining_Name
When there are no parsing errors, this field is never null.
- type Abstract_State_Decl_Expr
Directly corresponds to the right-hand side of the Abstract_State aspect. Only exists because the RHS of an AspectAssoc must be an expression: the actual logic is in AbstractStateDecl.
- function F_State_Decl (Node : Abstract_State_Decl_Expr'Class) Ada_Node
This field can contain one of the following nodes:
Abstract_State_Decl
,Multi_Abstract_State_Decl
,Paren_Abstract_State_Decl
When there are no parsing errors, this field is never null.
- type Abstract_State_Decl_List
List of AbstractStateDecls.
This list node can contain one of the following nodes:
Abstract_State_Decl
,Paren_Abstract_State_Decl
- type Accept_Stmt
accept
statement (RM 9.5.2).- function F_Body_Decl (Node : Accept_Stmt'Class) Accept_Stmt_Body
When there are no parsing errors, this field is never null.
- function F_Entry_Index_Expr (Node : Accept_Stmt'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- function F_Params (Node : Accept_Stmt'Class) Entry_Completion_Formal_Params
When there are no parsing errors, this field is never null.
- function P_Corresponding_Entry (Node : Accept_Stmt'Class; Origin : Ada_Node'Class) Entry_Decl
Return the entry which corresponds to this accept statement.
Origin
: Origin for this property’s request. See The origin parameter for more details
- type Body_Node
Base class for an Ada body (RM 3.11). A body is the completion of a declaration.
- function P_Previous_Part (Node : Body_Node'Class; Imprecise_Fallback : Standard.Boolean) Basic_Decl
Return the previous part for this body. Might be a declaration or a body stub.
- function P_Decl_Part (Node : Body_Node'Class; Imprecise_Fallback : Standard.Boolean) Basic_Decl
Return the decl corresponding to this node if applicable.
- function P_Subunit_Root (Node : Body_Node'Class) Basic_Decl
If self is a subunit, return the body in which it is rooted.
- type Accept_Stmt_Body
BasicDecl that is always the declaration of an AcceptStmt. This is nested inside of the accept statement.
- function F_Name (Node : Accept_Stmt_Body'Class) Defining_Name
When there are no parsing errors, this field is never null.
- type Accept_Stmt_With_Stmts
Extended
accept
statement (RM 9.5.2).- function F_Stmts (Node : Accept_Stmt_With_Stmts'Class) Handled_Stmts
When there are no parsing errors, this field is never null.
- function F_End_Name (Node : Accept_Stmt_With_Stmts'Class) End_Name
This field may be null even when there are no parsing errors.
- type Access_Def
Base class for access type definitions (RM 3.10).
- function F_Has_Not_Null (Node : Access_Def'Class) Not_Null
This field may be null even when there are no parsing errors.
- function F_Has_Not_Null (Node : Access_Def'Class) Standard.Boolean
- type Access_To_Subp_Def
Type definition for accesses to subprograms (RM 3.10).
- function F_Has_Protected (Node : Access_To_Subp_Def'Class) Protected_Node
When there are no parsing errors, this field is never null.
- function F_Has_Protected (Node : Access_To_Subp_Def'Class) Standard.Boolean
- function F_Subp_Spec (Node : Access_To_Subp_Def'Class) Subp_Spec
When there are no parsing errors, this field is never null.
- type Base_Aggregate
Base class for aggregates (RM 4.3).
- function F_Ancestor_Expr (Node : Base_Aggregate'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- function F_Assocs (Node : Base_Aggregate'Class) Assoc_List
This field contains a list that itself contains one of the following nodes:
Aggregate_Assoc
,Iterated_Assoc
When there are no parsing errors, this field is never null.
- function P_Aggregate_Params (Node : Base_Aggregate'Class) Param_Actual_Array
Returns an array of pairs, associating formal parameters to actual expressions. See
zip_with_params
.
- function P_Is_Subaggregate (Node : Base_Aggregate'Class) Standard.Boolean
Return whether this aggregate is actually a subaggregate of a multidimensional array aggregate, as described in RM 4.3.3.
- type Basic_Assoc
Association of one or several names to an expression.
- function P_Get_Params (Node : Basic_Assoc'Class; Imprecise_Fallback : Standard.Boolean) Defining_Name_Array
Return the list of parameters that this association refers to.
- function List_Child (Node : Basic_Assoc_List'Class; Index : Standard.Positive) Basic_Assoc
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Aggregate_Assoc
Association (X => Y) used for aggregates associations (RM 4.3).
- function F_Designators (Node : Aggregate_Assoc'Class) Alternatives_List
This field contains a list that itself contains one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Discrete_Subtype_Indication
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Others_Designator
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_R_Expr (Node : Aggregate_Assoc'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Box_Expr
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Aliased_Node
Qualifier for the
aliased
keyword.- function P_As_Bool (Node : Aliased_Node'Class) Standard.Boolean
Return whether this is an instance of AliasedPresent
- type Aliased_Absent
- type Aliased_Present
- type All_Node
Qualifier for the
all
keyword.- function P_As_Bool (Node : All_Node'Class) Standard.Boolean
Return whether this is an instance of AllPresent
- type All_Absent
- type All_Present
- type Allocator
Allocator expression (
new ...
) (RM 4.8).- function F_Subpool (Node : Allocator'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- function F_Type_Or_Expr (Node : Allocator'Class) Ada_Node
This field can contain one of the following nodes:
Qual_Expr
,Subtype_Indication
When there are no parsing errors, this field is never null.
- function P_Get_Allocated_Type (Node : Allocator'Class) Base_Type_Decl
Return the allocated type for this allocator.
- type Anonymous_Expr_Decl
Represents a anonymous declaration that holds an expression.
This is used to store the results of queries such as
referenced_decl
called on references to object formals from inside a instantiated generic in order to return the relevant actual.Indeed,
referenced_decl
must return aBasicDecl
, but actuals of generic instantiations areExpr
. This wrapper node is therefore a way to both satisfy theBasicDecl
interface, and provide to the user the expression of the actual through theexpr
field.- function F_Expr (Node : Anonymous_Expr_Decl'Class) Expr
Return the expression wrapped by this declaration.
When there are no parsing errors, this field is never null.
- function P_Get_Formal (Node : Anonymous_Expr_Decl'Class; Imprecise_Fallback : Standard.Boolean) Defining_Name
Return the generic formal object declaration corresponding to this actual.
- type Type_Expr
A type expression is an abstract node that embodies the concept of a reference to a type.
Since Ada has both subtype_indications and anonymous (inline) type declarations, a type expression contains one or the other.
This node has no ARM correspondence.
- function P_Type_Name (Node : Type_Expr'Class) Name
Return the name node for this type expression, if applicable, else null
- function P_Designated_Type_Decl (Node : Type_Expr'Class) Base_Type_Decl
Returns the type declaration designated by this type expression.
- function P_Designated_Type_Decl_From (Node : Type_Expr'Class; Origin_Node : Ada_Node'Class) Base_Type_Decl
Return the type declaration designated by this type expression as viewed from the node given by origin_node.
- function P_Subtype_Constraint (Node : Type_Expr'Class; Origin : Ada_Node'Class) 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
- function P_Discriminant_Constraints (Node : Type_Expr'Class) Param_Actual_Array
If this type expression designates a constrained discriminated type, return an array of pairs, associating each discriminant to its actual or default expression.
- type Anonymous_Type
Container for inline anonymous array and access types declarations.
- function F_Type_Decl (Node : Anonymous_Type'Class) Anonymous_Type_Decl
When there are no parsing errors, this field is never null.
- type Anonymous_Type_Access_Def
Synthetic type access, that will directly reference a type decl. It is used to generate synthetic anonymous access types.
- function F_Type_Decl (Node : Anonymous_Type_Access_Def'Class) Base_Type_Decl
When there are no parsing errors, this field is never null.
- type Base_Type_Decl
Base class for type declarations. It unifies every kind of type that exists in Ada, including types that have no source existence like classwide types.
- function F_Name (Node : Base_Type_Decl'Class) Defining_Name
This field may be null even when there are no parsing errors.
- function P_Base_Subtype (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Base_Type_Decl
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
- function P_Attribute_Subprogram (Node : Base_Type_Decl'Class; Attr_Name : Unbounded_Text_Type) Basic_Decl
Return the subprogram declaration denoted by this attribute name and defined on this type.
- function P_Private_Completion (Node : Base_Type_Decl'Class) Base_Type_Decl
Return the private completion for this type, if there is one.
- function P_Is_Inherited_Primitive (Node : Base_Type_Decl'Class; P : Basic_Decl'Class) Standard.Boolean
Assuming that P is a primitive of Self, return whether the given primitive P is inherited from one of Self’s parents.
- function P_Get_Record_Representation_Clause (Node : Base_Type_Decl'Class; Imprecise_Fallback : Standard.Boolean) Record_Rep_Clause
Return the record representation clause associated to this type decl, if applicable (i.e. this type decl defines a record type).
- function P_Get_Enum_Representation_Clause (Node : Base_Type_Decl'Class; Imprecise_Fallback : Standard.Boolean) Enum_Rep_Clause
Return the enum representation clause associated to this type decl, if applicable (i.e. this type decl defines an enum type).
- function P_Get_Primitives (Node : Base_Type_Decl'Class; Only_Inherited : Standard.Boolean; Include_Predefined_Operators : Standard.Boolean) Basic_Decl_Array
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 iffinclude_predefined_operators
is True. It defaults to False.
- function P_Is_Record_Type (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Standard.Boolean
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
- function P_Is_Array_Type (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Standard.Boolean
Return whether this type is an array type.
Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Find_Derived_Types (Node : Base_Type_Decl'Class; Root : Ada_Node'Class; Origin : Ada_Node'Class; Imprecise_Fallback : Standard.Boolean) Type_Decl_Array
Find types derived from self in the given
root
and its children.Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Is_Real_Type (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Standard.Boolean
Whether type is a real type or not.
Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Is_Float_Type (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Standard.Boolean
Whether type is a float type or not.
Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Is_Fixed_Point (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Standard.Boolean
Whether type is a fixed point type or not.
Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Is_Scalar_Type (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Standard.Boolean
Whether type is a scalar type.
Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Is_Enum_Type (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Standard.Boolean
Whether type is an enum type
Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Is_Access_Type (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Standard.Boolean
Whether Self is an access type or not
Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Specific_Type (Node : Base_Type_Decl'Class) Base_Type_Decl
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 returnT
.
- function P_Is_Char_Type (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Standard.Boolean
Whether type is a character type or not
Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Classwide_Type (Node : Base_Type_Decl'Class) Classwide_Type_Decl
Return the classwide type for this type, if applicable
- function P_Discrete_Range (Node : Base_Type_Decl'Class) Discrete_Range
Return the discrete range for this type decl, if applicable.
- function P_Is_Discrete_Type (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Standard.Boolean
Whether type is a discrete type or not.
Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Is_Int_Type (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Standard.Boolean
Whether type is an integer type or not.
Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Accessed_Type (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Base_Type_Decl
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
- function P_Is_Tagged_Type (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Standard.Boolean
Whether type is tagged or not
Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Base_Type (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Base_Type_Decl
Return the base type entity for this derived type declaration
Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Base_Types (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Base_Type_Decl_Array
Return the list of base types for Self.
Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Find_All_Derived_Types (Node : Base_Type_Decl'Class; Units : Analysis_Unit_Array; Imprecise_Fallback : Standard.Boolean) Type_Decl_Array
Return the list of all types that inherit (directly or indirectly) from Self among the given units.
- function P_Comp_Type (Node : Base_Type_Decl'Class; Is_Subscript : Standard.Boolean; Origin : Ada_Node'Class) Base_Type_Decl
Return the component type of
Self
, if applicable. The component type is the type you’ll get if you call a value whose type isSelf
. So it can either be:The component type for an array.
The return type for an access to function.
Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Index_Type (Node : Base_Type_Decl'Class; Dim : Standard.Integer; Origin : Ada_Node'Class) Base_Type_Decl
Return the index type for dimension
dim
for this type, if applicable.Warning
dim
is 0-based, so the firstindex_type
is at index 0.Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Is_Derived_Type (Node : Base_Type_Decl'Class; Other_Type : Base_Type_Decl'Class; Origin : Ada_Node'Class) Standard.Boolean
Whether Self is derived from other_type.
Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Is_Interface_Type (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Standard.Boolean
Return True iff this type declaration is an interface definition.
Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Is_Limited_Type (Node : Base_Type_Decl'Class) Standard.Boolean
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.
- function P_Matching_Type (Node : Base_Type_Decl'Class; Expected_Type : Base_Type_Decl'Class; Origin : Ada_Node'Class) Standard.Boolean
Return whether
self
matchesexpected_type
.Origin
: Origin for this property’s request. See The origin parameter for more details
- function P_Canonical_Type (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Base_Type_Decl
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
- function P_Previous_Part (Node : Base_Type_Decl'Class; Go_To_Incomplete : Standard.Boolean) Base_Type_Decl
Returns the previous part for this type decl.
- function P_Next_Part (Node : Base_Type_Decl'Class) Base_Type_Decl
Returns the next part for this type decl.
Note
Since this property returns a
BaseTypeDecl
, it cannot be used to retrieve the next part ofTaskTypeDecl
andProtectedTypeDecl
nodes as their next part is actually aBody
. UseBasicDecl.next_part_for_decl
for those instead.
- function P_Full_View (Node : Base_Type_Decl'Class) Base_Type_Decl
Return the full completion of this type.
- function P_Is_Definite_Subtype (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Standard.Boolean
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
- function P_Is_Private (Node : Base_Type_Decl'Class) Standard.Boolean
Whether node is a private view of corresponding type.
- function P_Discriminants_List (Node : Base_Type_Decl'Class; Stop_Recurse_At : Base_Type_Decl'Class; Origin : Ada_Node'Class) Base_Formal_Param_Decl_Array
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
- function P_Root_Type (Node : Base_Type_Decl'Class; Origin : Ada_Node'Class) Base_Type_Decl
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
- function P_Shapes (Node : Base_Type_Decl'Class; Include_Discriminants : Standard.Boolean; Origin : Ada_Node'Class) Shape_Array
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
- type Type_Decl
Type declarations that embed a type definition node. Corresponds to the ARM’s full type declarations (RM 3.2.1).
- function F_Discriminants (Node : Type_Decl'Class) Discriminant_Part
This field may be null even when there are no parsing errors.
- function F_Type_Def (Node : Type_Decl'Class) Type_Def
When there are no parsing errors, this field is never null.
- type Anonymous_Type_Decl
Anonymous type declaration (for anonymous array or access types). This class has no RM existence, and anonymous (sub)types are referred to implicitly in the RM.
- type Array_Type_Def
Type definition for an array (RM 3.6).
- function F_Indices (Node : Array_Type_Def'Class) Array_Indices
When there are no parsing errors, this field is never null.
- function F_Component_Type (Node : Array_Type_Def'Class) Component_Def
When there are no parsing errors, this field is never null.
- type Aspect_Assoc
Name/expression association in an aspect.
- function F_Id (Node : Aspect_Assoc'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Expr (Node : Aspect_Assoc'Class) Expr
This field can contain one of the following nodes:
Abstract_State_Decl_Expr
,Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Contract_Cases
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- function P_Is_Ghost_Code (Node : Aspect_Assoc'Class) Standard.Boolean
Return whether this aspect is ghost code or not. See SPARK RM 6.9.
- function List_Child (Node : Aspect_Assoc_List'Class; Index : Standard.Positive) Aspect_Assoc
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Aspect_Assoc_List
List of AspectAssoc.
- function Aspect_Assoc_List_First (Node : Aspect_Assoc_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Aspect_Assoc_List_Next (Node : Aspect_Assoc_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Aspect_Assoc_List_Has_Element (Node : Aspect_Assoc_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Aspect_Assoc_List_Element (Node : Aspect_Assoc_List; Cursor : Standard.Positive) Aspect_Assoc'Class
Implementation detail for the Iterable aspect
- type Aspect_Clause
Base class for aspect clauses.
- type Aspect_Spec
List of aspects in a declaration (RM 13.1.1).
- function F_Aspect_Assocs (Node : Aspect_Spec'Class) Aspect_Assoc_List
When there are no parsing errors, this field is never null.
- type Assign_Stmt
Statement for assignments (RM 5.2).
- function F_Dest (Node : Assign_Stmt'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Expr (Node : Assign_Stmt'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Basic_Assoc_List
List of BasicAssoc.
- function Basic_Assoc_List_First (Node : Basic_Assoc_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Basic_Assoc_List_Next (Node : Basic_Assoc_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Basic_Assoc_List_Has_Element (Node : Basic_Assoc_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Basic_Assoc_List_Element (Node : Basic_Assoc_List; Cursor : Standard.Positive) Basic_Assoc'Class
Implementation detail for the Iterable aspect
- type Assoc_List
List of associations.
- function P_Zip_With_Params (Node : Assoc_List'Class; Imprecise_Fallback : Standard.Boolean) Param_Actual_Array
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.
- type At_Clause
Representation clause (
for .. use at ...;
) (RM 13.5.1).- function F_Name (Node : At_Clause'Class) Base_Id
This field can contain one of the following nodes:
Char_Literal
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- function F_Expr (Node : At_Clause'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Attribute_Def_Clause
Clause for an attribute definition (
for ...'Attribute use ...;
) (RM 13.3).- function F_Attribute_Expr (Node : Attribute_Def_Clause'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Expr (Node : Attribute_Def_Clause'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Attribute_Ref
Expression to reference an attribute (RM 4.1.4).
- function F_Prefix (Node : Attribute_Ref'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Attribute (Node : Attribute_Ref'Class) Identifier
When there are no parsing errors, this field is never null.
- function F_Args (Node : Attribute_Ref'Class) Assoc_List
This field contains a list that itself contains one of the following nodes:
Param_Assoc
When there are no parsing errors, this field is never null.
- type Base_Assoc
Abstract class for a key/value association, where the value is an expression.
- function P_Assoc_Expr (Node : Base_Assoc'Class) Expr
Returns the expression side of this assoc node.
- function List_Child (Node : Base_Assoc_List'Class; Index : Standard.Positive) Base_Assoc
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Base_Assoc_List
List of BaseAssoc.
- function Base_Assoc_List_First (Node : Base_Assoc_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Base_Assoc_List_Next (Node : Base_Assoc_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Base_Assoc_List_Has_Element (Node : Base_Assoc_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Base_Assoc_List_Element (Node : Base_Assoc_List; Cursor : Standard.Positive) Base_Assoc'Class
Implementation detail for the Iterable aspect
- type Base_Formal_Param_Decl
Base class for formal parameter declarations. This is used both for records components and for subprogram parameters.
This is a Libadalang abstraction, that has no ARM existence.
- function P_Formal_Type (Node : Base_Formal_Param_Decl'Class; Origin : Ada_Node'Class) Base_Type_Decl
Return the type for this formal.
Origin
: Origin for this property’s request. See The origin parameter for more details
- type Base_Formal_Param_Holder
Base class for lists of formal parameters. This is used in every case a list of “formals” can be called or instantiated, so in all the following cases:
Subprogram specifications (and subprogram calls).
Component lists (and aggregates).
Generic formals (and generic instantiations).
This allows to share the parameter unpacking/matching logic.
This is a Libadalang abstraction that has no existence in the Ada reference manual.
- function P_Abstract_Formal_Params (Node : Base_Formal_Param_Holder'Class) Base_Formal_Param_Decl_Array
Return the list of abstract formal parameters for this holder.
- function P_Formal_Params (Node : Base_Formal_Param_Holder'Class) Defining_Name_Array
Return all parameters as a
DefiningName
array. This property doesn’t return record discriminants nor variants when called on a record component list.
- function P_Nb_Min_Params (Node : Base_Formal_Param_Holder'Class) Standard.Integer
Return the minimum number of parameters this subprogram can be called while still being a legal call.
- function P_Nb_Max_Params (Node : Base_Formal_Param_Holder'Class) Standard.Integer
Return the maximum number of parameters this subprogram can be called while still being a legal call.
- function P_Param_Types (Node : Base_Formal_Param_Holder'Class; Origin : Ada_Node'Class) Base_Type_Decl_Array
Returns the type of each parameter of Self.
Origin
: Origin for this property’s request. See The origin parameter for more details
- type Base_Loop_Stmt
Base class for loop statements (RM 5.5).
- function F_Spec (Node : Base_Loop_Stmt'Class) Loop_Spec
This field may be null even when there are no parsing errors.
- function F_Stmts (Node : Base_Loop_Stmt'Class) Stmt_List
This field contains a list that itself contains one of the following nodes:
Pragma_Node
,Stmt
When there are no parsing errors, this field is never null.
- function F_End_Name (Node : Base_Loop_Stmt'Class) End_Name
This field may be null even when there are no parsing errors.
- type Base_Package_Decl
Base class for package declarations. This will be used both for non- generic package declarations (via
Package_Decl
) and for generic ones (viaGeneric_Package_Internal
).- function F_Package_Name (Node : Base_Package_Decl'Class) Defining_Name
When there are no parsing errors, this field is never null.
- function F_Public_Part (Node : Base_Package_Decl'Class) Public_Part
When there are no parsing errors, this field is never null.
- function F_Private_Part (Node : Base_Package_Decl'Class) Private_Part
This field may be null even when there are no parsing errors.
- function F_End_Name (Node : Base_Package_Decl'Class) End_Name
This field may be null even when there are no parsing errors.
- function P_Body_Part (Node : Base_Package_Decl'Class) Package_Body
Return the PackageBody corresponding to this node.
- type Base_Record_Def
Base class for record definitions (RM 3.8).
- function F_Components (Node : Base_Record_Def'Class) Component_List
When there are no parsing errors, this field is never null.
- type Base_Subp_Body
Base class for subprogram bodies (RM 6.3).
- function F_Overriding (Node : Base_Subp_Body'Class) Overriding_Node
When there are no parsing errors, this field is never null.
- function F_Overriding (Node : Base_Subp_Body'Class) Libadalang.Common.Ada_Overriding_Node
- function F_Subp_Spec (Node : Base_Subp_Body'Class) Subp_Spec
When there are no parsing errors, this field is never null.
- type Base_Subp_Spec
Base class for subprogram specifications (RM 6.1).
- function P_Name (Node : Base_Subp_Spec'Class) Defining_Name
Syntax property. Return the name of the subprogram defined by this specification.
- function P_Returns (Node : Base_Subp_Spec'Class) Type_Expr
Syntax property. Return the type expression node corresponding to the return of this subprogram spec.
- function P_Params (Node : Base_Subp_Spec'Class) Param_Spec_Array
Returns the array of parameters specification for this subprogram spec.
- function P_Primitive_Subp_Types (Node : Base_Subp_Spec'Class; Imprecise_Fallback : Standard.Boolean) Base_Type_Decl_Array
Return the types of which this subprogram is a primitive of.
- function P_Primitive_Subp_First_Type (Node : Base_Subp_Spec'Class; Imprecise_Fallback : Standard.Boolean) Base_Type_Decl
Return the first type of which this subprogram is a primitive of.
- function P_Primitive_Subp_Tagged_Type (Node : Base_Subp_Spec'Class; Imprecise_Fallback : Standard.Boolean) Base_Type_Decl
If this subprogram is a primitive for a tagged type, then return this type.
- function P_Return_Type (Node : Base_Subp_Spec'Class; Origin : Ada_Node'Class) Base_Type_Decl
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
- type Base_Subtype_Decl
Base class for subtype declarations (RM 3.2.2).
- function P_Get_Type (Node : Base_Subtype_Decl'Class; Origin : Ada_Node'Class) Base_Type_Decl
Get the type for this subtype.
Origin
: Origin for this property’s request. See The origin parameter for more details
- type Begin_Block
Statement block with no declarative part (RM 5.6).
- function F_Stmts (Node : Begin_Block'Class) Handled_Stmts
When there are no parsing errors, this field is never null.
- function F_End_Name (Node : Begin_Block'Class) End_Name
This field may be null even when there are no parsing errors.
- type Bin_Op
Binary expression.
This encompasses several ARM expressions, because it is used for every binary expression in Ada, all documented in :RM 4.4.
- function F_Left (Node : Bin_Op'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Op (Node : Bin_Op'Class) Op
This field can contain one of the following nodes:
Op_And_Then
,Op_And
,Op_Div
,Op_Double_Dot
,Op_Eq
,Op_Gt
,Op_Gte
,Op_Lt
,Op_Lte
,Op_Minus
,Op_Mod
,Op_Mult
,Op_Neq
,Op_Or_Else
,Op_Or
,Op_Plus
,Op_Pow
,Op_Rem
,Op_Xor
When there are no parsing errors, this field is never null.
- function F_Op (Node : Bin_Op'Class) Libadalang.Common.Ada_Op
- function F_Right (Node : Bin_Op'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Box_Expr
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Body_Stub
Base class for a body stub (RM 10.1.3). A body stub is meant to be completed by .
- function P_Syntactic_Fully_Qualified_Name (Node : Body_Stub'Class) Unbounded_Text_Type_Array
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.).
- type Box_Expr
Box expression (
<>
).This is not an expression per-se in Ada, but treating it as one helps us keep coherent types in some cases, like aggregates expressions.
- type Call_Expr
Represent a syntactic call expression.
At the semantic level, this can be either a subprogram call, an array subcomponent access expression, an array slice or a type conversion, all described in RM 4.1, except for subprogram call statements, described in RM 6.4.
- function F_Name (Node : Call_Expr'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Suffix (Node : Call_Expr'Class) Ada_Node
This field can contain one of the following nodes:
Attribute_Ref
,Basic_Assoc_List
,Bin_Op
,Call_Expr
,Char_Literal
,Discrete_Subtype_Indication
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function P_Kind (Node : Call_Expr'Class) Call_Expr_Kind
Return whether this expression is a subprogram call, an array subcomponent access expression, an array slice or a type conversion.
- function P_Is_Array_Slice (Node : Call_Expr'Class) Standard.Boolean
Return whether this CallExpr is actually an access to a slice of the array denoted by the prefix of this CallExpr.
- type Call_Stmt
Statement for entry or procedure calls (RM 6.4).
- function F_Call (Node : Call_Stmt'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Cond_Expr
Base class for a conditional expressions (RM 4.5.7).
- function P_Dependent_Exprs (Node : Cond_Expr'Class) Expr_Array
Return the dependent expressions for this conditional expression.
- type Case_Expr
case
expression (RM 4.5.7).- function F_Expr (Node : Case_Expr'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Cases (Node : Case_Expr'Class) Case_Expr_Alternative_List
When there are no parsing errors, this field is never null.
- type Case_Expr_Alternative
Alternative in a
case
expression (when ... => ...
).- function F_Choices (Node : Case_Expr_Alternative'Class) Alternatives_List
This field contains a list that itself contains one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Discrete_Subtype_Indication
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Others_Designator
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Expr (Node : Case_Expr_Alternative'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function List_Child (Node : Case_Expr_Alternative_List'Class; Index : Standard.Positive) Case_Expr_Alternative
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Case_Expr_Alternative_List
List of CaseExprAlternative.
- function Case_Expr_Alternative_List_First (Node : Case_Expr_Alternative_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Case_Expr_Alternative_List_Next (Node : Case_Expr_Alternative_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Case_Expr_Alternative_List_Has_Element (Node : Case_Expr_Alternative_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Case_Expr_Alternative_List_Element (Node : Case_Expr_Alternative_List; Cursor : Standard.Positive) Case_Expr_Alternative'Class
Implementation detail for the Iterable aspect
- type Case_Stmt
case
statement (RM 5.4).- function F_Expr (Node : Case_Stmt'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Pragmas (Node : Case_Stmt'Class) Pragma_Node_List
When there are no parsing errors, this field is never null.
- function F_Alternatives (Node : Case_Stmt'Class) Case_Stmt_Alternative_List
When there are no parsing errors, this field is never null.
- type Case_Stmt_Alternative
Alternative in a
case
statement (when ... => ...
).- function F_Choices (Node : Case_Stmt_Alternative'Class) Alternatives_List
This field contains a list that itself contains one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Discrete_Subtype_Indication
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Others_Designator
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Stmts (Node : Case_Stmt_Alternative'Class) Stmt_List
This field contains a list that itself contains one of the following nodes:
Pragma_Node
,Stmt
When there are no parsing errors, this field is never null.
- function List_Child (Node : Case_Stmt_Alternative_List'Class; Index : Standard.Positive) Case_Stmt_Alternative
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Case_Stmt_Alternative_List
List of CaseStmtAlternative.
- function Case_Stmt_Alternative_List_First (Node : Case_Stmt_Alternative_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Case_Stmt_Alternative_List_Next (Node : Case_Stmt_Alternative_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Case_Stmt_Alternative_List_Has_Element (Node : Case_Stmt_Alternative_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Case_Stmt_Alternative_List_Element (Node : Case_Stmt_Alternative_List; Cursor : Standard.Positive) Case_Stmt_Alternative'Class
Implementation detail for the Iterable aspect
- type Char_Literal
Character literal (RM 4.1).
- function P_Denoted_Value (Node : Char_Literal'Class) Character_Type
Return the value that this literal denotes.
- type Classwide_Type_Decl
Synthetic node (not parsed, generated from a property call). Refers to the classwide type for a given tagged type (RM 3.4.1).
- type Compilation_Unit
Root node for all Ada analysis units (RM 10.1.1).
- function F_Prelude (Node : Compilation_Unit'Class) Ada_Node_List
with
,use
orpragma
statements.This field contains a list that itself contains one of the following nodes:
Pragma_Node
,Use_Clause
,With_Clause
When there are no parsing errors, this field is never null.
- function F_Body (Node : Compilation_Unit'Class) Ada_Node
This field can contain one of the following nodes:
Library_Item
,Subunit
When there are no parsing errors, this field is never null.
- function F_Pragmas (Node : Compilation_Unit'Class) Pragma_Node_List
When there are no parsing errors, this field is never null.
- function P_Syntactic_Fully_Qualified_Name (Node : Compilation_Unit'Class) Unbounded_Text_Type_Array
Return the syntactic fully qualified name of this compilation unit.
- function P_Unit_Kind (Node : Compilation_Unit'Class) Analysis_Unit_Kind
Return the kind corresponding to this analysis unit.
- function P_Withed_Units (Node : Compilation_Unit'Class; Include_Privates : Standard.Boolean) Compilation_Unit_Array
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 ifinclude_privates
is True.
- function P_Imported_Units (Node : Compilation_Unit'Class; Include_Privates : Standard.Boolean) Compilation_Unit_Array
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.
- function P_Unit_Dependencies (Node : Compilation_Unit'Class) Compilation_Unit_Array
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.
- function P_Decl (Node : Compilation_Unit'Class) Basic_Decl
Get the root basic decl defined in this compilation unit.
- function P_Is_Preelaborable (Node : Compilation_Unit'Class; Imprecise_Fallback : Standard.Boolean) Standard.Boolean
Whether this compilation unit is preelaborable or not.
- function P_Other_Part (Node : Compilation_Unit'Class) Compilation_Unit
If this compilation unit is of kind UnitSpecification, return its corresponding body unit, and conversely.
- function P_Has_Restriction (Node : Compilation_Unit'Class; Name : Unbounded_Text_Type) Standard.Boolean
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.
- function P_All_Config_Pragmas (Node : Compilation_Unit'Class) Pragma_Node_Array
Return the list of configuration pragmas that apply to the current unit.
- function P_Config_Pragmas (Node : Compilation_Unit'Class; Name : Unbounded_Text_Type) Pragma_Node_Array
Return the list of configuration pragmas with the given name that apply to the current unit.
- function List_Child (Node : Compilation_Unit_List'Class; Index : Standard.Positive) Compilation_Unit
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Compilation_Unit_List
List of CompilationUnit.
- function Compilation_Unit_List_First (Node : Compilation_Unit_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Compilation_Unit_List_Next (Node : Compilation_Unit_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Compilation_Unit_List_Has_Element (Node : Compilation_Unit_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Compilation_Unit_List_Element (Node : Compilation_Unit_List; Cursor : Standard.Positive) Compilation_Unit'Class
Implementation detail for the Iterable aspect
- type Component_Clause
Representation clause for a single component (RM 13.5.1).
- function F_Id (Node : Component_Clause'Class) Identifier
When there are no parsing errors, this field is never null.
- function F_Position (Node : Component_Clause'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Range (Node : Component_Clause'Class) Range_Spec
When there are no parsing errors, this field is never null.
- type Component_Decl
Declaration for a component (RM 3.8).
- function F_Ids (Node : Component_Decl'Class) Defining_Name_List
When there are no parsing errors, this field is never null.
- function F_Component_Def (Node : Component_Decl'Class) Component_Def
When there are no parsing errors, this field is never null.
- function F_Default_Expr (Node : Component_Decl'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- type Component_Def
Definition for a component (RM 3.6).
- function F_Has_Aliased (Node : Component_Def'Class) Aliased_Node
When there are no parsing errors, this field is never null.
- function F_Has_Aliased (Node : Component_Def'Class) Standard.Boolean
- function F_Has_Constant (Node : Component_Def'Class) Constant_Node
When there are no parsing errors, this field is never null.
- function F_Has_Constant (Node : Component_Def'Class) Standard.Boolean
- function F_Type_Expr (Node : Component_Def'Class) Type_Expr
This field can contain one of the following nodes:
Anonymous_Type
,Subtype_Indication
When there are no parsing errors, this field is never null.
- type Component_List
List of component declarations (RM 3.8).
- function F_Components (Node : Component_List'Class) Ada_Node_List
This field contains a list that itself contains one of the following nodes:
Aspect_Clause
,Component_Decl
,Null_Component_Decl
,Pragma_Node
When there are no parsing errors, this field is never null.
- function F_Variant_Part (Node : Component_List'Class) Variant_Part
This field may be null even when there are no parsing errors.
- type Composite_Constraint
Constraint for a composite type (RM 3.6.1). Due to ambiguities in the Ada grammar, this could be either a list of index constraints, if the owning type is an array type, or a list of discriminant constraints, if the owning type is a discriminated record type.
- function F_Constraints (Node : Composite_Constraint'Class) Assoc_List
This field contains a list that itself contains one of the following nodes:
Composite_Constraint_Assoc
When there are no parsing errors, this field is never null.
- function P_Is_Index_Constraint (Node : Composite_Constraint'Class) Standard.Boolean
Whether this composite constraint is an index constraint.
- function P_Is_Discriminant_Constraint (Node : Composite_Constraint'Class) Standard.Boolean
Whether this composite constraint is a discriminant constraint.
- function P_Discriminant_Params (Node : Composite_Constraint'Class) Param_Actual_Array
Returns an array of pairs, associating each discriminant to its actual or default expression.
- type Composite_Constraint_Assoc
Association of discriminant names to an expression (RM 3.7.1).
- function F_Ids (Node : Composite_Constraint_Assoc'Class) Discriminant_Choice_List
This field can contain one of the following nodes:
Identifier_List
When there are no parsing errors, this field is never null.
- function F_Constraint_Expr (Node : Composite_Constraint_Assoc'Class) Ada_Node
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Discrete_Subtype_Indication
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Concat_Op
Concatenation expression.
Since concatenation expression can be huge in practice, this node handles them as a list of operands rather than a deep tree of binary operators, in order to avoid crashes while parsing of running name resolution on such huge expression.
The purpose of this node is to replace the arbitrarily too deep tree of binary operators (which can lead to a stack overflow), as for example with
"A & B & C & D & E"
:BinOp( Binop( BinOp( BinOp(A, &, B), & , C), &, D), &, E)
by a single operator, handling a list of operands that can be processed without having to perform deep recursions:
ConcatOp(A, ConcatOperand(&, B), ConcatOperand(&, C), ConcatOperand(&, D), ConcatOperand(&, E))
- function F_First_Operand (Node : Concat_Op'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Other_Operands (Node : Concat_Op'Class) Concat_Operand_List
When there are no parsing errors, this field is never null.
- function P_Operands (Node : Concat_Op'Class) Expr_Array
Return the operands of this concatenation expression
- type Concat_Operand
A concatenation operator and its RHS operand.
This node is used to represent the tuple (”&”, operand) used by the
ConcatOp
node to store itsother_operands
list.- function F_Operator (Node : Concat_Operand'Class) Op_Concat
When there are no parsing errors, this field is never null.
- function F_Operand (Node : Concat_Operand'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function List_Child (Node : Concat_Operand_List'Class; Index : Standard.Positive) Concat_Operand
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Concat_Operand_List
List of ConcatOperand.
- function Concat_Operand_List_First (Node : Concat_Operand_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Concat_Operand_List_Next (Node : Concat_Operand_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Concat_Operand_List_Has_Element (Node : Concat_Operand_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Concat_Operand_List_Element (Node : Concat_Operand_List; Cursor : Standard.Positive) Concat_Operand'Class
Implementation detail for the Iterable aspect
- type Concrete_Type_Decl
A concrete type declaration.
- type Constant_Node
Qualifier for the
constant
keyword.- function P_As_Bool (Node : Constant_Node'Class) Standard.Boolean
Return whether this is an instance of ConstantPresent
- type Constant_Absent
- type Constant_Present
- type Constrained_Array_Indices
Constrained specification for array indexes (RM 3.6).
- function F_List (Node : Constrained_Array_Indices'Class) Constraint_List
This field contains a list that itself contains one of the following nodes:
Attribute_Ref
,Bin_Op
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Subtype_Indication
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Subtype_Indication
Reference to a type by name (RM 3.2.2).
- function F_Has_Not_Null (Node : Subtype_Indication'Class) Not_Null
When there are no parsing errors, this field is never null.
- function F_Has_Not_Null (Node : Subtype_Indication'Class) Standard.Boolean
- function F_Name (Node : Subtype_Indication'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- function F_Constraint (Node : Subtype_Indication'Class) Constraint
This field may be null even when there are no parsing errors.
- function P_Is_Static_Subtype (Node : Subtype_Indication'Class; Imprecise_Fallback : Standard.Boolean) Standard.Boolean
Returns whether Self denotes a static subtype or not.
- type Constrained_Subtype_Indication
Reference to a type with a range constraint.
- type Constraint_List
List of constraints.
This list node can contain one of the following nodes:
Attribute_Ref
,Bin_Op
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Subtype_Indication
,Target_Name
,Update_Attribute_Ref
- type Contract_Case_Assoc
Single association for the
Contract_Case
aspect.- function F_Guard (Node : Contract_Case_Assoc'Class) Ada_Node
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Others_Designator
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Consequence (Node : Contract_Case_Assoc'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function List_Child (Node : Contract_Case_Assoc_List'Class; Index : Standard.Positive) Contract_Case_Assoc
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Contract_Case_Assoc_List
List of ContractCaseAssoc.
- function Contract_Case_Assoc_List_First (Node : Contract_Case_Assoc_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Contract_Case_Assoc_List_Next (Node : Contract_Case_Assoc_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Contract_Case_Assoc_List_Has_Element (Node : Contract_Case_Assoc_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Contract_Case_Assoc_List_Element (Node : Contract_Case_Assoc_List; Cursor : Standard.Positive) Contract_Case_Assoc'Class
Implementation detail for the Iterable aspect
- type Contract_Cases
List of associations for the
Contract_Case
aspect.Contract cases is a non standard Ada extension that’s mainly useful in SPARK. See the SPARK RM for more details.
- function F_Contract_Cases (Node : Contract_Cases'Class) Contract_Case_Assoc_List
When there are no parsing errors, this field is never null.
- type Decimal_Fixed_Point_Def
Type definition for decimal fixed-point numbers (RM 3.5.9).
- function F_Delta (Node : Decimal_Fixed_Point_Def'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Box_Expr
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Digits (Node : Decimal_Fixed_Point_Def'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Box_Expr
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Range (Node : Decimal_Fixed_Point_Def'Class) Range_Spec
This field may be null even when there are no parsing errors.
- type Decl_Block
Statement block with a declarative part (RM 5.6).
- function F_Decls (Node : Decl_Block'Class) Declarative_Part
When there are no parsing errors, this field is never null.
- function F_Stmts (Node : Decl_Block'Class) Handled_Stmts
When there are no parsing errors, this field is never null.
- function F_End_Name (Node : Decl_Block'Class) End_Name
This field may be null even when there are no parsing errors.
- type Decl_Expr
Declare expression (Ada 2022, RM 4.5.9).
- function F_Decls (Node : Decl_Expr'Class) Ada_Node_List
This field contains a list that itself contains one of the following nodes:
Object_Decl
,Pragma_Node
When there are no parsing errors, this field is never null.
- function F_Expr (Node : Decl_Expr'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Decl_List
List of declarations.
This list node can contain one of the following nodes:
Abstract_Subp_Decl
,Aspect_Clause
,Component_Decl
,Entry_Decl
,Expr_Function
,Null_Subp_Decl
,Pragma_Node
,Subp_Decl
,Subp_Renaming_Decl
- type Declarative_Part
List of declarations (RM 3.11).
- function F_Decls (Node : Declarative_Part'Class) Ada_Node_List
This field contains a list that itself contains one of the following nodes:
Abstract_Subp_Decl
,Aspect_Clause
,Base_Subp_Body
,Body_Stub
,Component_Decl
,Concrete_Type_Decl
,Entry_Body
,Entry_Decl
,Error_Decl
,Exception_Decl
,Generic_Decl
,Generic_Instantiation
,Generic_Renaming_Decl
,Incomplete_Type_Decl
,Number_Decl
,Object_Decl
,Package_Body
,Package_Decl
,Package_Renaming_Decl
,Pragma_Node
,Protected_Body
,Protected_Type_Decl
,Single_Protected_Decl
,Single_Task_Decl
,Subp_Decl
,Subtype_Decl
,Task_Body
,Task_Type_Decl
,Use_Clause
When there are no parsing errors, this field is never null.
- type Defining_Name
Name that defines an entity (RM 3.1).
- function F_Name (Node : Defining_Name'Class) Name
This field can contain one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
,Synthetic_Identifier
When there are no parsing errors, this field is never null.
- function P_Canonical_Fully_Qualified_Name (Node : Defining_Name'Class) Text_Type
Return a canonical representation of the fully qualified name corresponding to this defining name.
- function P_Unique_Identifying_Name (Node : Defining_Name'Class) Text_Type
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.
Attention
This will only return a unique name for public declarations. Notably, anything nested in an unnamed declare block won’t be handled correctly.
- function P_Fully_Qualified_Name_Array (Node : Defining_Name'Class) Unbounded_Text_Type_Array
Return the fully qualified name corresponding to this defining name, as an array of symbols.
- function P_Fully_Qualified_Name (Node : Defining_Name'Class) Text_Type
Return the fully qualified name corresponding to this defining name.
- function P_Basic_Decl (Node : Defining_Name'Class) Basic_Decl
Returns this DefiningName’s basic declaration
- function P_Find_Refs (Node : Defining_Name'Class; Root : Ada_Node'Class; Imprecise_Fallback : Standard.Boolean) Ref_Result_Array
Find all references to this defining name in the given
root
and its children.
- function P_Find_All_References (Node : Defining_Name'Class; Units : Analysis_Unit_Array; Follow_Renamings : Standard.Boolean; Imprecise_Fallback : Standard.Boolean) Ref_Result_Array
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.
- function P_Find_All_Calls (Node : Defining_Name'Class; Units : Analysis_Unit_Array; Follow_Renamings : Standard.Boolean; Imprecise_Fallback : Standard.Boolean) Ref_Result_Array
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 theA (B)
call.Note
This does not yet support calls done inside generics.
- function P_Next_Part (Node : Defining_Name'Class; Imprecise_Fallback : Standard.Boolean) Defining_Name
Like
BasicDecl.next_part_for_decl
on a defining name
- function P_Previous_Part (Node : Defining_Name'Class; Imprecise_Fallback : Standard.Boolean) Defining_Name
Like
BasicDecl.previous_part_for_decl
on a defining name
- function P_Canonical_Part (Node : Defining_Name'Class; Imprecise_Fallback : Standard.Boolean) Defining_Name
Like
BasicDecl.canonical_part
on a defining name
- function P_Most_Visible_Part (Node : Defining_Name'Class; Origin : Ada_Node'Class; Imprecise_Fallback : Standard.Boolean) Defining_Name
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
- function P_All_Parts (Node : Defining_Name'Class; Imprecise_Fallback : Standard.Boolean) Defining_Name_Array
Return all parts that define this entity, sorted from first part to last part.
- function P_Get_Aspect (Node : Defining_Name'Class; Name : Unbounded_Text_Type; Previous_Parts_Only : Standard.Boolean; Imprecise_Fallback : Standard.Boolean) 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.
This will return the syntactic node corresponding to attribute directly.
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.Morover, 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 toTrue
in the returned result).
- function P_Has_Aspect (Node : Defining_Name'Class; Name : Unbounded_Text_Type; Previous_Parts_Only : Standard.Boolean; Imprecise_Fallback : Standard.Boolean) Standard.Boolean
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. SeeDefiningName.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 RM 13.1).
- function P_Get_Pragma (Node : Defining_Name'Class; Name : Unbounded_Text_Type) Pragma_Node
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.
- function P_Get_Representation_Clause (Node : Defining_Name'Class; Name : Unbounded_Text_Type; Imprecise_Fallback : Standard.Boolean) Attribute_Def_Clause
Return the representation clause associated to this entity that defines the given attribute name.
- function P_Get_At_Clause (Node : Defining_Name'Class; Imprecise_Fallback : Standard.Boolean) At_Clause
Return the at clause associated to this entity.
- function P_Is_Imported (Node : Defining_Name'Class) Standard.Boolean
Whether this entity defined by this name is imported from another language.
- function P_Is_Ghost_Code (Node : Defining_Name'Class) Standard.Boolean
Return whether the entity defined by this name is ghost or not. See SPARK RM 6.9.
- function List_Child (Node : Defining_Name_List'Class; Index : Standard.Positive) Defining_Name
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Defining_Name_List
List of DefiningName.
- function Defining_Name_List_First (Node : Defining_Name_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Defining_Name_List_Next (Node : Defining_Name_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Defining_Name_List_Has_Element (Node : Defining_Name_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Defining_Name_List_Element (Node : Defining_Name_List; Cursor : Standard.Positive) Defining_Name'Class
Implementation detail for the Iterable aspect
- type Delay_Stmt
delay
statement (RM 9.6).- function F_Has_Until (Node : Delay_Stmt'Class) Until_Node
When there are no parsing errors, this field is never null.
- function F_Has_Until (Node : Delay_Stmt'Class) Standard.Boolean
- function F_Expr (Node : Delay_Stmt'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Delta_Constraint
Delta and range type constraint (RM J.3).
- function F_Delta (Node : Delta_Constraint'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Range (Node : Delta_Constraint'Class) Range_Spec
This field may be null even when there are no parsing errors.
- type Derived_Type_Def
Type definition for a derived type (RM 3.4).
- function F_Has_Abstract (Node : Derived_Type_Def'Class) Abstract_Node
When there are no parsing errors, this field is never null.
- function F_Has_Abstract (Node : Derived_Type_Def'Class) Standard.Boolean
- function F_Has_Limited (Node : Derived_Type_Def'Class) Limited_Node
When there are no parsing errors, this field is never null.
- function F_Has_Limited (Node : Derived_Type_Def'Class) Standard.Boolean
- function F_Has_Synchronized (Node : Derived_Type_Def'Class) Synchronized_Node
When there are no parsing errors, this field is never null.
- function F_Has_Synchronized (Node : Derived_Type_Def'Class) Standard.Boolean
- function F_Subtype_Indication (Node : Derived_Type_Def'Class) Subtype_Indication
When there are no parsing errors, this field is never null.
- function F_Interfaces (Node : Derived_Type_Def'Class) Parent_List
This field contains a list that itself contains one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- function F_Record_Extension (Node : Derived_Type_Def'Class) Base_Record_Def
This field may be null even when there are no parsing errors.
- function F_Has_With_Private (Node : Derived_Type_Def'Class) With_Private
When there are no parsing errors, this field is never null.
- function F_Has_With_Private (Node : Derived_Type_Def'Class) Standard.Boolean
- type Digits_Constraint
Digits and range type constraint (RM 3.5.9).
- function F_Digits (Node : Digits_Constraint'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Range (Node : Digits_Constraint'Class) Range_Spec
This field may be null even when there are no parsing errors.
- type Discrete_Base_Subtype_Decl
Specific
BaseSubtypeDecl
synthetic subclass for the base type of scalar types.
- type Discrete_Subtype_Indication
Reference to a type with a general constraint.
- type Discrete_Subtype_Name
Subtype name for membership test expressions (RM 3.6).
- function F_Subtype (Node : Discrete_Subtype_Name'Class) Discrete_Subtype_Indication
When there are no parsing errors, this field is never null.
- type Identifier_List
List of Identifier.
- function Identifier_List_First (Node : Identifier_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Identifier_List_Next (Node : Identifier_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Identifier_List_Has_Element (Node : Identifier_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Identifier_List_Element (Node : Identifier_List; Cursor : Standard.Positive) Identifier'Class
Implementation detail for the Iterable aspect
- type Discriminant_Choice_List
List of discriminant associations.
- type Discriminant_Part
Specification for discriminants in type declarations.
- type Discriminant_Spec
Known list of discriminants in type declarations (RM 3.7).
- function F_Ids (Node : Discriminant_Spec'Class) Defining_Name_List
When there are no parsing errors, this field is never null.
- function F_Type_Expr (Node : Discriminant_Spec'Class) Type_Expr
This field can contain one of the following nodes:
Anonymous_Type
,Subtype_Indication
When there are no parsing errors, this field is never null.
- function F_Default_Expr (Node : Discriminant_Spec'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- function List_Child (Node : Discriminant_Spec_List'Class; Index : Standard.Positive) Discriminant_Spec
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Discriminant_Spec_List
List of DiscriminantSpec.
- function Discriminant_Spec_List_First (Node : Discriminant_Spec_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Discriminant_Spec_List_Next (Node : Discriminant_Spec_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Discriminant_Spec_List_Has_Element (Node : Discriminant_Spec_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Discriminant_Spec_List_Element (Node : Discriminant_Spec_List; Cursor : Standard.Positive) Discriminant_Spec'Class
Implementation detail for the Iterable aspect
- type Dotted_Name
Name to select a suffix in a prefix (RM 4.1.3).
- function F_Prefix (Node : Dotted_Name'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Suffix (Node : Dotted_Name'Class) Base_Id
This field can contain one of the following nodes:
Char_Literal
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- type Elsif_Expr_Part
elsif
block, part of anif
expression.- function F_Cond_Expr (Node : Elsif_Expr_Part'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Then_Expr (Node : Elsif_Expr_Part'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function List_Child (Node : Elsif_Expr_Part_List'Class; Index : Standard.Positive) Elsif_Expr_Part
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Elsif_Expr_Part_List
List of ElsifExprPart.
- function Elsif_Expr_Part_List_First (Node : Elsif_Expr_Part_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Elsif_Expr_Part_List_Next (Node : Elsif_Expr_Part_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Elsif_Expr_Part_List_Has_Element (Node : Elsif_Expr_Part_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Elsif_Expr_Part_List_Element (Node : Elsif_Expr_Part_List; Cursor : Standard.Positive) Elsif_Expr_Part'Class
Implementation detail for the Iterable aspect
- type Elsif_Stmt_Part
elsif
part in anif
statement block.- function F_Cond_Expr (Node : Elsif_Stmt_Part'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Stmts (Node : Elsif_Stmt_Part'Class) Stmt_List
This field contains a list that itself contains one of the following nodes:
Pragma_Node
,Stmt
When there are no parsing errors, this field is never null.
- function List_Child (Node : Elsif_Stmt_Part_List'Class; Index : Standard.Positive) Elsif_Stmt_Part
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Elsif_Stmt_Part_List
List of ElsifStmtPart.
- function Elsif_Stmt_Part_List_First (Node : Elsif_Stmt_Part_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Elsif_Stmt_Part_List_Next (Node : Elsif_Stmt_Part_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Elsif_Stmt_Part_List_Has_Element (Node : Elsif_Stmt_Part_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Elsif_Stmt_Part_List_Element (Node : Elsif_Stmt_Part_List; Cursor : Standard.Positive) Elsif_Stmt_Part'Class
Implementation detail for the Iterable aspect
- type End_Name
Entity name in
end ...;
syntactic constructs.- function F_Name (Node : End_Name'Class) Name
This field can contain one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- function P_Basic_Decl (Node : End_Name'Class) Basic_Decl
Returns this EndName’s basic declaration
- type Entry_Body
Entry body (RM 9.5.2).
- function F_Entry_Name (Node : Entry_Body'Class) Defining_Name
When there are no parsing errors, this field is never null.
- function F_Index_Spec (Node : Entry_Body'Class) Entry_Index_Spec
This field may be null even when there are no parsing errors.
- function F_Params (Node : Entry_Body'Class) Entry_Completion_Formal_Params
When there are no parsing errors, this field is never null.
- function F_Barrier (Node : Entry_Body'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Decls (Node : Entry_Body'Class) Declarative_Part
When there are no parsing errors, this field is never null.
- function F_Stmts (Node : Entry_Body'Class) Handled_Stmts
When there are no parsing errors, this field is never null.
- function F_End_Name (Node : Entry_Body'Class) End_Name
This field may be null even when there are no parsing errors.
- type Entry_Completion_Formal_Params
Formal parameters for the completion of an
EntryDecl
(either anEntryBody
or anAcceptStmt
).- function F_Params (Node : Entry_Completion_Formal_Params'Class) Params
This field may be null even when there are no parsing errors.
- type Entry_Decl
Entry declaration (RM 9.4).
- function F_Overriding (Node : Entry_Decl'Class) Overriding_Node
When there are no parsing errors, this field is never null.
- function F_Overriding (Node : Entry_Decl'Class) Libadalang.Common.Ada_Overriding_Node
- function F_Spec (Node : Entry_Decl'Class) Entry_Spec
When there are no parsing errors, this field is never null.
- function P_Body_Part (Node : Entry_Decl'Class; Imprecise_Fallback : Standard.Boolean) Body_Node
Return the entry body associated to this entry declaration.
- function P_Accept_Stmts (Node : Entry_Decl'Class) Accept_Stmt_Array
Return an array of accept statements corresponding to this entry.
- type Entry_Index_Spec
Index specification for an entry body (RM 9.5.2).
- function F_Id (Node : Entry_Index_Spec'Class) Defining_Name
When there are no parsing errors, this field is never null.
- function F_Subtype (Node : Entry_Index_Spec'Class) Ada_Node
This field can contain one of the following nodes:
Attribute_Ref
,Bin_Op
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Subtype_Indication
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Entry_Spec
Entry specification.
This node does not have ARM existence, because in the RM subprogram specifications don’t encompass the ad-hoc specifications that happen in entry declarations. Entry declarations are described in RM 9.5.2.
- function F_Entry_Name (Node : Entry_Spec'Class) Defining_Name
When there are no parsing errors, this field is never null.
- function F_Family_Type (Node : Entry_Spec'Class) Ada_Node
This field can contain one of the following nodes:
Attribute_Ref
,Bin_Op
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Subtype_Indication
,Target_Name
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- function F_Entry_Params (Node : Entry_Spec'Class) Params
This field may be null even when there are no parsing errors.
- type Enum_Lit_Synth_Type_Expr
Synthetic node. Represents the type expression for an enum literal.
- type Enum_Literal_Decl
Declaration for an enumeration literal (RM 3.5.1).
- function F_Name (Node : Enum_Literal_Decl'Class) Defining_Name
This field may be null even when there are no parsing errors.
- function P_Enum_Type (Node : Enum_Literal_Decl'Class) Type_Decl
Return the enum type corresponding to this enum literal.
- function P_Enum_Rep (Node : Enum_Literal_Decl'Class) Big_Integer
Return the integer used to encode this enum literal.
Note
This property is equivalent to GNAT’s
Enum_Rep
attribute.
- function List_Child (Node : Enum_Literal_Decl_List'Class; Index : Standard.Positive) Enum_Literal_Decl
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Enum_Literal_Decl_List
List of EnumLiteralDecl.
- function Enum_Literal_Decl_List_First (Node : Enum_Literal_Decl_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Enum_Literal_Decl_List_Next (Node : Enum_Literal_Decl_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Enum_Literal_Decl_List_Has_Element (Node : Enum_Literal_Decl_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Enum_Literal_Decl_List_Element (Node : Enum_Literal_Decl_List; Cursor : Standard.Positive) Enum_Literal_Decl'Class
Implementation detail for the Iterable aspect
- type Enum_Rep_Clause
Representation clause for enumeration types (RM 13.4).
- function F_Type_Name (Node : Enum_Rep_Clause'Class) Name
This field can contain one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- function F_Aggregate (Node : Enum_Rep_Clause'Class) Base_Aggregate
When there are no parsing errors, this field is never null.
- function P_Params (Node : Enum_Rep_Clause'Class) Param_Actual_Array
Returns an array of pairs, associating enum literals to representation clause actuals.
- type Enum_Subp_Spec
Synthetic node for the abstract subprogram spec of an enum literal.
NOTE: This has no existence in the ARM. While enum literals are functions semantically, they’re not such syntactically.
- type Enum_Type_Def
Type definition for enumerations (RM 3.5.1).
- function F_Enum_Literals (Node : Enum_Type_Def'Class) Enum_Literal_Decl_List
When there are no parsing errors, this field is never null.
- type Error_Decl
Placeholder node for syntax errors in lists of declarations.
- type Error_Stmt
Placeholder node for syntax errors in lists of statements.
- type Exception_Decl
Exception declarations (RM 11.1).
- function F_Ids (Node : Exception_Decl'Class) Defining_Name_List
When there are no parsing errors, this field is never null.
- function F_Renames (Node : Exception_Decl'Class) Renaming_Clause
This field may be null even when there are no parsing errors.
- type Exception_Handler
Exception handler (RM 11.2).
- function F_Exception_Name (Node : Exception_Handler'Class) Defining_Name
This field may be null even when there are no parsing errors.
- function F_Handled_Exceptions (Node : Exception_Handler'Class) Alternatives_List
This field contains a list that itself contains one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Others_Designator
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Stmts (Node : Exception_Handler'Class) Stmt_List
This field contains a list that itself contains one of the following nodes:
Pragma_Node
,Stmt
When there are no parsing errors, this field is never null.
- type Exit_Stmt
exit
statement (RM 5.7).- function F_Loop_Name (Node : Exit_Stmt'Class) Name
This field can contain one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
This field may be null even when there are no parsing errors.
- function F_Cond_Expr (Node : Exit_Stmt'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- type Explicit_Deref
Explicit dereference expression (
.all
) (RM 4.1).- function F_Prefix (Node : Explicit_Deref'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Expr_List
List of Expr.
This list node can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Discrete_Subtype_Name
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
- function Expr_List_First (Node : Expr_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Expr_List_Next (Node : Expr_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Expr_List_Has_Element (Node : Expr_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Expr_List_Element (Node : Expr_List; Cursor : Standard.Positive) Expr'Class
Implementation detail for the Iterable aspect
- type Expr_Alternatives_List
List of alternatives in a membership test expression.
This list node can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Discrete_Subtype_Name
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
- type Expr_Function
Expression function (RM 6.8).
- function F_Expr (Node : Expr_Function'Class) Expr
This field can contain one of the following nodes:
Base_Aggregate
,Paren_Expr
When there are no parsing errors, this field is never null.
- type Extended_Return_Stmt
Extended
return
statement (RM 6.5).- function F_Decl (Node : Extended_Return_Stmt'Class) Extended_Return_Stmt_Object_Decl
When there are no parsing errors, this field is never null.
- function F_Stmts (Node : Extended_Return_Stmt'Class) Handled_Stmts
This field may be null even when there are no parsing errors.
- type Object_Decl
Base class for Ada object declarations (RM 3.3.1). Ada object declarations are variables/constants declarations that can be declared in any declarative scope.
- function F_Ids (Node : Object_Decl'Class) Defining_Name_List
When there are no parsing errors, this field is never null.
- function F_Has_Aliased (Node : Object_Decl'Class) Aliased_Node
This field may be null even when there are no parsing errors.
- function F_Has_Aliased (Node : Object_Decl'Class) Standard.Boolean
- function F_Has_Constant (Node : Object_Decl'Class) Constant_Node
This field may be null even when there are no parsing errors.
- function F_Has_Constant (Node : Object_Decl'Class) Standard.Boolean
- function F_Mode (Node : Object_Decl'Class) Mode
This field may be null even when there are no parsing errors.
- function F_Mode (Node : Object_Decl'Class) Libadalang.Common.Ada_Mode
- function F_Type_Expr (Node : Object_Decl'Class) Type_Expr
This field can contain one of the following nodes:
Anonymous_Type
,Subtype_Indication
This field may be null even when there are no parsing errors.
- function F_Default_Expr (Node : Object_Decl'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- function F_Renaming_Clause (Node : Object_Decl'Class) Renaming_Clause
This field may be null even when there are no parsing errors.
- function P_Private_Part_Decl (Node : Object_Decl'Class) Basic_Decl
If this object decl is the constant completion of an object decl in the public part, return the object decl from the public part.
- function P_Public_Part_Decl (Node : Object_Decl'Class) Basic_Decl
If this object decl is the incomplete declaration of a constant in a public part, return its completion in the private part.
- type Extended_Return_Stmt_Object_Decl
Object declaration that is part of an extended return statement (RM 6.5).
- type Floating_Point_Def
Type definition for floating-point numbers (RM 3.5.7).
- function F_Num_Digits (Node : Floating_Point_Def'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Box_Expr
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Range (Node : Floating_Point_Def'Class) Range_Spec
This field may be null even when there are no parsing errors.
- type For_Loop_Iter_Filter
Represent the
when ...
filter after a for loop specification. This class has no RM existence, it is used internally to wrap the filtering expression, so as to have a dedicated name resolution entry point for it and make sure it is resolved separatly from theForLoopSpec
itself (which it cannot influence anyway).- function F_Expr (Node : For_Loop_Iter_Filter'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type For_Loop_Spec
Specification for a
for
loop (RM 5.5).- function F_Var_Decl (Node : For_Loop_Spec'Class) For_Loop_Var_Decl
When there are no parsing errors, this field is never null.
- function F_Loop_Type (Node : For_Loop_Spec'Class) Iter_Type
When there are no parsing errors, this field is never null.
- function F_Loop_Type (Node : For_Loop_Spec'Class) Libadalang.Common.Ada_Iter_Type
- function F_Has_Reverse (Node : For_Loop_Spec'Class) Reverse_Node
When there are no parsing errors, this field is never null.
- function F_Has_Reverse (Node : For_Loop_Spec'Class) Standard.Boolean
- function F_Iter_Expr (Node : For_Loop_Spec'Class) Ada_Node
This field can contain one of the following nodes:
Attribute_Ref
,Bin_Op
,Call_Expr
,Char_Literal
,Discrete_Subtype_Indication
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Iter_Filter (Node : For_Loop_Spec'Class) For_Loop_Iter_Filter
This field may be null even when there are no parsing errors.
- type For_Loop_Var_Decl
Declaration for the controlling variable in a
for
loop (RM 5.5).- function F_Id (Node : For_Loop_Var_Decl'Class) Defining_Name
When there are no parsing errors, this field is never null.
- function F_Id_Type (Node : For_Loop_Var_Decl'Class) Type_Expr
This field can contain one of the following nodes:
Anonymous_Type
,Subtype_Indication
This field may be null even when there are no parsing errors.
- type Formal_Type_Decl
A formal type declaration.
- function F_Default_Type (Node : Formal_Type_Decl'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- type Generic_Decl
Base class for generic declarations (RM 12.1).
- function F_Formal_Part (Node : Generic_Decl'Class) Generic_Formal_Part
When there are no parsing errors, this field is never null.
- type Generic_Formal
Enclosing declaration for a generic formal. The real declaration is accessible via the
decl
field.- function F_Decl (Node : Generic_Formal'Class) Basic_Decl
This field can contain one of the following nodes:
Formal_Subp_Decl
,Formal_Type_Decl
,Generic_Instantiation
,Incomplete_Formal_Type_Decl
,Object_Decl
When there are no parsing errors, this field is never null.
- type Generic_Formal_Obj_Decl
Formal declaration for an object.
- type Generic_Formal_Part
List of declaration for generic formals (RM 12.1).
- function F_Decls (Node : Generic_Formal_Part'Class) Ada_Node_List
This field contains a list that itself contains one of the following nodes:
Generic_Formal
,Pragma_Node
,Use_Clause
When there are no parsing errors, this field is never null.
- type Generic_Instantiation
Instantiations of generics (RM 12.3).
- function P_Designated_Generic_Decl (Node : Generic_Instantiation'Class) Basic_Decl
Return the generic decl entity designated by this instantiation, containing the generic context. This is equivalent to the expanded generic unit in GNAT.
- function P_Inst_Params (Node : Generic_Instantiation'Class) Param_Actual_Array
Returns an array of pairs, associating formal parameters to actual or default expressions.
- type Generic_Package_Decl
Generic package declaration (RM 12.1).
- function F_Package_Decl (Node : Generic_Package_Decl'Class) Generic_Package_Internal
When there are no parsing errors, this field is never null.
- function P_Body_Part (Node : Generic_Package_Decl'Class) Package_Body
Return the PackageBody corresponding to this node, or null if there is none.
- type Generic_Package_Instantiation
Instantiations of a generic package.
- function F_Name (Node : Generic_Package_Instantiation'Class) Defining_Name
When there are no parsing errors, this field is never null.
- function F_Generic_Pkg_Name (Node : Generic_Package_Instantiation'Class) Name
This field can contain one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- function F_Params (Node : Generic_Package_Instantiation'Class) Assoc_List
This field contains a list that itself contains one of the following nodes:
Param_Assoc
When there are no parsing errors, this field is never null.
- type Generic_Package_Internal
This class denotes the internal package contained by a GenericPackageDecl.
- type Generic_Package_Renaming_Decl
Declaration for a generic package renaming (RM 8.5.5).
- function F_Name (Node : Generic_Package_Renaming_Decl'Class) Defining_Name
When there are no parsing errors, this field is never null.
- function F_Renames (Node : Generic_Package_Renaming_Decl'Class) Name
This field can contain one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- type Generic_Subp_Decl
Generic subprogram declaration (RM 12.1).
- function F_Subp_Decl (Node : Generic_Subp_Decl'Class) Generic_Subp_Internal
When there are no parsing errors, this field is never null.
- function P_Body_Part (Node : Generic_Subp_Decl'Class; Imprecise_Fallback : Standard.Boolean) Base_Subp_Body
Return the BaseSubpBody corresponding to this node.
- type Generic_Subp_Instantiation
Instantiations of a generic subprogram .
- function F_Overriding (Node : Generic_Subp_Instantiation'Class) Overriding_Node
When there are no parsing errors, this field is never null.
- function F_Overriding (Node : Generic_Subp_Instantiation'Class) Libadalang.Common.Ada_Overriding_Node
- function F_Kind (Node : Generic_Subp_Instantiation'Class) Subp_Kind
When there are no parsing errors, this field is never null.
- function F_Kind (Node : Generic_Subp_Instantiation'Class) Libadalang.Common.Ada_Subp_Kind
- function F_Subp_Name (Node : Generic_Subp_Instantiation'Class) Defining_Name
When there are no parsing errors, this field is never null.
- function F_Generic_Subp_Name (Node : Generic_Subp_Instantiation'Class) Name
This field can contain one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- function F_Params (Node : Generic_Subp_Instantiation'Class) Assoc_List
This field contains a list that itself contains one of the following nodes:
Param_Assoc
When there are no parsing errors, this field is never null.
- function P_Designated_Subp (Node : Generic_Subp_Instantiation'Class) Basic_Subp_Decl
Return the subprogram decl designated by this instantiation.
- type Generic_Subp_Internal
Internal node for generic subprograms.
- function F_Subp_Spec (Node : Generic_Subp_Internal'Class) Subp_Spec
When there are no parsing errors, this field is never null.
- type Generic_Subp_Renaming_Decl
Declaration for a generic subprogram renaming.
- function F_Kind (Node : Generic_Subp_Renaming_Decl'Class) Subp_Kind
When there are no parsing errors, this field is never null.
- function F_Kind (Node : Generic_Subp_Renaming_Decl'Class) Libadalang.Common.Ada_Subp_Kind
- function F_Name (Node : Generic_Subp_Renaming_Decl'Class) Defining_Name
When there are no parsing errors, this field is never null.
- function F_Renames (Node : Generic_Subp_Renaming_Decl'Class) Name
This field can contain one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- type Goto_Stmt
goto
statement (RM 5.8).- function F_Label_Name (Node : Goto_Stmt'Class) Name
This field can contain one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- type Handled_Stmts
List of statements, with optional exception handlers (RM 11.2).
- function F_Stmts (Node : Handled_Stmts'Class) Stmt_List
This field contains a list that itself contains one of the following nodes:
Pragma_Node
,Stmt
When there are no parsing errors, this field is never null.
- function F_Exceptions (Node : Handled_Stmts'Class) Ada_Node_List
This field contains a list that itself contains one of the following nodes:
Exception_Handler
,Pragma_Node
When there are no parsing errors, this field is never null.
- type If_Expr
if
expression (:rmlink`4.5.7`).- function F_Cond_Expr (Node : If_Expr'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Then_Expr (Node : If_Expr'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Alternatives (Node : If_Expr'Class) Elsif_Expr_Part_List
When there are no parsing errors, this field is never null.
- function F_Else_Expr (Node : If_Expr'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- type If_Stmt
if
statement block (RM 5.3).- function F_Cond_Expr (Node : If_Stmt'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Then_Stmts (Node : If_Stmt'Class) Stmt_List
This field contains a list that itself contains one of the following nodes:
Pragma_Node
,Stmt
When there are no parsing errors, this field is never null.
- function F_Alternatives (Node : If_Stmt'Class) Elsif_Stmt_Part_List
When there are no parsing errors, this field is never null.
- function F_Else_Stmts (Node : If_Stmt'Class) Stmt_List
This field contains a list that itself contains one of the following nodes:
Pragma_Node
,Stmt
When there are no parsing errors, this field is never null.
- type Incomplete_Type_Decl
Incomplete declaration for a type (RM 12.5).
- function F_Discriminants (Node : Incomplete_Type_Decl'Class) Discriminant_Part
This field may be null even when there are no parsing errors.
- type Incomplete_Formal_Type_Decl
A formal incomplete type declaration.
- function F_Is_Tagged (Node : Incomplete_Formal_Type_Decl'Class) Tagged_Node
This field may be null even when there are no parsing errors.
- function F_Is_Tagged (Node : Incomplete_Formal_Type_Decl'Class) Standard.Boolean
- function F_Default_Type (Node : Incomplete_Formal_Type_Decl'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- type Incomplete_Tagged_Type_Decl
Incomplete declaration for a tagged type.
- function F_Has_Abstract (Node : Incomplete_Tagged_Type_Decl'Class) Abstract_Node
When there are no parsing errors, this field is never null.
- function F_Has_Abstract (Node : Incomplete_Tagged_Type_Decl'Class) Standard.Boolean
- type Int_Literal
Literal for an integer (RM 2.4).
- function P_Denoted_Value (Node : Int_Literal'Class) Big_Integer
Return the value that this literal denotes.
- type Interface_Kind
Kind of interface type.
- type Interface_Kind_Limited
- type Interface_Kind_Protected
- type Interface_Kind_Synchronized
- type Interface_Kind_Task
- type Interface_Type_Def
Type definition for an interface (RM 3.9.4).
- function F_Interface_Kind (Node : Interface_Type_Def'Class) Interface_Kind
This field may be null even when there are no parsing errors.
- function F_Interface_Kind (Node : Interface_Type_Def'Class) Libadalang.Common.Ada_Interface_Kind
- function F_Interfaces (Node : Interface_Type_Def'Class) Parent_List
This field contains a list that itself contains one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- type Iter_Type
Iteration type for
for
loops.
- type Iter_Type_In
- type Iter_Type_Of
- type Iterated_Assoc
Iterated association (Ada 2020, RM 4.3.3).
- function F_Spec (Node : Iterated_Assoc'Class) For_Loop_Spec
When there are no parsing errors, this field is never null.
- function F_Key_Expr (Node : Iterated_Assoc'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- function F_R_Expr (Node : Iterated_Assoc'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Known_Discriminant_Part
Known list of discriminants in type declarations (RM 3.7).
- function F_Discr_Specs (Node : Known_Discriminant_Part'Class) Discriminant_Spec_List
When there are no parsing errors, this field is never null.
- type Label
Statement to declare a code label (RM 5.1).
- function F_Decl (Node : Label'Class) Label_Decl
When there are no parsing errors, this field is never null.
- type Label_Decl
Declaration for a code label (RM 5.1).
- function F_Name (Node : Label_Decl'Class) Defining_Name
When there are no parsing errors, this field is never null.
- type Library_Item
Library item in a compilation unit (RM 10.1.1).
- function F_Has_Private (Node : Library_Item'Class) Private_Node
When there are no parsing errors, this field is never null.
- function F_Has_Private (Node : Library_Item'Class) Standard.Boolean
- function F_Item (Node : Library_Item'Class) Basic_Decl
This field can contain one of the following nodes:
Abstract_Subp_Decl
,Base_Subp_Body
,Error_Decl
,Generic_Decl
,Generic_Instantiation
,Generic_Renaming_Decl
,Package_Body
,Package_Decl
,Package_Renaming_Decl
,Subp_Decl
When there are no parsing errors, this field is never null.
- type Limited_Node
Qualifier for the
limited
keyword.- function P_As_Bool (Node : Limited_Node'Class) Standard.Boolean
Return whether this is an instance of LimitedPresent
- type Limited_Absent
- type Limited_Present
- type Membership_Expr
Represent a membership test (in/not in operators) (RM 4.4).
Note that we don’t consider them as binary operators since multiple expressions on the right hand side are allowed.
- function F_Expr (Node : Membership_Expr'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Op (Node : Membership_Expr'Class) Op
This field can contain one of the following nodes:
Op_In
,Op_Not_In
When there are no parsing errors, this field is never null.
- function F_Op (Node : Membership_Expr'Class) Libadalang.Common.Ada_Op
- function F_Membership_Exprs (Node : Membership_Expr'Class) Expr_Alternatives_List
This field contains a list that itself contains one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Discrete_Subtype_Name
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Mod_Int_Type_Def
Type definition for a modular integer type (RM 3.5.4).
- function F_Expr (Node : Mod_Int_Type_Def'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Box_Expr
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Mode_Default
- type Mode_In
- type Mode_In_Out
- type Mode_Out
- type Multi_Abstract_State_Decl
Node that holds several AbstractStateDecl nodes, which is necessary when the Abstract_State aspect is associated with an aggregate in order to declare a list of abstract states.
- function F_Decls (Node : Multi_Abstract_State_Decl'Class) Abstract_State_Decl_List
This field contains a list that itself contains one of the following nodes:
Abstract_State_Decl
,Paren_Abstract_State_Decl
When there are no parsing errors, this field is never null.
- type Multi_Dim_Array_Assoc
Association used for multi-dimension array aggregates.
- type Name_List
List of Name.
This list node can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
- function Name_List_First (Node : Name_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Name_List_Next (Node : Name_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Name_List_Has_Element (Node : Name_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Name_List_Element (Node : Name_List; Cursor : Standard.Positive) Name'Class
Implementation detail for the Iterable aspect
- type Named_Stmt
Wrapper class, used for composite statements that can be named (declare blocks, loops). This allows to both have a BasicDecl for the named entity declared, and a CompositeStmt for the statement hierarchy.
- function F_Decl (Node : Named_Stmt'Class) Named_Stmt_Decl
When there are no parsing errors, this field is never null.
- function F_Stmt (Node : Named_Stmt'Class) Composite_Stmt
This field can contain one of the following nodes:
Base_Loop_Stmt
,Block_Stmt
When there are no parsing errors, this field is never null.
- type Named_Stmt_Decl
BasicDecl that is always the declaration inside a named statement.
- function F_Name (Node : Named_Stmt_Decl'Class) Defining_Name
When there are no parsing errors, this field is never null.
- type No_Type_Object_Renaming_Decl
Object declaration without subtype indication. This node has been introduced to cover a special case for
ObjectDecl
, wheretype_expr
is made optional (AI12-0275), and therefore cannot fit in anObjectDecl
.
- type Not_Null
Qualifier for the
not null
keywords.- function P_As_Bool (Node : Not_Null'Class) Standard.Boolean
Return whether this is an instance of NotNullPresent
- type Not_Null_Absent
- type Not_Null_Present
- type Null_Record_Def
Record definition for
null record
.
- type Number_Decl
Declaration for a static constant number (RM 3.3.2).
- function F_Ids (Node : Number_Decl'Class) Defining_Name_List
When there are no parsing errors, this field is never null.
- function F_Expr (Node : Number_Decl'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Op
Operation in a binary expression.
Note that the ARM does not consider “double_dot” (“..”) as a binary operator, but we process it this way here anyway to keep things simple.
- type Op_Abs
- type Op_And
- type Op_And_Then
- type Op_Concat
- type Op_Div
- type Op_Double_Dot
- type Op_Eq
- type Op_Gt
- type Op_Gte
- type Op_In
- type Op_Lt
- type Op_Lte
- type Op_Minus
- type Op_Mod
- type Op_Mult
- type Op_Neq
- type Op_Not
- type Op_Not_In
- type Op_Or
- type Op_Or_Else
- type Op_Plus
- type Op_Pow
- type Op_Rem
- type Op_Xor
- type Ordinary_Fixed_Point_Def
Type definition for ordinary fixed-point numbers (RM 3.5.9).
- function F_Delta (Node : Ordinary_Fixed_Point_Def'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Box_Expr
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Range (Node : Ordinary_Fixed_Point_Def'Class) Range_Spec
This field may be null even when there are no parsing errors.
- type Others_Designator
other
designator.
- type Overriding_Node
Syntactic indicators for subprogram overriding modes.
- type Overriding_Not_Overriding
- type Overriding_Overriding
- type Overriding_Unspecified
- type Package_Body
Package body (RM 7.2).
- function F_Package_Name (Node : Package_Body'Class) Defining_Name
When there are no parsing errors, this field is never null.
- function F_Decls (Node : Package_Body'Class) Declarative_Part
When there are no parsing errors, this field is never null.
- function F_Stmts (Node : Package_Body'Class) Handled_Stmts
This field may be null even when there are no parsing errors.
- function F_End_Name (Node : Package_Body'Class) End_Name
This field may be null even when there are no parsing errors.
- type Package_Body_Stub
Stub for a package body (
is separate
) (RM 10.1.3).- function F_Name (Node : Package_Body_Stub'Class) Defining_Name
When there are no parsing errors, this field is never null.
- type Package_Renaming_Decl
Declaration for a package renaming (RM 8.5.3).
- function F_Name (Node : Package_Renaming_Decl'Class) Defining_Name
When there are no parsing errors, this field is never null.
- function F_Renames (Node : Package_Renaming_Decl'Class) Renaming_Clause
When there are no parsing errors, this field is never null.
- function P_Renamed_Package (Node : Package_Renaming_Decl'Class) Basic_Decl
Return the declaration of the package that is renamed by Self.
- function P_Final_Renamed_Package (Node : Package_Renaming_Decl'Class) Basic_Decl
Return the declaration of the package that is ultimately renamed by Self, skipping through all intermediate package renamings.
- type Param_Assoc
Association (X => Y) used for parameter associations (RM 6.4).
- function F_Designator (Node : Param_Assoc'Class) Ada_Node
This field can contain one of the following nodes:
Identifier
,Others_Designator
,String_Literal
This field may be null even when there are no parsing errors.
- function F_R_Expr (Node : Param_Assoc'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Box_Expr
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Param_Spec
Specification for a parameter (RM 6.1).
- function F_Ids (Node : Param_Spec'Class) Defining_Name_List
When there are no parsing errors, this field is never null.
- function F_Has_Aliased (Node : Param_Spec'Class) Aliased_Node
When there are no parsing errors, this field is never null.
- function F_Has_Aliased (Node : Param_Spec'Class) Standard.Boolean
- function F_Mode (Node : Param_Spec'Class) Mode
This field may be null even when there are no parsing errors.
- function F_Mode (Node : Param_Spec'Class) Libadalang.Common.Ada_Mode
- function F_Type_Expr (Node : Param_Spec'Class) Type_Expr
This field can contain one of the following nodes:
Anonymous_Type
,Subtype_Indication
When there are no parsing errors, this field is never null.
- function F_Default_Expr (Node : Param_Spec'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- function List_Child (Node : Param_Spec_List'Class; Index : Standard.Positive) Param_Spec
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Param_Spec_List
List of ParamSpec.
- function Param_Spec_List_First (Node : Param_Spec_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Param_Spec_List_Next (Node : Param_Spec_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Param_Spec_List_Has_Element (Node : Param_Spec_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Param_Spec_List_Element (Node : Param_Spec_List; Cursor : Standard.Positive) Param_Spec'Class
Implementation detail for the Iterable aspect
- type Params
List of parameter specifications.
- function F_Params (Node : Params'Class) Param_Spec_List
When there are no parsing errors, this field is never null.
- type Paren_Abstract_State_Decl
Holds an AbstractStateDecl between parentheses. Needed to support the syntax:
package Pkg with Abstract_State => (A, (B with Some_Aspect))
- function F_Decl (Node : Paren_Abstract_State_Decl'Class) Ada_Node
This field can contain one of the following nodes:
Abstract_State_Decl
,Paren_Abstract_State_Decl
When there are no parsing errors, this field is never null.
- type Paren_Expr
Parenthesized expression.
- function F_Expr (Node : Paren_Expr'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Parent_List
List of parents in a type declaration.
This list node can contain one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
- type Pp_Directive
Base node for all preprocessor directives.
- type Pp_Else_Directive
else
preprocessor directive.
- type Pp_Elsif_Directive
elsif ... [then]
preprocessor directive.- function F_Expr (Node : Pp_Elsif_Directive'Class) Expr
This field can contain one of the following nodes:
Attribute_Ref
,Bin_Op
,Identifier
,Paren_Expr
,Un_Op
When there are no parsing errors, this field is never null.
- function F_Then_Kw (Node : Pp_Elsif_Directive'Class) Pp_Then_Kw
This field may be null even when there are no parsing errors.
- type Pp_End_If_Directive
end if;
preprocessor directive.
- type Pp_If_Directive
if ... [then]
preprocessor directive.- function F_Expr (Node : Pp_If_Directive'Class) Expr
This field can contain one of the following nodes:
Attribute_Ref
,Bin_Op
,Identifier
,Paren_Expr
,Un_Op
When there are no parsing errors, this field is never null.
- function F_Then_Kw (Node : Pp_If_Directive'Class) Pp_Then_Kw
This field may be null even when there are no parsing errors.
- type Pp_Then_Kw
then
keyword in preprocessor directives.
- type Pragma_Argument_Assoc
Argument association in a pragma.
- function F_Name (Node : Pragma_Argument_Assoc'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Identifier
This field may be null even when there are no parsing errors.
- function F_Expr (Node : Pragma_Argument_Assoc'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Pragma_Node
Class for pragmas (RM 2.8). Pragmas are compiler directives, that can be language or compiler defined.
- function F_Id (Node : Pragma_Node'Class) Identifier
When there are no parsing errors, this field is never null.
- function F_Args (Node : Pragma_Node'Class) Base_Assoc_List
When there are no parsing errors, this field is never null.
- function P_Is_Ghost_Code (Node : Pragma_Node'Class) Standard.Boolean
Return whether this pragma is ghost code or not. See SPARK RM 6.9.
- function P_Associated_Entities (Node : Pragma_Node'Class) Defining_Name_Array
Return an array of
BasicDecl
instances associated with this pragma, or an empty array if non applicable.
- function List_Child (Node : Pragma_Node_List'Class; Index : Standard.Positive) Pragma_Node
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Pragma_Node_List
List of Pragma.
- function Pragma_Node_List_First (Node : Pragma_Node_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Pragma_Node_List_Next (Node : Pragma_Node_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Pragma_Node_List_Has_Element (Node : Pragma_Node_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Pragma_Node_List_Element (Node : Pragma_Node_List; Cursor : Standard.Positive) Pragma_Node'Class
Implementation detail for the Iterable aspect
- type Private_Node
Qualifier for the
private
keyword.- function P_As_Bool (Node : Private_Node'Class) Standard.Boolean
Return whether this is an instance of PrivatePresent
- type Private_Absent
- type Private_Part
List of declarations in a private part.
- type Private_Present
- type Private_Type_Def
Type definition for a private type.
Libadalang diverges from the ARM here, treating private types like regular type declarations that have an embedded type definition. This type definition hence corresponds to RM 7.3.
- function F_Has_Abstract (Node : Private_Type_Def'Class) Abstract_Node
When there are no parsing errors, this field is never null.
- function F_Has_Abstract (Node : Private_Type_Def'Class) Standard.Boolean
- function F_Has_Tagged (Node : Private_Type_Def'Class) Tagged_Node
When there are no parsing errors, this field is never null.
- function F_Has_Tagged (Node : Private_Type_Def'Class) Standard.Boolean
- function F_Has_Limited (Node : Private_Type_Def'Class) Limited_Node
When there are no parsing errors, this field is never null.
- function F_Has_Limited (Node : Private_Type_Def'Class) Standard.Boolean
- type Protected_Node
Qualifier for the
protected
keyword.- function P_As_Bool (Node : Protected_Node'Class) Standard.Boolean
Return whether this is an instance of ProtectedPresent
- type Protected_Absent
- type Protected_Body
Protected object body (RM 9.4).
- function F_Name (Node : Protected_Body'Class) Defining_Name
When there are no parsing errors, this field is never null.
- function F_Decls (Node : Protected_Body'Class) Declarative_Part
When there are no parsing errors, this field is never null.
- function F_End_Name (Node : Protected_Body'Class) End_Name
This field may be null even when there are no parsing errors.
- type Protected_Body_Stub
Stub for a protected object body (
is separate
) (RM 10.1.3).- function F_Name (Node : Protected_Body_Stub'Class) Defining_Name
When there are no parsing errors, this field is never null.
- type Protected_Def
Type definition for a protected object (RM 9.4).
- function F_Public_Part (Node : Protected_Def'Class) Public_Part
When there are no parsing errors, this field is never null.
- function F_Private_Part (Node : Protected_Def'Class) Private_Part
This field may be null even when there are no parsing errors.
- function F_End_Name (Node : Protected_Def'Class) End_Name
This field may be null even when there are no parsing errors.
- type Protected_Present
- type Protected_Type_Decl
Declaration for a protected type (RM 9.4).
- function F_Discriminants (Node : Protected_Type_Decl'Class) Discriminant_Part
This field may be null even when there are no parsing errors.
- function F_Interfaces (Node : Protected_Type_Decl'Class) Parent_List
This field contains a list that itself contains one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- function F_Definition (Node : Protected_Type_Decl'Class) Protected_Def
When there are no parsing errors, this field is never null.
- type Public_Part
List of declarations in a public part.
- type Qual_Expr
Qualified expression (
...'(...)
) .(RM 4.7).- function F_Prefix (Node : Qual_Expr'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Suffix (Node : Qual_Expr'Class) Expr
This field can contain one of the following nodes:
Base_Aggregate
,Paren_Expr
When there are no parsing errors, this field is never null.
- type Quantified_Expr
Quantified expression (RM 4.5.8).
- function F_Quantifier (Node : Quantified_Expr'Class) Quantifier
When there are no parsing errors, this field is never null.
- function F_Quantifier (Node : Quantified_Expr'Class) Libadalang.Common.Ada_Quantifier
- function F_Loop_Spec (Node : Quantified_Expr'Class) For_Loop_Spec
When there are no parsing errors, this field is never null.
- function F_Expr (Node : Quantified_Expr'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Quantifier
Type for quantified expressions.
- type Quantifier_All
- type Quantifier_Some
- type Raise_Expr
Expression to raise an exception (RM 4.4).
- function F_Exception_Name (Node : Raise_Expr'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- function F_Error_Message (Node : Raise_Expr'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- type Raise_Stmt
raise
statement (RM 11.3).- function F_Exception_Name (Node : Raise_Stmt'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- function F_Error_Message (Node : Raise_Stmt'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- type Range_Constraint
Range-based type constraint (RM 3.5).
- function F_Range (Node : Range_Constraint'Class) Range_Spec
When there are no parsing errors, this field is never null.
- type Range_Spec
Range specification (RM 3.5.7).
- function F_Range (Node : Range_Spec'Class) Expr
This field can contain one of the following nodes:
Attribute_Ref
,Bin_Op
,Box_Expr
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Record_Def
Record definition that contains components (
record ... end record
).
- type Record_Rep_Clause
Representation clause for a record type (RM 13.5.1).
- function F_Name (Node : Record_Rep_Clause'Class) Name
This field can contain one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- function F_At_Expr (Node : Record_Rep_Clause'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- function F_Components (Node : Record_Rep_Clause'Class) Ada_Node_List
This field contains a list that itself contains one of the following nodes:
Component_Clause
,Pragma_Node
When there are no parsing errors, this field is never null.
- type Record_Type_Def
Type definition for a record (RM 3.8).
- function F_Has_Abstract (Node : Record_Type_Def'Class) Abstract_Node
When there are no parsing errors, this field is never null.
- function F_Has_Abstract (Node : Record_Type_Def'Class) Standard.Boolean
- function F_Has_Tagged (Node : Record_Type_Def'Class) Tagged_Node
When there are no parsing errors, this field is never null.
- function F_Has_Tagged (Node : Record_Type_Def'Class) Standard.Boolean
- function F_Has_Limited (Node : Record_Type_Def'Class) Limited_Node
When there are no parsing errors, this field is never null.
- function F_Has_Limited (Node : Record_Type_Def'Class) Standard.Boolean
- function F_Record_Def (Node : Record_Type_Def'Class) Base_Record_Def
When there are no parsing errors, this field is never null.
- type Reduce_Attribute_Ref
Reduction expression (
Reduce
attribute). Ada 2022, RM 4.5.10.- function F_Prefix (Node : Reduce_Attribute_Ref'Class) Ada_Node
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
,Value_Sequence
When there are no parsing errors, this field is never null.
- function F_Attribute (Node : Reduce_Attribute_Ref'Class) Identifier
When there are no parsing errors, this field is never null.
- function F_Args (Node : Reduce_Attribute_Ref'Class) Assoc_List
This field contains a list that itself contains one of the following nodes:
Param_Assoc
When there are no parsing errors, this field is never null.
- type Renaming_Clause
Renaming clause, used everywhere renamings are valid.
- function F_Renamed_Object (Node : Renaming_Clause'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Requeue_Stmt
requeue
statement (RM 9.5.4).- function F_Call_Name (Node : Requeue_Stmt'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Has_Abort (Node : Requeue_Stmt'Class) Abort_Node
When there are no parsing errors, this field is never null.
- function F_Has_Abort (Node : Requeue_Stmt'Class) Standard.Boolean
- type Return_Stmt
return
statement (RM 6.5).- function F_Return_Expr (Node : Return_Stmt'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- type Reverse_Node
Qualifier for the
reverse
keyword.- function P_As_Bool (Node : Reverse_Node'Class) Standard.Boolean
Return whether this is an instance of ReversePresent
- type Reverse_Absent
- type Reverse_Present
- type Select_Stmt
select
statements block (RM 9.7).- function F_Guards (Node : Select_Stmt'Class) Select_When_Part_List
When there are no parsing errors, this field is never null.
- function F_Else_Stmts (Node : Select_Stmt'Class) Stmt_List
This field contains a list that itself contains one of the following nodes:
Pragma_Node
,Stmt
When there are no parsing errors, this field is never null.
- function F_Abort_Stmts (Node : Select_Stmt'Class) Stmt_List
This field contains a list that itself contains one of the following nodes:
Pragma_Node
,Stmt
When there are no parsing errors, this field is never null.
- type Select_When_Part
Alternative part in a
select
statements block (RM 9.7).- function F_Cond_Expr (Node : Select_When_Part'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- function F_Stmts (Node : Select_When_Part'Class) Stmt_List
This field contains a list that itself contains one of the following nodes:
Pragma_Node
,Stmt
When there are no parsing errors, this field is never null.
- function List_Child (Node : Select_When_Part_List'Class; Index : Standard.Positive) Select_When_Part
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Select_When_Part_List
List of SelectWhenPart.
- function Select_When_Part_List_First (Node : Select_When_Part_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Select_When_Part_List_Next (Node : Select_When_Part_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Select_When_Part_List_Has_Element (Node : Select_When_Part_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Select_When_Part_List_Element (Node : Select_When_Part_List; Cursor : Standard.Positive) Select_When_Part'Class
Implementation detail for the Iterable aspect
- type Signed_Int_Type_Def
Type definition for a signed integer type (RM 3.5.4).
- function F_Range (Node : Signed_Int_Type_Def'Class) Range_Spec
When there are no parsing errors, this field is never null.
- type Simple_Decl_Stmt
Statement wrapping a simple object declaration.
- function F_Decl (Node : Simple_Decl_Stmt'Class) Object_Decl
When there are no parsing errors, this field is never null.
- type Single_Protected_Decl
Declaration for a single protected object (RM 9.4).
- function F_Name (Node : Single_Protected_Decl'Class) Defining_Name
When there are no parsing errors, this field is never null.
- function F_Interfaces (Node : Single_Protected_Decl'Class) Parent_List
This field contains a list that itself contains one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- function F_Definition (Node : Single_Protected_Decl'Class) Protected_Def
When there are no parsing errors, this field is never null.
- type Single_Task_Decl
Declaration for a single task (RM 9.1).
- function F_Task_Type (Node : Single_Task_Decl'Class) Single_Task_Type_Decl
When there are no parsing errors, this field is never null.
- type Task_Type_Decl
Declaration for a task type (RM 9.1).
- function F_Discriminants (Node : Task_Type_Decl'Class) Discriminant_Part
This field may be null even when there are no parsing errors.
- function F_Definition (Node : Task_Type_Decl'Class) Task_Def
This field may be null even when there are no parsing errors.
- type Stmt_List
List of statements.
This list node can contain one of the following nodes:
Pragma_Node
,Stmt
- type String_Literal
String literal (RM 2.6).
- function P_Denoted_Value (Node : String_Literal'Class) Text_Type
Return the value that this literal denotes.
- type Subp_Body
Subprogram body(RM 6.3) .
- function F_Decls (Node : Subp_Body'Class) Declarative_Part
When there are no parsing errors, this field is never null.
- function F_Stmts (Node : Subp_Body'Class) Handled_Stmts
When there are no parsing errors, this field is never null.
- function F_End_Name (Node : Subp_Body'Class) End_Name
This field may be null even when there are no parsing errors.
- type Subp_Body_Stub
Stub for a subprogram body (
is separate
) (RM 10.1.3).- function F_Overriding (Node : Subp_Body_Stub'Class) Overriding_Node
When there are no parsing errors, this field is never null.
- function F_Overriding (Node : Subp_Body_Stub'Class) Libadalang.Common.Ada_Overriding_Node
- function F_Subp_Spec (Node : Subp_Body_Stub'Class) Subp_Spec
When there are no parsing errors, this field is never null.
- type Subp_Kind
Qualifier for a subprogram kind.
- type Subp_Kind_Function
- type Subp_Kind_Procedure
- type Subp_Renaming_Decl
Declaration for a subprogram renaming (RM 8.5.4).
- function F_Renames (Node : Subp_Renaming_Decl'Class) Renaming_Clause
When there are no parsing errors, this field is never null.
- type Subp_Spec
Subprogram specification (RM 6.1).
- function F_Subp_Kind (Node : Subp_Spec'Class) Subp_Kind
When there are no parsing errors, this field is never null.
- function F_Subp_Kind (Node : Subp_Spec'Class) Libadalang.Common.Ada_Subp_Kind
- function F_Subp_Name (Node : Subp_Spec'Class) Defining_Name
This field may be null even when there are no parsing errors.
- function F_Subp_Params (Node : Subp_Spec'Class) Params
This field may be null even when there are no parsing errors.
- function F_Subp_Returns (Node : Subp_Spec'Class) Type_Expr
This field can contain one of the following nodes:
Anonymous_Type
,Subtype_Indication
This field may be null even when there are no parsing errors.
- type Subtype_Decl
Subtype declaration (RM 3.2.2).
- function F_Subtype (Node : Subtype_Decl'Class) Subtype_Indication
When there are no parsing errors, this field is never null.
- type Subunit
Subunit (
separate
) (RM 10.1.3).- function F_Name (Node : Subunit'Class) Name
This field can contain one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- function F_Body (Node : Subunit'Class) Body_Node
This field can contain one of the following nodes:
Package_Body
,Protected_Body
,Subp_Body
,Task_Body
When there are no parsing errors, this field is never null.
- function P_Body_Root (Node : Subunit'Class) Basic_Decl
Return the body in which this subunit is rooted.
- type Synchronized_Node
Qualifier for the
synchronized
keyword.- function P_As_Bool (Node : Synchronized_Node'Class) Standard.Boolean
Return whether this is an instance of SynchronizedPresent
- type Synchronized_Absent
- type Synchronized_Present
- type Synth_Anonymous_Type_Decl
Synthetic anonymous type decl. Used to generate anonymous access types.
- type Synthetic_Binary_Spec
Synthetic subprogram specification for binary operators.
- function F_Left_Param (Node : Synthetic_Binary_Spec'Class) Synthetic_Formal_Param_Decl
When there are no parsing errors, this field is never null.
- function F_Right_Param (Node : Synthetic_Binary_Spec'Class) Synthetic_Formal_Param_Decl
When there are no parsing errors, this field is never null.
- function F_Return_Type_Expr (Node : Synthetic_Binary_Spec'Class) Type_Expr
This field may be null even when there are no parsing errors.
- type Synthetic_Char_Enum_Lit
Synthetic character enum literal declaration.
- function P_Expr (Node : Synthetic_Char_Enum_Lit'Class) Defining_Name
Return the CharLiteral expression corresponding to this enum literal.
- type Synthetic_Defining_Name
Synthetic DefiningName.
- type Synthetic_Formal_Param_Decl
Synthetic parameter declaration.
- function F_Param_Type (Node : Synthetic_Formal_Param_Decl'Class) Type_Expr
When there are no parsing errors, this field is never null.
- type Synthetic_Identifier
Synthetic identifier.
- type Synthetic_Object_Decl
SyntheticObjectDecl is a declaration that holds a virtual object. This is for example used in type predicates to refer to an object of the enclosing type, as in:
subtype Odd is Natural with Dynamic_Predicate => Odd mod 2 = 1;
where we have to create an object named
Odd
, and of typeOdd
so that the name in the aspect expression refers to it and can be properly resolved to the type identifier.This node has no existance in the Ada RM, it’s only used for internal name resolution purposes.
- type Synthetic_Renaming_Clause
Synthetic renaming clause. Used to synthesize object decls with renamings. (See to_anonymous_object_decl).
- type Synthetic_Subp_Decl
Synthetic subprogram declaration.
Is used to represent predefined operators. This should also be usable for synthesizing function attributes.
- function F_Spec (Node : Synthetic_Subp_Decl'Class) Base_Subp_Spec
This field can contain one of the following nodes:
Synthetic_Binary_Spec
,Synthetic_Unary_Spec
When there are no parsing errors, this field is never null.
- type Synthetic_Type_Expr
Synthetic type expression. The designated type is already known at instantiation time and is to be given in the
target_type
field.- function F_Target_Type (Node : Synthetic_Type_Expr'Class) Base_Type_Decl
When there are no parsing errors, this field is never null.
- type Synthetic_Unary_Spec
Synthetic subprogram specification for unary operators.
- function F_Right_Param (Node : Synthetic_Unary_Spec'Class) Synthetic_Formal_Param_Decl
When there are no parsing errors, this field is never null.
- function F_Return_Type_Expr (Node : Synthetic_Unary_Spec'Class) Synthetic_Type_Expr
When there are no parsing errors, this field is never null.
- type Tagged_Node
Qualifier for the
tagged
keyword.- function P_As_Bool (Node : Tagged_Node'Class) Standard.Boolean
Return whether this is an instance of TaggedPresent
- type Tagged_Absent
- type Tagged_Present
- type Task_Body
Task body (RM 9.1).
- function F_Name (Node : Task_Body'Class) Defining_Name
When there are no parsing errors, this field is never null.
- function F_Decls (Node : Task_Body'Class) Declarative_Part
When there are no parsing errors, this field is never null.
- function F_Stmts (Node : Task_Body'Class) Handled_Stmts
When there are no parsing errors, this field is never null.
- function F_End_Name (Node : Task_Body'Class) End_Name
This field may be null even when there are no parsing errors.
- type Task_Body_Stub
Stub for a task body (
is separate
) (RM 10.1.3).- function F_Name (Node : Task_Body_Stub'Class) Defining_Name
When there are no parsing errors, this field is never null.
- type Task_Def
Type definition for a task type (RM 9.1).
- function F_Interfaces (Node : Task_Def'Class) Parent_List
This field contains a list that itself contains one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- function F_Public_Part (Node : Task_Def'Class) Public_Part
When there are no parsing errors, this field is never null.
- function F_Private_Part (Node : Task_Def'Class) Private_Part
This field may be null even when there are no parsing errors.
- function F_End_Name (Node : Task_Def'Class) End_Name
This field may be null even when there are no parsing errors.
- type Type_Access_Def
Syntactic type definition for accesses.
- function F_Has_All (Node : Type_Access_Def'Class) All_Node
When there are no parsing errors, this field is never null.
- function F_Has_All (Node : Type_Access_Def'Class) Standard.Boolean
- function F_Has_Constant (Node : Type_Access_Def'Class) Constant_Node
When there are no parsing errors, this field is never null.
- function F_Has_Constant (Node : Type_Access_Def'Class) Standard.Boolean
- function F_Subtype_Indication (Node : Type_Access_Def'Class) Subtype_Indication
When there are no parsing errors, this field is never null.
- type Type_Attributes_Repository
Synthetic node that contains the lazy fields for the attribute subprograms of a given type. The lazy fields are not directly on the BaseTypeDecl node itself to minimize its size in memory: with this indirection, a type for which no function attribute is ever synthesized will not waste any memory.
- type Un_Op
Unary expression.
This encompasses several ARM expressions, because it is used for every unary operator in Ada. Those expressions are all documented in RM 4.4.
- function F_Op (Node : Un_Op'Class) Op
This field can contain one of the following nodes:
Op_Abs
,Op_Minus
,Op_Not
,Op_Plus
When there are no parsing errors, this field is never null.
- function F_Op (Node : Un_Op'Class) Libadalang.Common.Ada_Op
- function F_Expr (Node : Un_Op'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Unconstrained_Array_Index
List of unconstrained array indexes.
- function F_Subtype_Name (Node : Unconstrained_Array_Index'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- function F_Lower_Bound (Node : Unconstrained_Array_Index'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
This field may be null even when there are no parsing errors.
- function List_Child (Node : Unconstrained_Array_Index_List'Class; Index : Standard.Positive) Unconstrained_Array_Index
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Unconstrained_Array_Index_List
List of UnconstrainedArrayIndex.
- function Unconstrained_Array_Index_List_First (Node : Unconstrained_Array_Index_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Unconstrained_Array_Index_List_Next (Node : Unconstrained_Array_Index_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Unconstrained_Array_Index_List_Has_Element (Node : Unconstrained_Array_Index_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Unconstrained_Array_Index_List_Element (Node : Unconstrained_Array_Index_List; Cursor : Standard.Positive) Unconstrained_Array_Index'Class
Implementation detail for the Iterable aspect
- type Unconstrained_Array_Indices
Unconstrained specification for array indexes (RM 3.6).
- function F_Types (Node : Unconstrained_Array_Indices'Class) Unconstrained_Array_Index_List
When there are no parsing errors, this field is never null.
- type Until_Node
Qualifier for the
until
keyword.- function P_As_Bool (Node : Until_Node'Class) Standard.Boolean
Return whether this is an instance of UntilPresent
- type Until_Absent
- type Until_Present
- type Update_Attribute_Ref
Reference to the
Update
attribute, which is a non standard GNAT attribute.- function F_Prefix (Node : Update_Attribute_Ref'Class) Name
This field can contain one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Attribute (Node : Update_Attribute_Ref'Class) Identifier
When there are no parsing errors, this field is never null.
- function F_Values (Node : Update_Attribute_Ref'Class) Base_Aggregate
When there are no parsing errors, this field is never null.
- type Use_Package_Clause
Use clause for packages (RM 8.4).
- function F_Packages (Node : Use_Package_Clause'Class) Name_List
This field contains a list that itself contains one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- type Use_Type_Clause
Use clause for types (RM 8.4).
- function F_Has_All (Node : Use_Type_Clause'Class) All_Node
When there are no parsing errors, this field is never null.
- function F_Has_All (Node : Use_Type_Clause'Class) Standard.Boolean
- function F_Types (Node : Use_Type_Clause'Class) Name_List
This field contains a list that itself contains one of the following nodes:
Attribute_Ref
,Call_Expr
,Char_Literal
,Dotted_Name
,Explicit_Deref
,Identifier
,Qual_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type Value_Sequence
The value sequence of a reduction expression (see
ReduceAttributeRef
). Ada 2022, RM 4.5.10.- function F_Iter_Assoc (Node : Value_Sequence'Class) Iterated_Assoc
When there are no parsing errors, this field is never null.
- type Variant
Single variant in a discriminated type record declaration.
This corresponds to a
when ... => ...
section in a variant part.- function F_Choices (Node : Variant'Class) Alternatives_List
This field contains a list that itself contains one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Discrete_Subtype_Indication
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Others_Designator
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- function F_Components (Node : Variant'Class) Component_List
When there are no parsing errors, this field is never null.
- function List_Child (Node : Variant_List'Class; Index : Standard.Positive) Variant
Return the
Index
’th child ofNode
, or null ifNode
has no such child.
- type Variant_List
List of Variant.
- function Variant_List_First (Node : Variant_List) Standard.Positive
Implementation detail for the Iterable aspect
- function Variant_List_Next (Node : Variant_List; Cursor : Standard.Positive) Standard.Positive
Implementation detail for the Iterable aspect
- function Variant_List_Has_Element (Node : Variant_List; Cursor : Standard.Positive) Standard.Boolean
Implementation detail for the Iterable aspect
- function Variant_List_Element (Node : Variant_List; Cursor : Standard.Positive) Variant'Class
Implementation detail for the Iterable aspect
- type Variant_Part
Variant part in a discriminated type record declaration (RM 3.8.1).
This corresponds to the whole
case ... is ... end case;
block.- function F_Discr_Name (Node : Variant_Part'Class) Identifier
When there are no parsing errors, this field is never null.
- function F_Variant (Node : Variant_Part'Class) Variant_List
When there are no parsing errors, this field is never null.
- type While_Loop_Spec
Specification for a
while
loop (RM 5.5).- function F_Expr (Node : While_Loop_Spec'Class) Expr
This field can contain one of the following nodes:
Allocator
,Attribute_Ref
,Base_Aggregate
,Bin_Op
,Call_Expr
,Char_Literal
,Concat_Op
,Cond_Expr
,Decl_Expr
,Dotted_Name
,Explicit_Deref
,Identifier
,Membership_Expr
,Null_Literal
,Num_Literal
,Paren_Expr
,Qual_Expr
,Quantified_Expr
,Raise_Expr
,Reduce_Attribute_Ref
,String_Literal
,Target_Name
,Un_Op
,Update_Attribute_Ref
When there are no parsing errors, this field is never null.
- type With_Clause
With clause (RM 10.1.2).
- function F_Has_Limited (Node : With_Clause'Class) Limited_Node
When there are no parsing errors, this field is never null.
- function F_Has_Limited (Node : With_Clause'Class) Standard.Boolean
- function F_Has_Private (Node : With_Clause'Class) Private_Node
When there are no parsing errors, this field is never null.
- function F_Has_Private (Node : With_Clause'Class) Standard.Boolean
- function F_Packages (Node : With_Clause'Class) Name_List
This field contains a list that itself contains one of the following nodes:
Char_Literal
,Dotted_Name
,Identifier
,String_Literal
When there are no parsing errors, this field is never null.
- type With_Private
Qualifier for the
private
keyword inwith private
record clauses.- function P_As_Bool (Node : With_Private'Class) Standard.Boolean
Return whether this is an instance of WithPrivatePresent
- type With_Private_Absent
- type With_Private_Present
- function Is_Null (Node : Ada_Node'Class) Standard.Boolean
Return whether this node is a null node reference.
- function Is_Token_Node (Node : Ada_Node'Class) Standard.Boolean
Return whether this node is a node that contains only a single token.
- function Is_Synthetic (Node : Ada_Node'Class) Standard.Boolean
Return whether this node is synthetic.
- function "=" (L, R : Ada_Node'Class) Standard.Boolean
Return whether
L
andR
designate the same node
- function Image (Node : Ada_Node'Class) Standard.String
Return a short string describing
Node
, or None” ifNode.Is_Null
is true.
- type Event_Handler_Interface
Interface to handle events sent by the analysis context.
- procedure Release (Self : Event_Handler_Interface)
Actions to perform when releasing resources associated to Self
Callback that will be called when a unit is requested from the context
Context
.Name
is the name of the requested unit.From
is the unit from which the unit was requested.Found
indicates whether the requested unit was found or not.Is_Not_Found_Error
indicates whether the fact that the unit was not found is an error or not.Warning
The interface of this callback is probably subject to change, so should be treated as experimental.
Callback that will be called when any unit is parsed from the context
Context
.Unit
is the resulting unit.Reparsed
indicates whether the unit was reparsed, or whether it was the first parse.
- procedure Do_Release (Self : Event_Handler_Interface'Class)
Helper for the instantiation below
- package Event_Handler_References is new GNATCOLL.Refcount.Shared_Pointers
package Event_Handler_References is new GNATCOLL.Refcount.Shared_Pointers (Event_Handler_Interface'Class, Do_Release);
- Instantiated generic package:
- type Event_Handler_Reference
- No_Event_Handler_Ref : Event_Handler_Reference renames Event_Handler_References.Null_Ref
- Object type:
- Renames:
Event_Handler_References.Null_Ref
- function Create_Event_Handler_Reference (Handler : Event_Handler_Interface'Class) Event_Handler_Reference
Simple wrapper around the GNATCOLL.Refcount API to create event handler references.
- type Unit_Provider_Interface
Interface to fetch analysis units from a name and a unit kind.
The unit provider mechanism provides an abstraction which assumes that to any couple (unit name, unit kind) we can associate at most one source file. This means that several couples can be associated to the same source file, but on the other hand, only one one source file can be associated to a couple.
This is used to make the semantic analysis able to switch from one analysis units to another.
See the documentation of each unit provider for the exact semantics of the unit name/kind information.
- function Get_Unit_Filename (Provider : Unit_Provider_Interface; Name : Text_Type; Kind : Analysis_Unit_Kind) Standard.String
Return the filename corresponding to the given unit name/unit kind. Raise a
Property_Error
if the given unit name is not valid.
- function Get_Unit (Provider : Unit_Provider_Interface; Context : Analysis_Context'Class; Name : Text_Type; Kind : Analysis_Unit_Kind; Charset : Standard.String; Reparse : Standard.Boolean) Analysis_Unit'Class
Fetch and return the analysis unit referenced by the given unit name. Raise a
Property_Error
if the given unit name is not valid.
- procedure Release (Provider : Unit_Provider_Interface)
Actions to perform when releasing resources associated to Provider
Like
Get_Unit_Filename
, but return both the source file thatName
/Kind
designate (inFilename
) and the index of the PLE root inside that unit (inPLE_Root_Index
). IfPLE_Root_Index
is left to 0 upon return, discard the result and switch to the PLE root unawareGet_Unit_Filename
function.Like
Get_Unit
, but return both the analysis unit thatName
/Kind
designate (inUnit
) and the index of the PLE root inside that unit (inPLE_Root_Index
). IfPLE_Root_Index
is left to 0 upon return, discard the result and switch to the PLE root unawareGet_Unit
function.
- procedure Do_Release (Provider : Unit_Provider_Interface'Class)
Helper for the instantiation below
- package Unit_Provider_References is new GNATCOLL.Refcount.Shared_Pointers
package Unit_Provider_References is new GNATCOLL.Refcount.Shared_Pointers (Unit_Provider_Interface'Class, Do_Release);
- Instantiated generic package:
- type Unit_Provider_Reference
- No_Unit_Provider_Reference : Unit_Provider_Reference renames Unit_Provider_References.Null_Ref
- Object type:
- Renames:
Unit_Provider_References.Null_Ref
- function Create_Unit_Provider_Reference (Provider : Unit_Provider_Interface'Class) Unit_Provider_Reference
Simple wrapper around the GNATCOLL.Refcount API to create unit provider references.
- function Has_Unit (Context : Analysis_Context'Class; Unit_Filename : Standard.String) Standard.Boolean
Return whether
Context
contains a unit correponding toUnit_Filename
.
- function Has_With_Trivia (Context : Analysis_Context'Class) Standard.Boolean
Return whether
Context
keeps trivia when parsing units
- procedure Discard_Errors_In_Populate_Lexical_Env (Context : Analysis_Context'Class; Discard : Standard.Boolean)
Debug helper. Set whether
Property_Error
exceptions raised inPopulate_Lexical_Env
should be discarded. They are by default.
- procedure Set_Logic_Resolution_Timeout (Context : Analysis_Context'Class; Timeout : Standard.Natural)
If
Timeout
is greater than zero, set a timeout for the resolution of logic equations. The unit is the number of steps in ANY/ALL relations. IfTimeout
is zero, disable the timeout. By default, the timeout is100 000
steps.
- procedure Set_Lookup_Cache_Mode (Mode : Langkit_Support.Lexical_Envs.Lookup_Cache_Kind)
Set the lexical environments lookup cache mode according to
Mode
. Note: Mainly meant for debugging the default mode.
- function Has_Rewriting_Handle (Context : Analysis_Context'Class) Standard.Boolean
Return whether
Context
has a rewriting handler (seeLibadalang.Rewriting
), i.e. whether it is in the process of rewriting. If true, this means that the set of currently loaded analysis units is frozen until the rewriting process is done.
- function Get_Symbol_Table (Context : Analysis_Context'Class) Symbol_Table
Return the symbol table attached to this context. Useful for users needing their own symbolization and wanting to share it with their language frontend.
WARNING: EXPERIMENTAL & UNSAFE - The Symbol_Table exposes an unsafe API, that might be subject to some changes, use with caution.
- procedure Reparse (Unit : Analysis_Unit'Class; Charset : Standard.String)
Reparse an analysis unit from the associated file.
Use
Charset
in order to decode the source. IfCharset
is empty then use the context’s default charset.If any failure occurs, such as decoding, lexing or parsing failure, diagnostic are emitted to explain what happened.
- procedure Reparse (Unit : Analysis_Unit'Class; Charset : Standard.String; Buffer : Standard.String)
Reparse an analysis unit from a buffer.
Use
Charset
in order to decode the source. IfCharset
is empty then use the context’s default charset.If any failure occurs, such as decoding, lexing or parsing failure, diagnostic are emitted to explain what happened.
- procedure Populate_Lexical_Env (Unit : Analysis_Unit'Class; PLE_Root_Index : Standard.Positive)
Create lexical environments for this analysis unit, according to the specifications given in the language spec.
If not done before, it will be automatically called during semantic analysis. Calling it before enables one to control where the latency occurs.
Depending on whether errors are discarded (see
Discard_Errors_In_Populate_Lexical_Env
), raise aProperty_Error
on failure.
- function Get_Filename (Unit : Analysis_Unit'Class) Standard.String
Return the filename this unit is associated to.
- function Get_Charset (Unit : Analysis_Unit'Class) Standard.String
Return the charset that was used to parse Unit
- function Has_Diagnostics (Unit : Analysis_Unit'Class) Standard.Boolean
Return whether this unit has associated diagnostics.
- function Diagnostics (Unit : Analysis_Unit'Class) Diagnostics_Array
Return an array that contains the diagnostics associated to this unit.
- function Format_GNU_Diagnostic (Unit : Analysis_Unit'Class; D : Diagnostic) Standard.String
Format a diagnostic in a GNU fashion. See <https://www.gnu.org/prep/standards/html_node/Errors.html>.
- function First_Token (Unit : Analysis_Unit'Class) Token_Reference
Return a reference to the first token scanned in this unit.
- function Last_Token (Unit : Analysis_Unit'Class) Token_Reference
Return a reference to the last token scanned in this unit.
- function Token_Count (Unit : Analysis_Unit'Class) Standard.Natural
Return the number of tokens in this unit.
- function Trivia_Count (Unit : Analysis_Unit'Class) Standard.Natural
Return the number of trivias in this unit. This is 0 for units that were parsed with trivia analysis disabled.
- function Text (Unit : Analysis_Unit'Class) Text_Type
Return the source buffer associated to this unit.
- function Lookup_Token (Unit : Analysis_Unit'Class; Sloc : Source_Location) Token_Reference
Look for a token in this unit that contains the given source location. If this falls before the first token, return the first token. If this falls between two tokens, return the token that appears before. If this falls after the last token, return the last token. If there is no token in this unit, return no token.
- procedure Dump_Lexical_Env (Unit : Analysis_Unit'Class)
Debug helper: output the lexical envs for the given analysis unit.
- procedure Trigger_Envs_Debug (Is_Active : Standard.Boolean)
Debug helper: activate debug traces for lexical envs lookups
- procedure Print (Unit : Analysis_Unit'Class; Show_Slocs : Standard.Boolean)
Debug helper: output the AST and eventual diagnostic for this unit on standard output.
If Show_Slocs, include AST nodes’ source locations in the output.
- procedure PP_Trivia (Unit : Analysis_Unit'Class)
Debug helper: output a minimal AST with mixed trivias
- type Child_Record
- Discriminants:
Kind (
Child_Or_Trivia
) –
- Components:
Node (
Ada_Node
) –Trivia (
Token_Reference
) –
- type Children_Array
This iterable type holds an array of
Child
orTrivia
nodes- function First (Self : Children_Array) Standard.Natural
Return the first child or trivia cursor corresponding to the children array. Helper for the
Iterable
aspect.
- function Last (Self : Children_Array) Standard.Natural
Return the last child or trivia cursor corresponding to the children array. Helper for the
Iterable
aspect.
- function Next (Self : Children_Array; Pos : Standard.Natural) Standard.Natural
Return the child or trivia cursor that follows
Self
in the children array. Helper for theIterable
aspect.
- function Previous (Self : Children_Array; Pos : Standard.Natural) Standard.Natural
Return the child or trivia cursor that follows
Self
in the children array. Helper for theIterable
aspect.
- function Has_Element (Self : Children_Array; Pos : Standard.Natural) Standard.Boolean
Return if
Pos
is inSelf
’s iteration range. Helper for theIterable
aspect.
- function Element (Self : Children_Array; Pos : Standard.Natural) Child_Record
Return the child of trivia node at position
Pos
inSelf
. Helper for theIterable
aspect.
- function Children_And_Trivia (Node : Ada_Node'Class) Children_Array
Return the children of this node interleaved with Trivia token nodes, so that:
Every trivia contained between
Node.Start_Token
andNode.End_Token - 1
will be part of the returned array.Nodes and trivias will be lexically ordered.
- type Aspect
Composite field representing the aspect of an entity (RM 13).
- function Node (Self : Aspect) Ada_Node'Class
Syntactic node that defines the aspect
- function Value (Self : Aspect) Expr'Class
Expr node defining the value of the aspect
- function Inherited (Self : Aspect) Standard.Boolean
Whether the aspect is inherited (it has been defined by a parent)
- function Create_Aspect (Exists : Standard.Boolean; Node : Ada_Node'Class; Value : Expr'Class; Inherited : Standard.Boolean) Aspect
- type Completion_Item
- function Decl (Self : Completion_Item) Basic_Decl'Class
- function Is_Dot_Call (Self : Completion_Item) Standard.Boolean
- function Is_Visible (Self : Completion_Item) Standard.Boolean
- function Weight (Self : Completion_Item) Standard.Integer
The higher the weight, the more relevant the completion item is.
- function Create_Completion_Item (Decl : Basic_Decl'Class; Is_Dot_Call : Standard.Boolean; Is_Visible : Standard.Boolean; Weight : Standard.Integer) Completion_Item
- type Completion_Item_Iterator
An iterator provides a mean to retrieve values one-at-a-time.
Resource management for iterators is automatic.
Currently, each iterator is bound to the analysis context used to create it. Iterators are invalidated as soon as any unit of that analysis is reparsed. Due to the nature of iterators (lazy computations), this invalidation is necessary to avoid use of inconsistent state, such as an iterator trying to use analysis context data that is stale.
- function Next (Self : Completion_Item_Iterator; Item : Completion_Item) Standard.Boolean
Set the next value from the iterator in the given out argument. Return True if successful, otherwise False.
This raises a
Stale_Reference_Error
exception if the iterator is invalidated.
- type Discrete_Range
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.- function Low_Bound (Self : Discrete_Range) Expr'Class
- function High_Bound (Self : Discrete_Range) Expr'Class
- function Create_Discrete_Range (Low_Bound : Expr'Class; High_Bound : Expr'Class) Discrete_Range
- type Discriminant_Values
Represent a set of values (as a list of choices) on a discriminant.
- function Discriminant (Self : Discriminant_Values) Identifier'Class
- function Values (Self : Discriminant_Values) Alternatives_List'Class
- function Create_Discriminant_Values (Discriminant : Identifier'Class; Values : Alternatives_List'Class) Discriminant_Values
- type Discriminant_Values_Array
- type Doc_Annotation
Documentation annotation.
- function Key (Self : Doc_Annotation) Text_Type
Annotation key
- function Value (Self : Doc_Annotation) Text_Type
Annotation value
- function Create_Doc_Annotation (Key : Text_Type; Value : Text_Type) Doc_Annotation
- type Doc_Annotation_Array
- type Accept_Stmt_Array
- type Ada_Node_Array
- function Create_Solver_Diagnostic (Template : Text_Type; Args : Ada_Node_Array; Location : Ada_Node'Class; Contexts : Logic_Context_Array; Round : Standard.Integer) Solver_Diagnostic
- type Base_Formal_Param_Decl_Array
- function Create_Shape (Components : Base_Formal_Param_Decl_Array; Discriminants_Values : Discriminant_Values_Array) Shape
- type Base_Type_Decl_Array
- type Basic_Decl_Array
- type Compilation_Unit_Array
- type Defining_Name_Array
- type Expr_Array
- type Generic_Instantiation_Array
- type Param_Spec_Array
- type Pragma_Node_Array
- type Type_Decl_Array
- type Logic_Context
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.
- function Ref_Node (Self : Logic_Context) Ada_Node'Class
- function Decl_Node (Self : Logic_Context) Ada_Node'Class
- function Create_Logic_Context (Ref_Node : Ada_Node'Class; Decl_Node : Ada_Node'Class) Logic_Context
- type Logic_Context_Array
- type Param_Actual
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).
- function Param (Self : Param_Actual) Defining_Name'Class
- function Actual (Self : Param_Actual) Expr'Class
- function Create_Param_Actual (Param : Defining_Name'Class; Actual : Expr'Class) Param_Actual
- type Param_Actual_Array
- type Ref_Result
Result for a cross reference query returning a reference.
- function Ref (Self : Ref_Result) Base_Id'Class
- function Kind (Self : Ref_Result) Ref_Result_Kind
- function Create_Ref_Result (Ref : Base_Id'Class; Kind : Ref_Result_Kind) Ref_Result
- type Ref_Result_Array
- type Refd_Decl
Result for a cross reference query returning a referenced decl.
- function Decl (Self : Refd_Decl) Basic_Decl'Class
- function Kind (Self : Refd_Decl) Ref_Result_Kind
- function Create_Refd_Decl (Decl : Basic_Decl'Class; Kind : Ref_Result_Kind) Refd_Decl
- type Refd_Def
Result for a cross reference query returning a referenced defining name.
- function Def_Name (Self : Refd_Def) Defining_Name'Class
- function Kind (Self : Refd_Def) Ref_Result_Kind
- function Create_Refd_Def (Def_Name : Defining_Name'Class; Kind : Ref_Result_Kind) Refd_Def
- type Shape
Represent one of the shapes that a variant record can have, as a list of the available components.
- function Components (Self : Shape) Base_Formal_Param_Decl_Array
- function Discriminants_Values (Self : Shape) Discriminant_Values_Array
- type Shape_Array
- type Solver_Diagnostic
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.
Template
is a string explaining the error, which may contain holes reprsented by the{}
characters.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.
- function Template (Self : Solver_Diagnostic) Text_Type
- function Args (Self : Solver_Diagnostic) Ada_Node_Array
- function Location (Self : Solver_Diagnostic) Ada_Node'Class
- function Contexts (Self : Solver_Diagnostic) Logic_Context_Array
- function Round (Self : Solver_Diagnostic) Standard.Integer
- type Solver_Diagnostic_Array
- type 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.
- function From_Decl (Self : Substitution) Basic_Decl'Class
The declaration to substitute.
- function To_Value (Self : Substitution) Big_Integer
The value by which to substitute the declaration.
- function Value_Type (Self : Substitution) Base_Type_Decl'Class
The type of the substituted value.
- function Create_Substitution (From_Decl : Basic_Decl'Class; To_Value : Big_Integer; Value_Type : Base_Type_Decl'Class) Substitution
- type Substitution_Array
- type Analysis_Unit_Array
- type Unbounded_Text_Type_Array
- type Token_Iterator
Allow iteration on a range of tokens corresponding to a node
- function First_Token (Self : Token_Iterator) Token_Reference
Return the first token corresponding to the node
- function Next_Token (Self : Token_Iterator; Tok : Token_Reference) Token_Reference
Return the token that follows Tok in the token stream
- function Has_Element (Self : Token_Iterator; Tok : Token_Reference) Standard.Boolean
Return if Tok is in Self’s iteration range
- function Element (Self : Token_Iterator; Tok : Token_Reference) Token_Reference
Identity function: helper for the Iterable aspect
- function Token_Range (Node : Ada_Node'Class) Token_Iterator
Return an iterator on the range of tokens encompassed by Node
- function Kind (Node : Ada_Node'Class) Ada_Node_Kind_Type
- function Kind_Name (Node : Ada_Node'Class) Standard.String
Return the concrete kind for Node
- function Children_Count (Node : Ada_Node'Class) Standard.Natural
Return the number of children
Node
has
- function First_Child_Index (Node : Ada_Node'Class) Standard.Natural
Return the index of the first child
Node
has
- function Last_Child_Index (Node : Ada_Node'Class) Standard.Natural
Return the index of the last child
Node
has, or 0 if there is no child.
- function Traverse (Node : Ada_Node'Class; Visit : access function (Node : Ada_Node'Class) return Visit_Status) Visit_Status
Call
Visit
onNode
and all its children, transitively. Calls happen in prefix order (i.e. top-down and left first). The traversal is controlled as follows by the result returned by Visit:Into
The traversal continues normally with the syntactic children of the node just processed.
Over
The children of the node just processed are skipped and excluded from the traversal, but otherwise processing continues elsewhere in the tree.
Stop
The entire traversal is immediately abandoned, and the original call to
Traverse
returnsStop
.
- procedure Traverse (Node : Ada_Node'Class; Visit : access function (Node : Ada_Node'Class) return Visit_Status)
This is the same as
Traverse
function except that no result is returned i.e. theTraverse
function is called and the result is simply discarded.
- function Sloc_Range (Node : Ada_Node'Class) Source_Location_Range
Return the source location range corresponding to the set of tokens from which Node was parsed.
- function Compare (Node : Ada_Node'Class; Sloc : Source_Location) Relative_Position
Compare Sloc to the sloc range of Node
- function Text (Node : Ada_Node'Class) Text_Type
Return the source buffer slice corresponding to the text that spans between the first and the last tokens of this node.
Note that this returns the empty string for synthetic nodes.
- function Is_Keyword (Token : Token_Reference; Version : Language_Version) Standard.Boolean
Given an Ada language version, return whether
Token
is an Ada keyword.Due to the way Libadalang works, every token added after Ada 83 is lexed as a regular identifier, and then treated specially by the parser in some circumstances (being akin to the notion of reserved word).
This function returns True for regular lexer keywords, as well as for those identifiers.
- procedure Print (Node : Ada_Node'Class; Show_Slocs : Standard.Boolean; Line_Prefix : Standard.String)
Debug helper: print to standard output Node and all its children.
If Show_Slocs, include AST nodes’ source locations in the output.
Line_Prefix is prepended to each output line.
- procedure PP_Trivia (Node : Ada_Node'Class; Line_Prefix : Standard.String)
Debug helper: print to standard output Node and all its children along with the trivia associated to them. Line_Prefix is prepended to each output line.
- procedure Assign_Names_To_Logic_Vars (Node : Ada_Node'Class)
Debug helper: Assign names to every logical variable in the root node, so that we can trace logical variables.