|
|
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: 8703 (0x21ff)
Types: TextFile
Notes: R1k Text-file segment
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦e1962cc78⟧
└─⟦this⟧
with Text_Io, Lex;
use lex;
package body Error is
subtype Keyword_Token is Token range Entier .. Fin;
Last_Error_Line : Natural := 0;
use Lex.Visible;
procedure Position_Error is
begin
Text_io.put_line ("*** Erreur a la ligne " & Integer'Image (Lex.Get_Line) &
", colonne " & Integer'Image (Lex.Get_Column) & " ***");
end Position_Error;
use Lex.Visible;
procedure Test_If_Keyword is
begin
if Lex.Get_Token in Keyword_Token then
Text_io.put_line (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_Error;
case An_Error is
when Wrong_Sentence =>
Text_io.put_line ("Il manque des guillemets en fin de phrase.");
when Sentence =>
Text_io.put_line ("Il manque une chaine a cet endroit.");
when Closing_Bracket =>
Put ("Parenthese fermante omise.");
Test_If_Keyword; -- on peut pas confondre avec mots-cle
when Equal =>
Text_io.put_line ("Symbole '=' manquant.");
Test_If_Keyword; -- meme chose
when Substract =>
Text_io.put_line ("Symbole '-' manquant.");
Test_If_Keyword;
when Colon =>
Text_io.put_line ("Symbole ':' manquant.");
Test_If_Keyword; -- meme chose
when Number =>
Text_io.put_line ("Il faut imperativement une valeur entiere.");
Test_If_Keyword; -- meme chose
when Identifier =>
Text_io.put_line
("Il faut imperativement un identificateur a cette position.");
Test_If_Keyword;
when Type_Base =>
Text_io.put_line ("Ce n'est pas un type de base. ");
Text_io.put_line ("Types autorises : 'ENTIER', 'CHAINE', enumere.");
Test_If_Keyword;
when Type_Structure =>
Text_io.put_line ("Ce n'est pas un type de stucture. ");
Text_io.put_line
("types possibles: 'ENTITE', 'LIEU', 'ANIME', nom de structure.");
Test_If_Keyword;
when Valeur =>
Text_io.put_line ("Ce n'est pas une valeur.");
Text_io.put_line
("Exemples de valeurs: 10, 100, R2D2, Casimir_1er, ""Hello"".");
Test_If_Keyword;
when Chaine =>
Text_io.put_line
("Seule une chaine peut suivre un '&' dans ce cas. ");
Test_If_Keyword; -- meme chose
when Facteur =>
Text_io.put_line
("Un facteur commence par une '(', un nombre, ou un identificateur.");
Test_If_Keyword;
when Objet =>
Text_io.put_line
("Un objet commence par 'HEROS', 'LIEU', ou un identificateur.");
Test_If_Keyword;
when Tests =>
Text_io.put_line
("Vous avez oubliez le mot-cle 'EXISTE' ou un symbole de comparaison.");
Text_io.put_line
("Les symboles de comparaison possibles sont '=', '<>', '<', '>', '<=', '>='.");
Test_If_Keyword; -- meme chose
when Suite_Condition_Forte =>
Text_io.put_line
("Vous devez continuer avec 'DE', 'PAS', 'DANS' ou 'EXISTE'.");
Test_If_Keyword;
when Condition_Forte =>
Text_io.put_line
("Une condition commence par un identificateur, un nombre, ou l'un des mots-cle suivants:");
Text_io.put_line ("'HEROS', 'LIEU', 'RENCONTRE'.");
Test_If_Keyword;
when Change =>
Text_io.put_line
("Change peut etre suivi d'un identificateur, de 'HEROS' ou de 'LIEU'");
Test_If_Keyword;
when Quoi_Afficher =>
Text_io.put_line
("Vous pouvez afficher un nombre, une chaine ou un identificateur.");
Text_io.put_line
("Ou utiliser l'un des mots-cle suivants: 'ISSUE', 'ISSUES' ou 'CONTENU');");
Test_If_Keyword;
when Jeu_Aventure =>
Text_io.put_line (Token'Image (Lex.Get_Token) &
" mal place ou en trop.");
when others =>
Text_io.put_line ("Le mot-cle '" & Visible.Error'Image (An_Error) &
"' doit figurer a cette position.");
end case;
Last_Error_Line := Lex.Get_Line;
loop
Lex.Next;
exit when Follow (Lex.Get_Token);
end loop;
Text_io.put_line ("Resynchro : " & Token'Image (Lex.Get_Token));
end if;
end Syn;
procedure Sem (An_Error : in Sem_error; False_Part : in String) is
begin
Position_Error;
case An_Error is
when Identifier_belong_list =>
Text_io.put_line ("Vous avez declare l'identificateur " & False_Part &
" a plusieurs reprises dans la meme liste.");
when Message =>
Text_io.put_line ("Le message d'erreur " &
False_Part & " existe deja !");
when Enumere =>
Text_io.put_line ("Le litteral enumere '" & False_Part &
"' n'a pu etre stocke !");
when subject_exist_in_Group =>
Text_io.put_line ("Attention, le complement '" & False_Part &
" est nomme de fois dans ce groupe !");
when complement_exist=>
text_io.put_line("Attention, le complement " & false_part & " existe deja !");
when complement_not_exist=>
text_io.put_line("Attention, le complement " & false_part & " n'existe pas !");
when complement_not_a_place =>
text_io.put_line("Attention, le complement " & false_part & " n'est pas un lieu !");
when complement_not_an_animate=>
text_io.put_line("Attention, le complement " & false_part & " n'est pas un anime !");
when complement_not_an_animate=>
text_io.put_line("Attention, le complement " & false_part & " n'est pas une entite !");
when field_exist =>
text_io.put_line("Attention, le champ " & false_part & " existe deja !");
when field_not_exist =>
text_io.put_line("Attention, le champ " & false_part & " n'existe pas !");
when field_not_belong =>
text_io.put_line("Attention, le champ " & false_part & " n'a pas ete defini pour ce complement !");
when field_not_a_number=>
text_io.put_line("Attention, le champ " & false_part & " n'est pas un nombre !");
when field_not_a_sentence=>
text_io.put_line("Attention, le champ " & false_part & " n'est pas une chaine !");
when field_not_an_enumerate =>
text_io.put_line("Attention, le champ " & false_part & " n'est pas un enumere !");
when literal_exist =>
null;
--text_io.put_line("Attention, le literal " & false_part & " existe deja !");
when literal_not_belong =>
text_io.put_line("Attention, le literal " & false_part & " n'existe pas !");
when word_exist =>
text_io.put_line("Attention, le word " & false_part & " existe deja !");
when verb_exist =>
text_io.put_line("Attention, le verb " & false_part & " existe deja !");
when group_is_complement =>
text_io.put_line("Attention, vous ne pouvez declarer ce groupe car l'identificateur " & false_part & " est deja utilise pour un complement !");
when enumeration_exist =>
text_io.put_line("Attention, le type enumere " & false_part & " existe deja !");
when enumeration_not_exist =>
text_io.put_line("Attention, le type enumere " & false_part & " n'existe pas !");
when neither_complement_or_group =>
text_io.put_line("Attention, l'identificateur " & false_part & " n'est ni un complement, ni un groupe !");
when number_of_repeat_null =>
text_io.put_line("Attention, le nombre de repetition est nul !");
end case;
end Sem;
end Error;