|
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: 45056 (0xb000) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Syntaxique_Analyzer, seg_04674f
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦this⟧
with Lexical_Analyzer, Text_Io; package body Syntaxique_Analyzer is use Lexical_Analyzer; -- ************ VIE DU MONDE ************ function Nom_Variable return code_error is begin if (Lexical_Analyzer.Get_Token = Identifier) then Lexical_Analyzer.Next; while (Lexical_Analyzer.Get_Token = De) loop Lexical_Analyzer.Next; if (Lexical_Analyzer.Get_Token = Identifier) then Lexical_Analyzer.Next; else return (error_id_excpected); end if; end loop; else return(error_variable_neme_excepted); end if; return(no_error); end Nom_Variable; function Expression return code_error; --le corps est declare apres la 5ieme procedure ci-dessous function Facteur return code_error is the_error : code_error; begin case (Lexical_Analyzer.Get_Token) is when Left_Bracket => Lexical_Analyzer.Next; the_error := Expression; if (the_error = no_error) then if (Lexical_Analyzer.Get_Token = Right_Bracket) then Lexical_Analyzer.Next; else return(error_right_bracket_excepted); end if; else return (the_error); end if; when Non => Lexical_Analyzer.Next; return (Facteur); when Identifier => return (nom_Variable); when Complement_Or_Verbe | Complement1 | Complement2 => Lexical_Analyzer.Next; when Integer_Number | String_Of_Characters => Lexical_Analyzer.Next; when others => return(error_facteur_excepted); end case; return(no_error); end Facteur; function Terme return code_error is the_error : code_error; begin the_error := Facteur; if (the_error = no_error ) then while ((Lexical_Analyzer.Get_Token = Multiplication) or (Lexical_Analyzer.Get_Token = Division) or (Lexical_Analyzer.Get_Token = Et)) loop Lexical_Analyzer.Next; the_error := Facteur; if (the_error /= no_error) then return (the_error); end loop; else return(no_error); end if; return(no_error); end Terme; function Liste_Mots_Du_Vocabulaire return code_error is begin while ((Lexical_Analyzer.Get_Token = Complement_Or_Verbe) or (Lexical_Analyzer.Get_Token = Complement1) or (Lexical_Analyzer.Get_Token = Complement2)) loop Lexical_Analyzer.Next; end loop; return(no_error); end Liste_Mots_Du_Vocabulaire; function Signe return code_error is begin if ((Lexical_Analyzer.Get_Token = Plus) or (Lexical_Analyzer.Get_Token = Minus)) then Lexical_Analyzer.Next; end if; return(no_error); end Signe; function Expression_Simple return code_error is the_error : code_error; begin the_error := Signe; if (the_error = no_error) then the_error := Terme; if (the_error = no_error) then while ((Lexical_Analyzer.Get_Token = Plus) or (Lexical_Analyzer.Get_Token = Minus) or (Lexical_Analyzer.Get_Token = Ou)) loop Lexical_Analyzer.Next; the_error := Terme; if (the_error /= no_error) then return (the_error); end loop; else return(the_error); end if; else return(the_error); end if; return(no_error); end Expression_Simple; function Expression return code_error is the_error : code_error ; begin the_error := Expression_Simple; if (the_error = no_error) then while ((Lexical_Analyzer.Get_Token /= Devient) and (Lexical_Analyzer.Get_Token /= Complement_Or_Verbe) and (Lexical_Analyzer.Get_Token /= Complement1) and (Lexical_Analyzer.Get_Token /= Complement2))loop case (Lexical_Analyzer.Get_Token) is when Equal | Less | Less_Equal | Different | More | More_Equal | Dans => Lexical_Analyzer.Next; the_error := Expression_Simple; if (the_error /= no_error) then return bug dans expression when others => null; -- erreur une expresssion doit etre du type.... -- donner toute les formes des expression (math et logique) end case; end loop; case (Lexical_Analyzer.Get_Token) is when Devient => Lexical_Analyzer.Next; Expression_Simple; when First_Un_Mot_Du_Vocabulaire => --Complement_Or_Verbe | Complement1 | Complement2 => Liste_Mots_Du_Vocabulaire; when others => null; -- erreur une expresssion doit etre du type.... -- donner toute les formes des expression (math et logique) end case; else return(the_error); end if; return(no_error); end Expression; function Liste_Actions return code_error; -- le corps de cette function est declare au dessus de la function vie_du_monde function Clause_Sinon return code_error is begin if (Lexical_Analyzer.Get_Token = Sinon) then Liste_Actions; end if; end Clause_Sinon; function Action_Conditionnelle return code_error is begin if (Lexical_Analyzer.Get_Token = Si) then Lexical_Analyzer.Next; Expression; if (Lexical_Analyzer.Get_Token = Alors) then Lexical_Analyzer.Next; Liste_Actions; Clause_Sinon; if (Lexical_Analyzer.Get_Token = Fsi) then Lexical_Analyzer.Next; --else erreur le test conditionnel doit etre termine par fsi end if; -- else erreur il faut declarer un alors ici end if; end if; end Action_Conditionnelle; --function nom_variable est declaree au debut de ce fichier function Un_Mot_Du_Vocabulaire return code_error is begin if (Lexical_Analyzer.Get_Token = First_Un_Mot_Du_Vocabulaire) then Lexical_Analyzer.Next; --else erreur il faut declarer un mot du voca, sachant que c'est '...' ou comp1 ou comp2 end if; end Un_Mot_Du_Vocabulaire; function Liste_Arguments return code_error is begin if (Lexical_Analyzer.Get_Token = First_Argument) then Lexical_Analyzer.Next; -- else erreur il faut au moins un argument end if; while (Lexical_Analyzer.Get_Token = First_Argument) loop Lexical_Analyzer.Next; end loop; end Liste_Arguments; function Appel return code_error is begin case (Lexical_Analyzer.Get_Token) is when Ecrire => Lexical_Analyzer.Next; Liste_Arguments; when Retirer => Lexical_Analyzer.Next; Un_Mot_Du_Vocabulaire; if (Lexical_Analyzer.Get_Token = A) then Lexical_Analyzer.Next; Nom_Variable; --else erreur : il manque la particule "A" : donner 1 exemple de syntaxe end if; when Ajouter => Lexical_Analyzer.Next; Un_Mot_Du_Vocabulaire; if (Lexical_Analyzer.Get_Token = A) then Lexical_Analyzer.Next; Nom_Variable; --else erreur : il manque la particule "A" : donner 1 exemple de syntaxe end if; when Vider => Lexical_Analyzer.Next; Nom_Variable; when others => null; -- erreur : les operations predefinies sont ... end case; end Appel; function Action return code_error is begin case (Lexical_Analyzer.Get_Token) is when (First_Action_Conditionnelle) => Action_Conditionnelle; if (Lexical_Analyzer.Get_Token = Terminator) then Lexical_Analyzer.Next; --else erreur il manque un . pour finir cette ligne d'instruction end if; when (First_Appel) => Appel; if (Lexical_Analyzer.Get_Token = Terminator) then Lexical_Analyzer.Next; --else erreur il manque un . pour finir cette ligne d'instruction end if; when (First_Expression) => Expression; if (Lexical_Analyzer.Get_Token = Terminator) then Lexical_Analyzer.Next; --else erreur il manque un . pour finir cette ligne d'instruction end if; when others => null; -- erreur il faut definir une action sachant qu'1 action peut etre -- 1 action conditionnelle, une utilisation d'une operation predefinie, ou une -- expression end case; end Action; function Liste_Actions return code_error is begin the_error := Action.parse; if (the_error = error.no) then while (action.is_First(Lexical_Analyzer.Get_Token) loop the_error := Action; if (the_error /= error.no) then return(the_error); end if; end loop; else return(the_error); end if; return(error.no); end Liste_Actions; function Vie_Du_Monde return code_error is begin if (Lexical_Analyzer.Get_Token = Vie) then Lexical_Analyzer.Next; if (Lexical_Analyzer.Get_Token = Est) then Lexical_Analyzer.Next; return (Liste_Actions.parse); else return (error.est_expected); end if; else return(error.decl_vie_expected); -- ou verifier qu'il n'y a pas erreur de declaration de la section precedent vie est. end if; end Vie_Du_Monde; --IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII -- ............. Defintion_Vocabulaire ............. function Liste_Id return code_error is begin if (Lexical_Analyzer.Get_Token = Identifier) then Lexical_Analyzer.Next; while (Lexical_Analyzer.Get_Token = Identifier) loop Lexical_Analyzer.Next; end loop; --else erreur, il faut au moins declarer un mot du langage lorsque vous declarer la liste de verbes ou de complements end if; end Liste_Id; function Definition_Complements return code_error is begin if (Lexical_Analyzer.Get_Token = Complements) then Lexical_Analyzer.Next; if (Lexical_Analyzer.Get_Token = Sont) then Lexical_Analyzer.Next; Liste_Id; if (Lexical_Analyzer.Get_Token = Terminator) then Lexical_Analyzer.Next; --else erreur, il faut au terminer la declaration de la liste des complements par un . end if; -- else erreur le mots cle complements doit etre suivit de sont pour declarer la liste de complements end if; --else ok car liste de complements est optionnelle end if; end Definition_Complements; function Definition_Verbes return code_error is begin if (Lexical_Analyzer.Get_Token = Verbes) then Lexical_Analyzer.Next; if (Lexical_Analyzer.Get_Token = Sont) then Lexical_Analyzer.Next; Liste_Id; if (Lexical_Analyzer.Get_Token = Terminator) then Lexical_Analyzer.Next; --else erreur, il faut au terminer la declaration de la liste de verbes par un . end if; -- else erreur le mots cle verbes doit etre suivit de sont pour declarer la liste de verbes end if; --else ok car liste de verbes est optionnelle end if; end Definition_Verbes; function Definition_Vocabulaire return code_error is begin Definition_Verbes; Definition_Complements; end Definition_Vocabulaire; -- ............. Initialisation simple ............. function Affectation_Ou_Appel return code_error is the_error : code_error; begin if (Lexical_Analyzer.Get_Token = First_Appel) then the_error := Appel; if (the_error = ERROR.NO) then if (Lexical_Analyzer.Get_Token = Terminator) then Lexical_Analyzer.Next; else return(error_point_excepted); end if; else return(the_error); end if; else if (Lexical_Analyzer.Get_Token = First_Expression) then the_error := Expression; if (the_error = ERROR.NO) then if (Lexical_Analyzer.Get_Token = Terminator) then Lexical_Analyzer.Next; else return(error_point_excepted); end if; else return(the_error); else return(error_intitialisation_false); end if; end if; return(no_error); end Affectation_Ou_Appel; function Liste_Affectations return code_error is the_error : code_error; begin the_error := Affectation_Ou_Appel; if (the_error = no_error) then while (Lexical_Analyzer.Get_Token = ecrire) or (Lexical_Analyzer.Get_Token = retirer) or (Lexical_Analyzer.Get_Token = ajouter) or (Lexical_Analyzer.Get_Token = vider) or (Lexical_Analyzer.Get_Token = quitter) or (Lexical_Analyzer.Get_Token = plus) or (Lexical_Analyzer.Get_Token = ...)loop the _error := Affectation_Ou_Appel; if (the_error /= no_error) then return(the_error); end loop; else return(the_error); end if; return(no_error); end Liste_Affectations; function Intialisation_Simple return code_error is begin if (Lexical_Analyzer.Get_Token = Initialisations) then Lexical_Analyzer.Next; if (Lexical_Analyzer.Get_Token = Sont) then Lexical_Analyzer.Next; return (Liste_Affectations); else return (error_sont_excepted); end if; else return (no_error); end if; end Intialisation_Simple; -- ............. Definition des variables ............. function Liste_Valeurs return code_error; function Valeur return code_error is the_error : code_error; begin case (Lexical_Analyzer.Get_Token) is when Left_Bracket => Lexical_Analyzer.Next; the_error := Liste_Valeurs; if (the_error = no_error) then if (Lexical_Analyzer.Get_Token = Right_Bracket) then Lexical_Analyzer.Next; else return (valeur); end if; else return(the_error); when String_Of_Characters | Integer_Number => Lexical_Analyzer.Next; when others => return(error_decl_valeur_excepted); end case; return(no_error); end Valeur; function Liste_Valeurs return code_error is the_error : code_error; begin the_error := Valeur; if (the_error = no_error) then while (Lexical_Analyzer.Get_Token = Left_Bracket) or (Lexical_Analyzer.Get_Token = String_Of_Characters) or (Lexical_Analyzer.Get_Token = Integer_Number) loop the _error := Valeur; if (the_error /= no_error) then return(the_error); end if; end loop; else return(the_error); end if; return(no_error); end Liste_Valeurs; function Initialisation_Par_Agregats return code_error is the_error : code_error; begin if (Lexical_Analyzer.Get_Token = Left_Bracket) then Lexical_Analyzer.Next; the_error := Liste_Valeurs; if (the_error = no_error) then if (Lexical_Analyzer.Get_Token = Right_Bracket) then Lexical_Analyzer.Next; else return(error_right_bracket_excepted); end if; else return (the_error); end if; else return (no_error); end if; return(no_error); end Initialisation_Par_Agregats; function Nom_Famille return code_error is begin case (Lexical_Analyzer.Get_Token) is when Identifier => Lexical_Analyzer.Next; when Entier | Chaine => Lexical_Analyzer.Next; when others => return(error_type_unknown); end case; return(no_error); end Nom_Famille; function Variable return code_error is the_error : code_error; begin if (Lexical_Analyzer.Get_Token = Identifier) then Lexical_Analyzer.Next; if (Lexical_Analyzer.Get_Token = Comme) then Lexical_Analyzer.Next; the_error := Nom_Famille; if (the_error = no_error) then the_error := Initialisation_Par_Agregats; if (the_error = no_error) then if (Lexical_Analyzer.Get_Token = Terminator) then Lexical_Analyzer.Next; else return (error_point_excepted); end if; else return (the_error); end if; else return (the_error); end if; else return(error_comme_excepted); end if; else return(error_decl_variable_excepted); end if; return(no_error) end Variable; function Liste_Variables return code_error is the_error : code_error; begin the_error := Variable; if (the_error = no_error) then while (Lexical_Analyzer.Get_Token = Identifier) loop the_error := Variable; if (the_error /= no_error) then return (the_error); end if; end loop; else return (the_error); end if; return(no_error); end Liste_Variables; function Definition_Variables return code_error is begin if (Lexical_Analyzer.Get_Token = Variables) then Lexical_Analyzer.Next; if (Lexical_Analyzer.Get_Token = Sont) then Lexical_Analyzer.Next; return (Liste_Variables); else return (error_sont_excepted); end if; else return(no_error); end if; end Definition_Variables; -- ............. Definition des Types ............. function Mot_Cle_Chaine_Ou_Entier return code_error is begin if (Lexical_Analyzer.Get_Token = Chaine) or (Lexical_Analyzer.Get_Token = Entier) then Lexical_Analyzer.Next; else return(error_decl_type_simple_excepted); end if; return(no_error) end Mot_Cle_Chaine_Ou_Entier; function Champs return code_error is Token : Tokens; the_error : code_error; begin Token := Lexical_Analyzer.Get_Token; case (Token) is when Ensemble => Lexical_Analyzer.Next; if (Lexical_Analyzer.Get_Token = De) then Lexical_Analyzer.Next; if (Lexical_Analyzer.Get_Token = Identifier) then Lexical_Analyzer.Next; else return(error_id_excepted); end if; else return(error_de_excepted); end if; when Identifier => Lexical_Analyzer.Next; if (Lexical_Analyzer.Get_Token = Left_Bracket) then Lexical_Analyzer.Next; the_error := Mot_Cle_Chaine_Ou_Entier; if (the_error = no_error) then if (Lexical_Analyzer.Get_Token = Right_Bracket) then Lexical_Analyzer.Next; else return(error_right_bracket_excepted); end if; else return(the_error); end if; else return(error_left_bracket_excepted); end if; when Heritage => Lexical_Analyzer.Next; if (Lexical_Analyzer.Get_Token = De) then Lexical_Analyzer.Next; if (Lexical_Analyzer.Get_Token = Identifier) then Lexical_Analyzer.Next; else return(error_id_excepted); end if; else return(error_de_excepted); end if; when others => return(error_decl_champs_excepted); end case; return(no_error) end Champs; function Liste_Champs return code_error is the_error : code_error; begin the _error := Champs; if (the_error = no_error) then while (Lexical_Analyzer.Get_Token = Et) loop Lexical_Analyzer.Next; the_error := Champs; if (the_error /= no_error) then return (the_error); end if; end loop; else return (the_error); end if; return(no_error); end Liste_Champs; function Famille return code_error is the_error : code_error; begin if (Lexical_Analyzer.Get_Token = Identifier) then Lexical_Analyzer.Next; if (Lexical_Analyzer.Get_Token = Avec) then Lexical_Analyzer.Next; the_error := Liste_Champs; if (the_error = no_error) then if (Lexical_Analyzer.Get_Token = Terminator) then Lexical_Analyzer.Next; else return(error_point_excepted); end if; else return (the_error); end if; else return (error_avec_excepted); end if; else return(error_decl_famille_excepted); end if; return(no_error); end Famille; function Liste_Familles return code_error is the_error : code_error; begin the_error := Famille; if (the_error = no_error) then while (Lexical_Analyzer.Get_Token = Identifier) loop the_error := Famille; if (the_error /= no_error) then return(the_error); end if; end loop; else return (the_error); end if; return(no-error); end Liste_Familles; function Definition_Types return code_error is begin if (Lexical_Analyzer.Get_Token = Familles) then Lexical_Analyzer.Next; if (Lexical_Analyzer.Get_Token = Sont) then Lexical_Analyzer.Next; return (Liste_Familles); else return (error_sont_excpected); end if; else return(no_error); end if; end Definition_Types; -- ************ DEDFINITION DU MONDE ************ function Definition_Du_Monde return code_error is the_error : code_error; begin the_error := Definition_Types; if (the_error = no_error) then the_error := Definition_Variables; if (the_error = no_error) then the_error := Initialisation_Simple; if (the_error = no_error) then return(Defintion_Vocabulaire) end if; end if; end if; end Definition_Du_Monde; -- ************ DEDFINITION DU SCENARIO ************ function Scenario return code_error is the_error : code_error; begin the_error :=Definition_Du_Monde ; if (the_error = no_error) then return (Vie_Du_Monde); else return (the_error); end if; end Scenario; -- ****************************************************************** -- ** PARSE ** -- ****************************************************************** function Parse (File_Name : String) return code_error is the _error : code_error; begin Lexical_Analyzer.Open (File_Name); Lexical_Analyzer.Next; the_error := scenario; Lexical_Analyzer.close (File_Name); return (the_error); end Parse; end Syntaxique_Analyzer;
nblk1=2b nid=1a hdr6=38 [0x00] rec0=25 rec1=00 rec2=01 rec3=036 [0x01] rec0=1d rec1=00 rec2=09 rec3=00e [0x02] rec0=1d rec1=00 rec2=15 rec3=02a [0x03] rec0=1d rec1=00 rec2=24 rec3=02c [0x04] rec0=1a rec1=00 rec2=26 rec3=006 [0x05] rec0=1d rec1=00 rec2=0b rec3=00c [0x06] rec0=1e rec1=00 rec2=14 rec3=03e [0x07] rec0=20 rec1=00 rec2=23 rec3=02a [0x08] rec0=1d rec1=00 rec2=0c rec3=028 [0x09] rec0=1a rec1=00 rec2=08 rec3=014 [0x0a] rec0=1f rec1=00 rec2=22 rec3=02a [0x0b] rec0=1d rec1=00 rec2=21 rec3=022 [0x0c] rec0=19 rec1=00 rec2=12 rec3=054 [0x0d] rec0=1c rec1=00 rec2=06 rec3=01c [0x0e] rec0=1b rec1=00 rec2=27 rec3=050 [0x0f] rec0=16 rec1=00 rec2=11 rec3=018 [0x10] rec0=1f rec1=00 rec2=25 rec3=066 [0x11] rec0=1e rec1=00 rec2=13 rec3=020 [0x12] rec0=22 rec1=00 rec2=20 rec3=04a [0x13] rec0=1b rec1=00 rec2=1b rec3=010 [0x14] rec0=1f rec1=00 rec2=0e rec3=064 [0x15] rec0=1e rec1=00 rec2=10 rec3=054 [0x16] rec0=15 rec1=00 rec2=1f rec3=05e [0x17] rec0=22 rec1=00 rec2=03 rec3=034 [0x18] rec0=1b rec1=00 rec2=18 rec3=01a [0x19] rec0=21 rec1=00 rec2=04 rec3=028 [0x1a] rec0=21 rec1=00 rec2=1e rec3=034 [0x1b] rec0=07 rec1=00 rec2=1d rec3=000 [0x1c] rec0=00 rec1=00 rec2=00 rec3=000 [0x1d] rec0=04 rec1=00 rec2=00 rec3=000 [0x1e] rec0=00 rec1=10 rec2=00 rec3=000 [0x1f] rec0=00 rec1=00 rec2=00 rec3=000 [0x20] rec0=8c rec1=00 rec2=00 rec3=000 [0x21] rec0=00 rec1=00 rec2=15 rec3=7cf [0x22] rec0=00 rec1=00 rec2=00 rec3=000 [0x23] rec0=00 rec1=00 rec2=00 rec3=01a [0x24] rec0=dc rec1=fe rec2=42 rec3=400 [0x25] rec0=00 rec1=01 rec2=00 rec3=6b7 [0x26] rec0=3f rec1=d0 rec2=a0 rec3=000 [0x27] rec0=00 rec1=40 rec2=10 rec3=5f8 [0x28] rec0=36 rec1=9c rec2=a2 rec3=650 [0x29] rec0=00 rec1=09 rec2=82 rec3=0bf [0x2a] rec0=06 rec1=d3 rec2=97 rec3=3c5 tail 0x21543358486515a2ca562 0x42a00088462060003 Free Block Chain: 0x1a: 0000 00 0a 03 fc 80 11 7a 65 72 2e 47 65 74 5f 54 6f ┆ zer.Get_To┆ 0xa: 0000 00 1c 03 fc 00 22 20 20 20 20 65 6e 64 20 4c 69 ┆ " end Li┆ 0x1c: 0000 00 17 03 f9 80 0b 28 6e 6f 5f 65 72 72 6f 72 29 ┆ (no_error)┆ 0x17: 0000 00 19 03 fc 80 26 20 20 63 61 73 65 20 28 4c 65 ┆ & case (Le┆ 0x19: 0000 00 28 03 fc 00 00 00 00 37 20 20 20 20 66 75 6e ┆ ( 7 fun┆ 0x28: 0000 00 02 00 26 80 20 20 64 65 63 6c 61 72 65 65 20 ┆ & declaree ┆ 0x2: 0000 00 29 03 fc 80 4d 20 6c 65 20 63 6f 72 70 73 20 ┆ ) M le corps ┆ 0x29: 0000 00 0d 00 15 80 09 64 65 5f 65 72 72 6f 72 3b 09 ┆ de_error; ┆ 0xd: 0000 00 2a 03 fc 80 02 20 7c 02 00 30 20 20 20 20 20 ┆ * | 0 ┆ 0x2a: 0000 00 05 00 39 80 36 20 20 20 20 20 20 20 20 20 20 ┆ 9 6 ┆ 0x5: 0000 00 07 03 fc 80 17 74 65 5f 4d 6f 74 73 5f 44 75 ┆ te_Mots_Du┆ 0x7: 0000 00 0f 02 7a 00 3f 20 20 20 20 20 20 20 20 77 68 ┆ z ? wh┆ 0xf: 0000 00 2b 03 f9 80 22 73 65 20 28 4c 65 78 69 63 61 ┆ + "se (Lexica┆ 0x2b: 0000 00 16 00 38 80 1c 46 61 63 74 65 75 72 20 72 65 ┆ 8 Facteur re┆ 0x16: 0000 00 00 00 27 80 24 72 65 75 72 20 3a 20 6d 61 6e ┆ ' $reur : man┆