|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 5739 (0x166b)
Types: TextFile
Names: »B«
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
└─⟦129cab021⟧ »DATA«
└─⟦this⟧
with Block_Class;
with Custom;
with Errors;
with Scanner;
package body Parser is
Error_Number : Natural;
procedure Go (From_File : String;
The_Root : in out Statements.Node;
Terminal : String) is
begin
Scanner.Start (From_File);
Scanner.Next_Token;
case Scanner.Get_Token is
when Scanner.L_Eof =>
raise Errors.Empty_Source_File;
when others =>
Block_Class.Create_Program_Block;
Block_Class.New_Symbols_Table;
Block_Class.Set_Predefined_Identifiers;
Statements.Parse (The_Root);
Scanner.Stop;
end case;
exception
when Errors.Empty_Source_File =>
Errors.Parse_Log
("Le fichier source que vous avez indique ne contient aucune instruction Tiny_Talk ! ",
Terminal, False);
when Errors.Expecting_Binary =>
Errors.Parse_Log ("Expression binaire attendue !", Terminal);
when Errors.Expecting_Binary_After_Keyword =>
Errors.Parse_Log
("Expression binaire attendue apres un mot cle !", Terminal);
when Errors.Expecting_Closing_Brace =>
Errors.Parse_Log
("Accolade fermante attendue ('}') pour marquer la fin d'un bloc !",
Terminal);
when Errors.Expecting_Closing_Parenthesis =>
Errors.Parse_Log
("Parenthese fermante attendue (')') pour delimiter une valeur !",
Terminal);
when Errors.Expecting_Dot =>
Errors.Parse_Log
("Il manque un separateur d'instructions ('.') ! ", Terminal);
when Errors.Expecting_Id_After_Keyword =>
Errors.Parse_Log
("Identifificateur attendu apres un mot cle, dans la liste d'arguments d'un bloc !",
Terminal);
when Errors.Expecting_Id_After_Pour =>
Errors.Parse_Log
("Identifificateur attendu apres le mot reserve 'Pour' !",
Terminal);
when Errors.Expecting_Id_Or_Keyword =>
Errors.Parse_Log
("Identificateur ou mot cle attendu, dans la liste declarative des arguments d'un bloc !",
Terminal);
when Errors.Expecting_Opening_Brace =>
Errors.Parse_Log
("Accolade ouvrante attendue ('{') pour marquer le debut d'un bloc !",
Terminal);
when Errors.Expecting_Other_Id_Or_Dot =>
Errors.Parse_Log
("Attente d'un autre identificateur ou du separateur ('.'), dans la liste d'arguments d'un bloc !",
Terminal);
when Errors.Expecting_Other_Keyword_Or_Dot =>
Errors.Parse_Log
("Attente d'un autre mot cle ou du separateur ('.'), dans la liste d'arguments d'un bloc !",
Terminal);
when Errors.Expecting_Pour_Or_Value =>
Errors.Parse_Log
("Attente du mot reserve 'Pour' ou d'une valeur, en debut d'une expression !",
Terminal);
when Errors.Expecting_Prendre_After_Id =>
Errors.Parse_Log
("Attente du mot reserve 'Prendre' apres un identificateur !",
Terminal);
when Errors.Expecting_Primary | Errors.Expecting_Primary_First =>
Errors.Parse_Log
("Attente d'une expression primaire (identificateur, chaine, entier, '('Valeur')', ou bloc) !",
Terminal);
when Errors.Expecting_Unary =>
Errors.Parse_Log ("Attente d'une expression unaire !", Terminal);
when Errors.Expecting_Unary_After_Binary_Message =>
Errors.Parse_Log
("Attente d'une expression unaire, apres un message binaire !",
Terminal);
when Errors.Expecting_Value =>
Errors.Parse_Log
("Attente d'une valeur apres une parenthese ouvrante ('(') !",
Terminal);
when Errors.Expecting_Value_After_Prendre =>
Errors.Parse_Log
("Attente d'une valeur apres le mot reserve 'Prendre' !",
Terminal);
when Errors.Unknown_Lexeme_Found =>
Error_Number := Scanner.Get_Error_Number;
case Error_Number is
when 1 =>
Errors.Parse_Log
("Caractere non reconnu par l'analyseur lexical !",
Terminal);
when 2 =>
Errors.Parse_Log
("Identificateur invalide ! (tout '_' doit etre precede ET suivi d'une lettre ou d'un chiffre)",
Terminal);
when 3 =>
Errors.Parse_Log
("Chaine trop longue !... La longueur maximum autorisee pour une chaine est " &
Natural'Image (Custom.String_Max_Length),
Terminal);
when 4 =>
Errors.Parse_Log
("Identificateur trop long !... La longueur maximum autorisee pour un identificateur est " &
Natural'Image (Custom.Id_Max_Length),
Terminal);
when 5 =>
Errors.Parse_Log
("Entier trop grand, au_dela des limites de la machine !",
Terminal);
when others =>
Errors.Parse_Log
("Erreur non identifiee detectee par l'analyseur lexical...",
Terminal);
end case;
end Go;
end Parser;