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

⟦a84a587b7⟧ TextFile

    Length: 1767 (0x6e7)
    Types: TextFile
    Names: »B«

Derivation

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

TextFile

with Arguments;  
with Block_Class;
with Errors;
with Statements;  
with Trace;
with Unparser;

package body Block is

    type Node_Structure is
        record
            Line : Natural;
            Stat : Statements.Node := Statements.Empty_Node;
        end record;

    procedure Parse (N : in out Node) is  
    begin
        Trace.Display ("parsing Block");
        N := new Node_Structure;
        N.Line := Scanner.Get_Line_Number;
        case Scanner.Get_Token is
            when Scanner.L_Obra =>
                Scanner.Next_Token;
                Arguments.Parse;
                Statements.Parse (N.Stat);
                case Scanner.Get_Token is
                    when Scanner.L_Cbra =>  
                        Block_Class.Close;
                        Scanner.Next_Token;
                    when others =>
                        raise Errors.Expecting_Closing_Brace;
                end case;
            when others =>
                raise Errors.Expecting_Opening_Brace;
        end case;
    end Parse;

    procedure Unparse (N : Node; Block_Obj : Object.Reference) is
    begin  
        Unparser.New_Right ("{ ");
        Unparser.New_Line;
        Block_Class.Unparse (Block_Obj);
        Statements.Unparse (N.Stat);
        Unparser.New_Left ("} ");
        Unparser.New_Line;
        Trace.Display ("fin unparse block");
    end Unparse;

    function Is_First (T : Scanner.Token) return Boolean is
        use Scanner;
    begin
        return T = Scanner.L_Obra;
    end Is_First;

    function Interpret (N : Node) return Object.Reference is
    begin
        Errors.Save_Interpret_Line (N.Line);
        return Statements.Interpret (N.Stat);
        Trace.Display ("fin interpretation Block");
    end Interpret;

end Block;