|
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 - download
Length: 7168 (0x1c00) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Expression, seg_03b226, seg_03b22e
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦this⟧
with Bounded_String; with Error_Broadcaster; with Lex; with Object; with Value; with Bloc_Class; with Unparser; package body Expression is type Node_Structure is record Rule : Natural range 0 .. 1 := 0; Val : Value.Node := Value.Empty_Node; Ident : Object.Message; end record; procedure Parse (N : in out Node; Error : out Boolean) is Failed : Boolean := False; Ident_Error : Object.Message; begin N := new Node_Structure; Bounded_String.Copy (Ident_Error, Lex.Get_Value); if Value.Is_First (Lex.Get_Token) then N.Rule := 0; Value.Parse (N.Val, Failed); else case Lex.Get_Token is when Lex.Pour => N.Rule := 1; Lex.Next_Token; case Lex.Get_Token is when Lex.Identifier => Bounded_String.Copy (N.Ident, Lex.Get_Value); Bloc_Class.Put (N.Ident); Lex.Next_Token; case Lex.Get_Token is when Lex.Prendre => Lex.Next_Token; if Value.Is_First (Lex.Get_Token) then Value.Parse (N.Val, Failed); else raise Error_Broadcaster. Unexpected_Token; end if; when others => raise Error_Broadcaster.Prendre_Is_Missing; end case; when others => Failed := True; raise Error_Broadcaster.Identifier_Is_Missing; end case; when others => Failed := True; Error_Broadcaster.Unexpectedtoken (Lex.Get_Line); raise Error_Broadcaster.Expression_Is_Missing; end case; end if; Error := Failed; exception when Error_Broadcaster.Pour_Is_Missing => Error_Broadcaster.Pour_Missing (Lex.Get_Line); N.Rule := 1; Bounded_String.Copy (N.Ident, Ident_Error); Bloc_Class.Put (N.Ident); Lex.Next_Token; Value.Parse (N.Val, Failed); Error := Failed; when Error_Broadcaster.Prendre_Is_Missing => Error_Broadcaster.Prendre_Missing (Lex.Get_Line); Value.Parse (N.Val, Failed); Error := Failed; end Parse; procedure Unparse (N : Node) is begin case N.Rule is when 0 => Value.Unparse (N.Val); when 1 => Unparser.Put ("pour "); Unparser.Put (Bounded_String.Image (N.Ident)); Unparser.Put (" prendre "); Value.Unparse (N.Val); end case; end Unparse; function Is_First (T : Lex.Token) return Boolean is use Lex; begin return T = Lex.Pour or else Value.Is_First (T); end Is_First; function Interpret (N : Node; Inherited : Object.Reference := Object.Void_Reference) return Object.Reference is Result : Object.Reference; begin case N.Rule is when 0 => Result := Value.Interpret (N.Val); when 1 => Result := Value.Interpret (N.Val); Bloc_Class.Set (N.Ident, Result); end case; return Result; end Interpret; end Expression;
nblk1=6 nid=6 hdr6=a [0x00] rec0=21 rec1=00 rec2=01 rec3=02e [0x01] rec0=00 rec1=00 rec2=04 rec3=002 [0x02] rec0=11 rec1=00 rec2=05 rec3=084 [0x03] rec0=1c rec1=00 rec2=03 rec3=026 [0x04] rec0=22 rec1=00 rec2=02 rec3=000 [0x05] rec0=42 rec1=5f rec2=42 rec3=3ec tail 0x21533c0f0851573120c5e 0x42a00088462060003 Free Block Chain: 0x6: 0000 00 00 00 2a 80 11 65 78 74 5f 49 6f 2e 50 75 74 ┆ * ext_Io.Put┆