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

⟦ebc7af108⟧ Ada Source

    Length: 70656 (0x11400)
    Types: Ada Source
    Notes: 03_class, FILE, Long Ada Source, R1k_Segment, e3_tag, package body Syn_Prec, seg_043166

Derivation

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

E3 Source Code



with Text_Io, Lex, Error;
use Text_Io;


package body Syn_Prec is

    use Lex.Visible, Error.Visible;

    procedure Type_Base (Ok : in out Boolean) is
        Local : Boolean := True;
    begin  
        case Lex.Get_Token is
            when Entier =>
                Lex.Next;
            when Chaine =>
                Lex.Next;
            when Identifier =>
                Lex.Next;
            when others =>
                Local := False;
                Error.Syn (Type_Base, Follow_Type_Base);
        end case;
        Ok := Ok and Local;
    end Type_Base;


    procedure Type_Structure (Ok : in out Boolean) is
        Local : Boolean := True;
    begin  
        case Lex.Get_Token is
            when Anime =>
                Lex.Next;
            when Lieu =>
                Lex.Next;  
            when Entite =>
                Lex.Next;
            when Identifier =>
                Lex.Next;
            when others =>
                Local := False;
                Error.Syn (Type_Structure, Follow_Type_Structure);
        end case;
        Ok := Ok and Local;
    end Type_Structure;


    procedure Chaine (Ok : in out Boolean) is
        Local : Boolean := True;
    begin  
        while Lex.Get_Token = Ampersand loop
            Lex.Next;
            if Lex.Get_Token /= Right_Sentence then
                Local := False;
                Error.Syn (Chaine, Follow_Chaine);
            else
                Lex.Next;
            end if;
        end loop;
        Ok := Local;
    end Chaine;


    procedure Valeur (Ok : in out Boolean) is
        Local : Boolean := True;
    begin  
        case Lex.Get_Token is
            when Number | Identifier =>
                Lex.Next;
            when Right_Sentence =>
                Lex.Next;
                Chaine (Local);
            when others =>
                Local := False;               Error.Syn (Valeur, Follow_Valeur);
        end case;
        Ok := Ok and Local;
    end Valeur;


    procedure Objet (Ok : in out Boolean) is

        Local : Boolean := True;

    begin  
        case Lex.Get_Token is
            when Identifier | Heros | Lieu =>
                Lex.Next;
            when others =>
                Local := False;
                Error.Syn (Objet, Follow_Objet);
        end case;
        Ok := Ok and Local;
    end Objet;


    procedure Liste_Identificateurs (Ok : in out Boolean) is
        Local : Boolean := True;
    begin  
        if Lex.Get_Token = Identifier then
            Lex.Next;
            while Lex.Get_Token = Comma loop
                Lex.Next;
                if Lex.Get_Token /= Identifier then
                    Local := False;
                    Error.Syn (Identifier, Follow_Liste_Identificateurs);
                else
                    Lex.Next;
                end if;
            end loop;
        else
            Local := False;
            Error.Syn (Identifier, Follow_Liste_Identificateurs);
        end if;
        Ok := Ok and Local;
    end Liste_Identificateurs;

    procedure Liste_Messages_Erreur (Ok : in out Boolean) is
        Local : Boolean := True;
    begin  
        while Lex.Get_Token = Message loop
            Lex.Next;
            if Lex.Get_Token = Erreur then
                Lex.Next;
                if Lex.Get_Token = Right_Sentence then
                    Lex.Next;
                    Chaine (Local);
                    -- if local then
                    -- put_line("message");
                    -- end if;
                else
                    Local := False;  
                    if Lex.Get_Token = Wrong_Sentence then
                        Error.Syn (Wrong_Sentence,
                                   Follow_Liste_Messages_Erreur);
                    else
                        Error.Syn (Sentence, Follow_Liste_Messages_Erreur);
                    end if;
                end if;
            else
                Local := False;
                Error.Syn (Erreur, Follow_Liste_Messages_Erreur);
            end if;
        end loop;
        Ok := Ok and Local;
    end Liste_Messages_Erreur;

    procedure Liste_Enumeres (Ok : in out Boolean) is
        Local : Boolean := True;
    begin  
        while Lex.Get_Token = Enumere loop
            Lex.Next;
            if Lex.Get_Token = Identifier then
                Lex.Next;
                if Lex.Get_Token = Colon then
                    Lex.Next;
                    Liste_Identificateurs (Local);
                    --if Local then
                    --Put_Line ("enumere");
                    --end if;
                else
                    Local := False;
                    Error.Syn (Colon, Follow_Liste_Enumeres);
                end if;
            else
                Local := False;
                Error.Syn (Identifier, Follow_Liste_Enumeres);
            end if;
        end loop;
        Ok := Ok and Local;
    end Liste_Enumeres;


    procedure Attribut (Ok : in out Boolean) is
        Local : Boolean := True;
    begin  
        Type_Base (Local);
        if Lex.Get_Token = Colon then
            Lex.Next;
            if Lex.Get_Token = Identifier then
                Lex.Next;
                if Lex.Get_Token = Equal then
                    Lex.Next;
                    Valeur (Local);
                end if;
            else
                Local := False;
                Error.Syn (Identifier, Follow_Attribut);
            end if;
        else
            Local := False;
            Error.Syn (Colon, Follow_Attribut);  
        end if;
        Ok := Ok and Local;
    end Attribut;

    procedure Corps_Structure (Ok : in out Boolean) is
        Local : Boolean := True;
    begin  
        if Lex.Get_Token = Attributs then
            Lex.Next;
            if Lex.Get_Token = En then
                Lex.Next;
                Attribut (Local);
                while Lex.Get_Token = En loop
                    Lex.Next;
                    Attribut (Local);
                end loop;
            else
                Local := False;
                Error.Syn (En, Follow_Attribut);
            end if;
        end if;
        Ok := Ok and Local;
    end Corps_Structure;

    procedure Liste_Structures (Ok : in out Boolean) is
        Local : Boolean := True;
    begin  
        while Lex.Get_Token = Structure loop
            Lex.Next;
            Type_Structure (Local);
            if Lex.Get_Token = Colon then
                Lex.Next;
                if Lex.Get_Token = Identifier then
                    Lex.Next;
                    Corps_Structure (Local);
                    --if Local then
                    --Put_Line ("structure");
                    --end if;
                else
                    Local := False;
                    Error.Syn (Identifier, Follow_Liste_Structures);
                end if;
            else
                Local := False;
                Error.Syn (Colon, Follow_Liste_Structures);
            end if;
        end loop;
        Ok := Ok and Local;
    end Liste_Structures;


    procedure Champs (Ok : in out Boolean) is
        Local : Boolean := True;
    begin
        while Lex.Get_Token = Identifier loop
            Lex.Next;
            if Lex.Get_Token = Equal then
                Lex.Next;
                Valeur (Local);
            else
                Local := False;
                Error.Syn (Equal, Follow_Champs);
            end if;
        end loop;
        Ok := Ok and Local;
    end Champs;


    procedure Mouvement (Ok : in out Boolean) is
        Local : Boolean := True;
    begin
        if Lex.Get_Token = Identifier then
            Lex.Next;
            if Lex.Get_Token = Colon then
                Lex.Next;
                if Lex.Get_Token = Number then
                    Lex.Next;
                else
                    Local := False;
                    Error.Syn (Number, Follow_Mouvement);
                end if;
            end if;
        else
            Local := False;
            Error.Syn (Identifier, Follow_Mouvement);
        end if;
        Ok := Ok and Local;
    end Mouvement;

    procedure Mouvements (Ok : in out Boolean) is
        Local : Boolean := True;
    begin
        Mouvement (Local);
        while Lex.Get_Token = Comma loop
            Lex.Next;
            Mouvement (Local);
        end loop;
        Ok := Ok and Local;
    end Mouvements;

    procedure Itineraire (Ok : in out Boolean) is
        Local : Boolean := True;
    begin
        if Lex.Get_Token = Itineraire then
            Lex.Next;
            if Lex.Get_Token = Equal then
                Lex.Next;
                Mouvements (Local);
            else
                Local := False;
                Error.Syn (Equal, Follow_Liste_Objets);
            end if;
        end if;
        Ok := Ok and Local;
    end Itineraire;


    procedure Corps_Objet (Ok : in out Boolean) is
        Local : Boolean := True;
    begin
        if Lex.Get_Token = Attributs then
            Lex.Next;
            Champs (Local);
            Itineraire (Local);
        end if;
        Ok := Ok and Local;
    end Corps_Objet;


    procedure Liste_Objets (Ok : in out Boolean) is
        Local : Boolean := True;
    begin
        while Lex.Get_Token = Cree loop
            Lex.Next;
            Type_Structure (Local);
            if Lex.Get_Token = Colon then
                Lex.Next;
                Liste_Identificateurs (Local);
                Corps_Objet (Local);
                --if Local then
                --Put_Line ("objet");
                --end if;
            else
                Local := False;
                Error.Syn (Colon, Follow_Liste_Objets);
            end if;
        end loop;
        Ok := Ok and Local;
    end Liste_Objets;

    procedure Liste_Mots (Ok : in out Boolean) is
        Local : Boolean := True;
    begin
        if Lex.Get_Token = Mots then
            Lex.Next;
            Liste_Identificateurs (Local);
            --if Local then
            --Put_Line ("mots");
            --end if;
        end if;
        Ok := Ok and Local;
    end Liste_Mots;

    procedure Liens_Speciaux (Ok : in out Boolean) is
        Local : Boolean := True;
    begin
        if Lex.Get_Token = Lien then
            Lex.Next;
            if Lex.Get_Token = Special then
                Lex.Next;
                if Lex.Get_Token = Colon then
                    Lex.Next;
                    Liste_Identificateurs (Local);
                    --if Local then
                    --Put_Line ("etats liens speciaux");
                    --end if;
                else
                    Local := False;
                    Error.Syn (Colon, Follow_Etats_Liens);
                end if;
            else
                Local := False;
                Error.Syn (Special, Follow_Etats_Liens);
            end if;
        end if;
        Ok := Ok and Local;
    end Liens_Speciaux;

    procedure Etats_Liens (Ok : in out Boolean) is
        Local : Boolean := True;
    begin
        if Lex.Get_Token = Lien then
            Lex.Next;
            if Lex.Get_Token = Normal then
                Lex.Next;
                if Lex.Get_Token = Colon then
                    Lex.Next;
                    Liste_Identificateurs (Local);
                    --if Local then
                    --Put_Line ("etats liens normaux");
                    --end if;
                    Liens_Speciaux (Local);
                else
                    Local := False;
                    Error.Syn (Colon, Follow_Etats_Liens);
                end if;
            else
                Local := False;
                Error.Syn (Normal, Follow_Etats_Liens);
            end if;
        end if;
        Ok := Ok and Local;
    end Etats_Liens;

    procedure Lieu (Ok : in out Boolean) is
        Local : Boolean := True;
    begin
        if Lex.Get_Token = Identifier then
            Lex.Next;
            if Lex.Get_Token = Identifier then
                Lex.Next;
            else
                Local := False;
                Error.Syn (Identifier, Follow_Lier_Lieux);
            end if;
        else
            Local := False;
            Error.Syn (Identifier, Follow_Lier_Lieux);
        end if;
        Ok := Ok and Local;
    end Lieu;

    procedure Moyen (Ok : in out Boolean) is
        Local : Boolean := True;
    begin
        if Lex.Get_Token = Par then
            Lex.Next;
            if Lex.Get_Token = Identifier then
                Lex.Next;
                if Lex.Get_Token = Identifier then
                    Lex.Next;
                end if;
            else
                Local := False;
                Error.Syn (Identifier, Follow_Lier_Lieux);
            end if;
        else
            Local := False;
            Error.Syn (Par, Follow_Lier_Lieux);
        end if;
        Ok := Ok and Local;
    end Moyen;

    procedure Lier_Lieux (Ok : in out Boolean) is
        Local : Boolean := True;
    begin
        while Lex.Get_Token = Lie loop
            Lex.Next;
            Lieu (Local);
            if Lex.Get_Token = A then
                Lex.Next;
                Lieu (Local);
                if Local then
                    Moyen (Local);
                end if;
                --if Local then
                --Put_Line ("lien");
                --end if;
            else
                Local := False;
                Error.Syn (A, Follow_Lier_Lieux);
            end if;
        end loop;
        Ok := Ok and Local;
    end Lier_Lieux;

    procedure Liste_Groupes (Ok : in out Boolean) is
        Local : Boolean := True;
    begin
        while Lex.Get_Token = Groupe loop
            Lex.Next;
            if Lex.Get_Token = Identifier then
                Lex.Next;
                if Lex.Get_Token = Colon then
                    Lex.Next;
                    Liste_Identificateurs (Local);
                    --if Local then
                    --Put_Line ("groupe");
                    --end if;
                else
                    Local := False;
                    Error.Syn (Colon, Follow_Liste_Groupes);
                end if;
            else
                Local := False;
                Error.Syn (Identifier, Follow_Liste_Groupes);
            end if;
        end loop;
        Ok := Ok and Local;
    end Liste_Groupes;

    procedure Synonymes (Ok : in out Boolean) is
        Local : Boolean := True;
    begin
        if Lex.Get_Token = Ou then
            Lex.Next;
            Liste_Identificateurs (Local);
        end if;
        Ok := Ok and Local;
    end Synonymes;

    procedure Liste_Verbes (Ok : in out Boolean) is
        Local : Boolean := True;
    begin
        if Lex.Get_Token = Verbes then
            Lex.Next;
            --Put_Line ("liste_verbes");
            while Lex.Get_Token = Identifier loop  
                Lex.Next;
                Synonymes (Local);
                --if Local then
                --Put_Line ("verbe");
                --end if;
            end loop;
        end if;
        Ok := Ok and Local;
    end Liste_Verbes;

    procedure Instructions_Simples (Ok : in out Boolean);
    procedure Expression (Ok : in out Boolean);

    procedure Facteur (Ok : in out Boolean) is

        Local : Boolean := True;

    begin
        case Lex.Get_Token is
            when Opening_Bracket =>
                Lex.Next;
                Expression (Local);
                if Lex.Get_Token = Closing_Bracket then
                    Lex.Next;
                else
                    Local := False;
                    Error.Syn (Closing_Bracket, Follow_Facteur);
                end if;
            when Identifier =>
                Lex.Next;
                if Lex.Get_Token = De then
                    Lex.Next;
                    Objet (Local);
                end if;
            when Number =>
                Lex.Next;
            when others =>
                Local := False;
                Error.Syn (Facteur, Follow_Facteur);
        end case;
        Ok := Ok and Local;
    end Facteur;



    procedure Terme (Ok : in out Boolean) is

        First_Terme : constant Token_To_Boolean_Array :=
           Token_To_Boolean_Array'(Multiply .. Divide => True, others => False);

        Local : Boolean := True;

    begin
        Facteur (Local);
        while First_Terme (Lex.Get_Token) loop
            case Lex.Get_Token is
                when Multiply | Divide =>
                    Lex.Next;
                    Facteur (Local);
                when others =>
                    null;
            end case;
        end loop;
        Ok := Ok and Local;
    end Terme;

    procedure Expression (Ok : in out Boolean) is

        First_Expression : constant Token_To_Boolean_Array :=
           Token_To_Boolean_Array'(Substract .. Add => True, others => False);

        Local : Boolean := True;

    begin
        Terme (Local);
        while First_Expression (Lex.Get_Token) loop
            case Lex.Get_Token is
                when Add | Substract =>
                    Lex.Next;
                    Terme (Local);
                when others =>
                    null;
            end case;
        end loop;
        Ok := Ok and Local;
    end Expression;

    procedure Symbole_Comparaison (Ok : in out Boolean) is

        Local : Boolean := True;

    begin
        case Lex.Get_Token is
            when Equal | Not_Equal | Less | Greater |
                 Greater_Equal | Less_Equal =>
                Lex.Next;
            when others =>
                Local := False;
                Error.Syn (Symbole_Comparaison, Follow_Symbole_Comparaison);
        end case;
        Ok := Ok and Local;
    end Symbole_Comparaison;

    procedure Suite_Condition_Forte (Ok : in out Boolean) is

        Local : Boolean := True;

    begin
        case Lex.Get_Token is
            when De =>
                Lex.Next;
                Objet (Local);
                Symbole_Comparaison (Local);
                Expression (Local);
            when Appartient =>
                Lex.Next;
                if Lex.Get_Token = Pas then
                    Lex.Next;
                end if;
                if Lex.Get_Token = A then
                    Lex.Next;
                    Objet (Local);
                else
                    Local := False;
                    Error.Syn (A, Follow_Suite_Condition_Forte);
                end if;
            when Existe =>
                Lex.Next;
                if Lex.Get_Token = Pas then
                    Lex.Next;
                end if;
            when others =>
                Local := False;
                Error.Syn (Suite_Condition_Forte, Follow_Suite_Condition_Forte);
        end case;
        Ok := Ok and Local;
    end Suite_Condition_Forte;

    procedure Condition_Forte (Ok : in out Boolean) is

        Local : Boolean := True;

    begin
        case Lex.Get_Token is
            when Identifier =>
                Lex.Next;
                Suite_Condition_Forte (Local);
            when Heros | Lieu =>
                Lex.Next;
                if Lex.Get_Token = Equal then
                    Lex.Next;
                    if Lex.Get_Token = Identifier then
                        Lex.Next;  
                    else
                        Local := False;
                        Error.Syn (Identifier, Follow_Condition_Forte);
                    end if;
                else
                    Local := False;
                    Error.Syn (Equal, Follow_Condition_Forte);
                end if;
            when Number =>
                Lex.Next;
                if Lex.Get_Token = Actions then
                    Lex.Next;
                    if Lex.Get_Token = Passees then
                        Lex.Next;  
                    else
                        Local := False;
                        Error.Syn (Passees, Follow_Condition_Forte);
                    end if;
                else
                    Local := False;
                    Error.Syn (Actions, Follow_Condition_Forte);
                end if;
            when Rencontre =>
                Lex.Next;
                if Lex.Get_Token = Identifier then
                    Lex.Next;  
                else
                    Local := False;
                    Error.Syn (Identifier, Follow_Condition_Forte);
                end if;
            when Issue =>
                Lex.Next;
                if Lex.Get_Token = Equal then
                    Lex.Next;
                    if Lex.Get_Token = Identifier then
                        Lex.Next;
                    else  
                        Local := False;
                        Error.Syn (Identifier, Follow_Condition_Forte);
                    end if;
                else
                    Local := False;
                    Error.Syn (Equal, Follow_Condition_Forte);
                end if;
            when others =>
                Local := False;
                Error.Syn (Condition_Forte, Follow_Condition_Forte);
        end case;
        Ok := Ok and Local;
    end Condition_Forte;


    procedure Condition_Faible (Ok : in out Boolean) is

        First_Condition_Faible : constant Token_To_Boolean_Array :=
           Token_To_Boolean_Array'(Et => True, others => False);

        Local : Boolean := True;

    begin
        Condition_Forte (Local);
        while First_Condition_Faible (Lex.Get_Token) loop-- a simplifier
            case Lex.Get_Token is
                when Et =>  
                    Lex.Next;
                    Condition_Forte (Local);
                when others =>
                    null;
            end case;
        end loop;
        Ok := Ok and Local;
    end Condition_Faible;

    procedure Condition (Ok : in out Boolean) is

        First_Condition : constant Token_To_Boolean_Array :=
           Token_To_Boolean_Array'(Ou => True, others => False);

        Local : Boolean := True;

    begin
        Condition_Faible (Local);
        while First_Condition (Lex.Get_Token) loop-- a simplifier
            case Lex.Get_Token is
                when Ou =>  
                    Lex.Next;
                    Condition_Faible (Local);
                when others =>
                    null;           end case;
        end loop;
        Ok := Ok and Local;
    end Condition;

    procedure Si (Ok : in out Boolean) is

        Local : Boolean := True;

    begin
        Condition (Local);
        if Lex.Get_Token = Alors then
            Lex.Next;
            --Put_Line ("alors detecte");
            Instructions_Simples (Local);
            --Put_Line ("sinon possible");
            if Lex.Get_Token = Sinon then
                --Put_Line ("sinon detecte");
                Lex.Next;
                Instructions_Simples (Local);
            end if;
            --Put_Line ("fin de sinon");
            if Lex.Get_Token = Fin then
                Lex.Next;
                if Lex.Get_Token = Si then
                    Lex.Next;
                else
                    Local := False;
                    Error.Syn (Si, Follow_Instruction_Simple);
                end if;
            else
                Local := False;
                Error.Syn (Fin, Follow_Instruction_Simple);
            end if;  
        else
            Local := False;
            Error.Syn (Alors, Follow_Instruction_Simple);
        end if;
        Ok := Ok and Local;
    end Si;

    procedure Change (Ok : in out Boolean) is

        Local : Boolean := True;

    begin
        case Lex.Get_Token is
            when Identifier =>
                Lex.Next;
                if Lex.Get_Token = De then
                    Lex.Next;
                    Objet (Local);
                    if Lex.Get_Token = En then
                        Lex.Next;
                        Expression (Local);
                    else
                        Local := False;
                        Error.Syn (En, Follow_Instruction_Simple);
                    end if;
                else
                    Local := False;
                    Error.Syn (De, Follow_Instruction_Simple);
                end if;
            when Heros | Lieu =>
                Lex.Next;
                if Lex.Get_Token = En then
                    Lex.Next;
                    if Lex.Get_Token = Identifier then
                        Lex.Next;
                    else
                        Local := False;
                        Error.Syn (Identifier, Follow_Instruction_Simple);
                    end if;
                else
                    Local := False;
                    Error.Syn (En, Follow_Instruction_Simple);
                end if;
            when others =>
                Local := False;
                Error.Syn (Change, Follow_Instruction_Simple);
        end case;
        Ok := Ok and Local;
    end Change;

    procedure Quoi_Afficher (Ok : in out Boolean) is

        Local : Boolean := True;

    begin  
        case Lex.Get_Token is
            when Right_Sentence =>
                Lex.Next;
            when Wrong_Sentence =>  
                Local := False;
                Error.Syn (Wrong_Sentence, Follow_Quoi_Afficher);  
            when Number =>  
                Lex.Next;
            when Identifier =>
                Lex.Next;
                if Lex.Get_Token = De then
                    Lex.Next;
                    Objet (Local);
                else
                    Local := False;
                    Error.Syn (De, Follow_Quoi_Afficher);
                end if;
            when Issue =>
                Lex.Next;
                if Lex.Get_Token = Identifier then
                    Lex.Next;
                else
                    Local := False;
                    Error.Syn (Identifier, Follow_Quoi_Afficher);
                end if;  
            when Issues =>  
                Lex.Next;
            when Contenu =>
                Lex.Next;
                if Lex.Get_Token = De then
                    Lex.Next;
                    Objet (Local);  
                else
                    Local := False;
                    Error.Syn (De, Follow_Quoi_Afficher);
                end if;  
            when others =>
                Local := False;
                Error.Syn (Quoi_Afficher, Follow_Quoi_Afficher);
        end case;
        Ok := Ok and Local;  
    end Quoi_Afficher;


    procedure Liste_Affiche (Ok : in out Boolean) is

        First_Liste_Affiche : constant Token_To_Boolean_Array :=
           Token_To_Boolean_Array'(Ampersand => True, others => False);

        Local : Boolean := True;

    begin  
        Quoi_Afficher (Local);
        while (First_Liste_Affiche (Lex.Get_Token)) loop
            case Lex.Get_Token is
                when Ampersand =>
                    Lex.Next;
                    Quoi_Afficher (Local);
                when others =>
                    null;
            end case;
        end loop;
        Ok := Ok and Local;
    end Liste_Affiche;

    procedure Ligne (Ok : in out Boolean) is

        Local : Boolean := True;

    begin
        if Lex.Get_Token = Suivante then
            Lex.Next;
        else
            Local := False;
            Error.Syn (Suivante, Follow_Instruction_Simple);
        end if;
        Ok := Ok and Local;
    end Ligne;

    procedure Bouge (Ok : in out Boolean) is

        Local : Boolean := True;

    begin
        if Lex.Get_Token = Anime then
            Lex.Next;
        else
            Local := False;
            Error.Syn (Anime, Follow_Instruction_Simple);
        end if;
        Ok := Ok and Local;
    end Bouge;

    procedure Positionne (Ok : in out Boolean) is

        Local : Boolean := True;

    begin
        Liste_Identificateurs (Local);
        if Lex.Get_Token = A then
            Lex.Next;
            Objet (Local);
        else
            Local := False;
            Error.Syn (Dans, Follow_Instruction_Simple);
        end if;
        Ok := Ok and Local;
    end Positionne;

    procedure Va (Ok : in out Boolean) is

        Local : Boolean := True;
   begin
        if Lex.Get_Token = Vers then
            Lex.Next;
            if Lex.Get_Token = Identifier then
                Lex.Next;
            else
                Local := False;
                Error.Syn (Identifier, Follow_Instruction_Simple);
            end if;  
        else
            Local := False;
            Error.Syn (Vers, Follow_Instruction_Simple);
        end if;
        Ok := Ok and Local;
    end Va;

    procedure Instructions_Simples (Ok : in out Boolean) is

        First_Instructions_Simples : constant Token_To_Boolean_Array :=
           Token_To_Boolean_Array'(Si .. Va => True, others => False);

        Local : Boolean := True;

    begin
        while First_Instructions_Simples (Lex.Get_Token) loop
            case Lex.Get_Token is
                when Si =>
                    Lex.Next;
                    Si (Local);
                when Change =>
                    Lex.Next;
                    Change (Local);
                when Affiche =>
                    Lex.Next;
                    Liste_Affiche (Local);
                when Ligne =>
                    Lex.Next;
                    Ligne (Local);
                when Bouge =>
                    Lex.Next;
                    Bouge (Local);
                when Positionne =>
                    Lex.Next;
                    Positionne (Local);
                when Retire =>
                    Lex.Next;
                    Liste_Identificateurs (Local);
                when Termine =>
                    Lex.Next;
                when Va =>
                    Lex.Next;
                    Va (Local);
                when Efface =>
                    Lex.Next;
                when others =>
                    null;
                    Put_Line ("fin instructions simples");
            end case;
        end loop;
        Ok := Ok and Local;
    end Instructions_Simples;


    procedure Description_Ordre (Ok : in out Boolean) is
        Local : Boolean := True;

    begin  
        if Lex.Get_Token = Identifier then
            Lex.Next;
            while Lex.Get_Token = Identifier loop
                Lex.Next;
            end loop;
        else
            Local := False;
            Error.Syn (Identifier, Follow_Ordre);
        end if;
        Ok := Ok and Local;
    end Description_Ordre;


    procedure Ordre (Ok : in out Boolean) is
        Local : Boolean := True;

    begin  
        Description_Ordre (Local);
        while Lex.Get_Token = Comma loop
            Lex.Next;
            Description_Ordre (Local);
        end loop;
        if Lex.Get_Token = Colon then
            Lex.Next;
            Instructions_Simples (Local);
            while Lex.Get_Token = Pour or Lex.Get_Token = Ailleurs loop
                if Lex.Get_Token = Pour then
                    Lex.Next;
                    if Lex.Get_Token = Identifier then
                        Lex.Next;
                        Instructions_Simples (Local);
                    else
                        Local := False;
                        Error.Syn (Identifier, Follow_Ordre);

                    end if;
                else
                    Lex.Next;
                    Instructions_Simples (Local);
                    exit;
                end if;
            end loop;
        else
            Local := False;
            Error.Syn (Colon, Follow_Ordre);
        end if;
        if Local then
            Put_Line ("ordre");
        end if;
        Ok := Ok and Local;
    end Ordre;


    procedure Fin_Quand (Ok : in out Boolean) is
        Local : Boolean := True;
    begin
        if Lex.Get_Token = Fin then
            Lex.Next;
            if Lex.Get_Token = Quand then
                Lex.Next;
            else
                Local := False;
                Error.Syn (Quand, Follow_Quand_Ordre);
            end if;
        else
            Local := False;
            Error.Syn (Fin, Follow_Quand_Ordre);
        end if;
        Ok := Ok and Local;
    end Fin_Quand;


    procedure Quand_Ordre (Ok : in out Boolean) is
        Local : Boolean := True;

    begin
        if Lex.Get_Token = Quand then
            Lex.Next;
            if Lex.Get_Token = Ordre then
                Lex.Next;
                if Lex.Get_Token = Vaut then
                    Lex.Next;
                    if Lex.Get_Token = Substract then
                        Lex.Next;
                        Ordre (Local);
                        while Lex.Get_Token = Substract loop
                            Lex.Next;
                            Ordre (Local);
                        end loop;
                        Fin_Quand (Local);
                        if Local then
                            Put_Line ("quand_ordre correct");
                        end if;
                    else
                        Local := False;
                        Error.Syn (Substract, Follow_Ordre);
                    end if;
                else
                    Local := False;
                    Error.Syn (Vaut, Follow_Quand_Ordre);
                end if;
            else
                Local := False;
                Error.Syn (Ordre, Follow_Quand_Ordre);
            end if;
        else
            Local := False;
            Error.Syn (Quand, Follow_Quand_Ordre);
        end if;
        Ok := Ok and Local;
    end Quand_Ordre;


    procedure Creation_Monde (Ok : in out Boolean) is
        Local : Boolean := True;
    begin  
        Put_Line ("Lecture de la zone de creation ...");
        Liste_Messages_Erreur (Local);
        Liste_Enumeres (Local);
        Liste_Structures (Local);
        Liste_Objets (Local);
        Liste_Mots (Local);
        Etats_Liens (Local);
        Lier_Lieux (Local);
        Liste_Groupes (Local);
        Liste_Verbes (Local);
        Ok := Ok and Local;
    end Creation_Monde;


    procedure Scenario (Ok : in out Boolean) is
        Local : Boolean := True;

    begin
        if Lex.Get_Token = Introduction then
            Lex.Next;  
            Put_Line ("Lecture d'introduction ...");
            Instructions_Simples (Local);
        end if;
        if Lex.Get_Token = Scenario then
            Lex.Next;  
            Put_Line ("Lecture de scenario ...");
            Instructions_Simples (Local);
            Quand_Ordre (Local);
            Instructions_Simples (Local);
        end if;
        Ok := Ok and Local;
    end Scenario;


    procedure Jeu_Aventure (Ok : in out Boolean) is

        Local : Boolean := True;

    begin
        --    loop
        Creation_Monde (Local);
        Scenario (Local);
        if not Lex.Is_At_End then
            Local := False;
            Put_Line ("not at end");
            Error.Syn (Jeu_Aventure, Follow_Jeu_Aventure);
            --else
            --exit;
        end if;
        --        Put_Line ("redemarrage");
        --    end loop;
        Ok := Ok and Local;
    end Jeu_Aventure;


    procedure Start is

        Local : Boolean := True;

    begin

        Lex.Initialize;  
        Jeu_Aventure (Local);
        if Local then
            Put_Line ("Program is Ok");
        else
            Put_Line ("Program is false");
        end if;
    end Start;

end Syn_Prec;

E3 Meta Data

    nblk1=44
    nid=2c
    hdr6=56
        [0x00] rec0=28 rec1=00 rec2=01 rec3=008
        [0x01] rec0=23 rec1=00 rec2=41 rec3=002
        [0x02] rec0=22 rec1=00 rec2=03 rec3=01e
        [0x03] rec0=1c rec1=00 rec2=0b rec3=01c
        [0x04] rec0=1c rec1=00 rec2=12 rec3=020
        [0x05] rec0=01 rec1=00 rec2=2e rec3=014
        [0x06] rec0=22 rec1=00 rec2=39 rec3=006
        [0x07] rec0=1d rec1=00 rec2=2a rec3=04a
        [0x08] rec0=23 rec1=00 rec2=13 rec3=02e
        [0x09] rec0=08 rec1=00 rec2=1c rec3=002
        [0x0a] rec0=22 rec1=00 rec2=2f rec3=00a
        [0x0b] rec0=23 rec1=00 rec2=10 rec3=00a
        [0x0c] rec0=1f rec1=00 rec2=18 rec3=004
        [0x0d] rec0=1d rec1=00 rec2=11 rec3=036
        [0x0e] rec0=22 rec1=00 rec2=30 rec3=004
        [0x0f] rec0=22 rec1=00 rec2=09 rec3=03c
        [0x10] rec0=1e rec1=00 rec2=16 rec3=034
        [0x11] rec0=22 rec1=00 rec2=1e rec3=05c
        [0x12] rec0=04 rec1=00 rec2=2d rec3=01a
        [0x13] rec0=21 rec1=00 rec2=3b rec3=016
        [0x14] rec0=23 rec1=00 rec2=27 rec3=040
        [0x15] rec0=1f rec1=00 rec2=38 rec3=02a
        [0x16] rec0=1e rec1=00 rec2=21 rec3=078
        [0x17] rec0=1a rec1=00 rec2=3c rec3=074
        [0x18] rec0=1d rec1=00 rec2=31 rec3=00a
        [0x19] rec0=20 rec1=00 rec2=1d rec3=002
        [0x1a] rec0=20 rec1=00 rec2=0c rec3=018
        [0x1b] rec0=1c rec1=00 rec2=06 rec3=02a
        [0x1c] rec0=1e rec1=00 rec2=07 rec3=00e
        [0x1d] rec0=06 rec1=00 rec2=26 rec3=032
        [0x1e] rec0=1d rec1=00 rec2=3d rec3=01e
        [0x1f] rec0=23 rec1=00 rec2=1b rec3=024
        [0x20] rec0=2a rec1=00 rec2=14 rec3=002
        [0x21] rec0=1f rec1=00 rec2=0f rec3=034
        [0x22] rec0=20 rec1=00 rec2=02 rec3=006
        [0x23] rec0=00 rec1=00 rec2=2b rec3=04a
        [0x24] rec0=21 rec1=00 rec2=32 rec3=016
        [0x25] rec0=00 rec1=00 rec2=37 rec3=01a
        [0x26] rec0=22 rec1=00 rec2=0d rec3=022
        [0x27] rec0=1e rec1=00 rec2=24 rec3=02e
        [0x28] rec0=1f rec1=00 rec2=04 rec3=034
        [0x29] rec0=25 rec1=00 rec2=33 rec3=01a
        [0x2a] rec0=1a rec1=00 rec2=15 rec3=000
        [0x2b] rec0=1b rec1=00 rec2=2c rec3=000
        [0x2c] rec0=07 rec1=00 rec2=12 rec3=001
        [0x2d] rec0=00 rec1=00 rec2=26 rec3=200
        [0x2e] rec0=00 rec1=00 rec2=09 rec3=000
        [0x2f] rec0=20 rec1=24 rec2=40 rec3=000
        [0x30] rec0=00 rec1=00 rec2=80 rec3=000
        [0x31] rec0=00 rec1=04 rec2=00 rec3=000
        [0x32] rec0=00 rec1=00 rec2=00 rec3=000
        [0x33] rec0=00 rec1=00 rec2=00 rec3=000
        [0x34] rec0=00 rec1=00 rec2=00 rec3=000
        [0x35] rec0=00 rec1=00 rec2=00 rec3=000
        [0x36] rec0=00 rec1=00 rec2=00 rec3=000
        [0x37] rec0=00 rec1=00 rec2=00 rec3=000
        [0x38] rec0=00 rec1=00 rec2=00 rec3=000
        [0x39] rec0=00 rec1=00 rec2=00 rec3=000
        [0x3a] rec0=00 rec1=01 rec2=00 rec3=000
        [0x3b] rec0=00 rec1=04 rec2=00 rec3=000
        [0x3c] rec0=00 rec1=40 rec2=03 rec3=391
        [0x3d] rec0=fc rec1=00 rec2=00 rec3=000
        [0x3e] rec0=32 rec1=00 rec2=00 rec3=000
        [0x3f] rec0=00 rec1=00 rec2=00 rec3=000
        [0x40] rec0=00 rec1=00 rec2=00 rec3=000
        [0x41] rec0=00 rec1=00 rec2=00 rec3=000
        [0x42] rec0=00 rec1=00 rec2=00 rec3=000
        [0x43] rec0=00 rec1=00 rec2=00 rec3=000
    tail 0x2153e7848863479f90251 0x42a00088462060003
Free Block Chain:
  0x2c: 0000  00 1a 02 09 80 06 74 75 72 65 29 3b 06 00 12 20  ┆      ture);    ┆
  0x1a: 0000  00 35 00 08 80 05 53 79 6e 20 28 05 74 69 66 69  ┆ 5    Syn ( tifi┆
  0x35: 0000  00 36 00 e4 80 16 20 20 20 20 20 20 20 20 20 20  ┆ 6              ┆
  0x36: 0000  00 08 00 06 80 03 74 65 5f 03 04 00 13 20 20 20  ┆      te_       ┆
  0x8: 0000  00 0e 00 04 80 01 3b 01 69 03 1b 20 20 20 20 20  ┆      ; i       ┆
  0xe: 0000  00 1f 00 09 80 06 20 20 20 20 20 20 06 20 69 66  ┆              if┆
  0x1f: 0000  00 34 00 06 80 03 20 20 20 03 20 20 20 20 20 20  ┆ 4              ┆
  0x34: 0000  00 28 00 08 00 05 20 20 20 20 20 05 20 20 20 20  ┆ (              ┆
  0x28: 0000  00 3e 00 06 80 03 20 74 68 03 20 20 20 20 20 20  ┆ >     th       ┆
  0x3e: 0000  00 0a 00 06 80 03 65 74 5f 03 00 02 20 20 02 00  ┆      et_       ┆
  0xa: 0000  00 3f 00 0a 80 07 20 20 45 72 72 6f 72 07 15 20  ┆ ?      Error   ┆
  0x3f: 0000  00 20 00 0c 80 09 20 69 66 20 4c 65 78 2e 47 09  ┆       if Lex.G ┆
  0x20: 0000  00 40 00 09 80 06 20 20 20 20 20 20 06 20 20 20  ┆ @              ┆
  0x40: 0000  00 05 00 0c 80 09 20 20 20 20 20 20 20 20 20 09  ┆                ┆
  0x5: 0000  00 19 00 09 80 06 6f 6c 6c 6f 77 5f 06 65 08 00  ┆      ollow_ e  ┆
  0x19: 0000  00 3a 00 0c 80 09 20 20 20 20 20 20 20 65 6e 09  ┆ :           en ┆
  0x3a: 0000  00 22 00 10 80 0d 20 20 20 20 20 20 20 20 20 20  ┆ "              ┆
  0x22: 0000  00 29 00 5d 80 26 20 20 20 20 20 20 20 20 50 75  ┆ ) ] &        Pu┆
  0x29: 0000  00 23 00 0c 80 09 6e 20 49 64 65 6e 74 69 66 09  ┆ #    n Identif ┆
  0x23: 0000  00 42 03 fc 80 02 73 65 02 00 1d 20 20 20 20 20  ┆ B    se        ┆
  0x42: 0000  00 25 00 11 80 0e 20 20 20 20 20 20 20 20 20 20  ┆ %              ┆
  0x25: 0000  00 43 03 fc 80 14 20 20 20 20 20 20 20 20 4f 6b  ┆ C            Ok┆
  0x43: 0000  00 17 00 11 80 03 20 3d 3e 03 00 08 20 20 20 20  ┆       =>       ┆
  0x17: 0000  00 44 03 fc 80 0d 68 65 6e 20 6f 74 68 65 72 73  ┆ D    hen others┆
  0x44: 0000  00 00 00 10 00 0d 20 20 20 20 20 20 20 20 20 20  ┆                ┆