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

⟦521f011cf⟧ Ada Source

    Length: 11264 (0x2c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Error, seg_048691

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, Liste_Actions, Unbounded_String, Error_File_Maker, Queue_Generic;

package body Error is


    type Error_Object is
        record
            Error_Code : Code;
            Error_Line : Natural;
            Error_Column : Natural;
        end record;

    package Unlimited_String is new Unbounded_String (10);
    package Error_Queue is new Queue_Generic (Error_Object);

    My_Error_Queue : Error_Queue.Queue;
    Number_Of_Errors : Natural := 0;
    Error_Type : Code;


    Tab_Error : constant array (Code) of Unlimited_String.Variable_String :=
       (Unlimited_String.Value ("Un nom de variable est attendu"),
        Unlimited_String.Value ("Un identificateur est attendu"),
        Unlimited_String.Value ("Une parenthese fermante est attendue"),
        Unlimited_String.Value ("Une parenthese ouvrante est attendue"),
        Unlimited_String.Value ("Un facteur est attendu"),
        Unlimited_String.Value ("Un argument est attendu"),
        Unlimited_String.Value ("Un crochet ouvrant est attendu"),
        Unlimited_String.Value ("Un crochet fermant est attendu"),
        Unlimited_String.Value ("La declaration d'une famille est attendue"),
        Unlimited_String.Value ("La declaration d'un champs est attendue"),
        Unlimited_String.Value ("La declaration d'un type simple est attendue"),
        Unlimited_String.Value ("La declaration d'un facteur est attendue"),
        Unlimited_String.Value ("La declaration d'une action est attendue"),
        Unlimited_String.Value ("La declaration d'une variable est attendue"),
        Unlimited_String.Value
           ("La declaration d'un mot du Vocabulaire est attendue"),
        Unlimited_String.Value ("La declaration d'une valeur est attendue"),
        Unlimited_String.Value ("La declaration de la Vie est attendue"),
        Unlimited_String.Value ("Le mot cle 'AVEC' est attendu"),
        Unlimited_String.Value ("Le mot cle 'DE' est attendu"),
        Unlimited_String.Value ("Le mot cle 'DEVIENT' est attendu"),
        Unlimited_String.Value ("Le mot cle 'COMME' est attendu"),
        Unlimited_String.Value ("Le mot cle 'SONT' est attendu"),
        Unlimited_String.Value ("Le mot cle 'FSI' est attendu"),
        Unlimited_String.Value ("Le mot cle 'ALORS' est attendu"),
        Unlimited_String.Value ("Le mot cle 'EST' est attendu"),
        Unlimited_String.Value ("Le mot cle 'A' est attendu"),
        Unlimited_String.Value ("Mauvaise initialisation"),
        Unlimited_String.Value ("Un point est attendu"),
        Unlimited_String.Value ("Type inconnu"),
        Unlimited_String.Value ("Mot du vocabulaire non declare"),
        Unlimited_String.Value ("Un complement est attendu"),
        Unlimited_String.Value ("Un verbe est attendu"),
        Unlimited_String.Value ("Un complement etait attendu precedemment"),
        Unlimited_String.Value ("Un verbe etait attendu precedemment"),
        Unlimited_String.Value
           ("Un verbe etait attendu au debut de l'expression"),
        Unlimited_String.Value
           ("'COMPLEMENT1' devrait etre en premiere position apres un verbe"),
        Unlimited_String.Value
           ("'COMPLEMENT2' devrait etre en seconde position apres un verbe"),
        Unlimited_String.Value
           ("Incompatibilite de type dans l'expression precedente"),
        Unlimited_String.Value
           ("Incompatibilite de type dans l'expression precedente"),
        Unlimited_String.Value
           ("Incompatibilite de type dans l'expression precedente"),
        Unlimited_String.Value
           ("Incompatibilite de type dans l'expression precedente"),
        Unlimited_String.Value
           ("Incompatibilite de type dans l'expression precedente"),
        Unlimited_String.Value ("L'expression precedente est incomplete"),

        Unlimited_String.Value ("Type non autorise pour l'operation 'DEVIENT'"),
        Unlimited_String.Value ("Type non autorise pour l'operation 'AJOUTER'"),
        Unlimited_String.Value ("Type non autorise pour l'operation 'ECRIRE'"),
        Unlimited_String.Value ("Type non autorise pour l'operation 'RETIRER'"),
        Unlimited_String.Value
           ("Type non autorise pour l'operation 'VIDER' un ensemble"),

        Unlimited_String.Value ("Ce mot est deja un verbe"),
        Unlimited_String.Value ("Ce mot est deja un complement"),

        Unlimited_String.Value ("Une expression booleenne etait attendue"),
        Unlimited_String.Value ("Un entier etait attendu"),
        Unlimited_String.Value ("Une chaine de caracteres etait attendue"),
        Unlimited_String.Value ("Un mot du vocabulaire etait attendu"),
        Unlimited_String.Value ("Un ensemble etait attendu"),  
        Unlimited_String.Value
           ("Un mot du vocabulaire ou une chaine de caracteres etait attendu"),

        Unlimited_String.Value ("Ce champs existe deja"),
        Unlimited_String.Value ("Declaration recursive"),
        Unlimited_String.Value ("Type inconnu pour l'heritage"),

        Unlimited_String.Value ("Ce type est deja declare "),
        Unlimited_String.Value ("Cette variable est deja declaree"),
        Unlimited_String.Value ("Ce type n'existe pas"),
        Unlimited_String.Value ("Ce champ est inconnu"),
        Unlimited_String.Value ("Nom de variable precedent inconnu"),
        Unlimited_String.Value ("Trop de parametres pour cette initialisation"),
        Unlimited_String.Value
           ("Un nom de variable est attendu a la place de ce champs"),
        Unlimited_String.Value
           ("Un champs est attendu a la place de ce nom de variable"),

        Unlimited_String.Value ("Fin de fichier non attendue"));



    procedure Set_Type_Error (What_Type : Error.Code) is
    begin
        Error_Type := What_Type;
        if (Number_Of_Errors = 0) then
            Error_Queue.Initialize (My_Error_Queue);
        end if;
        Number_Of_Errors := Number_Of_Errors + 1;
    end Set_Type_Error;


    function Syntaxe_End_Correctly return Boolean is
    begin
        return (Number_Of_Errors = 0);
    end Syntaxe_End_Correctly;


    procedure Treat is
        My_Error : Error_Object;
    begin  
        Text_Io.Put_Line ("erreur ligne " &
                          Natural'Image (Lexical_Analyzer.Get_Line_In_File) &
                          " colonne " & Natural'Image (Lexical_Analyzer.
                                                       Get_Position_In_Line) &
                          "     " & Code'Image (Error_Type));
        My_Error.Error_Code := Error_Type;
        My_Error.Error_Line := Lexical_Analyzer.Get_Line_In_File;
        My_Error.Error_Column := Lexical_Analyzer.Get_Position_In_Line;
        Error_Queue.Add (My_Error_Queue, My_Error);
    end Treat;


    procedure Resynchro is  
        use Lexical_Analyzer;
    begin  
        while (Lexical_Analyzer.Get_Token /= Terminator) loop
            Lexical_Analyzer.Next;
        end loop;
        Lexical_Analyzer.Next;  
        while not (Is_Follow (Lexical_Analyzer.Get_Token)) loop
            Lexical_Analyzer.Next;
        end loop;
    end Resynchro;


    procedure Make_Error_File (Source_Name : in String) is
        It : Error_Queue.Iterator;
        My_Error : Error_Object;
        Error_File : Error_File_Maker.Object;
    begin
        Error_File_Maker.Open (Error_File, Source_Name, Source_Name & "_error");
        Error_Queue.Init (It, My_Error_Queue);
        while not (Error_Queue.Done (It)) loop
            My_Error := Error_Queue.Value (It);
            Error_File_Maker.Copy_To_Line (Error_File, My_Error.Error_Line);
            Error_File_Maker.Highlight (Error_File, My_Error.Error_Column);
            Error_File_Maker.Write
               (Error_File, Unlimited_String.Image
                               (Tab_Error (My_Error.Error_Code)));  
            Error_Queue.Next (It);
        end loop;  
        Error_File_Maker.Copy_To_End (Error_File);
        Error_File_Maker.Close (Error_File);
    end Make_Error_File;


end Error;

E3 Meta Data

    nblk1=a
    nid=0
    hdr6=14
        [0x00] rec0=1c rec1=00 rec2=01 rec3=072
        [0x01] rec0=0f rec1=00 rec2=05 rec3=004
        [0x02] rec0=0f rec1=00 rec2=03 rec3=034
        [0x03] rec0=13 rec1=00 rec2=09 rec3=044
        [0x04] rec0=12 rec1=00 rec2=02 rec3=030
        [0x05] rec0=17 rec1=00 rec2=04 rec3=014
        [0x06] rec0=1d rec1=00 rec2=0a rec3=022
        [0x07] rec0=03 rec1=00 rec2=07 rec3=028
        [0x08] rec0=17 rec1=00 rec2=08 rec3=064
        [0x09] rec0=06 rec1=00 rec2=06 rec3=001
    tail 0x215459ffc8659804c709c 0x42a00088462060003