|
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 - metrics - download
Length: 14419 (0x3853) Types: TextFile Notes: R1k Text-file segment
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦b9f4901e0⟧ └─⟦this⟧
with Text_Io, Lex, Moving_String; use Lex, Moving_String; package body Error4 is subtype Keyword_Token is Token range Entier .. Fin; Last_Error_Line : Natural := 0; use Lex.Visible; procedure Position_Error2 is begin Lex.Write_Error_File ("*** Erreur a la ligne " & Integer'Image (Lex.Get_Line) & ", colonne " & Integer'Image (Lex.Get_Column) & " ***"); end Position_Error2; procedure Position_Error is Position : Positive := Lex.Get_Column; Adjust : Moving_String.Object; begin while Position /= 1 loop Position := Position - 1; Adjust := Adjust & " "; end loop; Write_Error_File (Moving_String.Image (Adjust & "^")); end Position_Error; procedure Delimitor is begin Write_Error_File ("----------------------------------------------------------------------------------"); end Delimitor; use Lex.Visible; procedure Test_If_Keyword is begin if Lex.Get_Token in Keyword_Token then Lex.Write_Error_File (Token'Image (Lex.Get_Token) & " est un mot reserve !"); end if; end Test_If_Keyword; use Lex.Visible; procedure Syn (An_Error : in Syn_Error; Follow : Token_To_Boolean_Array) is begin if Lex.Get_Line /= Last_Error_Line then -- Position_Error2; --plus besoin si erreur reecrite dans fichier Position_Error; Delimitor; case An_Error is when Wrong_Sentence => Lex.Write_Error_File ("Il manque des guillemets en fin de phrase."); when Sentence => Lex.Write_Error_File ("Il manque une chaine a cet endroit."); when Closing_Bracket => Lex.Write_Error_File ("Parenthese fermante omise."); Test_If_Keyword; -- on peut pas confondre avec mots-cle when Equal => Lex.Write_Error_File ("Symbole '=' manquant."); Test_If_Keyword; -- meme chose when Substract => Lex.Write_Error_File ("Symbole '-' manquant."); Test_If_Keyword; when Colon => Lex.Write_Error_File ("Symbole ':' manquant."); Test_If_Keyword; -- meme chose when Number => Lex.Write_Error_File ("Il faut imperativement une valeur entiere."); Test_If_Keyword; -- meme chose when Id => Lex.Write_Error_File ("Il faut imperativement un identificateur a cette position."); Test_If_Keyword; when Type_Base => Lex.Write_Error_File ("Ce n'est pas un type de base. "); Lex.Write_Error_File ("Types autorises : 'ENTIER', 'CHAINE', enumere."); Test_If_Keyword; when Type_Structure => Lex.Write_Error_File ("Ce n'est pas un type de stucture. "); Lex.Write_Error_File ("types possibles: 'ENTITE', 'LIEU', 'ANIME', nom de structure."); Test_If_Keyword; when Valeur => Lex.Write_Error_File ("Ce n'est pas une valeur."); Lex.Write_Error_File ("Exemples de valeurs: 10, 100, R2D2, Casimir_1er, ""Hello""."); Test_If_Keyword; when Chaine => Lex.Write_Error_File ("Seule une chaine peut suivre un '&' dans ce cas. "); Test_If_Keyword; -- meme chose when Facteur => Lex.Write_Error_File ("Un facteur commence par une '(', un nombre, ou un identificateur."); Test_If_Keyword; when Objet => Lex.Write_Error_File ("Un objet commence par 'HEROS', 'LIEU', ou un identificateur."); Test_If_Keyword; when Tests => Lex.Write_Error_File ("Vous avez oubliez le mot-cle 'EXISTE' ou un symbole de comparaison."); Lex.Write_Error_File ("Les symboles de comparaison possibles sont '=', '<>', '<', '>', '<=', '>='."); Test_If_Keyword; -- meme chose when Suite_Condition_Forte => Lex.Write_Error_File ("Vous devez continuer avec 'DE', 'PAS', 'DANS' ou 'EXISTE'."); Test_If_Keyword; when Condition_Forte => Lex.Write_Error_File ("Une condition commence par un identificateur, un nombre, ou l'un des mots-cle suivants:"); Lex.Write_Error_File ("'HEROS', 'LIEU', 'RENCONTRE'."); Test_If_Keyword; when Change => Lex.Write_Error_File ("Change peut etre suivi d'un identificateur, de 'HEROS' ou de 'LIEU'"); Test_If_Keyword; when Quoi_Afficher => Lex.Write_Error_File ("Vous pouvez afficher un nombre, une chaine ou un identificateur."); Lex.Write_Error_File ("Ou utiliser l'un des mots-cle suivants: 'ISSUE', 'ISSUES' ou 'CONTENU');"); Test_If_Keyword; when Jeu_Aventure => Lex.Write_Error_File (Token'Image (Lex.Get_Token) & " mal place ou en trop."); when Too_Many_Complements => Lex.Write_Error_File ("L'ordre contient plus de quatre complements."); when Identifier_Place => Lex.Write_Error_File ("Il faut imperativement un identificateur ou le mot-cle lieu."); Test_If_Keyword; when others => Lex.Write_Error_File ("Le mot-cle '" & Visible.Syn_Error'Image (An_Error) & "' doit figurer a cette position."); end case; Delimitor; Last_Error_Line := Lex.Get_Line; loop Lex.Next; exit when Follow (Lex.Get_Token); end loop; Lex.Write_Error_File ("Resynchro : " & Token'Image (Lex.Get_Token)); end if; end Syn; procedure Sem (An_Error : in Sem_Error; False_Part : in String) is begin if Lex.Get_Line /= Last_Error_Line then Delimitor; case An_Error is when Identifier_Belong_List => Lex.Write_Error_File ("Vous avez declare l'identificateur " & False_Part & " a plusieurs reprises dans la meme liste."); when Message => Lex.Write_Error_File ("Le message d'erreur " & False_Part & " existe deja !"); when Enumere => Lex.Write_Error_File ("Le litteral enumere '" & False_Part & "' n'a pu etre stocke !"); when Subject_Exist_In_Group => Lex.Write_Error_File ("Attention, le complement '" & False_Part & " est nomme de fois dans ce groupe !"); when no_mother_structure => Lex.Write_Error_File ("Attention, vous faites appel a une structure " & False_Part & " qui n'est pas declaree auparavant !"); when structure_Exist => Lex.Write_Error_File ("Attention, la structure " & False_Part & " existe deja !"); when Complement_Exist => Lex.Write_Error_File ("Attention, le complement " & False_Part & " existe deja !"); when Complement_Not_Exist => Lex.Write_Error_File ("Attention, le complement " & False_Part & " n'existe pas !"); when Complement_Not_A_Word => Lex.Write_Error_File ("Attention, le complement " & False_Part & " n'est pas un mot !"); when Complement_Not_A_Place => Lex.Write_Error_File ("Attention, le complement " & False_Part & " n'est pas un lieu !"); when Complement_Not_An_Animate => Lex.Write_Error_File ("Attention, le complement " & False_Part & " n'est pas un anime !"); when Complement_Not_An_Entity => Lex.Write_Error_File ("Attention, le complement " & False_Part & " n'est pas une entite !"); when Complement_Not_Entity_Or_Animate => Lex.Write_Error_File ("Attention, le complement " & False_Part & " n'est pas ni une entite, ni un anime !"); when Field_Exist => Lex.Write_Error_File ("Attention, le champ " & False_Part & " existe deja !"); when Field_Not_Exist => Lex.Write_Error_File ("Attention, le champ " & False_Part & " n'existe pas !"); when Field_Not_Belong => Lex.Write_Error_File ("Attention, le champ " & False_Part & " n'a pas ete defini pour ce complement !"); when Field_Not_A_Number => Lex.Write_Error_File ("Attention, le champ " & False_Part & " n'est pas un nombre !"); when Field_Not_A_Sentence => Lex.Write_Error_File ("Attention, le champ " & False_Part & " n'est pas une chaine !"); when Field_Not_An_Enumerate => Lex.Write_Error_File ("Attention, le champ " & False_Part & " n'est pas un enumere !"); when Literal_Exist => null; --lex.write_error_file("Attention, le literal " & false_part & " existe deja !"); when Literal_Not_Belong => Lex.Write_Error_File ("Attention, le literal " & False_Part & " n'existe pas !"); when Word_Exist => Lex.Write_Error_File ("Attention, le word " & False_Part & " existe deja !"); when Verb_Exist => Lex.Write_Error_File ("Attention, le verb " & False_Part & " existe deja !"); when Group_Is_Complement => Lex.Write_Error_File ("Attention, vous ne pouvez declarer ce groupe car l'identificateur " & False_Part & " est deja utilise pour un complement !"); when Enumeration_Exist => Lex.Write_Error_File ("Attention, le type enumere " & False_Part & " existe deja !"); when Enumeration_Not_Exist => Lex.Write_Error_File ("Attention, le type enumere " & False_Part & " n'existe pas !"); when Neither_An_Entity_Nor_An_Animate => Lex.Write_Error_File ("Attention, l'identificateur " & False_Part & " n'est ni une entite, ni un anime !"); when Neither_A_Subject_Nor_A_Group => Lex.Write_Error_File ("Attention, l'identificateur " & False_Part & " n'est ni un sujet, ni un groupe !"); when Neither_A_Place_Nor_A_Group => Lex.Write_Error_File ("Attention, l'identificateur " & False_Part & " n'est ni un lieu, ni un groupe !"); when Neither_A_Field_Nor_A_Group => Lex.Write_Error_File ("Attention, l'identificateur " & False_Part & " n'est ni un champ, ni un groupe !"); when Number_Of_Repeat_Null => Lex.Write_Error_File ("Attention, le nombre de repetition est nul !"); when Expression_Not_Same_Type => Lex.Write_Error_File ("Attention, l'expression contient des nombres et des enumeres !"); when Number_Of_Actions_Null => Lex.Write_Error_File ("Attention, l'expression contient des nombres et des enumeres !"); when An_Exit => Lex.Write_Error_File ("Attention, la sortie " & False_Part & " de ce lieu est deja utilisee !"); when Field_Belong => Lex.Write_Error_File ("Attention, le champ " & False_Part & " existe deja !"); when Order_Exist => Lex.Write_Error_File ("Attention, l'ordre " & False_Part & " est deja contenu dans la liste !"); end case; Delimitor; Last_Error_Line := Lex.Get_Line; end if; end Sem; end Error4