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: 3143 (0xc47) Types: TextFile Names: »B«
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11 └─ ⟦129cab021⟧ »DATA« └─⟦this⟧
with Value, Scanner, Object, Message, Symbol, String_Class, Printer, Bug, Table, Block; package body Expression is type Node_Structure is record Rule : Natural range 0 .. 1 := 0; Iden : Message.Tiny_String; Val : Value.Node := Value.Empty_Node; Line : Natural; end record; procedure Parse (N : in out Node) is use Scanner; A_Object : Object.Reference; Object_Exist : Boolean; begin N := new Node_Structure; N.Line := Scanner.Get_Line_Number; if Scanner.Get_Token = Scanner.T_Pour then N.Rule := 0; Scanner.Next; N.Iden := Scanner.Get_Value; Table.Find (The_Table => Block.Symbol (Block.Current), Name => N.Iden, New_Reference => A_Object, Success => Object_Exist); if not Object_Exist then Symbol.Insert (N.Iden, Object.Void_Reference); end if; Scanner.Next; if Scanner.Get_Token = T_Prendre then Scanner.Next; Value.Parse (N.Val); else raise Bug.Missing_Reserved_Word; end if; else N.Rule := 1; Value.Parse (N.Val); end if; end Parse; procedure Unparse (N : in Node) is begin Scanner.Set_Line_Number (N.Line); case N.Rule is when 0 => Printer.Write ("pour"); Printer.Write (N.Iden); Printer.Write ("prendre"); Value.Unparse (N.Val); when 1 => Value.Unparse (N.Val); end case; end Unparse; function Is_First (T : Scanner.Token) return Boolean is use Scanner; begin case T is when Scanner.T_Pour | Scanner.T_Integer | Scanner.T_Identifier | Scanner.T_Parenthese_Open | Scanner.T_Block_Open | Scanner.T_String => return (Standard.True); when others => return (Standard.False); end case; end Is_First; function Interpret (N : Node) return Object.Reference is Result, A_Object : Object.Reference; begin Scanner.Set_Line_Number (N.Line); case N.Rule is when 0 => Result := Value.Interpret (N.Val); A_Object := Symbol.Eval (N.Iden); case Object.Get_Class (A_Object) is when Object.String_Class => String_Class.Remove (A_Object); when Object.Date_Class => raise Bug.Unexpected_Action_On_Date; when others => null; end case; Object.Copy (Source => Result, Target => A_Object); Symbol.Insert (N.Iden, A_Object); when 1 => Result := Value.Interpret (N.Val); end case; return Result; end Interpret; end Expression;