DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦12c28ff5e⟧ Ada Source

    Length: 43008 (0xa800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Syntaxic, seg_04ccc2, seg_04cd9a

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Position;
with Lexical;
with Text_Io;
with Parametres;
with Lecteur;
with L_Lecteurs;
with Porte;
with L_Portes;
with L_Zones;
with Zone;
with L_Porteurs;
with Porteur;
with L_Groupes;
with Groupe;
with Date;
with Plage;
with L_Plages_Horaires;
with Plage_Horaire;
with P_Acces;
with L_P_Access;

package body Syntaxic is

    Nom_Groupe_Non_Declare_Erreur : exception;
    Nom_Zone_Non_Declaree_Erreur : exception;
    Nombre_Maximum_De_Plage_Est_Atteint_Erreur : exception;
    Semaine_Trop_Longue_Erreur : exception;
    Semaine_Trop_Courte_Erreur : exception;
    Trop_De_Plages_Declarees_Erreur : exception;
    Nom_Du_Porteur_Non_Declare_Erreur : exception;
    Double_Declaration_Numero_De_Carte_Erreur : exception;
    Double_Declaration_Nom_De_Porteur_Erreur : exception;
    Double_Declaration_Nom_Zone_Erreur : exception;
    Double_Declaration_Nom_Porte_Erreur : exception;
    Numero_Lecteur_Non_Declare_Erreur : exception;
    Double_Declaration_Nom_Groupe_Erreur : exception;
    Double_Declaration_Numero_Lecteur_Erreur : exception;
    Porte_Non_Declaree_Erreur : exception;
    Plage_Horaire_Label_Erreur : exception;
    Lecteur_Label_Erreur : exception;
    Code_Site_Label_Erreur : exception;
    Zones_Label_Erreur : exception;
    Porteurs_Label_Erreur : exception;
    Egal_Erreur : exception;
    Double_Point_Erreur : exception;
    Identificateur_Erreur : exception;
    Identificateur_Erreur_Ou_Fin_Erreur : exception;
    Fin_Erreur : exception;
    Portes_Label_Erreur : exception;
    Virgule_Erreur : exception;
    Point_Virgule_Erreur : exception;
    Virgule_Ou_Point_Virgule_Erreur : exception;
    Entier_Erreur : exception;
    Apb_Erreur : exception;
    Veille_Erreur : exception;
    Entree_Tor_Erreur : exception;
    Evenement_Erreur : exception;
    Groupes_Label_Erreur : exception;
    Acces_Label_Erreur : exception;
    Tiret_Erreur : exception;

    Banner : constant String (1 .. 80) := (1 .. 80 => '-');
    type Bloc_Syntaxique is (Bloc_Lecteurs, Bloc_Code_Site, Bloc_Portes,
                             Bloc_Zones, Bloc_Porteurs, Bloc_Groupes,
                             Bloc_Acces, Bloc_Plage_Horaire);
    Le_Bloc_Syntaxique : Bloc_Syntaxique;

    procedure Affiche_Erreur is
    begin
        Text_Io.Put_Line (Banner);
        Text_Io.Put_Line ("Contenu de la ligne : #" &
                          Lexical.La_String (1 .. Lexical.Dernier_Car) & "#");
        Text_Io.Put_Line ("Contenu de l'unite lexicale : #" &
                          Lexical.Unite (1 .. Lexical.Indice_Unite - 1) & "#");
        Text_Io.Put_Line (Position.Image (Lexical.La_Position));
        if (Lexical.Is_Eof = True) then
            Text_Io.Put_Line ("Unexpected End_Of_File");
        end if;
        if (Lexical.Is_In_Bloc = True) then
            Text_Io.Put_Line ("On est dans un Bloc Syntaxique : " &
                              Bloc_Syntaxique'Image (Le_Bloc_Syntaxique));

        end if;

        Text_Io.Put_Line (Banner);
        Lexical.Close;
    end Affiche_Erreur;

    procedure Verifier_Plage_Horaire is
        use Lexical;
    begin
        if (Lexical.Typ_Mot_Cle /= Lexical.Typ_Plages_Horaires) then
            raise Plage_Horaire_Label_Erreur;
        end if;
    end Verifier_Plage_Horaire;

    procedure Verifier_Lecteur is
        use Lexical;
    begin
        if (Lexical.Typ_Mot_Cle /= Lexical.Typ_Lecteurs) then
            raise Lecteur_Label_Erreur;
        end if;
    end Verifier_Lecteur;

    procedure Verifier_Double_Point is
        use Lexical;
    begin
        if (Lexical.Typ_Mot_Cle /= Lexical.Typ_Double_Point) then
            raise Double_Point_Erreur;
        end if;
    end Verifier_Double_Point;

    procedure Verifier_Identificateur_Ou_Fin is
        use Lexical;
    begin
        if (Lexical.Typ_Unite /= Lexical.Identificateur) then
            raise Identificateur_Erreur_Ou_Fin_Erreur;
        end if;
    end Verifier_Identificateur_Ou_Fin;

    procedure Verifier_Virgule is
        use Lexical;
    begin
        if (Lexical.Typ_Mot_Cle /= Lexical.Typ_Virgule) then
            raise Virgule_Erreur;
        end if;
    end Verifier_Virgule;

    procedure Verifier_Entier is
        use Lexical;
    begin
        if (Lexical.Typ_Unite /= Lexical.Entier) then
            raise Entier_Erreur;
        end if;
    end Verifier_Entier;

    procedure Verifier_Point_Virgule is
        use Lexical;
    begin
        if (Lexical.Typ_Mot_Cle /= Lexical.Typ_Point_Virgule) then
            raise Point_Virgule_Erreur;
        end if;
    end Verifier_Point_Virgule;

    procedure Verifier_Code_Site is
        use Lexical;
    begin
        if (Lexical.Typ_Mot_Cle /= Lexical.Typ_Code_Site) then
            raise Code_Site_Label_Erreur;
        end if;
    end Verifier_Code_Site;

    procedure Verifier_Fin is
        use Lexical;
    begin
        if (Lexical.Typ_Mot_Cle /= Lexical.Typ_Fin) then
            raise Fin_Erreur;
        end if;
    end Verifier_Fin;

    procedure Verifier_Portes is
        use Lexical;
    begin
        if (Lexical.Typ_Mot_Cle /= Lexical.Typ_Portes) then
            raise Portes_Label_Erreur;
        end if;
    end Verifier_Portes;

    procedure Verifier_Zones is
        use Lexical;
    begin
        if (Lexical.Typ_Mot_Cle /= Lexical.Typ_Zones) then
            raise Zones_Label_Erreur;
        end if;
    end Verifier_Zones;

    procedure Verifier_Groupes is
        use Lexical;
    begin
        if (Lexical.Typ_Mot_Cle /= Lexical.Typ_Groupes) then
            raise Groupes_Label_Erreur;
        end if;
    end Verifier_Groupes;

    procedure Verifier_Acces is
        use Lexical;
    begin
        if (Lexical.Typ_Mot_Cle /= Lexical.Typ_Acces) then
            raise Acces_Label_Erreur;
        end if;
    end Verifier_Acces;

    procedure Verifier_Egal is
        use Lexical;
    begin
        if (Lexical.Typ_Mot_Cle /= Lexical.Typ_Egal) then
            raise Egal_Erreur;
        end if;
    end Verifier_Egal;

    procedure Verifier_Identificateur is
        use Lexical;
    begin
        if (Lexical.Typ_Unite /= Lexical.Identificateur) then
            raise Identificateur_Erreur;
        end if;
    end Verifier_Identificateur;

    procedure Verifier_Virgule_Ou_Point_Virgule is
        use Lexical;
    begin
        if (Lexical.Typ_Mot_Cle /= Lexical.Typ_Virgule) then
            raise Virgule_Ou_Point_Virgule_Erreur;
        end if;
    end Verifier_Virgule_Ou_Point_Virgule;

    procedure Verifier_Porteurs is
        use Lexical;
    begin
        if (Lexical.Typ_Mot_Cle /= Lexical.Typ_Porteurs) then
            raise Porteurs_Label_Erreur;
        end if;
    end Verifier_Porteurs;
    procedure Verifier_Tiret is
        use Lexical;
    begin
        if (Lexical.Typ_Mot_Cle /= Lexical.Typ_Tiret) then
            raise Tiret_Erreur;
        end if;
    end Verifier_Tiret;

    procedure Verifier_Apb is
        use Lexical;
        use Parametres;
    begin
        if ((Lexical.Typ_Unite /= Lexical.Identificateur) and
            ((Parametres.Inactif /=
              Parametres.Apb'Value
                 (Lexical.Unite (1 .. Lexical.Indice_Unite - 1)) or
              (Parametres.Actif /=
               Parametres.Apb'Value
                  (Lexical.Unite (1 .. Lexical.Indice_Unite - 1)))))) then
            raise Apb_Erreur;
        end if;
    end Verifier_Apb;

    procedure Verifier_Veille is
        use Lexical;  
        use Parametres;
    begin
        if ((Lexical.Typ_Unite /= Lexical.Identificateur) and
            ((Parametres.En_Veille /=
              Parametres.Veille'Value
                 (Lexical.Unite (1 .. Lexical.Indice_Unite - 1))) or
             (Parametres.En_Service /=
              Parametres.Veille'Value
                 (Lexical.Unite (1 .. Lexical.Indice_Unite - 1))))) then
            raise Veille_Erreur;
        end if;
    end Verifier_Veille;

    procedure Verifier_Entree_Tor is
        use Lexical;  
        use Parametres;
    begin
        if ((Lexical.Typ_Unite /= Lexical.Identificateur) and
            ((Parametres.Contact /=
              Parametres.Entree_Tor'Value
                 (Lexical.Unite (1 .. Lexical.Indice_Unite - 1))) or
             (Parametres.Boucle /=
              Parametres.Entree_Tor'Value
                 (Lexical.Unite (1 .. Lexical.Indice_Unite - 1))) or
             (Parametres.Bp /=
              Parametres.Entree_Tor'Value
                 (Lexical.Unite (1 .. Lexical.Indice_Unite - 1))))) then
            raise Entree_Tor_Erreur;
        end if;
    end Verifier_Entree_Tor;

    procedure Verifier_Evenement is
        use Lexical;  
        use Parametres;
    begin
        if ((Lexical.Typ_Unite /= Lexical.Identificateur) and
            ((Parametres.Anomalies /=
              Parametres.Evenement'Value
                 (Lexical.Unite (1 .. Lexical.Indice_Unite - 1))) or
             (Parametres.Tous /=
              Parametres.Evenement'Value
                 (Lexical.Unite (1 .. Lexical.Indice_Unite - 1))))) then
            raise Evenement_Erreur;
        end if;
    end Verifier_Evenement;

    procedure Get_Lecteurs is
        Lect : Lecteur.Object;
        Typ_Lect : String (1 .. 30);
        Dern_Char : Natural;
        Numero : Natural;
        Les_P : Parametres.Object;
        P_Tempo : Natural;
        P_Apb : Parametres.Apb;
        P_Veille : Parametres.Veille;
        P_Entree_Tor : Parametres.Entree_Tor;
        P_Evenements : Parametres.Evenement;

        use Lexical;
    begin
        --
        -- Lecture de "LECTEURS:"
        --
        Lexical.Lex_File;
        Verifier_Lecteur;
        Lexical.Lex_File;
        Verifier_Double_Point;
        --
        --
        -- Lecture des parametres d'un lecteur
        --
        Le_Bloc_Syntaxique := Bloc_Lecteurs;
        Lexical.Is_In_Bloc := True;
        Lecture_Parametres_Lecteur:
            loop
                --
                -- Lecture du type de lecteur
                --
                Lexical.Lex_File;
                if (Lexical.Typ_Mot_Cle = Typ_Fin) then
                    exit Lecture_Parametres_Lecteur;
                end if;
                Verifier_Identificateur_Ou_Fin;
                Typ_Lect (1 .. Lexical.Indice_Unite - 1) :=
                   Lexical.Unite (1 .. Lexical.Indice_Unite - 1);
                Dern_Char := Lexical.Indice_Unite - 1;

                Lexical.Lex_File;
                Verifier_Virgule;
                --
                --Lecture du numero de lecteur
                --
                Lexical.Lex_File;
                Verifier_Entier;
                Numero := Natural'Value (Lexical.Unite
                                            (1 .. Lexical.Indice_Unite - 1));
                if (L_Lecteurs.Search (Liste_Lect, Numero)) then
                    raise Double_Declaration_Numero_Lecteur_Erreur;
                end if;  
                Lexical.Lex_File;
                Verifier_Virgule;
                --
                -- lecture du Tempo du lecteur
                --
                Lexical.Lex_File;
                Verifier_Entier;
                P_Tempo := Natural'Value (Unite (1 .. Indice_Unite - 1));
                Lexical.Lex_File;
                Verifier_Virgule;
                --
                --Lecture APB du lecteur
                --
                Lexical.Lex_File;
                Verifier_Apb;
                P_Apb := Parametres.Apb'Value (Unite (1 .. Indice_Unite - 1));
                Lexical.Lex_File;
                Verifier_Virgule;
                --
                --Lecture Veille du lecteur
                --
                Lexical.Lex_File;
                Verifier_Veille;
                P_Veille := Parametres.Veille'Value
                               (Unite (1 .. Indice_Unite - 1));
                Lexical.Lex_File;
                Verifier_Virgule;
                --
                --Lecture Entree_Tor du lecteur
                --
                Lexical.Lex_File;
                Verifier_Entree_Tor;
                P_Entree_Tor := Parametres.Entree_Tor'Value
                                   (Unite (1 .. Indice_Unite - 1));
                Lexical.Lex_File;
                Verifier_Virgule;
                --
                -- Lecture Evenement du Lecteur
                --
                Lexical.Lex_File;
                Verifier_Evenement;
                P_Evenements := Parametres.Evenement'Value
                                   (Unite (1 .. Indice_Unite - 1));
                Lexical.Lex_File;
                Verifier_Point_Virgule;
                --
                -- Mise a jour de la liste
                --
                Les_P := Parametres.Set (P_Tempo, P_Apb, P_Veille,
                                         P_Entree_Tor, P_Evenements);
                Lecteur.Set (Lect, Typ_Lect (1 .. Dern_Char), Numero, Les_P);
                L_Lecteurs.Insert_Element (Lect, Liste_Lect);
            end loop Lecture_Parametres_Lecteur;
        Lexical.Is_In_Bloc := False;
    end Get_Lecteurs;


    procedure Get_Code_Site is
    begin
        --
        -- Lecture de "CODE_SITE:"
        --
        Lexical.Lex_File;
        Verifier_Code_Site;
        Lexical.Lex_File;
        Verifier_Double_Point;
        Le_Bloc_Syntaxique := Bloc_Code_Site;
        --
        -- Lecture du code site
        --
        Lexical.Lex_File;
        Verifier_Entier;
        Le_Site := Natural'Value (Lexical.Unite
                                     (1 .. Lexical.Indice_Unite - 1));
        Lexical.Lex_File;
        Verifier_Point_Virgule;
        --
        -- Lecture de "FIN"
        --
        Lexical.Lex_File;
        Verifier_Fin;

    end Get_Code_Site;


    procedure Get_Portes is
        Une_Porte : Porte.Object;
        Nom_Porte : String (1 .. 30);
        Dernier_Car, Number : Natural;  
        use Lexical;
    begin
        --
        -- Lecture de "PORTES:"
        --
        Lexical.Lex_File;
        Verifier_Portes;
        Lexical.Lex_File;
        Verifier_Double_Point;
        --
        -- Lecture des couples (porte , lecteur)
        --
        Le_Bloc_Syntaxique := Bloc_Portes;
        Lexical.Is_In_Bloc := True;
        Lecture_Porte_Lecteur:
            loop
                --
                -- Lecture du nom de la porte
                --
                Lexical.Lex_File;
                if (Lexical.Typ_Mot_Cle = Lexical.Typ_Fin) then
                    exit Lecture_Porte_Lecteur;
                end if;
                Verifier_Identificateur_Ou_Fin;
                Dernier_Car := Indice_Unite - 1;
                Nom_Porte (1 .. Dernier_Car) := Unite (1 .. Dernier_Car);
                if (L_Portes.Search (Liste_Port,
                                     Nom_Porte (1 .. Dernier_Car))) then
                    raise Double_Declaration_Nom_Porte_Erreur;
                end if;
                Lexical.Lex_File;
                Verifier_Virgule;
                --
                --Lecture du numero de lecteur
                --
                Lexical.Lex_File;
                Verifier_Entier;
                Number := Natural'Value (Unite (1 .. Indice_Unite - 1));
                if (L_Lecteurs.Search (Liste_Lect, Number) = False) then
                    raise Numero_Lecteur_Non_Declare_Erreur;
                end if;
                Lexical.Lex_File;
                Verifier_Point_Virgule;
                Porte.Set (Une_Porte, Nom_Porte (1 .. Dernier_Car), Number);
                L_Portes.Insert_Element (Une_Porte, Liste_Port);
            end loop Lecture_Porte_Lecteur;
        Lexical.Is_In_Bloc := False;
    end Get_Portes;


    procedure Get_Zones is
        Nom_Zone : String (1 .. 30);
        Dernier_Car_Zone : Natural;
        Nom_Porte : String (1 .. 30);
        Dernier_Car_Porte : Natural;
        Une_Zone : Zone.Object;
        Une_Porte : Porte.Object;
        use Lexical;

    begin
        --
        -- Lecture de "ZONES:"
        --
        Lexical.Lex_File;
        Verifier_Zones;
        Lexical.Lex_File;
        Verifier_Double_Point;
        --
        -- Lecture des zones
        --
        Le_Bloc_Syntaxique := Bloc_Zones;
        Lexical.Is_In_Bloc := True;

        Lecture_Zones:
            loop
                --
                -- lecture nom de la zone
                --
                Lexical.Lex_File;
                if (Lexical.Typ_Mot_Cle = Lexical.Typ_Fin) then
                    exit Lecture_Zones;
                end if;
                Verifier_Identificateur_Ou_Fin;
                Dernier_Car_Zone := (Indice_Unite - 1);
                Nom_Zone (1 .. Dernier_Car_Zone) :=
                   Unite (1 .. Dernier_Car_Zone);

                Lexical.Lex_File;
                Verifier_Egal;
                --
                -- Lecture des portes affectees a la zone
                --
                Lecture_Des_Portes:
                    loop
                        --
                        -- lecture du nom d'une porte
                        --
                        Lexical.Lex_File;
                        Verifier_Identificateur;
                        Dernier_Car_Porte := (Indice_Unite - 1);
                        Nom_Porte (1 .. Dernier_Car_Porte) :=
                           Unite (1 .. Dernier_Car_Porte);
                        L_Portes.Search
                           (Liste_Port, Nom_Porte (1 .. Dernier_Car_Porte),
                            Une_Porte);
                        if ("" = Porte.Get (Une_Porte)) then
                            raise Porte_Non_Declaree_Erreur;
                        else
                            Zone.Insert_Element (Une_Porte, Une_Zone);
                        end if;
                        Lexical.Lex_File;
                        if (Lexical.Typ_Mot_Cle =
                            Lexical.Typ_Point_Virgule) then
                            exit Lecture_Des_Portes;
                        end if;
                        Verifier_Virgule_Ou_Point_Virgule;
                    end loop Lecture_Des_Portes;
                Zone.Set_Name (Une_Zone, Nom_Zone (1 .. Dernier_Car_Zone));
                if (L_Zones.Search
                       (Liste_Zone, Nom_Zone (1 .. Dernier_Car_Zone)) =
                    False) then
                    L_Zones.Insert_Element (Une_Zone, Liste_Zone);
                    Zone.Vide_List (Une_Zone);
                else
                    raise Double_Declaration_Nom_Zone_Erreur;
                end if;
            end loop Lecture_Zones;
        Lexical.Is_In_Bloc := False;

    end Get_Zones;


    procedure Get_Porteurs is
        Un_Porteur : Porteur.Object;
        Dernier_Car_Porteur : Natural;
        Nom_Du_Porteur : String (1 .. 30);
        Numero : Natural;  
        use Lexical;
    begin
        --
        -- Lecture de "PORTEURS:"
        --
        Lexical.Lex_File;
        Verifier_Porteurs;
        Lexical.Lex_File;
        Verifier_Double_Point;
        --
        -- Lecture des couples (nom porteurs , numero carte)
        --
        Le_Bloc_Syntaxique := Bloc_Porteurs;
        Lexical.Is_In_Bloc := True;
        Lecture_Porteur_Carte:
            loop
                --
                -- Lecture du nom du porteur
                --
                Lexical.Lex_File;
                if (Lexical.Typ_Mot_Cle = Typ_Fin) then
                    exit Lecture_Porteur_Carte;
                end if;
                Verifier_Identificateur_Ou_Fin;
                Dernier_Car_Porteur := (Indice_Unite - 1);
                Nom_Du_Porteur (1 .. Dernier_Car_Porteur) :=
                   Unite (1 .. Dernier_Car_Porteur);
                if (L_Porteurs.Search
                       (Liste_Porteur, Nom_Du_Porteur
                                          (1 .. Dernier_Car_Porteur))) then
                    raise Double_Declaration_Nom_De_Porteur_Erreur;
                end if;
                Lexical.Lex_File;
                Verifier_Virgule;
                --
                --Lecture du numero de carte
                --
                Lexical.Lex_File;
                Verifier_Entier;
                Numero := Natural'Value (Unite (1 .. Indice_Unite - 1));
                if (L_Porteurs.Search (Liste_Porteur, Numero)) then
                    raise Double_Declaration_Numero_De_Carte_Erreur;
                end if;
                Lexical.Lex_File;
                Verifier_Point_Virgule;
                Porteur.Set (Un_Porteur, Nom_Du_Porteur
                                            (1 .. Dernier_Car_Porteur), Numero);
                L_Porteurs.Insert_Element (Un_Porteur, Liste_Porteur);
            end loop Lecture_Porteur_Carte;
        Lexical.Is_In_Bloc := False;

    end Get_Porteurs;


    procedure Get_Groupes is
        Un_Groupe : Groupe.Object;
        Un_Porteur : Porteur.Object;
        Dernier_Car_Groupe : Natural;
        Dernier_Car_Porteur : Natural;
        use Lexical;
    begin
        --
        -- Lecture de "GROUPES:"
        --
        Lexical.Lex_File;
        Verifier_Groupes;
        Lexical.Lex_File;
        Verifier_Double_Point;
        --
        -- Lecture des noms de groupe
        --
        Le_Bloc_Syntaxique := Bloc_Groupes;
        Lexical.Is_In_Bloc := True;
        Lecture_Groupes:
            loop
                --
                -- lecture nom du groupe
                --
                Lexical.Lex_File;
                if (Lexical.Typ_Mot_Cle = Lexical.Typ_Fin) then
                    exit Lecture_Groupes;
                end if;
                Verifier_Identificateur_Ou_Fin;
                Dernier_Car_Groupe := Indice_Unite - 1;
                Groupe.Set (Un_Groupe, Unite (1 .. Dernier_Car_Groupe));
                if (L_Groupes.Search
                       (L_G => Liste_G,
                        Nom_Groupe => Unite (1 .. Dernier_Car_Groupe))) then
                    raise Double_Declaration_Nom_Groupe_Erreur;
                end if;
                Lexical.Lex_File;
                Verifier_Egal;
                --
                -- Lecture des portes affectees a la zone
                --
                Lecture_Des_Porteurs:
                    loop
                        --
                        -- lecture du nom d'un porteur
                        --
                        Lexical.Lex_File;
                        Verifier_Identificateur;
                        Dernier_Car_Porteur := Indice_Unite - 1;
                        Un_Porteur := L_Porteurs.Search
                                         (Liste_Porteur,
                                          Unite (1 .. Dernier_Car_Porteur));
                        if (Porteur.Get (Un_Porteur) = "") then
                            raise Nom_Du_Porteur_Non_Declare_Erreur;
                        end if;

                        Groupe.Insert_Element (Un_Porteur, Un_Groupe);
                        Lexical.Lex_File;
                        if (Lexical.Typ_Mot_Cle =
                            Lexical.Typ_Point_Virgule) then
                            exit Lecture_Des_Porteurs;
                        end if;
                        Verifier_Virgule_Ou_Point_Virgule;
                    end loop Lecture_Des_Porteurs;
                L_Groupes.Insert_Element (Un_Groupe, Liste_G);
                Groupe.Vide_List (Un_Groupe);
            end loop Lecture_Groupes;
        Lexical.Is_In_Bloc := False;

    end Get_Groupes;


    procedure Get_Horaire (A_Date : in out Date.Horaire) is
        Deb, Fin : Natural;
    begin
        Lexical.Lex_File;
        Verifier_Entier;
        Deb := Natural'Value (Lexical.Unite (1 .. Lexical.Indice_Unite - 1));
        Lexical.Lex_File;
        Verifier_Double_Point;
        Lexical.Lex_File;
        Verifier_Entier;
        Fin := Natural'Value (Lexical.Unite (1 .. Lexical.Indice_Unite - 1));
        A_Date := Date.Set (Deb, Fin);
    end Get_Horaire;

    procedure Get_Plage_Horaire is
        Une_Plage : Plage.Object;
        Une_Plage_Horaire : Plage_Horaire.Object;
        Der_Car_Zone : Natural;
        N_Zone : String (1 .. 30);
        Numero_Plage : Natural range 1 .. 7;
        Max_Plage_Horaire_Counter :
           Natural range 0 .. 3; -- 3 declenche une exception
        Deb1, Fin1, Deb2, Fin2 : Date.Horaire;
        S_Zone1, S_Zone2, S_Zone3 : Plage.Sous_Zone;
        Jours_Valides : Plage.Semaine;  
        use Lexical;
    begin
        --
        -- Lecture de "PLAGE_HORAIRE:"
        --
        Lexical.Lex_File;
        Verifier_Plage_Horaire;
        Lexical.Lex_File;
        Verifier_Double_Point;
        --
        -- Lecture du nom de zone + groupe + plage horaire
        --
        Le_Bloc_Syntaxique := Bloc_Plage_Horaire;
        Lexical.Is_In_Bloc := True;

        Lexical.Lex_File;
        -- utilise pour la lecture de la 1ere zone uniquement !
        Lecture_Zone_Numero:
            loop
                --
                -- Lecture de la zone avant la boucle ou avant la fin de boucle !
                --
                if (Lexical.Typ_Mot_Cle = Lexical.Typ_Fin) then
                    exit Lecture_Zone_Numero;
                end if;
                Verifier_Identificateur_Ou_Fin;
                Der_Car_Zone := Indice_Unite - 1;
                N_Zone (1 .. Der_Car_Zone) := Unite (1 .. Der_Car_Zone);
                if (L_Zones.Search (Liste_Zone, N_Zone (1 .. Der_Car_Zone)) =
                    False) then
                    raise Nom_Zone_Non_Declaree_Erreur;
                end if;
                Lexical.Lex_File;
                Verifier_Egal;
                --
                -- Lecture du numero de plage associe a la zone
                --
                Lexical.Lex_File;
                Verifier_Entier;
                Numero_Plage :=
                   Natural'Value (Lexical.Unite
                                     (1 .. Lexical.Indice_Unite - 1));
                Lexical.Lex_File;
                Verifier_Egal;

                Max_Plage_Horaire_Counter := 0;

                S_Zone1 := Plage.Zero;
                S_Zone2 := Plage.Zero;
                S_Zone3 := Plage.Zero;
                Lecture_Plage_Horaire:
                    loop
                        if (Max_Plage_Horaire_Counter = 3) then
                            raise Trop_De_Plages_Declarees_Erreur;
                        end if;

                        Get_Horaire (Deb1);        --1
                        Lexical.Lex_File;
                        Verifier_Tiret;

                        Get_Horaire (Fin1);        --2
                        Lexical.Lex_File;
                        Verifier_Virgule;

                        Get_Horaire (Deb2);        --3
                        Lexical.Lex_File;
                        Verifier_Tiret;

                        Get_Horaire (Fin2);        --4
                        Lexical.Lex_File;
                        Verifier_Double_Point;
                        --
                        -- Lecture de la liste de jour associe a Zone + Numero de plage
                        --
                        Lexical.Lex_File;
                        Verifier_Identificateur;
                        if ((Indice_Unite - 1) > 7) then
                            raise Semaine_Trop_Longue_Erreur;
                        elsif ((Indice_Unite - 1) < 7) then
                            raise Semaine_Trop_Courte_Erreur;
                        end if;
                        Jours_Valides (1 .. 7) := Unite (1 .. 7);
                        --
                        -- Mise a jour d'une sous_zone
                        --
                        if (Max_Plage_Horaire_Counter = 0) then
                            S_Zone1 := Plage.Set (Deb1, Fin1, Deb2, Fin2,
                                                  Jours_Valides (1 .. 7));
                        elsif (Max_Plage_Horaire_Counter = 1) then
                            S_Zone2 := Plage.Set (Deb1, Fin1, Deb2, Fin2,
                                                  Jours_Valides (1 .. 7));
                        elsif (Max_Plage_Horaire_Counter = 2) then
                            S_Zone3 := Plage.Set (Deb1, Fin1, Deb2, Fin2,
                                                  Jours_Valides (1 .. 7));
                        end if;
                        Lexical.Lex_File;
                        if (Lexical.Typ_Mot_Cle =
                            Lexical.Typ_Point_Virgule) then
                            exit Lecture_Plage_Horaire;
                        end if;
                        Verifier_Virgule_Ou_Point_Virgule;
                        Max_Plage_Horaire_Counter :=
                           Max_Plage_Horaire_Counter + 1;
                    end loop Lecture_Plage_Horaire;

                Une_Plage := Plage.Set
                                (Numero_Plage, S_Zone1, S_Zone2, S_Zone3);
                Une_Plage_Horaire := Plage_Horaire.Set
                                        (N_Zone (1 .. Der_Car_Zone),
                                         Numero_Plage, Une_Plage);
                L_Plages_Horaires.Insert_Element (Une_Plage_Horaire, List_P_H);

                --
                -- Lecture d'une nouvelle zone ou bien du mot FIN
                --
                Lexical.Lex_File;
                if (Lexical.Typ_Mot_Cle = Lexical.Typ_Fin) then
                    exit Lecture_Zone_Numero;
                end if;


            end loop Lecture_Zone_Numero;
        Lexical.Is_In_Bloc := False;

    exception
        when Constraint_Error =>
            raise Nombre_Maximum_De_Plage_Est_Atteint_Erreur;

    end Get_Plage_Horaire;

    procedure Get_Acces is
        Un_Acces : P_Acces.Object;
        N_Zone : String (1 .. 30);
        N_Groupe : String (1 .. 30);
        Der_Car_Zone : Natural;
        Der_Car_G : Natural;
        Numero_P : Natural;
        use Lexical;
    begin
        --
        -- Lecture de "ACCES:"
        --
        Lexical.Lex_File;
        Verifier_Acces;
        Lexical.Lex_File;
        Verifier_Double_Point;
        --
        -- Lecture (nom zone, nom groupe, numero plage)
        --
        Le_Bloc_Syntaxique := Bloc_Acces;
        Lexical.Is_In_Bloc := True;
        Lecture_Acces:
            loop
                --
                -- Lecture du nom de zone
                --
                Lexical.Lex_File;
                if (Lexical.Typ_Mot_Cle = Typ_Fin) then
                    exit Lecture_Acces;
                end if;
                Verifier_Identificateur_Ou_Fin;
                Der_Car_Zone := Indice_Unite - 1;
                N_Zone (1 .. Der_Car_Zone) := Unite (1 .. Der_Car_Zone);
                if (L_Zones.Search (Liste_Zone, N_Zone (1 .. Der_Car_Zone)) =
                    False) then
                    raise Nom_Zone_Non_Declaree_Erreur;
                end if;

                Lexical.Lex_File;
                Verifier_Egal;

                --
                --Lecture du nom de groupe
                --
                Lexical.Lex_File;
                Verifier_Identificateur;

                Der_Car_G := Indice_Unite - 1;
                N_Groupe (1 .. Der_Car_G) := Unite (1 .. Der_Car_G);
                if (L_Groupes.Search (Liste_G, N_Groupe (1 .. Der_Car_G)) =
                    False) then
                    raise Nom_Groupe_Non_Declare_Erreur;
                end if;

                Lexical.Lex_File;
                Verifier_Egal;
                --
                -- Lecture du numero de plage
                --
                Lexical.Lex_File;
                Verifier_Entier;
                Numero_P := Natural'Value (Unite (1 .. (Indice_Unite - 1)));
                if (L_Porteurs.Search (Liste_Porteur, Numero_P)) then
                    raise Double_Declaration_Numero_De_Carte_Erreur;
                end if;

                Lexical.Lex_File;
                Verifier_Point_Virgule;
                Un_Acces := P_Acces.Set (N_Zone (1 .. Der_Car_Zone),
                                         N_Groupe (1 .. Der_Car_G),
                                         Der_Car_G, Der_Car_Zone, Numero_P);
                L_P_Access.Insert_Element (Un_Acces, Liste_L_A);
            end loop Lecture_Acces;
        Lexical.Is_In_Bloc := False;
    end Get_Acces;

    procedure Charge_Config is
    begin

        Lexical.Init;
        Get_Lecteurs;
        Get_Code_Site;
        Get_Portes;
        Get_Zones;
        Get_Porteurs;
        Get_Groupes;
        Get_Plage_Horaire;
        Get_Acces;
        Lexical.Close;

    exception
        when Nom_Groupe_Non_Declare_Erreur =>
            Text_Io.Put_Line ("Nom_Groupe_Non_Declare_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Nom_Zone_Non_Declaree_Erreur =>
            Text_Io.Put_Line ("Nom_Zone_Non_Declaree_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Nombre_Maximum_De_Plage_Est_Atteint_Erreur =>
            Text_Io.Put_Line ("Nombre_Maximum_De_Plage_Est_Atteint");
            Affiche_Erreur;
            raise Syntax_Error;
        when Semaine_Trop_Longue_Erreur =>
            Text_Io.Put_Line ("Semaine_Trop_Longue_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Semaine_Trop_Courte_Erreur =>
            Text_Io.Put_Line ("Semaine_Trop_Courte_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Trop_De_Plages_Declarees_Erreur =>
            Text_Io.Put_Line ("Trop_De_Plages_Declarees_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Nom_Du_Porteur_Non_Declare_Erreur =>
            Text_Io.Put_Line ("Nom_Du_Porteur_Non_Declare_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Double_Declaration_Nom_De_Porteur_Erreur =>
            Text_Io.Put_Line ("Double_Declaration_Nom_De_Porteur_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Double_Declaration_Numero_De_Carte_Erreur =>
            Text_Io.Put_Line ("Double_Declaration_Numero_De_Carte_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Double_Declaration_Nom_Zone_Erreur =>
            Text_Io.Put_Line ("Double_Declaration_Nom_Zone_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Double_Declaration_Nom_Porte_Erreur =>
            Text_Io.Put_Line ("Double_declaration_Nom_Porte_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Double_Declaration_Nom_Groupe_Erreur =>
            Text_Io.Put_Line ("Double_declaration_Nom_Groupe_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Numero_Lecteur_Non_Declare_Erreur =>
            Text_Io.Put_Line ("Numero_Lecteur_non_declare_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Double_Declaration_Numero_Lecteur_Erreur =>
            Text_Io.Put_Line ("double_declaration_numero_lecteur_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Porte_Non_Declaree_Erreur =>
            Text_Io.Put_Line ("Porte_Non_Declaree_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Plage_Horaire_Label_Erreur =>
            Text_Io.Put_Line ("Plage_Horaire_Label_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Lecteur_Label_Erreur =>
            Text_Io.Put_Line ("Lecteur_Label_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Code_Site_Label_Erreur =>
            Text_Io.Put_Line ("Code_Site_Label_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Zones_Label_Erreur =>
            Text_Io.Put_Line ("Zones_Label_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Porteurs_Label_Erreur =>
            Text_Io.Put_Line ("Porteurs_Label_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Portes_Label_Erreur =>
            Text_Io.Put_Line ("Portes_Label_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Egal_Erreur =>
            Text_Io.Put_Line ("Egal_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Double_Point_Erreur =>
            Text_Io.Put_Line ("Double_Point_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Identificateur_Erreur =>
            Text_Io.Put_Line ("Identificateur_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Identificateur_Erreur_Ou_Fin_Erreur =>
            Text_Io.Put_Line ("Identificateur_Erreur_Ou_Fin_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Fin_Erreur =>
            Text_Io.Put_Line ("Fin_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Virgule_Erreur =>
            Text_Io.Put_Line ("Virgule_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Point_Virgule_Erreur =>
            Text_Io.Put_Line ("Point_Virgule_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Virgule_Ou_Point_Virgule_Erreur =>
            Text_Io.Put_Line ("Virgule_Or_Point_Virgule_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Entier_Erreur =>
            Text_Io.Put_Line ("Entier_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Apb_Erreur =>
            Text_Io.Put_Line ("Apb_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Veille_Erreur =>
            Text_Io.Put_Line ("Veille_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Entree_Tor_Erreur =>
            Text_Io.Put_Line ("Entree_Tor_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Evenement_Erreur =>
            Text_Io.Put_Line ("Evenement_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Groupes_Label_Erreur =>
            Text_Io.Put_Line ("Groupe_Label_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Acces_Label_Erreur =>
            Text_Io.Put_Line ("acces_Label_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when Constraint_Error =>
            Text_Io.Put_Line ("Constraint_Error : Un mot cle est attendu");
            Affiche_Erreur;
            raise Syntax_Error;
        when Tiret_Erreur =>
            Text_Io.Put_Line ("Tiret_Erreur");
            Affiche_Erreur;
            raise Syntax_Error;
        when others =>
            raise Syntax_Error;
    end Charge_Config;


end Syntaxic;

E3 Meta Data

    nblk1=29
    nid=0
    hdr6=52
        [0x00] rec0=25 rec1=00 rec2=01 rec3=004
        [0x01] rec0=1a rec1=00 rec2=02 rec3=012
        [0x02] rec0=13 rec1=00 rec2=03 rec3=04c
        [0x03] rec0=23 rec1=00 rec2=04 rec3=07a
        [0x04] rec0=23 rec1=00 rec2=05 rec3=034
        [0x05] rec0=26 rec1=00 rec2=06 rec3=01c
        [0x06] rec0=23 rec1=00 rec2=07 rec3=000
        [0x07] rec0=1f rec1=00 rec2=08 rec3=042
        [0x08] rec0=1a rec1=00 rec2=09 rec3=034
        [0x09] rec0=1e rec1=00 rec2=0a rec3=042
        [0x0a] rec0=1e rec1=00 rec2=0b rec3=014
        [0x0b] rec0=18 rec1=00 rec2=0c rec3=022
        [0x0c] rec0=1a rec1=00 rec2=0d rec3=01a
        [0x0d] rec0=1d rec1=00 rec2=0e rec3=030
        [0x0e] rec0=25 rec1=00 rec2=0f rec3=038
        [0x0f] rec0=16 rec1=00 rec2=10 rec3=000
        [0x10] rec0=24 rec1=00 rec2=11 rec3=00c
        [0x11] rec0=18 rec1=00 rec2=12 rec3=076
        [0x12] rec0=13 rec1=00 rec2=13 rec3=066
        [0x13] rec0=21 rec1=00 rec2=14 rec3=01a
        [0x14] rec0=18 rec1=00 rec2=15 rec3=02a
        [0x15] rec0=1c rec1=00 rec2=16 rec3=024
        [0x16] rec0=1a rec1=00 rec2=17 rec3=030
        [0x17] rec0=15 rec1=00 rec2=18 rec3=01e
        [0x18] rec0=1c rec1=00 rec2=19 rec3=038
        [0x19] rec0=1d rec1=00 rec2=1a rec3=070
        [0x1a] rec0=17 rec1=00 rec2=1b rec3=018
        [0x1b] rec0=1b rec1=00 rec2=1c rec3=048
        [0x1c] rec0=13 rec1=00 rec2=1d rec3=00e
        [0x1d] rec0=12 rec1=00 rec2=1e rec3=01c
        [0x1e] rec0=1d rec1=00 rec2=1f rec3=01c
        [0x1f] rec0=1d rec1=00 rec2=20 rec3=056
        [0x20] rec0=1c rec1=00 rec2=21 rec3=03e
        [0x21] rec0=1f rec1=00 rec2=22 rec3=03e
        [0x22] rec0=16 rec1=00 rec2=23 rec3=084
        [0x23] rec0=16 rec1=00 rec2=24 rec3=016
        [0x24] rec0=17 rec1=00 rec2=25 rec3=00c
        [0x25] rec0=1a rec1=00 rec2=26 rec3=02a
        [0x26] rec0=19 rec1=00 rec2=27 rec3=056
        [0x27] rec0=1b rec1=00 rec2=28 rec3=00a
        [0x28] rec0=0a rec1=00 rec2=29 rec3=000
    tail 0x217540d3a874f6eb229e1 0x42a00088462060003