DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦6255277b6⟧ TextFile

    Length: 1673 (0x689)
    Types: TextFile
    Names: »B«

Derivation

└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Scanner;
with Object;
with Value;

package body Expression is

    type Node_Structure is
        record
            Rule : Natural range 0 .. 1 := 0;
            Val : Value.Node := Value.Empty_Node;
            Ident : Object.Unary;
        end record;

    procedure Parse (N : in out Node; Error : out Boolean) is
        Failed : Boolean := False;
        use Scanner;
    begin  
        N := new Node_Structure;
        if Value.Is_First (Scanner.Get_Token) then
            N.Rule := 0;
            Value.Parse (N.Val, Failed);
        else
            case Scanner.Get_Token is
                when Scanner.Pour =>
                    N.Rule := 1;
                    Scanner.Next;
                    N.Ident := Scanner.Get_Value;
                    Scanner.Next;
                    if Scanner.Get_Token = Scanner.Prendre then
                        Scanner.Next;
                        Value.Parse (N.Val, Failed);
                    end if;
                when others =>
                    null;
            end case;
        end if;
        Error := Failed;
    end Parse;

    function Is_First (T : Scanner.Token) return Boolean is
        use Scanner;
    begin
        return T = Pour or else Value.Is_First (T);
    end Is_First;

    function Interpret (N : Node) 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);
                -- remplir la hash avec n.identfier et result
        end case;
        return Result;
    end Interpret;
end Expression;