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 - downloadIndex: ┃ B T ┃
Length: 4618 (0x120a) Types: TextFile Names: »B«
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11 └─ ⟦129cab021⟧ »DATA« └─⟦this⟧
with Statements, Arguments; with Class_Block; with Bug_Report; package body Block is type Node_Structure is record Table : Symbols.Table := Symbols.Create; Kwd : Message.Unary; Ident : Message.Unary; Stat : Statements.Node := Statements.Empty_Node; Parent : Block.Node := Block.Empty_Node; end record; Current_Node : Block.Node; Ghost : Object.Reference; function Get_Ident (N : Node) return Message.Unary is begin return N.Ident; end Get_Ident; function Get_Kwd (N : Node) return Message.Unary is begin return N.Kwd; end Get_Kwd; function Get_Table (N : Node) return Symbols.Table is begin return N.Table; end Get_Table; procedure Put_Table (This_Object : Object.Reference; Named : Object.Tiny_String; Into : in out Node) is begin Symbols.Put (This_Object, Named, Into.Table); end Put_Table; procedure Get_From_Table (Object_Named : Object.Tiny_String; From_Block : Node; Into : in out Object.Reference; Status : out Boolean) is Block_Node : Node := From_Block; Success : Boolean := False; begin while not Success and then Block_Node /= Empty_Node loop Symbols.Get (Object_Named => Object_Named, From_Table => Block_Node.Table, Into => Into, Status => Success); if not Success then Block_Node := Block_Node.Parent; end if; end loop; Status := Success; end Get_From_Table; procedure Put_Into_Table (This_Object : Object.Reference; Named : Object.Tiny_String; Into_Block : in out Node) is Block_Node : Node := Into_Block; Success : Boolean := False; Result : Object.Reference; begin while not Success and then Block_Node /= Empty_Node loop Symbols.Get (Object_Named => Named, From_Table => Block_Node.Table, Into => Result, Status => Success); if not Success then Block_Node := Block_Node.Parent; end if; end loop; if Block_Node = Empty_Node and Block_Node /= Into_Block then Symbols.Put (This_Object, Named, Into_Block.Table); else Symbols.Put (This_Object, Named, Block_Node.Table); end if; end Put_Into_Table; function Get_Current_Node return Node is begin return Current_Node; end Get_Current_Node; function Get_Current_Table return Symbols.Table is begin return Current_Node.Table; end Get_Current_Table; procedure Put_Current_Table (This_Object : Object.Reference; Named : Object.Tiny_String) is begin Symbols.Put (This_Object, Named, Current_Node.Table); end Put_Current_Table; function Get_Parent (N : Node) return Node is begin return N.Parent; end Get_Parent; function Is_Nil (N : Node) return Boolean is begin return N = Empty_Node; end Is_Nil; procedure Parse (N : in out Node) is use Scanner; begin N := new Node_Structure; N.Parent := Current_Node; Current_Node := N; if Scanner.Get_Token = Scanner.Open_Brace then Scanner.Next; Arguments.Parse (N.Ident, N.Kwd); Statements.Parse (N.Stat); if Scanner.Get_Token = Scanner.Close_Brace then Scanner.Next; else raise Bug_Report.Brace_Is_Missing; end if; Current_Node := N.Parent; else raise Bug_Report.Unexpected_Token; end if; end Parse; function Is_First (T : Scanner.Token) return Boolean is use Scanner; begin return T = Open_Brace; end Is_First; function Interpret (N : Node) return Object.Reference is Result : Object.Reference := Object.Void_Reference; Node : Block.Node := Block.Current_Node; begin Current_Node := N; Result := Statements.Interpret (N.Stat); Current_Node := Node; return Result; end Interpret; begin Current_Node := new Node_Structure; Ghost := Class_Block.Create (Block.Get_Current_Node); end Block;