--  -*- ada -*-
--
--  This file contains declaration such as:
--
--    Type  [ <-- ParentType ]
--      Field : FieldType [ := Initialization ]
--
--    There is a special node kind called Root, which is not a real node,
--    and will serve as a virtual parent for everything. It has to contain
--    a Kind node of type Node_Kind, which will be used for qualification
--    purpose. Also, an Original_Node field of type Node_Id must be retained
--    if one wants to use the Node_Access.Manip package.
--
--    Accessors will have the name Field and Set_Field.
--
--  $Id$
--

START

Root
  Kind : Node_Kind
  Original_Node : Node_Id
  Loc : Location
  Expanded : Boolean := False

Named
  Definition : Identifier_Definition_Acc
  Repository_Id : Node_Id
  Is_Explicit_Repository_Id : Boolean := False
  --  The repository ID for this entity was explicitly set
  --  using #pragma ID.
  Is_Explicit_Version_Id : Boolean := False
  --  The version of the Repository ID was explicitly set
  --  using #pragma version
  Parent_Scope_Override : Node_Id
  --  Expansion attribute: override that
  --  value of Definition.Parent_Scope for this
  --  copy of the node (used for inherited operation
  --  and attribute nodes).
  Repository_Id_Identifier : Node_Id
  --  Expansion attribute: A Named node that holds the name
  --  of the Ada constant that contains the node's repository ID.

Scope <-- Named
  Identifier_List : Identifier_Definition_List
  Identifier_Table : Storage
  Current_Prefix : Node_Id
  --  The current Repository Id prefix for the scope.
  --  This attribute is used only during parse.

Forward <-- Scope
  Unimplemented_Forwards : Node_List

Imports <-- Scope
  Imported_Table : Storage
  Imported : Boolean

Repository <-- Forward
  Contents : Node_List

Module <-- Forward
  Contents : Node_List
  Imported : Boolean

Interface <-- Imports
  Parents  : Node_List
  --  The ancestors of this interface
  Contents : Node_List
  --  The declarations of this interface
  Forward  : Node_Id
  --  Forward declaration (if any) of this interface
  Abst     : Boolean
  --  Abstract interface
  Local    : Boolean
  --  Locality-constrained interface
  Has_Non_Implicit_Inherited_Operations : Boolean := False
  --  Set when this interface has operations for which stub bodies are
  --  actually generated.

Forward_Interface <-- Named
  Forward : Node_Id
  --  Actual interface corresponding to this forward declaration (set during
  --  semantic analysis of the complete declaration).
  --  The Name and Parent_Scope of the forward declaration must then be
  --  retrieved from the full declaration's Definition
  Abst : Boolean
  --  Abstract interface
  Local : Boolean
  --  Locality-constrained interface

ValueType <-- Imports
  Parents : Node_List
  Contents : Node_List
  Supports : Node_List
  Forward : Node_Id
  Abst : Boolean
  Custom : Boolean
  Truncatable : Boolean

Forward_ValueType <-- Named
  Forward : Node_Id
  Abst : Boolean

Boxed_ValueType <-- Named
  Boxed_Type : Node_Id

Declarator <-- Named
  Array_Bounds : Node_List
  Parent : Node_Id

State_Member
  State_Type : Node_Id
  State_Declarators : Node_List
  Is_Public : Boolean

Initializer <-- Scope
  Param_Decls : Node_List

Scoped_Name
  Value : Node_Id
  --  The Named node that this scoped name resolves to.

Operation <-- Scope
  Is_Oneway : Boolean
  Operation_Type : Node_Id
  Parameters : Node_List
  Raises : Node_List
  Contexts : Node_List
  Is_Explicit_Self : Boolean := False
  --  Determines whether the argument that determines the target object for
  --  this operation is listed explicitly in Parameters. Normally False for
  --  the standard IDL -> Ada mapping. Intended for implementation of
  --  distributed objects in DSA personality.
  Is_Implicit_Inherited : Boolean := False
  --  Expansion attribute: this operation is inherited from
  --  the first parent (and therefore its calling stubs need
  --  not be redeclared).
  Is_Directly_Supported : Boolean := False
  --  Expansion attribute: this operation is copied
  --  from one of this valuetype's supported interfaces
  Oldest_Supporting_ValueType : Node_Id := No_Node
  --  Expansion attribute: when an operation is copied down
  --  to a valuetype from a supported interface, then this attribute
  --  is set to this valuetype; it keeps its value when copied down
  --  to derived valuetypes.

Attribute
  Is_Readonly : Boolean
  A_Type : Node_Id
  Declarators : Node_List
  Raises : Node_List
  Get_Raises : Node_List
  Set_Raises : Node_List

Void

Float

Double

Long_Double

Short

Long

Long_Long

Unsigned_Short

Unsigned_Long

Unsigned_Long_Long

Char

Wide_Char

Boolean

Octet

Any

Object

Param
  Mode : Param_Mode
  Param_Type : Node_Id
  Declarator : Node_Id
  Is_Returns : Boolean := False
  --  Expansion attribute: is this a mode out
  --  formal that represents the return value
  --  of a function with out or inout formals?

Exception <-- Scope
  Members : Node_List
  Imported : Boolean
  Members_Type : Node_Id := No_Node
  --  Expansion attribute: The expanded struct
  --  <exception>_Members.

Member
  M_Type : Node_Id
  Decl : Node_List

Native
  Declarator : Node_Id

Union <-- Scope
  Switch_Type : Node_Id
  Default_Index : Long_Integer := -1
  Cases : Node_List
  Imported : Boolean

Case
  Labels : Node_List
  Case_Type : Node_Id
  Case_Decl : Node_Id

Struct <-- Scope
  Members : Node_List
  Imported : Boolean
  Is_Exception_Members : Boolean := False
  --  Expansion attribute: is this struct
  --  generated by the expander to hold the
  --  members of an exception?

Enum <-- Named
  Enumerators : Node_List
  Imported : Boolean

Enumerator <-- Named

Type_Declarator
  T_Type : Node_Id
  Declarators : Node_List
  Imported : Boolean

Expr
  Expr_Value : Constant_Value_Ptr

Binary_Expr <-- Expr
  Left : Node_Id
  Right : Node_Id

Unary_Expr <-- Expr
  Operand : Node_Id

Primary_Expr <-- Expr
  Operand : Node_Id

Or_Expr <-- Binary_Expr

Xor_Expr <-- Binary_Expr

And_Expr <-- Binary_Expr

Shl_Expr <-- Binary_Expr

Shr_Expr <-- Binary_Expr

Add_Expr <-- Binary_Expr

Sub_Expr <-- Binary_Expr

Mul_Expr <-- Binary_Expr

Div_Expr <-- Binary_Expr

Mod_Expr <-- Binary_Expr

Neg_Expr <-- Unary_Expr

Id_Expr <-- Unary_Expr

Not_Expr <-- Unary_Expr

Literal <-- Expr

Lit_Integer <-- Literal

Lit_String <-- Literal

Lit_Wide_String <-- Literal

Lit_Character <-- Literal

Lit_Wide_Character <-- Literal

Lit_Fixed_Point <-- Literal

Lit_Floating_Point <-- Literal

Lit_Boolean <-- Literal

Lit_Enum <-- Literal

Const_Dcl <-- Named
  Constant_Type : Node_Id
  Expression : Node_Id

Sequence
  Sequence_Type : Node_Id
  Bound : Node_Id

String
  Bound : Node_Id

Wide_String
  Bound : Node_Id

Fixed
  Digits_Nb : Node_Id
  Scale : Node_Id

ValueBase

Pragma

------------------------------
-- Expansion-specific nodes --
------------------------------

Ben_Idl_File <-- Scope
  Contents : Node_List
  Is_Unknown : Boolean := False
  --  Expansion attribute: set to True if this node does
  --  not actually correspond to a real file (in which case
  --  it is expected that it only contains other scopes).
  Generate_Code : Boolean := True
  --  Expansion attribute: set to True if for this node
  --  code should be generated. By default code generation
  --  is always enabled, but for CORBA 3 style "imported"
  --  file we disable code generation.

Sequence_Instance <-- Named
  Sequence : Node_Id
  --  The Sequence node for which this instance was created

String_Instance <-- Named
  --  An instance of CORBA.Bounded_Strings or CORBA.Bounded_Wide_Strings
  Bound : Node_Id
  Is_Wide : Boolean

END
