|
|
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 - metrics - download
Length: 7168 (0x1c00)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Expression, seg_0360c5, seg_036394, seg_036902
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦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;
nblk1=6
nid=6
hdr6=8
[0x00] rec0=1d rec1=00 rec2=01 rec3=044
[0x01] rec0=22 rec1=00 rec2=04 rec3=036
[0x02] rec0=1a rec1=00 rec2=03 rec3=032
[0x03] rec0=0b rec1=00 rec2=05 rec3=000
[0x04] rec0=0b rec1=00 rec2=05 rec3=000
[0x05] rec0=0a rec1=00 rec2=02 rec3=001
tail 0x21732f66e84dd7ff026a1 0x42a00088462060003
Free Block Chain:
0x6: 0000 00 02 00 04 80 01 68 01 02 03 04 05 06 07 08 09 ┆ h ┆
0x2: 0000 00 00 01 0d 80 2a 70 79 20 28 53 6f 75 72 63 65 ┆ *py (Source┆