|
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: 3072 (0xc00) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Expression, seg_03798e
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« └─⟦this⟧
with Lex, Error, Symbol, Debug; with Term; package body Expression is procedure Parse (N : in out Binary_Tree.Node; Success : in out Boolean) is N1, N2 : Binary_Tree.Node; Ok : Boolean := True; begin N1 := new Binary_Tree.Node_Structure; N := N1; Success := True; Term.Parse (N1.Left_Son, Ok); while (Lex.Current_Token_In ((Lex.Plus, Lex.Minus))) loop N2 := new Binary_Tree.Node_Structure; N1.Right_Son := N2; case Lex.Get is when Lex.Plus => Debug.Put (530); Lex.Next; N1.The_Type := Binary_Tree.Add_Type; Term.Parse (N2.Left_Son, Ok); Success := Success and Ok; when Lex.Minus => Debug.Put (531); Lex.Next; N1.The_Type := Binary_Tree.Sub_Type; Term.Parse (N2.Left_Son, Ok); Success := Success and Ok; when others => Error.Append (2); Success := False; end case; N1 := N2; end loop; end Parse; procedure Generate (N : in out Binary_Tree.Node; The_Value : out Natural) is Value1, Value2 : Natural; begin Term.Generate (N.Left_Son, Value1); case N.The_Type is when Binary_Tree.Add_Type => Term.Generate (N.Right_Son.Left_Son, Value2); The_Value := Value1 + Value2; when Binary_Tree.Sub_Type => Term.Generate (N.Right_Son.Left_Son, Value2); The_Value := Value1 - Value2; when others => The_Value := Value1; end case; end Generate; end Expression;
nblk1=2 nid=0 hdr6=4 [0x00] rec0=1c rec1=00 rec2=01 rec3=022 [0x01] rec0=1d rec1=00 rec2=02 rec3=001 tail 0x2173520be84e54ede2b01 0x42a00088462060003