|
|
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: 137216 (0x21800)
Types: Ada Source
Notes: 03_class, FILE, Long Ada Source, R1k_Segment, e3_tag, package body Syn4, seg_047baa
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
with Text_Io, Lex, Error4, Moving_String, Group_Array;
with Complement, Complement_Array, Structure_Array, Field_Identifier_Array;
with Objet, Detail, Attribute, View, View_List, Animate_List,
Order, Pre_Order_Instructions, Introduction_Instructions;
with Post_Order_Instructions, Order_List, Condition,
Expression, Affectation, Instruction_List;
with Enumeration_Array, Message_Array;
with Exclusive_Generic_List, Identifier, Cheat_Code;
use Text_Io, Moving_String;
package body Syn4 is
use Lex.Visible, Error4.Visible;
package Identifier_List is new Exclusive_Generic_List
(Element => Identifier.Object,
Null_Element => Identifier.Null_Object,
Show_Element => Identifier.Show,
Get_Key => Identifier.Image);
subtype States is Token range Message .. Introduction;
In_Progress : States := Message;
procedure Type_Base (Structure_Name : in Identifier.Object;
Attribute_Index : in Positive;
Enumeration_Type : out Natural;
Ok : in out Boolean) is
Syn_Ok : Boolean := True;
begin
Enumeration_Type := 0;
case Lex.Get_Token is
when Entier =>
Structure_Array.Create_Number_Field
(Structure_Name, Attribute_Index, Syn_Ok);
if not Syn_Ok then
Error4.Sem (Field_Exist,
Field_Identifier_Array.Image (Attribute_Index));
end if;
Lex.Next;
when Chaine =>
Structure_Array.Create_Sentence_Field
(Structure_Name, Attribute_Index, Syn_Ok);
if not Syn_Ok then
Error4.Sem (Field_Exist,
Field_Identifier_Array.Image (Attribute_Index));
end if;
Lex.Next;
when Id =>
if Enumeration_Array.Enumeration_Belong
(Lex.Get_Lower_Case_Value) then
Enumeration_Type := Enumeration_Array.Enum
(Lex.Get_Lower_Case_Value);
Structure_Array.Create_Enumerate_Field
(Structure_Name, Attribute_Index, Syn_Ok);
if not Syn_Ok then
Error4.Sem (Field_Exist, Field_Identifier_Array.Image
(Attribute_Index));
end if;
else
Syn_Ok := False;
Error4.Sem (Enumeration_Not_Exist,
Lex.Get_Lower_Case_Value);
end if;
Lex.Next;
when others =>
Syn_Ok := False;
Error4.Syn (Type_Base, Follow_Type_Base);
end case;
Ok := Ok and Syn_Ok;
end Type_Base;
procedure Type_Structure (Structure_Type : out Moving_String.Object;
Ok : in out Boolean) is
Syn_Ok : Boolean := True;
begin
case Lex.Get_Token is
when Anime | Lieu | Entite | Id =>
Structure_Type := Lex.Get_Lower_Case_Value;
if not Structure_Array.Belong (Lex.Get_Lower_Case_Value) then
Ok := False;
Error4.Sem (Structure_Not_Exist, Lex.Get_Value);
end if;
Lex.Next;
when others =>
Syn_Ok := False;
Error4.Syn (Type_Structure, Follow_Type_Structure);
end case;
Ok := Ok and Syn_Ok;
end Type_Structure;
procedure Chaine (A_Sentence : out Identifier.Object;
Ok : in out Boolean) is
Syn_Ok : Boolean := True;
Value : Moving_String.Object;
begin
Value := Moving_String.From_String (Lex.Get_Value);
Lex.Next;
while Lex.Get_Token = Ampersand loop
Lex.Next;
if Lex.Get_Token /= Right_Sentence then
Syn_Ok := False;
Error4.Syn (Chaine, Follow_Chaine);
else
Value := Value & Lex.Get_Value;
Lex.Next;
end if;
end loop;
Ok := Ok and Syn_Ok;
A_Sentence := Identifier.From_String (Moving_String.Image (Value));
end Chaine;
procedure Valeur (Structure_Name : Identifier.Object;
Attribute_Index : Positive;
Enumeration_Type : in Natural;
Ok : in out Boolean) is
A_Sentence : Identifier.Object;
Literal_Index : Natural;
Syn_Ok : Boolean := True;
begin
case Lex.Get_Token is
when Number =>
Structure_Array.Field_Put_Number
(Structure_Name, Attribute_Index,
Integer'Value (Lex.Get_Lower_Case_Value), Syn_Ok);
if not Syn_Ok then
Error4.Sem (Field_Not_A_Number,
Field_Identifier_Array.Image (Attribute_Index));
end if;
Lex.Next;
when Id =>
if Enumeration_Type /= 0 then
if Enumeration_Array.Literal_Belong
(Enumeration_Type, Lex.Get_Lower_Case_Value) then
Literal_Index := Enumeration_Array.Literal
(Enumeration_Type,
Lex.Get_Lower_Case_Value);
Structure_Array.Field_Put_Enumerate
(Structure_Name, Attribute_Index,
Enumeration_Type, Literal_Index, Syn_Ok);
if not Syn_Ok then
Error4.Sem (Field_Not_An_Enumerate,
Field_Identifier_Array.Image
(Attribute_Index));
end if;
else
Syn_Ok := False;
Error4.Sem (Literal_Not_Belong,
Lex.Get_Lower_Case_Value);
end if;
end if;
Lex.Next;
when Right_Sentence =>
Chaine (A_Sentence, Syn_Ok);
Structure_Array.Field_Put_Sentence
(Structure_Name, Attribute_Index, A_Sentence, Syn_Ok);
if not Syn_Ok then
Error4.Sem (Field_Not_A_Sentence,
Field_Identifier_Array.Image (Attribute_Index));
end if;
when others =>
Syn_Ok := False;
Error4.Syn (Valeur, Follow_Valeur);
end case;
Ok := Ok and Syn_Ok;
end Valeur;
procedure Valeur (A_Complement : in out Complement.Object;
Attribute_Index : in Natural;
Ok : in out Boolean) is
Syn_Ok : Boolean := True;
A_Sentence : Identifier.Object;
Enumeration_Type : Natural;
Literal_Index : Natural;
begin
case Lex.Get_Token is
when Number =>
if Attribute_Index /= 0 then
if Complement.Field_Belong
(A_Complement, Attribute_Index) then
if Complement.Field_Is_A_Number
(A_Complement, Attribute_Index) then
Complement.Field_Put_Number
(A_Complement, Attribute_Index,
Integer'Value (Lex.Get_Lower_Case_Value),
Syn_Ok);
else
Syn_Ok := False;
Error4.Sem (Field_Not_A_Number,
Field_Identifier_Array.Image
(Attribute_Index));
end if;
else
Syn_Ok := False;
Error4.Sem (Field_Not_Belong,
Field_Identifier_Array.Image
(Attribute_Index));
end if;
end if;
Lex.Next;
when Id =>
if Attribute_Index /= 0 then
if Complement.Field_Belong
(A_Complement, Attribute_Index) then
if Complement.Field_Is_An_Enumerate
(A_Complement, Attribute_Index) then
Enumeration_Type :=
Complement.Field_Enumeration
(A_Complement, Attribute_Index);
if Enumeration_Array.Literal_Belong
(Enumeration_Type,
Lex.Get_Lower_Case_Value) then
Literal_Index := Enumeration_Array.Literal
(Enumeration_Type,
Lex.Get_Lower_Case_Value);
Complement.Field_Put_Enumerate
(A_Complement, Attribute_Index,
Enumeration_Type, Literal_Index, Syn_Ok);
else
Syn_Ok := False;
Error4.Sem (Literal_Not_Belong,
Lex.Get_Lower_Case_Value);
end if;
else
Syn_Ok := False;
Error4.Sem (Field_Not_An_Enumerate,
Field_Identifier_Array.Image
(Attribute_Index));
end if;
else
Syn_Ok := False;
Error4.Sem (Field_Not_Belong,
Field_Identifier_Array.Image
(Attribute_Index));
end if;
end if;
Lex.Next;
when Right_Sentence =>
Chaine (A_Sentence, Syn_Ok);
if Attribute_Index /= 0 then
if Complement.Field_Belong
(A_Complement, Attribute_Index) then
if Complement.Field_Is_A_Sentence
(A_Complement, Attribute_Index) then
Complement.Field_Put_Sentence
(A_Complement, Attribute_Index,
A_Sentence, Syn_Ok);
else
Syn_Ok := False;
Error4.Sem (Field_Not_A_Sentence,
Field_Identifier_Array.Image
(Attribute_Index));
end if;
else
Syn_Ok := False;
Error4.Sem (Field_Not_Belong,
Field_Identifier_Array.Image
(Attribute_Index));
end if;
end if;
when others =>
Syn_Ok := False;
Error4.Syn (Valeur, Follow_Valeur);
end case;
Ok := Ok and Syn_Ok;
end Valeur;
-- procedure Objet (an_objet: out objet.object;Ok : in out Boolean) is
procedure Objet (Ok : in out Boolean) is
Syn_Ok : Boolean := True;
begin
case Lex.Get_Token is
when Id =>
--if complement_array.is_a_subject(lex.get_lower_case_value) then
--objet.create_real(an_objet,complement_array.index(lex.get_lower_case_value));
--elsif group_array.belong(lex.get_lower_case_value) then
---objet.create_group(an_objet,order_list.complement_position(lex.get_lower_case_value));.
--else
-- syn_ok := false;
--Error4.sem (neither_a_complement_or_a_group,lex.get_lower_value);
--end if;
Lex.Next;
when Heros =>
--create_hero(an_object);
Lex.Next;
when Lieu =>
--objet.create_place(an_object);
Lex.Next;
when others =>
Syn_Ok := False;
Error4.Syn (Single_Objet, Follow_Objet);
end case;
Ok := Ok and Syn_Ok;
end Objet;
procedure Liste_Identificateurs (Id_List : in out Identifier_List.Object;
Ok : in out Boolean) is
Syn_Ok : Boolean := True;
begin
Identifier_List.Free (Id_List);
if Lex.Get_Token = Id then
Identifier_List.Put
(Id_List, Identifier.From_String (Lex.Get_Lower_Case_Value),
Syn_Ok);
Lex.Next;
while Lex.Get_Token = Comma loop
Lex.Next;
if Lex.Get_Token = Id then
Identifier_List.Put
(Id_List,
Identifier.From_String (Lex.Get_Lower_Case_Value),
Syn_Ok);
if not Syn_Ok then
Error4.Sem (Identifier_Belong_List,
Lex.Get_Lower_Case_Value);
end if;
Lex.Next;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Liste_Identificateurs);
end if;
end loop;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Liste_Identificateurs);
end if;
Ok := Ok and Syn_Ok;
-------------------------------
--Identifier_List.Show (Id_List);
-------------------------------
end Liste_Identificateurs;
procedure Aide (Ok : in out Boolean) is
Syn_Ok : Boolean;
begin
Lex.Next;
if Lex.Get_Token = Right_Sentence then
-- Cheat_Code.Put (Lex.Get_Lower_Case_Value);
null;
else
Syn_Ok := False;
if Lex.Get_Token = Wrong_Sentence then
Error4.Syn (Wrong_Sentence, Follow_Aide);
else
Error4.Syn (Sentence, Follow_Aide);
end if;
end if;
Ok := Ok and Syn_Ok;
end Aide;
procedure Liste_Messages_Erreur (Ok : in out Boolean) is
A_Sentence : Identifier.Object;
Sem_Ok : Boolean;
Syn_Ok : Boolean := True;
begin
while Lex.Get_Token = Message loop
Lex.Next;
if Lex.Get_Token = Erreur then
Lex.Next;
if Lex.Get_Token = Right_Sentence then
Chaine (A_Sentence, Syn_Ok);
if Syn_Ok then
Message_Array.Put (A_Sentence, Syn_Ok);
if not Syn_Ok then
Ok := False;
Error4.Sem (Message, Identifier.Image (A_Sentence));
end if;
end if;
else
Syn_Ok := False;
if Lex.Get_Token = Wrong_Sentence then
Error4.Syn (Wrong_Sentence, Follow_Liste_Messages_Erreur);
else
Error4.Syn (Sentence, Follow_Liste_Messages_Erreur);
end if;
end if;
else
Syn_Ok := False;
Error4.Syn (Erreur, Follow_Liste_Messages_Erreur);
end if;
end loop;
Ok := Ok and Syn_Ok;
end Liste_Messages_Erreur;
procedure Liste_Enumeres (Ok : in out Boolean) is
Enumeration_Identifier : Identifier.Object;
Id_List : Identifier_List.Object;
Iterator : Identifier_List.Iterator;
Syn_Ok : Boolean := True;
begin
while Lex.Get_Token = Enumere loop
Lex.Next;
Identifier_List.Free (Id_List);
if Lex.Get_Token = Id then
Enumeration_Identifier := Identifier.From_String
(Lex.Get_Lower_Case_Value);
if Enumeration_Array.Enumeration_Belong
(Lex.Get_Lower_Case_Value) then
Syn_Ok := False;
Error4.Sem (Enumeration_Exist, Lex.Get_Value);
end if;
Lex.Next;
if Lex.Get_Token = Colon then
Lex.Next;
Liste_Identificateurs (Id_List, Syn_Ok);
if Syn_Ok then
Put_Line ("enumere");
Identifier_List.Init (Iterator, Id_List);
while not Identifier_List.Done (Iterator) loop
Enumeration_Array.Put_Literal
(Enumeration_Identifier,
Identifier_List.Value (Iterator), Syn_Ok);
--if not syn_ok then
-- syn_ok:=false;Error4.sem (literal_exist, Identifier.Image
-- (identifier_list.value(iterator))); -- est ce bien utile
--end if;
Identifier_List.Next (Iterator);
end loop;
end if;
else
Syn_Ok := False;
Error4.Syn (Colon, Follow_Liste_Enumeres);
end if;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Liste_Enumeres);
end if;
end loop;
Ok := Ok and Syn_Ok;
end Liste_Enumeres;
procedure Liens_Speciaux (Ok : in out Boolean) is
Id_List : Identifier_List.Object;
Special_Identifier : Identifier.Object;
Iterator : Identifier_List.Iterator;
Syn_Ok : Boolean := True;
begin
if Lex.Get_Token = Lien then
Lex.Next;
if Lex.Get_Token = Special then
Special_Identifier := Identifier.From_String
(Lex.Get_Lower_Case_Value);
Lex.Next;
if Lex.Get_Token = Colon then
Lex.Next;
Liste_Identificateurs (Id_List, Syn_Ok);
if Syn_Ok then
Put_Line ("etats liens speciaux");
Identifier_List.Init (Iterator, Id_List);
while not Identifier_List.Done (Iterator) loop
if not Enumeration_Array.Literal_Belong
(Enumeration_Array.Enum ("normal"),
Identifier.Image (Identifier_List.Value
(Iterator))) then
Enumeration_Array.Put_Literal
(Special_Identifier,
Identifier_List.Value (Iterator), Syn_Ok);
-- if not syn_ok then
-- ok:=false;
-- Error4.sem (literal_exist, Identifier.Image
-- (identifier_list.value(iterator)));
-- end if;
-- GED dit aussi inutile
else
Ok := False;
Error4.Sem (Special_In_Normal,
Identifier.Image
(Identifier_List.Value
(Iterator)));
end if;
Identifier_List.Next (Iterator);
end loop;
end if;
else
Syn_Ok := False;
Error4.Syn (Colon, Follow_Lien_Special);
end if;
else
Syn_Ok := False;
Error4.Syn (Special, Follow_Lien_Special);
end if;
end if;
Ok := Ok and Syn_Ok;
end Liens_Speciaux;
procedure Etats_Liens (Ok : in out Boolean) is
Normal_Identifier : Identifier.Object;
Id_List : Identifier_List.Object;
Iterator : Identifier_List.Iterator;
Syn_Ok : Boolean := True;
begin
if Lex.Get_Token = Lien then
Lex.Next;
if Lex.Get_Token = Normal then
Normal_Identifier := Identifier.From_String
(Lex.Get_Lower_Case_Value);
Lex.Next;
if Lex.Get_Token = Colon then
Lex.Next;
Liste_Identificateurs (Id_List, Syn_Ok);
if Syn_Ok then
Put_Line ("etats liens normaux");
Identifier_List.Init (Iterator, Id_List); while not Identifier_List.Done (Iterator) loop
Enumeration_Array.Put_Literal
(Normal_Identifier,
Identifier_List.Value (Iterator), Syn_Ok);
-- if not syn_ok then
-- syn_ok:=false;Error4.sem (literal_exist, Identifier.Image
-- (identifier_list.value(iterator)));
-- end if;
-- GED dit aussi inutile
Identifier_List.Next (Iterator);
end loop;
end if;
Liens_Speciaux (Syn_Ok);
else
Syn_Ok := False;
Error4.Syn (Colon, Follow_Lien_Normal);
end if;
else
Syn_Ok := False;
Error4.Syn (Normal, Follow_Lien_Normal);
end if;
end if;
Ok := Ok and Syn_Ok;
end Etats_Liens;
procedure Synonymes (Id_List : in out Identifier_List.Object;
Ok : in out Boolean) is
Syn_Ok : Boolean := True;
begin
if Lex.Get_Token = Ou then
Lex.Next;
Liste_Identificateurs (Id_List, Syn_Ok);
end if;
Ok := Ok and Syn_Ok;
end Synonymes;
procedure Verbe (Ok : in out Boolean) is
Id_List : Identifier_List.Object;
Verb_Identifier : Identifier.Object;
Syn_Ok : Boolean := True;
Iterator : Identifier_List.Iterator;
begin
Verb_Identifier := Identifier.From_String (Lex.Get_Lower_Case_Value);
Complement_Array.Put_Verb (Verb_Identifier, Verb_Identifier, Syn_Ok);
if not Syn_Ok then
Syn_Ok := False;
Error4.Sem (Verb_Exist, Lex.Get_Value);
end if;
Lex.Next;
Identifier_List.Free (Id_List);
Synonymes (Id_List, Syn_Ok);
if Syn_Ok then
Identifier_List.Init (Iterator, Id_List);
while not Identifier_List.Done (Iterator) loop
Complement_Array.Put_Verb
(Identifier_List.Value (Iterator), Verb_Identifier, Syn_Ok);
if not Syn_Ok then
Ok := False;
Error4.Sem (Verb_Exist,
Identifier.Image
(Identifier_List.Value (Iterator)));
end if;
Identifier_List.Next (Iterator);
end loop;
end if;
end Verbe;
procedure Liste_Verbes (Ok : in out Boolean) is
Syn_Ok : Boolean := True;
begin
if Lex.Get_Token = Verbes then
Lex.Next;
if Lex.Get_Token = Id then
Verbe (Syn_Ok);
while Lex.Get_Token = Id loop
Verbe (Syn_Ok);
end loop;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Liste_Verbes);
end if;
if Syn_Ok then
Put_Line ("liste_verbes");
end if;
end if;
Ok := Ok and Syn_Ok;
end Liste_Verbes;
procedure Liste_Mots (Ok : in out Boolean) is
Id_List : Identifier_List.Object;
Iterator : Identifier_List.Iterator;
Syn_Ok : Boolean := True;
begin
if Lex.Get_Token = Mots then
Lex.Next;
Liste_Identificateurs (Id_List, Syn_Ok);
if Syn_Ok then
Put_Line ("mots");
Identifier_List.Init (Iterator, Id_List);
while not Identifier_List.Done (Iterator) loop
Complement_Array.Put_Word
(Identifier_List.Value (Iterator), Syn_Ok);
if not Syn_Ok then
Error4.Sem (Word_Exist,
Identifier.Image
(Identifier_List.Value (Iterator)));
end if;
Identifier_List.Next (Iterator);
end loop;
end if;
end if;
Ok := Ok and Syn_Ok;
end Liste_Mots;
procedure Attribut (Structure_Name : in Identifier.Object;
Ok : in out Boolean) is
Attribute_Index : Positive;
Enumeration_Type : Natural;
Syn_Ok : Boolean := True;
begin
if Lex.Get_Token = Id then
Field_Identifier_Array.Put (Identifier.From_String
(Lex.Get_Lower_Case_Value));
Attribute_Index := Field_Identifier_Array.Index
(Lex.Get_Lower_Case_Value);
Lex.Next;
if Lex.Get_Token = En then
Lex.Next;
Type_Base (Structure_Name, Attribute_Index,
Enumeration_Type, Syn_Ok);
if Lex.Get_Token = Equal then
Lex.Next;
-- pb si type base a dit que le field existait deja, valeur pourrait modifier celui qui existe deja !! ca fait rien ---puisque ca ne marchera pas !! attention a ce que valeur ne repete les memes erreurs !!
-- il peut tester le ok qu'il recoit !!
Valeur (Structure_Name, Attribute_Index,
Enumeration_Type, Syn_Ok);
Text_Io.Put_Line ("affectation");
end if;
else
Syn_Ok := False;
Error4.Syn (En, Follow_Attribut);
end if;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Attribut);
end if;
Ok := Ok and Syn_Ok;
end Attribut;
procedure Corps_Structure
(Structure_Name : in Identifier.Object; Ok : in out Boolean) is
Syn_Ok : Boolean := True;
begin
if Lex.Get_Token = Attributs then
Lex.Next;
--if Lex.Get_Token = Substract then
-- Lex.Next;
Attribut (Structure_Name, Syn_Ok);
Text_Io.Put_Line ("attribut");
while Lex.Get_Token = Id loop
--Lex.Next;
Attribut (Structure_Name, Syn_Ok);
Text_Io.Put_Line ("attribut");
end loop;
--else
-- Syn_Ok := False;
-- Error4.Syn (Substract, Follow_Liste_Structures);
-- end if;
end if;
Ok := Ok and Syn_Ok;
end Corps_Structure;
procedure Liste_Structures (Ok : in out Boolean) is
Syn_Ok : Boolean := True;
Structure_Type : Moving_String.Object;
Structure_Name : Identifier.Object;
begin
while Lex.Get_Token = Structure loop
Lex.Next;
Type_Structure (Structure_Type, Syn_Ok);
if Lex.Get_Token = Colon then
Lex.Next;
if Lex.Get_Token = Id then
if Syn_Ok then
Structure_Name := Identifier.From_String
(Lex.Get_Lower_Case_Value);
Structure_Array.Put
(Moving_String.Image (Structure_Type),
Structure_Name, Syn_Ok);
-- si syn_ok faux et struc renvoie true !!!!
end if;
Lex.Next;
Corps_Structure (Structure_Name, Syn_Ok);
if Syn_Ok then
Put_Line ("structure");
end if;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Liste_Structures);
end if; else
Syn_Ok := False;
Error4.Syn (Colon, Follow_Liste_Structures);
end if;
end loop;
Ok := Ok and Syn_Ok;
end Liste_Structures;
procedure Champs (A_Complement : in out Complement.Object;
Ok : in out Boolean) is
Value : Moving_String.Object;
Attribute_Index : Natural;
Syn_Ok : Boolean := True;
begin
while Lex.Get_Token = Id loop
Attribute_Index := Field_Identifier_Array.Index
(Lex.Get_Lower_Case_Value);
if Attribute_Index = 0 then
Syn_Ok := False;
Error4.Sem (Field_Not_Exist, Lex.Get_Lower_Case_Value);
end if;
Lex.Next;
if Lex.Get_Token = Equal then
Lex.Next;
Valeur (A_Complement, Attribute_Index, Syn_Ok);
else
Syn_Ok := False;
Error4.Syn (Equal, Follow_Champs);
end if;
end loop;
Ok := Ok and Syn_Ok;
end Champs;
procedure Corps_Objet (A_Complement : in out Complement.Object;
Ok : in out Boolean) is
Syn_Ok : Boolean := True;
begin
if Lex.Get_Token = Attributs then
Lex.Next;
Champs (A_Complement, Syn_Ok);
end if;
Ok := Ok and Syn_Ok;
end Corps_Objet;
procedure Liste_Objets (Ok : in out Boolean) is
Id_List : Identifier_List.Object;
Iterator : Identifier_List.Iterator;
Structure_Type : Moving_String.Object;
A_Complement : Complement.Object;
Syn_Ok : Boolean := True;
begin
while Lex.Get_Token = Cree loop
Lex.Next;
Type_Structure (Structure_Type, Syn_Ok);
if Syn_Ok then
A_Complement := Structure_Array.Subject
(Moving_String.Image (Structure_Type));
end if;
if Lex.Get_Token = Colon then
Lex.Next;
Liste_Identificateurs (Id_List, Syn_Ok);
Corps_Objet (A_Complement, Syn_Ok);
if Syn_Ok then
Identifier_List.Init (Iterator, Id_List);
while not Identifier_List.Done (Iterator) loop
Complement_Array.Put
(A_Complement,
Identifier_List.Value (Iterator), Syn_Ok);
--------------
-- attention si syn_ok faux et put done true il ya un bug !!!!!!!!!!!
-----------------------
if not Syn_Ok then
Error4.Sem (Complement_Exist,
Identifier.Image
(Identifier_List.Value (Iterator)));
end if;
Identifier_List.Next (Iterator);
end loop;
Put_Line ("objet");
end if;
else
Syn_Ok := False;
Error4.Syn (Colon, Follow_Liste_Objets);
end if;
end loop;
Ok := Ok and Syn_Ok;
end Liste_Objets;
procedure Lieu (Place_Index, Direction_Index : out Natural;
Ok : in out Boolean) is
Syn_Ok : Boolean := True;
begin
if Lex.Get_Token = Id then
if Complement_Array.Belong (Identifier.From_String
(Lex.Get_Lower_Case_Value)) then
Place_Index := Complement_Array.Index
(Lex.Get_Lower_Case_Value);
else
Syn_Ok := False;
Error4.Sem (Complement_Not_Exist, Lex.Get_Lower_Case_Value);
end if;
Lex.Next;
if Lex.Get_Token = Id then
if Complement_Array.Belong (Identifier.From_String
(Lex.Get_Lower_Case_Value)) then
Direction_Index := Complement_Array.Index
(Lex.Get_Lower_Case_Value);
else
Syn_Ok := False;
Error4.Sem (Complement_Not_Exist, Lex.Get_Lower_Case_Value);
end if;
Lex.Next;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Lier_Lieux);
end if;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Lier_Lieux);
end if;
Ok := Ok and Syn_Ok;
end Lieu;
procedure Moyen (Enumeration_Type, Literal_Index, Exit_Name_Index : out
Natural;
Ok : in out Boolean) is
Syn_Ok : Boolean := True;
Local_Type : Natural;
begin
Local_Type := Enumeration_Array.Enum ("normal");
Text_Io.Put_Line ("lt 1:" & Integer'Image (Local_Type));
-- pas joli, mais necessaire car enumeration_type est un param "out",
-- appele en tant que param "in" dans certaines fonctions.
Literal_Index := 0;
if Lex.Get_Token = Par then
Lex.Next;
Text_Io.Put_Line ("av id :" & Lex.Get_Lower_Case_Value);
if Lex.Get_Token = Id then
if Complement_Array.Belong (Identifier.From_String
(Lex.Get_Lower_Case_Value)) then
Exit_Name_Index := Complement_Array.Index
(Lex.Get_Lower_Case_Value);
else
Syn_Ok := False;
Error4.Sem (Complement_Not_Exist, Lex.Get_Lower_Case_Value);
end if;
Lex.Next;
Text_Io.Put_Line ("a1");
Text_Io.Put_Line ("sy 1:" & Boolean'Image (Syn_Ok));
if Lex.Get_Token = Id then
Text_Io.Put_Line ("id " & Lex.Get_Lower_Case_Value);
if Enumeration_Array.Literal_Belong
(Local_Type, Lex.Get_Lower_Case_Value) then
Text_Io.Put_Line ("a2");
Literal_Index :=
Enumeration_Array.Literal
(Local_Type, Lex.Get_Lower_Case_Value);
Lex.Next;
Text_Io.Put_Line ("li 1");
else
Local_Type := Enumeration_Array.Enum ("special");
Text_Io.Put_Line ("lt 2:" & Integer'Image (Local_Type));
if Enumeration_Array.Literal_Belong
(Local_Type, Lex.Get_Lower_Case_Value) then
Literal_Index :=
Enumeration_Array.Literal
(Local_Type, Lex.Get_Lower_Case_Value);
Text_Io.Put_Line ("li 2");
Lex.Next;
else
Syn_Ok := False;
Error4.Sem (Literal_Not_Belong,
Lex.Get_Lower_Case_Value);
end if;
end if;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Lier_Lieux);
end if;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Lier_Lieux);
end if;
else
Syn_Ok := False;
Error4.Syn (Par, Follow_Lier_Lieux);
end if;
Enumeration_Type := Local_Type;
Text_Io.Put_Line ("end " & Boolean'Image (Syn_Ok));
Ok := Ok and Syn_Ok;
end Moyen;
procedure Lier_Lieux (Ok : in out Boolean) is
First_Place_Index, First_Direction_Index,
Second_Place_Index, Second_Direction_Index, Exit_Name_Index,
Enumeration_Type, Literal_Index, Field_Index : Natural;
Syn_Ok : Boolean := True;
begin
while Lex.Get_Token = Lie loop
Lex.Next;
Lieu (First_Place_Index, First_Direction_Index, Syn_Ok);
Text_Io.Put_Line (Complement_Array.Name (First_Place_Index));
Text_Io.Put_Line (Complement_Array.Name (First_Direction_Index));
Text_Io.Put_Line ("l l 1:" & Boolean'Image (Syn_Ok));
if Lex.Get_Token = A then
Lex.Next;
Lieu (Second_Place_Index, Second_Direction_Index, Syn_Ok);
Text_Io.Put_Line (Complement_Array.Name (Second_Place_Index));
Text_Io.Put_Line (Complement_Array.Name
(Second_Direction_Index));
Text_Io.Put_Line ("l l 2:" & Boolean'Image (Syn_Ok));
Moyen (Enumeration_Type, Literal_Index,
Exit_Name_Index, Syn_Ok);
Text_Io.Put_Line (Complement_Array.Name (Exit_Name_Index));
Text_Io.Put_Line (Integer'Image (Enumeration_Type));
Text_Io.Put_Line (Integer'Image (Literal_Index));
Text_Io.Put_Line ("l l 3:" & Boolean'Image (Syn_Ok));
if Syn_Ok then
Put_Line ("lien");
-- faire les verifications d'usage /= 0 !!
Complement_Array.Put_Exit
(First_Place_Index, Exit_Name_Index,
First_Place_Index, First_Direction_Index,
Second_Place_Index, Second_Direction_Index, Syn_Ok);
Text_Io.Put_Line ("l l 4:" & Boolean'Image (Syn_Ok));
if Syn_Ok then
Complement_Array.Put_Exit
(Second_Place_Index, Exit_Name_Index,
Second_Place_Index, Second_Direction_Index,
First_Place_Index, First_Direction_Index, Syn_Ok);
Text_Io.Put_Line ("l l 5:" & Boolean'Image (Syn_Ok));
if Syn_Ok then
Field_Identifier_Array.Put
(Identifier.From_String
(Complement_Array.Name
(First_Direction_Index)));
Field_Index := Field_Identifier_Array.Index
(Complement_Array.Name
(First_Direction_Index));
Complement_Array.Create_Enumerate_Field
(First_Place_Index, Field_Index, Syn_Ok);
Text_Io.Put_Line ("l l 6:" &
Boolean'Image (Syn_Ok));
if Syn_Ok then
Field_Identifier_Array.Put
(Identifier.From_String
(Complement_Array.Name
(Second_Direction_Index)));
Field_Index := Field_Identifier_Array.Index
(Complement_Array.Name
(Second_Direction_Index));
Complement_Array.Create_Enumerate_Field
(Second_Place_Index, Field_Index, Syn_Ok);
Text_Io.Put_Line ("l l 7:" &
Boolean'Image (Syn_Ok));
if Syn_Ok then
Complement_Array.Field_Put_Enumerate
(Second_Place_Index,
Field_Index, Enumeration_Type,
Literal_Index, Syn_Ok);
else
Syn_Ok := False;
Error4.Sem (Field_Belong,
Field_Identifier_Array.Image
(Field_Index));
end if;
else
Syn_Ok := False;
Error4.Sem (Field_Belong,
Field_Identifier_Array.Image
(Field_Index));
end if;
else
Syn_Ok := False;
Error4.Sem (An_Exit, Complement_Array.Name
(Second_Place_Index));
end if;
else
Syn_Ok := False;
Error4.Sem (An_Exit, Complement_Array.Name
(First_Place_Index));
end if;
end if;
else
Syn_Ok := False;
Error4.Syn (A, Follow_Lier_Lieux);
end if;
end loop;
Ok := Ok and Syn_Ok;
end Lier_Lieux;
procedure Liste_Groupes (Ok : in out Boolean) is
Id_List : Identifier_List.Object;
Iterator : Identifier_List.Iterator;
Complement_Index : Natural;
Group_Identifier : Identifier.Object;
Syn_Ok : Boolean := True;
begin
while Lex.Get_Token = Groupe loop
Lex.Next;
if Lex.Get_Token = Id then
Group_Identifier := Identifier.From_String
(Lex.Get_Lower_Case_Value);
if Complement_Array.Belong (Identifier.From_String
(Lex.Get_Lower_Case_Value)) then
Syn_Ok := False;
Error4.Sem (Group_Is_Complement, Lex.Get_Lower_Case_Value);
end if;
Lex.Next;
if Lex.Get_Token = Colon then
Lex.Next;
Liste_Identificateurs (Id_List, Syn_Ok);
if Syn_Ok then
Put_Line ("groupe");
Identifier_List.Init (Iterator, Id_List);
while not Identifier_List.Done (Iterator) loop
if Complement_Array.Belong
(Identifier_List.Value (Iterator)) then
Complement_Index :=
Complement_Array.Index
(Identifier.Image
(Identifier_List.Value (Iterator)));
Group_Array.Put (Group_Identifier,
Complement_Index, Syn_Ok);
else
Syn_Ok := False;
Error4.Sem (Complement_Not_Exist,
Identifier.Image
(Identifier_List.Value
(Iterator)));
end if;
-- tester si meme type ou si ce sont tous des sujets !!
--if not syn_ok then
-- syn_ok:=false;Error4.sem (Subject_exist_in_group, Identifier.Image -- est ce bien --utile ?
-- (Identifier_List.Value
-- (Iterator)));
-- end if;
Identifier_List.Next (Iterator);
end loop;
end if;
else
Syn_Ok := False;
Error4.Syn (Colon, Follow_Liste_Groupes);
end if;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Liste_Groupes);
end if;
end loop;
Ok := Ok and Syn_Ok;
end Liste_Groupes;
procedure Mouvement (Animate_List : in Identifier_List.Object;
Ok : in out Boolean) is
Syn_Ok : Boolean := True;
Iterator : Identifier_List.Iterator;
Place_Index, Number_Of_Repeat : Natural;
begin
if Lex.Get_Token = Id then
if Complement_Array.Belong (Identifier.From_String
(Lex.Get_Lower_Case_Value)) then
Place_Index := Complement_Array.Index
(Lex.Get_Lower_Case_Value);
if not Complement_Array.Is_A_Place
(Lex.Get_Lower_Case_Value) then
Syn_Ok := False;
Error4.Sem (Complement_Not_A_Place,
Complement_Array.Name (Place_Index));
end if;
else
Syn_Ok := False;
Error4.Sem (Complement_Not_Exist, Lex.Get_Lower_Case_Value);
end if;
Lex.Next;
if Lex.Get_Token = Colon then
Lex.Next;
if Lex.Get_Token = Number then
Number_Of_Repeat := Natural'Value
(Lex.Get_Lower_Case_Value);
Lex.Next;
if Number_Of_Repeat /= 0 then
Identifier_List.Init (Iterator, Animate_List);
while not Identifier_List.Done (Iterator) loop
if Complement_Array.Is_An_Animate
(Identifier.Image
(Identifier_List.Value (Iterator))) then
if Complement_Array.Is_A_Place
(Complement_Array.Name (Place_Index)) then
for I in 1 .. Number_Of_Repeat loop
Complement_Array.Put_Movement
(Identifier_List.Value (Iterator),
Place_Index);
end loop;
end if;
else
Syn_Ok := False;
Error4.Sem (Complement_Not_An_Animate,
Identifier.Image
(Identifier_List.Value
(Iterator)));
end if;
Identifier_List.Next (Iterator);
end loop;
else
Syn_Ok := False;
Error4.Sem (Number_Of_Repeat_Null, "");
end if;
else
Syn_Ok := False;
Error4.Syn (Number, Follow_Mouvement);
end if;
end if;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Mouvement);
end if;
Ok := Ok and Syn_Ok;
end Mouvement;
procedure Mouvements (Animate_List : in Identifier_List.Object;
Ok : in out Boolean) is
Syn_Ok : Boolean := True;
begin
Mouvement (Animate_List, Syn_Ok);
while Lex.Get_Token = Comma loop
Lex.Next;
Mouvement (Animate_List, Syn_Ok);
end loop;
Ok := Ok and Syn_Ok;
end Mouvements;
procedure Liste_Itineraires (Ok : in out Boolean) is
Animate_List : Identifier_List.Object;
An_Iterator : Identifier_List.Iterator;
Syn_Ok : Boolean := True;
begin
while Lex.Get_Token = Itineraire loop
Lex.Next;
Liste_Identificateurs (Animate_List, Syn_Ok);
if Lex.Get_Token = Colon then
Lex.Next;
Mouvements (Animate_List, Syn_Ok);
else
Syn_Ok := False;
Error4.Syn (Colon, Follow_Liste_Itineraires);
end if;
end loop;
Ok := Ok and Syn_Ok;
end Liste_Itineraires;
--procedure complement_detail (a_detail : in detail.object;a_complement : in string;ok : out boolean) is
--syn_ok : boolean := true;
--begin
--if complement_array.belong(a_complement) then
--detail.create_real_complement(a_detail,complement_array.index(a_complement));
--elsif group_array.belong(a_complement) then
--detail.create_group_complement(a_detail,order_list.complement_position(a_complement));.
--else
--syn_ok := false;
--error.sem (neither_a_complement_nor_a_group,a_complement);
--end if;
--ok :=Ok and syn_ok;
--end detail;
--procedure field_detail (a_detail : in detail.object;a_field:in string;ok : out boolean) is
--syn_ok : boolean := true;
--begin
--if field_identifier_array.belong(a_field) then
--detail.create_real_field(a_detail,field_identifier_array.index(a_field));
--elsif group_array.belong(a_field) then
--detail.create_group_field(a_detail,order_list.complement_position(a_field));
--else
--syn_ok := false;
--error.sem (neither_a_field_nor_a_group,a_field);
--end if;
--ok := syn_ok &
--end;
procedure Instructions_Simples (Ok : in out Boolean);
--procedure Instructions_Simples (ins_list : in out instruction_list.object;Ok : in out Boolean);
procedure Expression (Ok : in out Boolean);
--procedure Expression (an_expression: in out expression.object;
--enumeration_type : in natural;Ok : in out Boolean);
procedure Facteur (Ok : in out Boolean) is
--procedure facteur (an_expression: in out expression.object;
--enumeration_type : in natural;Ok : in out Boolean) is
--an_identifier : moving_string.object;
--an_attribute : attribute.object;
--an_objet : objet.object;
--a_detail : detail.object;
Syn_Ok : Boolean := True;
begin
case Lex.Get_Token is
when Opening_Bracket =>
Lex.Next;
Expression (Syn_Ok);
--Expression (an_expression,enumeration_type,syn_ok);
if Lex.Get_Token = Closing_Bracket then
Lex.Next;
else
Syn_Ok := False;
Error4.Syn (Closing_Bracket, Follow_Facteur);
end if;
when Id =>
--an_identifier := lex.get_lower_case_value;
Lex.Next;
if Lex.Get_Token = De then
Lex.Next;
--field_detail (a_detail,moving_string.image(an_identifier),syn_ok );
Objet (Syn_Ok);
--Objet (an_objet,syn_ok);
--if syn_ok then
--attribute.put(an_attribute,an_objet,a_detail);
--expression.create(an_expression,an_attribute);
--end if;
--else
--if enumeration.literal_belong(enumaration_type,
--moving_string(an_identifier)) then
--expression.create(an_expression,enumeration_type,
--enumeration_array.literal(enumeration_type,
--moving_string(an_identifier));
--else
--error.sem (literal_not_exist,moving_string(an_identifier));
--end if;
--probleme
end if;
when Number =>
--expression.create(an_expression,integer'value(lex.get_lower_case_value);
Lex.Next;
when others =>
Syn_Ok := False;
Error4.Syn (Facteur, Follow_Facteur);
end case;
Ok := Ok and Syn_Ok;
end Facteur;
procedure Terme (Ok : in out Boolean) is
--procedure terme (an_expression: in out expression.object;
--enumeration_type : in natural;Ok : in out Boolean) is
First_Terme : constant Token_To_Boolean_Array :=
Token_To_Boolean_Array'(Multiply .. Divide => True, others => False);
--left_expression : expression.object;
Syn_Ok : Boolean := True;
begin
Facteur (Syn_Ok);
--facteur(an_expression,syn_ok);
while First_Terme (Lex.Get_Token) loop
case Lex.Get_Token is
when Multiply =>
Lex.Next;
Facteur (Syn_Ok);
--facteur(left_expression,syn_ok);
--expression.create(an_expression,'*',an_expression,left_expression,syn_ok);
--if not syn_ok then
--error.sem(expression_not_same_type,"");
-- end if;
when Divide =>
Lex.Next;
Facteur (Syn_Ok);
--facteur(left_expression,syn_ok);
--expression.create(an_expression,'/',an_expression,left_expression,syn_ok);
--if not syn_ok then
--error.sem(expression_not_same_type,"");
--end if;
when others =>
null;
end case;
end loop;
Ok := Ok and Syn_Ok;
end Terme;
procedure Expression (Ok : in out Boolean) is
--procedure Expression (an_expression: in out expression.object;
--enumeration_type : in natural;Ok : in out Boolean) is
First_Expression : constant Token_To_Boolean_Array :=
Token_To_Boolean_Array'(Substract .. Add => True, others => False);
--left_expression : expression.object;
Syn_Ok : Boolean := True;
begin
Terme (Syn_Ok);
--Terme (an_expression,syn_ok);
while First_Expression (Lex.Get_Token) loop
case Lex.Get_Token is
when Add =>
Lex.Next;
Terme (Syn_Ok);
--Terme (left_expression,syn_ok);
--expression.create(an_expression,'+',an_expression,left_expression,syn_ok);
--if not syn_ok then
--error.sem(expression_not_same_type,"");
--end if;
when Substract =>
Lex.Next;
Terme (Syn_Ok);
--Terme (left_expression,syn_ok);
--expression.create(an_expression,'-',an_expression,left_expression,syn_ok);
--if not syn_ok then
--error.sem(expression_not_same_type,"");
--end if;
when others =>
null;
end case;
end loop;
Ok := Ok and Syn_Ok;
end Expression;
procedure Tests (Ok : in out Boolean) is
--procedure tests (a_condition: out condition.object;an_attribute: in attribute.object;
--enumeration_type;Ok : in out Boolean) is
--an_expression : expression.object;
Syn_Ok : Boolean := True;
begin
case Lex.Get_Token is
when Existe =>
Lex.Next;
if Lex.Get_Token = Pas then
--condition.create_attribute_exist(a_condition,an_attribute,no);
Lex.Next;
else
--condition.create_attribute_exist(a_condition,an_attribute,yes);
null;
end if;
when Equal | Not_Equal =>
Expression (Syn_Ok);
--Expression (an_expression,enumeration_type,syn_ok);
--if syn_ok then
--condition.create_compare(a_condition,an_attribute,
--compare_kind'value(token'image(lex.get_token)),an_expression,syn_ok);
-- tenir compte du syn_ok
--end if;
Lex.Next;
when Less | Greater | Greater_Equal | Less_Equal =>
Expression (Syn_Ok);
--Expression (an_expression,enumeration_type,syn_ok);
--if syn_ok then
--condition.create_compare(a_condition,an_attribute,
--compare_kind'value(token'image(lex.get_token)),an_expression,syn_ok);
-- tenir compte du syn_ok
--end if;
Lex.Next;
when others =>
Syn_Ok := False;
Error4.Syn (Tests, Follow_Suite_Condition_Forte);
end case;
Ok := Ok and Syn_Ok;
end Tests;
procedure Suite_Condition_Forte (Ok : in out Boolean) is
--procedure suite_condition_forte (a_condition: in out condition.object;an_identifier: in moving_string.object;Ok : in out Boolean) is
--an_attribute : attribute.object;
-- an_objet : objet.object;
-- a_detail : detail.object;
-- a_binary_kind : condition.binary_kind
Syn_Ok : Boolean := True;
begin
case Lex.Get_Token is
when De =>
--procedure field_detail (a_detail,moving_string.image(an_identifier),syn_ok );
Lex.Next;
Objet (Syn_Ok);
--Objet (an_objet,syn_ok);
--if syn_ok then
--attribute.put(an_attribute,an_objet,a_detail);
--end if;
--Tests(a_condition,an_attribute,
--attribute.enumeration(an_attribute),syn_ok);
Tests (Syn_Ok);
when Appartient =>
Lex.Next;
--complement_detail (a_detail,moving_string.image(an_identifier),syn_ok );
if Lex.Get_Token = Pas then
--a_binary_kind := no;
Lex.Next;
else
--a_binary_kind := yes
null;
end if;
if Lex.Get_Token = A then
Lex.Next;
Objet (Syn_Ok);
--Objet (an_objet,syn_ok);
--if syn_ok then
--condition.create_belong(a_condition,an_objet,a_detail,a_binary_kind));
--end if;
else
Syn_Ok := False;
Error4.Syn (A, Follow_Suite_Condition_Forte);
end if;
when Existe =>
Lex.Next;
--complement_detail (a_detail,moving_string.image(an_identifier),syn_ok );
if Lex.Get_Token = Pas then
--a_binary_kind := no;
Lex.Next;
else
null;
--a_binary_kinf := yes;
end if;
--if syn_ok then
--condition.create_subject_exist(a_condition,a_detail,a_binary_kind);
--end if;
when others =>
Syn_Ok := False;
Error4.Syn (Suite_Condition_Forte,
Follow_Suite_Condition_Forte);
end case;
Ok := Ok and Syn_Ok;
end Suite_Condition_Forte;
procedure Condition_Forte (Ok : in out Boolean) is
--procedure Condition_forte (a_condition: in out condition.object;Ok : in out Boolean) is
--an_objet : objet.object;
--a_number : integer;
Syn_Ok : Boolean := True;
begin
case Lex.Get_Token is
when Id =>
Lex.Next;
Suite_Condition_Forte (Syn_Ok);
--Suite_Condition_Forte (a_condition,lex.get_lower_case_value,syn_ok);
when Heros =>
Lex.Next;
if Lex.Get_Token = Equal then
Lex.Next;
if Lex.Get_Token = Id then
--procedure complement_detail (a_detail,lex.get_lower_case_value,syn_ok );
--if syn_ok then
-- condition.create_hero(a_condition,a_detail);
--end if;
Lex.Next;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Condition_Forte);
end if;
else
Syn_Ok := False;
Error4.Syn (Equal, Follow_Condition_Forte);
end if;
when Lieu =>
Lex.Next;
if Lex.Get_Token = Equal then
Lex.Next;
if Lex.Get_Token = Id then
--procedure complement_detail (a_detail,lex.get_lower_case_value,syn_ok );
--if syn_ok then
--condition.create_place(a_condition,a_detail);
--end if;
Lex.Next;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Condition_Forte);
end if;
else
Syn_Ok := False;
Error4.Syn (Equal, Follow_Condition_Forte);
end if;
when Number =>
--a_number:= integer'value(lex.get_lower_case_value);
--if number = 0 then
--error.sem (number_of_actions_null,"");
--else
--condition.create_actions(a_condition,a_number);
--end if;
Lex.Next;
if Lex.Get_Token = Actions then
Lex.Next;
if Lex.Get_Token = Passees then
Lex.Next;
else
Syn_Ok := False;
Error4.Syn (Passees, Follow_Condition_Forte);
end if;
else
Syn_Ok := False;
Error4.Syn (Actions, Follow_Condition_Forte);
end if;
when Rencontre =>
Lex.Next;
if Lex.Get_Token = Id then
--procedure complement_detail (a_detail,lex.get_lower_case_value,syn_ok );
--if syn_ok then
-- condition.create_meet(a_condition,a_detail);
--end if;
Lex.Next;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Condition_Forte);
end if;
when Issues =>
Lex.Next;
if Lex.Get_Token = De then
Lex.Next;
if Lex.Get_Token = Id then
--if complement_array.is_a_place(lex.get_lower_case_value) then
--objet.create_real(an_objet,complement_array.index(lex.get_lower_case_value));
--elsif group_array.belong(lex.get_lower_case_value) then
--objet.create_group(an_objet,order_list.complement_position(lex.get_lower_case_value));
--else
--syn_ok := false;
--error.sem (neither_a_place_nor_a_group,lex.get_lower_case_value);
--end if;
Lex.Next;
elsif Lex.Get_Token = Lieu then
--objet.create_place(an_objet);
Lex.Next;
if Lex.Get_Token = Existe then
Lex.Next;
if Lex.Get_Token = Pas then
Lex.Next;
--conditon.create_exits_exist(a_conditon,an_objet,no);
else
--conditon.create_exits_exist(a_conditon,an_objet,yes);
null;
end if;
else
Syn_Ok := False;
Error4.Syn (Existe, Follow_Condition_Forte);
end if;
else
Syn_Ok := False;
Error4.Syn (Identifier_Place, Follow_Condition_Forte);
end if;
else
Syn_Ok := False;
Error4.Syn (De, Follow_Condition_Forte);
end if;
when others =>
Syn_Ok := False;
Error4.Syn (Condition_Forte, Follow_Condition_Forte);
end case;
Ok := Ok and Syn_Ok;
end Condition_Forte;
procedure Condition_Faible (Ok : in out Boolean) is
--procedure Condition_faible (a_condition: in out condition.object;Ok : in out Boolean) is
First_Condition_Faible : constant Token_To_Boolean_Array :=
Token_To_Boolean_Array'(Et => True, others => False);
--left_condition : condition.object;
Syn_Ok : Boolean := True;
begin
Condition_Forte (Syn_Ok);
--Condition_Fort (a_condition,syn_ok);
while First_Condition_Faible (Lex.Get_Token) loop -- a simplifier
case Lex.Get_Token is
when Et =>
Lex.Next;
Condition_Forte (Syn_Ok);
--Condition_Forte (left_condition,syn_ok); --Condition.create (a_condition,et,a_condition,left_condition);
when others =>
null;
end case;
end loop;
Ok := Ok and Syn_Ok;
end Condition_Faible;
procedure Condition (Ok : in out Boolean) is
--procedure Condition (a_condition: in out condition.object;Ok : in out Boolean) is
First_Condition : constant Token_To_Boolean_Array :=
Token_To_Boolean_Array'(Ou => True, others => False);
-- ou ou bien et ?????
--left_condition : condition.object;
Syn_Ok : Boolean := True;
begin
Condition_Faible (Syn_Ok);
--Condition_Faible (a_condition,syn_ok);
while First_Condition (Lex.Get_Token) loop -- a simplifier
case Lex.Get_Token is
when Ou =>
Lex.Next;
Condition_Faible (Syn_Ok);
--Condition_Faible (left_condition,syn_ok);
--Condition.create (a_condition,ou,a_condition,left_condition);
when others =>
null;
end case;
end loop;
Ok := Ok and Syn_Ok;
end Condition;
procedure Si (Ok : in out Boolean) is
--procedure Si (ins_list: in out instruction_list.object;Ok : in out Boolean) is
--right_list,wrong_list : instruction_list_list;object;
-- peut etre mettre un := null_object;
--a_condition : condition.object;
Syn_Ok : Boolean := True;
begin
Condition (Syn_Ok);
--Condition (a_condition,syn_ok);
if Lex.Get_Token = Alors then
Lex.Next;
--Put_Line ("alors detecte");
Instructions_Simples (Syn_Ok);
--Instructions_Simples (right_list,syn_ok);
--Put_Line ("sinon possible");
if Lex.Get_Token = Sinon then
--Put_Line ("sinon detecte");
Lex.Next;
--Instructions_Simples (wrong_list,syn_ok);
Instructions_Simples (Syn_Ok);
end if;
--instruction_list.insert_if(ins_list,a_condition,right_list,wrong_list);
--Put_Line ("fin de sinon");
if Lex.Get_Token = Fin then
Lex.Next;
if Lex.Get_Token = Si then
Lex.Next;
else
Syn_Ok := False;
Error4.Syn (Si, Follow_Instruction_Simple);
end if;
else
Syn_Ok := False;
Error4.Syn (Fin, Follow_Instruction_Simple);
end if;
else
Syn_Ok := False;
Error4.Syn (Alors, Follow_Instruction_Simple);
end if;
Ok := Ok and Syn_Ok;
end Si;
procedure Change (Ok : in out Boolean) is
--procedure Change (ins_list: in out instruction_list.object;Ok : in out Boolean) is
--an_affectation : affectation.object;
--an_expression : expression.object;
--an_objet : objet.object;
--a_detail : detail.object;
Syn_Ok : Boolean := True;
begin
case Lex.Get_Token is
when Id =>
--procedure field_detail (a_detail ,lex.get_lower_case_value,syn_ok );
Lex.Next;
if Lex.Get_Token = De then
Lex.Next;
Objet (Syn_Ok);
--objet (an_objet,syn_ok);
-- if syn_ok then
--attribute.put(an_attribute,an_objet,a_detail);
--end if;
if Lex.Get_Token = En then
Lex.Next;
Expression (Syn_Ok);
--Expression (an_expression,
--attribute.enumeration(an_attribute),syn_ok);
--if syn_ok then
--affectation.create_attribute(an_affectation,an_attribute,an_expression);
--instruction_list.insert_change(ins_list,an_affectation);
--end if;
else
Syn_Ok := False;
Error4.Syn (En, Follow_Instruction_Simple);
end if;
else
Syn_Ok := False;
Error4.Syn (De, Follow_Instruction_Simple);
end if;
when Heros =>
Lex.Next;
if Lex.Get_Token = En then
Lex.Next;
if Lex.Get_Token = Id then
--complement_detail (a_detail,lex.get_lower_case_value,syn_ok );
--if syn_ok then
--affectation.create_hero(an_affectation,a_detail);
--instruction_list.insert_change(ins_list,an_affectation);
--end if;
Lex.Next;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Instruction_Simple);
end if;
else
Syn_Ok := False;
Error4.Syn (En, Follow_Instruction_Simple);
end if;
when Lieu =>
Lex.Next;
if Lex.Get_Token = En then
Lex.Next;
if Lex.Get_Token = Id then
--procedure complement_detail (a_detail,lex.get_lower_case_value,syn_ok );
--if syn_ok then
--affectation.create_place(an_affectation,a_detail);
--instruction_list.insert_change(ins_list,an_affectation);
--end if;
Lex.Next;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Instruction_Simple);
end if;
else
Syn_Ok := False;
Error4.Syn (En, Follow_Instruction_Simple);
end if;
when others =>
Syn_Ok := False;
Error4.Syn (Change, Follow_Instruction_Simple);
end case;
Ok := Ok and Syn_Ok;
end Change;
procedure Quoi_Afficher (Ok : in out Boolean) is
--procedure Quoi_Afficher (a_view:out view.object;Ok : in out Boolean) is
--an_objet : objet.object;
--a_detail : detail.object;
Syn_Ok : Boolean := True;
begin
case Lex.Get_Token is
when Right_Sentence =>
--view.create_sentence(a_view,identifier.from_string(lex.get_lower_case_value));
Lex.Next;
when Wrong_Sentence =>
Syn_Ok := False;
Error4.Syn (Wrong_Sentence, Follow_Quoi_Afficher);
when Number =>
--view.create_number(a_view,integer'value(lex.get_lower_case_value));
Lex.Next;
when Id =>
-- field_detail (a_detail,lex.get_lower_case_value,syn_ok );
Lex.Next;
if Lex.Get_Token = De then
Lex.Next;
Objet (Syn_Ok);
--Objet (an_objet,syn_ok);
--if syn_ok then
--attribute.put(an_attribute,an_objet,a_detail);
--view.create_attribute(a_view,an_attribute);
--end if;
end if;
when Nom =>
Lex.Next;
if Lex.Get_Token = De then
Lex.Next;
Objet (Syn_Ok);
--objet(an_objet,syn_ok);
--if syn_ok then
--view.create_name(a_view,an_objet);
--end if;
else
Syn_Ok := False;
Error4.Syn (De, Follow_Quoi_Afficher);
end if;
when Issue =>
Lex.Next;
if Lex.Get_Token = Id then
--complement_detail (a_detail,lex.get_lower_case_value,syn_ok );
--if syn_ok then
--view.create_exit(a_view,a_detail);
--end if;
Lex.Next;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Quoi_Afficher);
end if;
when Issues =>
--view.create_exits(a_view);
Lex.Next;
when Contenu =>
Lex.Next;
if Lex.Get_Token = De then
Lex.Next;
Objet (Syn_Ok);
--Objet (an_objet,syn_ok);
--if syn_ok then
--view.create_contents(a_view,an_objet);
-- end if;
else
Syn_Ok := False;
Error4.Syn (De, Follow_Quoi_Afficher);
end if;
when others =>
Syn_Ok := False;
Error4.Syn (Quoi_Afficher, Follow_Quoi_Afficher);
end case;
Ok := Ok and Syn_Ok;
end Quoi_Afficher;
procedure Liste_Affiche (Ok : in out Boolean) is
--procedure Liste_Affiche (ins_list:in out instruction_list.object;Ok : in out Boolean) is
First_Liste_Affiche : constant Token_To_Boolean_Array :=
Token_To_Boolean_Array'(Ampersand => True, others => False);
--display_list : view_list.object;
--a_view : view.object;
Syn_Ok : Boolean := True;
begin
Quoi_Afficher (Syn_Ok);
--Quoi_Afficher (a_view,syn_ok);
--if syn_ok then
--view_list.put(display_list,a_view);
--end if;
while (First_Liste_Affiche (Lex.Get_Token)) loop
case Lex.Get_Token is
when Ampersand =>
Lex.Next;
Quoi_Afficher (Syn_Ok);
--quoi_Afficher (a_view,syn_ok);
--if syn_ok then
--view_list.put(display_list,a_view);
--end if;
when others =>
null;
end case;
end loop;
Ok := Ok and Syn_Ok;
end Liste_Affiche;
procedure Ligne (Ok : in out Boolean) is
--procedure Ligne (ins_list: in out instruction_list.object;Ok : in out Boolean) is
Syn_Ok : Boolean := True;
begin
if Lex.Get_Token = Suivante then
Lex.Next;
--instruction_list.insert_next_line(ins_list);
else
Syn_Ok := False;
Error4.Syn (Suivante, Follow_Instruction_Simple);
end if;
Ok := Ok and Syn_Ok;
end Ligne;
procedure Bouge (Ok : in out Boolean) is
--procedure Bouge (ins_list: in out instruction_list.object;Ok : in out Boolean) is
Syn_Ok : Boolean := True;
begin
if Lex.Get_Token = Anime then
Lex.Next;
--instruction_list.insert_move(ins_list);
else
Syn_Ok := False;
Error4.Syn (Anime, Follow_Instruction_Simple);
end if;
Ok := Ok and Syn_Ok;
end Bouge;
--procedure instruction_put(ins_list: in out instruction_list.object;
--id_list:in identifier_list.object;an_objet : objet.object;ok : out boolean) is
--an_iterator: identifier_list.iterator;
--ind_list: index_list.object;
--syn_ok : boolean := true;
--begin
--identifier.init(an_iterator,id_list);
--while not identifier_list.done(an_iterator) loop
--if complement_array.belong(identifier.image(identifier_list.value(an_iterator))) then
--if complement_array.is_an_entity(identifier.image(identifier_list.value(an_iterator)))
--or complement_array.is_an_animate(identifier.image(identifier_list.value(an_iterator))) then
--index_list.put(ind_list,complement_array.index(identifier.image(identifier_list.value(an_iterator));
--else
--syn_ok := false;
--error.sem (complement_not_entity_or_animate,identifier.image(identifier_list.value(an_iterator)));
--end if;
--else
--syn_ok := false;
--error.sem (complement_not_exist,identifier.image(identifier_list.value(an_iterator)));
--end if;
--identifier_list.next(an_iterator);
--end loop;
--instruction_list.insert_put(ins_list,ind_list,an_objet);
-- Ok := Ok and syn_ok;
--end;
procedure Positionne (Ok : in out Boolean) is
--procedure Positionne (ins_list: in out instruction_list.object;Ok : in out Boolean) is
Id_List : Identifier_List.Object;
An_Iterator : Identifier_List.Iterator;
--ind_list: index_list.object;
--an_objet : objet.object;
Syn_Ok : Boolean := True;
begin
Liste_Identificateurs (Id_List, Syn_Ok);
if Lex.Get_Token = A then
Lex.Next;
Objet (Syn_Ok);
--objet (an_objet,syn_ok);
-- if syn_ok then
--instruction_put(ins_list,id_list,an_objet);
--end if;
else
Syn_Ok := False;
Error4.Syn (Dans, Follow_Instruction_Simple);
end if;
Ok := Ok and Syn_Ok;
end Positionne;
procedure Va (Ok : in out Boolean) is
--procedure va (ins_list : in out instruction_list.object;Ok : in out Boolean) is
--a_detail: detail.object;
Syn_Ok : Boolean := True;
begin
if Lex.Get_Token = Vers then
Lex.Next;
if Lex.Get_Token = Id then
--complement_detail (a_detail,lex.get_lower_case_value,syn_ok);
--if syn_ok then
--instruction_list.insert_go(ins_list,a_detail);
--end if;
Lex.Next;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Instruction_Simple);
end if;
else
Syn_Ok := False;
Error4.Syn (Vers, Follow_Instruction_Simple);
end if;
Ok := Ok and Syn_Ok;
end Va;
procedure Instructions_Simples (Ok : in out Boolean) is
--procedure Instructions_Simples (ins_list : in out instruction_list.object;Ok : in out Boolean) is
First_Instructions_Simples : constant Token_To_Boolean_Array :=
Token_To_Boolean_Array'(Si .. Va => True, others => False);
Id_List : Identifier_List.Object;
-- Display_List : View_List.Object;
Syn_Ok : Boolean := True;
--instructions simples peut etre vide !!!!!!!
begin
while First_Instructions_Simples (Lex.Get_Token) loop
case Lex.Get_Token is
when Si =>
Lex.Next;
Si (Syn_Ok);
--si(ins_list,syn_ok);
when Change =>
Lex.Next;
Change (Syn_Ok);
--change(ins_list,syn_ok);
when Affiche =>
Lex.Next;
Liste_Affiche (Syn_Ok);
--liste_affiche(ins_list,syn_ok);
when Ligne =>
Lex.Next;
Ligne (Syn_Ok);
--Ligne (ins_list,syn_ok);
when Bouge =>
Lex.Next;
Bouge (Syn_Ok);
--Bouge (ins_list,syn_ok);
when Positionne =>
Lex.Next;
Positionne (Syn_Ok);
--Positionne (ins_list,syn_ok);
when Retire =>
Lex.Next;
Liste_Identificateurs (Id_List, Syn_Ok);
--instruction_put(ins_list,id_list,objet.null_object);
when Termine =>
Lex.Next;
--instruction_list.insert_stop(ins_list);
when Va =>
Lex.Next;
Va (Syn_Ok);
--Va (ins_list,syn_ok);
when Efface =>
Lex.Next;
--instruction_list.insert_erase(ins_list);
when others =>
null;
Put_Line ("fin instructions simples");
end case;
end loop;
Ok := Ok and Syn_Ok;
end Instructions_Simples;
procedure Description_Ordre (Ok : in out Boolean) is
--procedure Description_Ordre (an_order : out order.object;Ok : in out Boolean) is
-- peut etre in out ?????
Syn_Ok : Boolean := True;
begin
if Lex.Get_Token = Id then
--order.put_first_complement(an_order,lex.get_lower_case_value);
Lex.Next;
if Lex.Get_Token = Id then
--order.put_second_complement(an_order,lex.get_lower_case_value);
Lex.Next;
end if;
if Lex.Get_Token = Id then
--order.put_third_complement(an_order,lex.get_lower_case_value);
Lex.Next;
end if;
if Lex.Get_Token = Id then
--order.put_fourth_complement(an_order,lex.get_lower_case_value);
Lex.Next;
end if;
if Lex.Get_Token = Id then
Syn_Ok := False;
Error4.Syn (Too_Many_Complements, Follow_Ordre);
end if;
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Ordre);
end if;
Ok := Ok and Syn_Ok;
end Description_Ordre;
procedure Liste_Description_Ordre (Ok : in out Boolean) is
--an_order : order.object;
Syn_Ok : Boolean := True;
begin
--order_list.free;
Description_Ordre (Syn_Ok);
--Description_Ordre (an_order,syn_ok);
--order_list.put(an_order,syn_ok);
--if not syn_ok then
--error.sem (order_exist,order.image(an_order));
--end if;
while Lex.Get_Token = Comma loop
Lex.Next;
Description_Ordre (Syn_Ok);
--Description_Ordre (an_order,syn_ok);
--order_list.put (an_order,syn_ok);
--if not syn_ok then
--error.sem (order_exist,order.image(an_order));
--end if;
end loop;
Ok := Ok and Syn_Ok;
end Liste_Description_Ordre;
--procedure fill_coded_order_array(ins_list : in instruction_list.object;
--a_place : in string) is
--an_order : order.object;
--begin
--order_list.init;
--while not order_list.done loop
--an_order := order_list.value;
--order_array.put_place(a_place);
--order_array.put_first_complement(order.complement
--(an_order,1));
--order_array.put_second_complement(order.complement
--(an_order,2));
--order_array.put_third_complement(order.complement
--(an_order,3));
--order_array.put_fourth_complement(order.complement
--(an_order,4));
--order_array.init;
--while not order_array.done loop
--an_order := (order_array.value);
--order.put_instruction(an_order,ins_list);
--order_array.put(an_order);
--order_array.next;
--end loop;
--order_list.next;
--end loop;
--end;
procedure Ordre (Ok : in out Boolean) is
--procedure Ordre (Ok : in out Boolean) is
--ins_list,common_ins_list : instruction.object;
A_Place : Moving_String.Object;
Syn_Ok : Boolean := True;
begin
Liste_Description_Ordre (Syn_Ok);
if Lex.Get_Token = Colon then
Lex.Next;
--Instructions_Simples (comon_ins_list,syn_ok);
Instructions_Simples (Syn_Ok);
if Lex.Get_Token = Pour then
Lex.Next;
if Lex.Get_Token = Id then
A_Place := Lex.Get_Lower_Case_Value;
Lex.Next;
Instructions_Simples (Syn_Ok);
--copy(common_ins_list,ins_list);
--Instructions_Simples (ins_list,syn_ok);
--fill_order_array(ins_list,moving_string.image(a_place));
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Ordre);
end if;
while Lex.Get_Token = Pour loop
Lex.Next;
if Lex.Get_Token = Id then
A_Place := Lex.Get_Lower_Case_Value;
Lex.Next;
Instructions_Simples (Syn_Ok);
--copy(common_ins_list,ins_list);
--Instructions_Simples (ins_list,syn_ok);
--fill_order_array(ins_list,moving_string.image(a_place));
else
Syn_Ok := False;
Error4.Syn (Id, Follow_Ordre);
end if;
end loop;
if Lex.Get_Token = Global then
Lex.Next;
Instructions_Simples (Syn_Ok);
--copy (common_ins_list,ins_list);
--Instructions_Simples (ins_list,syn_ok);
--fill_order_array(ins_list,"ailleurs");
end if;
else
Instructions_Simples (Syn_Ok);
--copy(common_ins_list,ins_list);
--Instructions_Simples (ins_list,syn_ok);
--fill_order_array(ins_list,ailleurs));
end if;
else
Syn_Ok := False;
Error4.Syn (Colon, Follow_Ordre);
end if;
if Syn_Ok then
Put_Line ("ordre");
end if;
Ok := Ok and Syn_Ok;
end Ordre;
procedure Fin_Quand (Ok : in out Boolean) is
Syn_Ok : Boolean := True;
begin
if Lex.Get_Token = Fin then
Lex.Next;
if Lex.Get_Token = Quand then
Lex.Next;
else
Syn_Ok := False;
Error4.Syn (Quand, Follow_Quand_Ordre);
end if;
else
Syn_Ok := False;
Error4.Syn (Fin, Follow_Quand_Ordre);
end if;
Ok := Ok and Syn_Ok;
end Fin_Quand;
procedure Quand_Ordre (Ok : in out Boolean) is
--ins_list : instruction_list.object;
Syn_Ok : Boolean := True;
begin
if Lex.Get_Token = Quand then
Lex.Next;
if Lex.Get_Token = Ordre then
Lex.Next;
if Lex.Get_Token = Vaut then
Lex.Next;
if Lex.Get_Token = Substract then
Lex.Next;
Ordre (Syn_Ok);
while Lex.Get_Token = Substract loop
Lex.Next;
Ordre (Syn_Ok);
end loop;
Fin_Quand (Syn_Ok);
if Syn_Ok then
Put_Line ("quand_ordre correct");
end if;
else
Syn_Ok := False;
Error4.Syn (Substract, Follow_Ordre);
end if;
else
Syn_Ok := False;
Error4.Syn (Vaut, Follow_Quand_Ordre);
end if;
else
Syn_Ok := False;
Error4.Syn (Ordre, Follow_Quand_Ordre);
end if;
else
Syn_Ok := False;
Error4.Syn (Quand, Follow_Quand_Ordre);
end if;
Ok := Ok and Syn_Ok;
end Quand_Ordre;
procedure Creation_Monde (Ok : in out Boolean) is
Syn_Ok : Boolean := True;
begin
Put_Line ("Lecture de la zone de creation ...");
while Lex.Get_Token in States and Lex.Get_Token >= In_Progress loop
case In_Progress is
when Aide =>
Aide (Syn_Ok);
when Message =>
Liste_Messages_Erreur (Syn_Ok);
when Enumere =>
Liste_Enumeres (Syn_Ok);
when Lien =>
Etats_Liens (Syn_Ok);
when Verbes =>
Liste_Verbes (Syn_Ok);
when Mots =>
Liste_Mots (Syn_Ok);
when Structure =>
Liste_Structures (Syn_Ok);
when Cree =>
Liste_Objets (Syn_Ok);
when Lie =>
Lier_Lieux (Syn_Ok);
when Itineraire =>
Liste_Itineraires (Syn_Ok);
when Groupe =>
Liste_Groupes (Syn_Ok);
when others =>
exit;
end case;
while Lex.Get_Token in States and Lex.Get_Token > In_Progress loop
In_Progress := States'Succ (In_Progress);
end loop;
end loop;
if not Lex.Is_At_End then
Put_Line ("in_progress : " & Token'Image (In_Progress));
end if;
Ok := Ok and Syn_Ok;
end Creation_Monde;
procedure Scenario (Ok : in out Boolean) is
--ins_list : instruction_list.object;
Syn_Ok : Boolean := True;
begin
if Lex.Get_Token = Introduction then
Lex.Next;
Put_Line ("Lecture de la zone d'introduction ...");
Instructions_Simples (Syn_Ok);
--Instructions_Simples (ins_list,syn_ok);
--introduction_instructions.put(ins_list);
end if;
if Lex.Get_Token = Scenario then
Lex.Next;
Put_Line ("Lecture de la zone de scenario ...");
--ins_list := instruction_list.null_object;
--Instructions_Simples (ins_list,syn_ok);
--pre_order_instructions.put(ins_list);
Instructions_Simples (Syn_Ok);
Quand_Ordre (Syn_Ok);
--ins_list := instruction_list.null_object;
--Instructions_Simples (ins_list,syn_ok);
--post_order_instructions.put(ins_list);
Instructions_Simples (Syn_Ok);
end if;
Ok := Ok and Syn_Ok;
end Scenario;
procedure Jeu_Aventure (Ok : in out Boolean) is
Syn_Ok : Boolean := True;
begin
loop
Creation_Monde (Syn_Ok);
--Scenario (syn_ok);
if not Lex.Is_At_End then
Syn_Ok := False;
Error4.Syn (Jeu_Aventure, Follow_Jeu_Aventure);
else
exit;
end if;
Put_Line ("redemarrage");
end loop;
Ok := Ok and Syn_Ok;
end Jeu_Aventure;
procedure Start is
Syn_Ok : Boolean := True;
begin
Lex.Initialize;
Jeu_Aventure (Syn_Ok);
Lex.Close;
if Syn_Ok then
Put_Line ("Program is Ok");
else
Put_Line ("Program is false");
end if;
Message_Array.Show;
Enumeration_Array.Show;
Complement_Array.Show;
Structure_Array.Show;
Field_Identifier_Array.Show;
--Group_Array.Show;
end Start;
end Syn4;
nblk1=85
nid=85
hdr6=d0
[0x00] rec0=18 rec1=00 rec2=01 rec3=030
[0x01] rec0=00 rec1=00 rec2=55 rec3=018
[0x02] rec0=18 rec1=00 rec2=52 rec3=07e
[0x03] rec0=16 rec1=00 rec2=3b rec3=01c
[0x04] rec0=1c rec1=00 rec2=5e rec3=00c
[0x05] rec0=1d rec1=00 rec2=39 rec3=030
[0x06] rec0=13 rec1=00 rec2=5f rec3=03e
[0x07] rec0=15 rec1=00 rec2=37 rec3=006
[0x08] rec0=19 rec1=00 rec2=7d rec3=032
[0x09] rec0=15 rec1=00 rec2=6d rec3=036
[0x0a] rec0=10 rec1=00 rec2=36 rec3=00e
[0x0b] rec0=15 rec1=00 rec2=60 rec3=020
[0x0c] rec0=14 rec1=00 rec2=35 rec3=04c
[0x0d] rec0=1e rec1=00 rec2=02 rec3=01a
[0x0e] rec0=18 rec1=00 rec2=4f rec3=06e
[0x0f] rec0=20 rec1=00 rec2=61 rec3=048
[0x10] rec0=02 rec1=00 rec2=7f rec3=012
[0x11] rec0=1b rec1=00 rec2=2b rec3=002
[0x12] rec0=1a rec1=00 rec2=5a rec3=090
[0x13] rec0=13 rec1=00 rec2=2e rec3=076
[0x14] rec0=1d rec1=00 rec2=49 rec3=036
[0x15] rec0=10 rec1=00 rec2=43 rec3=06a
[0x16] rec0=14 rec1=00 rec2=47 rec3=020
[0x17] rec0=1b rec1=00 rec2=1e rec3=002
[0x18] rec0=13 rec1=00 rec2=4b rec3=04c
[0x19] rec0=1f rec1=00 rec2=26 rec3=014
[0x1a] rec0=1c rec1=00 rec2=15 rec3=02c
[0x1b] rec0=01 rec1=00 rec2=57 rec3=034
[0x1c] rec0=1d rec1=00 rec2=03 rec3=014
[0x1d] rec0=00 rec1=00 rec2=3c rec3=00c
[0x1e] rec0=19 rec1=00 rec2=1d rec3=034
[0x1f] rec0=17 rec1=00 rec2=32 rec3=044
[0x20] rec0=1c rec1=00 rec2=0f rec3=02a
[0x21] rec0=17 rec1=00 rec2=27 rec3=002
[0x22] rec0=1b rec1=00 rec2=46 rec3=040
[0x23] rec0=21 rec1=00 rec2=62 rec3=010
[0x24] rec0=14 rec1=00 rec2=72 rec3=01c
[0x25] rec0=1c rec1=00 rec2=6a rec3=014
[0x26] rec0=19 rec1=00 rec2=77 rec3=00c
[0x27] rec0=16 rec1=00 rec2=25 rec3=028
[0x28] rec0=11 rec1=00 rec2=64 rec3=04e
[0x29] rec0=1a rec1=00 rec2=04 rec3=072
[0x2a] rec0=0d rec1=00 rec2=7e rec3=008
[0x2b] rec0=10 rec1=00 rec2=30 rec3=028
[0x2c] rec0=13 rec1=00 rec2=66 rec3=00e
[0x2d] rec0=0f rec1=00 rec2=12 rec3=066
[0x2e] rec0=0f rec1=00 rec2=50 rec3=05c
[0x2f] rec0=13 rec1=00 rec2=65 rec3=018
[0x30] rec0=08 rec1=00 rec2=05 rec3=00e
[0x31] rec0=18 rec1=00 rec2=67 rec3=04c
[0x32] rec0=11 rec1=00 rec2=4a rec3=01e
[0x33] rec0=16 rec1=00 rec2=07 rec3=016
[0x34] rec0=16 rec1=00 rec2=51 rec3=08a
[0x35] rec0=12 rec1=00 rec2=63 rec3=074
[0x36] rec0=14 rec1=00 rec2=53 rec3=05a
[0x37] rec0=20 rec1=00 rec2=48 rec3=048
[0x38] rec0=1b rec1=00 rec2=58 rec3=09c
[0x39] rec0=00 rec1=00 rec2=54 rec3=00e
[0x3a] rec0=1b rec1=00 rec2=68 rec3=066
[0x3b] rec0=1b rec1=00 rec2=44 rec3=046
[0x3c] rec0=17 rec1=00 rec2=56 rec3=012
[0x3d] rec0=1a rec1=00 rec2=23 rec3=018
[0x3e] rec0=17 rec1=00 rec2=6f rec3=092
[0x3f] rec0=18 rec1=00 rec2=3f rec3=064
[0x40] rec0=1d rec1=00 rec2=22 rec3=016
[0x41] rec0=18 rec1=00 rec2=40 rec3=02e
[0x42] rec0=1a rec1=00 rec2=6e rec3=00c
[0x43] rec0=17 rec1=00 rec2=20 rec3=0a4
[0x44] rec0=1d rec1=00 rec2=2f rec3=00e
[0x45] rec0=17 rec1=00 rec2=21 rec3=008
[0x46] rec0=15 rec1=00 rec2=08 rec3=06c
[0x47] rec0=19 rec1=00 rec2=73 rec3=010
[0x48] rec0=12 rec1=00 rec2=1f rec3=004
[0x49] rec0=14 rec1=00 rec2=70 rec3=078
[0x4a] rec0=1b rec1=00 rec2=1c rec3=002
[0x4b] rec0=1b rec1=00 rec2=6c rec3=05a
[0x4c] rec0=1b rec1=00 rec2=1b rec3=038
[0x4d] rec0=1b rec1=00 rec2=1a rec3=050
[0x4e] rec0=18 rec1=00 rec2=69 rec3=08a
[0x4f] rec0=15 rec1=00 rec2=19 rec3=03c
[0x50] rec0=16 rec1=00 rec2=09 rec3=00a
[0x51] rec0=1b rec1=00 rec2=18 rec3=040
[0x52] rec0=18 rec1=00 rec2=16 rec3=01c
[0x53] rec0=1a rec1=00 rec2=17 rec3=01c
[0x54] rec0=1b rec1=00 rec2=13 rec3=01c
[0x55] rec0=1d rec1=00 rec2=14 rec3=04c
[0x56] rec0=20 rec1=00 rec2=74 rec3=02e
[0x57] rec0=15 rec1=00 rec2=11 rec3=00a
[0x58] rec0=1e rec1=00 rec2=24 rec3=008
[0x59] rec0=19 rec1=00 rec2=6b rec3=040
[0x5a] rec0=1c rec1=00 rec2=4d rec3=042
[0x5b] rec0=19 rec1=00 rec2=10 rec3=03a
[0x5c] rec0=1a rec1=00 rec2=0e rec3=038
[0x5d] rec0=1f rec1=00 rec2=71 rec3=016
[0x5e] rec0=21 rec1=00 rec2=0d rec3=008
[0x5f] rec0=18 rec1=00 rec2=0c rec3=02c
[0x60] rec0=15 rec1=00 rec2=06 rec3=014
[0x61] rec0=21 rec1=00 rec2=75 rec3=01e
[0x62] rec0=1b rec1=00 rec2=41 rec3=048
[0x63] rec0=1e rec1=00 rec2=28 rec3=038
tail 0x21544cf6c8654a69bb0e7 0x42a00088462060003
Free Block Chain:
0x85: 0000 00 31 0d 00 2e 85 81 a0 05 c0 24 4c 00 84 0e 83 ┆ 1 . $L ┆
0x31: 0000 00 4c 01 80 80 15 78 2e 47 65 74 5f 54 6f 6b 65 ┆ L x.Get_Toke┆
0x4c: 0000 00 0b 00 05 80 02 6e 20 02 20 04 20 06 64 65 6e ┆ n den┆
0xb: 0000 00 0a 00 05 80 02 69 65 02 65 04 65 06 20 20 20 ┆ ie e e ┆
0xa: 0000 00 2d 10 00 35 03 81 c0 04 10 28 3a 00 50 10 80 ┆ - 5 (: P ┆
0x2d: 0000 00 59 00 0c 80 01 3b 01 00 05 20 20 20 20 20 05 ┆ Y ; ┆
0x59: 0000 00 76 00 f2 80 10 67 72 61 6d 20 69 73 20 66 61 ┆ v gram is fa┆
0x76: 0000 00 2c 00 05 80 02 20 20 02 00 43 db 50 c6 68 a1 ┆ , C P h ┆
0x2c: 0000 00 78 00 05 80 02 20 20 02 20 20 20 20 20 20 20 ┆ x ┆
0x78: 0000 00 79 00 06 80 03 20 20 20 03 00 00 00 01 3f ff ┆ y ? ┆
0x79: 0000 00 7a 00 04 80 01 3d 01 42 80 00 3d 14 c0 00 00 ┆ z = B = ┆
0x7a: 0000 00 29 00 05 80 02 74 3b 02 33 41 0a 00 01 d0 2a ┆ ) t; 3A *┆
0x29: 0000 00 7b 00 06 80 03 4c 69 65 03 20 20 20 20 20 20 ┆ { Lie ┆
0x7b: 0000 00 7c 00 04 80 01 4c 01 20 29 22 29 3b 07 00 27 ┆ | L )"); '┆
0x7c: 0000 00 33 00 04 80 01 3b 01 5f 49 6e 73 74 72 75 63 ┆ 3 ; _Instruc┆
0x33: 0000 00 34 00 05 80 02 5f 54 02 61 6c 75 65 20 28 49 ┆ 4 _T alue (I┆
0x34: 0000 00 38 00 07 80 04 61 6c 75 65 04 72 75 65 3b 09 ┆ 8 alue rue; ┆
0x38: 0000 00 45 03 fc 80 29 20 20 20 20 20 20 20 20 45 72 ┆ E ) Er┆
0x45: 0000 00 3a 03 fc 80 58 20 20 20 20 20 20 20 20 20 20 ┆ : X ┆
0x3a: 0000 00 3d 00 06 00 03 2d 2d 20 03 20 20 20 20 20 20 ┆ = -- ┆
0x3d: 0000 00 3e 00 0a 80 07 20 20 20 20 20 20 20 07 3b 09 ┆ > ; ┆
0x3e: 0000 00 81 00 3e 80 32 20 20 20 20 20 20 20 20 20 20 ┆ > 2 ┆
0x81: 0000 00 82 03 fc 80 1d 45 72 72 6f 72 34 2e 73 65 6d ┆ Error4.sem┆
0x82: 0000 00 4e 00 05 80 02 20 20 02 00 00 00 10 c6 52 21 ┆ N R!┆
0x4e: 0000 00 83 00 06 80 03 28 46 69 03 04 00 1d 20 20 20 ┆ (Fi ┆
0x83: 0000 00 84 00 04 80 01 20 01 0c 65 12 14 00 01 bb e3 ┆ e ┆
0x84: 0000 00 2a 00 05 80 02 20 20 02 00 00 00 00 00 00 06 ┆ * ┆
0x2a: 0000 00 5b 00 08 80 05 20 20 20 20 20 05 20 20 20 20 ┆ [ ┆
0x5b: 0000 00 00 00 15 80 12 20 20 20 20 20 20 20 20 20 20 ┆ ┆