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: 3458 (0xd82) Types: TextFile Names: »B«
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11 └─ ⟦129cab021⟧ »DATA« └─⟦this⟧
with Bounded_String; with Error_Broadcaster; with Lex; with Object; with Value; with Bloc_Class; with Text_Io; 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; 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;