DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦16df605ce⟧ TextFile

    Length: 2511 (0x9cf)
    Types: TextFile
    Names: »B«

Derivation

└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Bounded_String;
with Msg_Report;
with Scanner;
with Symbol_Table;
with Object;

procedure Test_Scanner is

    use Scanner;
    use Object;

    Num_Value : Integer := 1;

    Receive_Token : Scanner.Token;
    Receive_Value : Scanner.B_String;

    Name, Ident : Scanner.B_String;
    Content : Object.Reference;


begin
    Msg_Report.Tracing_On;
    Scanner.Open ("lex");
    Symbol_Table.Create;

    Scanner.Next;
    Receive_Token := Scanner.Symbol;
    Bounded_String.Copy (Receive_Value, Scanner.Value);
    Msg_Report.Continue ("Value : " & Bounded_String.Image (Receive_Value));

    while Receive_Token /= L_Eof loop

        case Receive_Token is
            when L_Identifier =>
                if Scanner.Value = "mettrei" then
                    Content := Object.Create (C_Integer, 20);
                    Bounded_String.Copy (Ident, "i");
                    Symbol_Table.Set_Info (Ident, Content);

                else
                    Bounded_String.Copy (Ident, Scanner.Value);
                    Symbol_Table.Insert (Ident, Object.Void_Reference);

                    if Scanner.Value = "i" then
                        Content := Object.Create (C_Integer, Num_Value);
                    end if;
                    if Scanner.Value = "chaine" then
                        Content := Object.Create (C_String, Num_Value);
                    end if;
                    if Scanner.Value = "tortue" then
                        Content := Object.Create (C_Turtle, Num_Value);
                    end if;
                    if Scanner.Value = "j" then
                        Content := Object.Create (C_Integer, Num_Value);
                    end if;
                    if Scanner.Value = "k" then
                        Content := Object.Create (C_Integer, Num_Value);
                    end if;

                    Symbol_Table.Set_Info (Ident, Content);

                    Num_Value := Num_Value + 1;
                end if;
            when L_Open_Bracket =>
                Symbol_Table.New_Enter (Name);

            when L_Close_Bracket =>
                Symbol_Table.Leave;

            when others =>
                null;

        end case;

        Scanner.Next;
        Receive_Token := Scanner.Symbol;
        Bounded_String.Copy (Receive_Value, Scanner.Value);
        Msg_Report.Continue ("Value : " & Bounded_String.Image (Receive_Value));

    end loop;

    Symbol_Table.Image_Table;

    Msg_Report.Information ("C'EST FINI !!!");

end Test_Scanner;