nightshade

The nightshade programming language, compiler and tools (WIP)
Log | Files | Refs | README

scope.ads (946B)



with Ada.Containers.Indefinite_Hashed_Maps;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Strings.Hash;
with Types;                 use Types;

package Scope is

   type Scoper is record
      Scope      : AST_Scope_Ref;
      Scoped_AST : Declaration_Vectors.Vector;
   end record;

   Int_Type    : constant AST_Type_Info_Ref := new AST_Type_Info'(Kind => TY_INT);
   String_Type : constant AST_Type_Info_Ref := new AST_Type_Info'(Kind => TY_STRING);
   Bool_Type   : constant AST_Type_Info_Ref := new AST_Type_Info'(Kind => TY_BOOL);
   Void_Type   : constant AST_Type_Info_Ref := new AST_Type_Info'(Kind => TY_VOID);
   Error_Type  : constant AST_Type_Info_Ref := new AST_Type_Info'(Kind => TY_ERROR);

   ----------
   -- init --
   ----------

   function Init (AST : Declaration_Vectors.Vector) return Scoper;

   --------------
   -- analysis --
   --------------

   procedure Analysis (S : in out Scoper);

end Scope;