|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 9216 (0x2400) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Interpreteur, seg_044b20
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦this⟧
with Document, Mots, Nombre_De_Mots, Numeros_De_Lignes, Text_Io, Gestion_De_Tables; package body Interpreteur is Verbe_Table : Gestion_De_Tables.Tableau; Preposition_Table : Gestion_De_Tables.Tableau; Complement_Table : Gestion_De_Tables.Tableau; Complement2_Table : Gestion_De_Tables.Tableau; Compteur : Natural := 1; procedure File_Interprete (File_Name : in String) is Read_Word : Mots.Mot; Num_Line : Numeros_De_Lignes.Numero; function Equal (Chaine1, Chaine2 : String) return Boolean renames Standard."="; begin Document.Fopen (File_Name); while not Document.En_Fin_De_Fichier loop Document.File_Get (Read_Word, Num_Line); --Text_Io.Put_Line (Mots.Valeur (Read_Word)); if Mots.Valeur (Read_Word) = "Debut_Verbes" then loop Document.File_Get (Read_Word, Num_Line); exit when Equal (Mots.Valeur (Read_Word), "Fin_Verbes"); Verbe_Table (Compteur) := new String'(Mots.Valeur (Read_Word)); Compteur := Compteur + 1; Text_Io.Put_Line (Mots.Valeur (Read_Word)); end loop; Verbe_Table (Compteur .. 80) := (others => (new String'(" "))); end if; end loop; Document.Fclose; Compteur := 1; Document.Fopen (File_Name); while not Document.En_Fin_De_Fichier loop Document.File_Get (Read_Word, Num_Line); if Mots.Valeur (Read_Word) = "Debut_Prepositions" then loop Document.File_Get (Read_Word, Num_Line); exit when Equal (Mots.Valeur (Read_Word), "Fin_Prepositions"); Preposition_Table (Compteur) := new String'(Mots.Valeur (Read_Word)); Compteur := Compteur + 1; Text_Io.Put_Line (Mots.Valeur (Read_Word)); end loop; Preposition_Table (Compteur .. 80) := (others => (new String'(" "))); end if; end loop; Document.Fclose; Compteur := 1; Document.Fopen (File_Name); while not Document.En_Fin_De_Fichier loop Document.File_Get (Read_Word, Num_Line); if Mots.Valeur (Read_Word) = "Debut_Complements" then loop Document.File_Get (Read_Word, Num_Line); exit when Equal (Mots.Valeur (Read_Word), "Fin_Complements"); Complement_Table (Compteur) := new String'(Mots.Valeur (Read_Word)); Compteur := Compteur + 1; Text_Io.Put_Line (Mots.Valeur (Read_Word)); end loop; Complement_Table (Compteur .. 80) := (others => (new String'(" "))); end if; end loop; Document.Fclose; Compteur := 1; Document.Fopen (File_Name); while not Document.En_Fin_De_Fichier loop Document.File_Get (Read_Word, Num_Line); if Mots.Valeur (Read_Word) = "Debut_Complements2" then loop Document.File_Get (Read_Word, Num_Line); exit when Equal (Mots.Valeur (Read_Word), "Fin_Complements2"); Complement2_Table (Compteur) := new String'(Mots.Valeur (Read_Word)); Compteur := Compteur + 1; Text_Io.Put_Line (Mots.Valeur (Read_Word)); end loop; Complement2_Table (Compteur .. 80) := (others => (new String'(" "))); end if; end loop; Document.Fclose; Compteur := 1; end File_Interprete; -------------------------------------------------------------------------------------- procedure Interprete is Tableau_Mots_Lus : Mots.Tableau; Mot_Lu : Mots.Mot; Nb_Mots : Natural := 0; Line_Fini : Boolean := False; package T is new Text_Io.Integer_Io (Natural); begin Mots.Creer (Tableau_Mots_Lus, ""); loop Document.Open; Text_Io.Put ("/:> "); Document.Get (Tableau_Mots_Lus, Nb_Mots); T.Put (Nb_Mots); if (Nb_Mots > Nombre_De_Mots.Nombre_Max_Mots) then Text_Io.Put_Line ("Une instruction ne comporte pas plus de quatre mots"); else for I in 1 .. Nb_Mots --// Loop_A_Instruction: loop if Mots.Valeur (Tableau_Mots_Lus, I) = "quit" then raise End_Of_Play; elsif (Nb_Mots > 0) then if Mots.Valeur (Tableau_Mots_Lus, I) /= "nothing" then if Gestion_De_Tables.Chercher_Dans_Table (Verbe_Table, [expression]) then Text_Io.Put_Line ("Mot c"); elsif Gestion_De_Tables.Chercher_Dans_Table (Preposition_Table, Tableau_Mots_Lus) then Text_Io.Put_Line ("Mot c"); elsif Gestion_De_Tables.Chercher_Dans_Table (Complement_Tabble, Tableau_Mots_Lus) then Text_Io.Put_Line ("Mot c"); elsif Gestion_De_Tables.Chercher_Dans_Table (Complement2_Table, Tableau_Mots_Lus) then Text_Io.Put_Line ("Mot connu"); else Text_Io.Put_Line ("Mot inconnu"); end if; end if; end if; end loop;--// Loop_A_Instruction; end if; Document.Close; end loop; exception when End_Of_Play => return; -- when others => -- Text_Io.Put_Line ("fin de commande"); end Interprete; end Interpreteur;
nblk1=8 nid=3 hdr6=e [0x00] rec0=1e rec1=00 rec2=01 rec3=032 [0x01] rec0=14 rec1=00 rec2=08 rec3=070 [0x02] rec0=16 rec1=00 rec2=07 rec3=01a [0x03] rec0=17 rec1=00 rec2=06 rec3=00a [0x04] rec0=1f rec1=00 rec2=05 rec3=024 [0x05] rec0=0e rec1=00 rec2=02 rec3=08e [0x06] rec0=15 rec1=00 rec2=04 rec3=000 [0x07] rec0=68 rec1=63 rec2=c5 rec3=466 tail 0x21540b8aa864352fb08ca 0x42a00088462060003 Free Block Chain: 0x3: 0000 00 00 02 0e 80 18 20 20 20 20 20 20 20 20 20 20 ┆ ┆