text
stringlengths
0
234
Right : constant Nodes.Tokens.Token_Access :=
Node.Last_Token (Previous);
Next : constant Nodes.Tokens.Token_Access :=
Right.Next_Token (Previous);
begin
-- Check if lexical analysis cross right edge of Node
if Right.Get_Flag (Nodes.Need_Analysis) and
(Next not in null and then
Next.Get_Flag (Nodes.Need_Analysis))
then
return False;
end if;
Function Definition: procedure Right_Breakdown is
Function Body: Node : Nodes.Node_Access;
Limit : constant Natural := Stack.Top - 1;
begin
loop
Pop (Stack, State, Node);
exit when Node.Is_Token;
for J in 1 .. Node.Arity loop
Do_Shift (Node.Child (J, Now));
end loop;
if Stack.Top = Limit then
-- Empty subtree was on the top of the stack
return;
end if;
end loop;
Do_Shift (Node);
end Right_Breakdown;
Verify : Boolean := False;
Lexing : Boolean := False;
EOF : Boolean := False;
Term : Nodes.Tokens.Token_Access;
LA : access Nodes.Node'Class := Document.Start_Of_Stream;
Next : Action;
begin
Document.Start_Of_Stream.Set_Text
(League.Strings.Empty_Universal_String);
Document.End_Of_Stream.Set_Text
(League.Strings.Empty_Universal_String);
Lexer.Prepare_Document (Document, Reference);
Clear (Stack);
Push (Stack, State, Nodes.Node_Access (Document.Start_Of_Stream));
if not LA.Get_Flag (Nodes.Need_Analysis) then
LA := LA.Next_Subtree (Reference);
end if;
loop
if LA.Is_Token then
if not Lexing
and then LA.Get_Flag (Nodes.Need_Analysis)
and then not EOF
then
Term := Lexer.First_New_Token (Nodes.Tokens.Token_Access (LA));
LA := Term;
Lexing := True;
else
Term := Nodes.Tokens.Token_Access (LA);
end if;
Next := Next_Action (State, Term.Kind);
case Next.Kind is
when Finish =>
if Term.Kind = 0 then -- End_Of_Stream
declare
Node : Nodes.Node_Access;
begin
Pop (Stack, State, Node);
Document.Ultra_Root.Set_Child (2, Node);
return;
Function Definition: overriding function Exists
Function Body: (Self : Node_With_Exist;
Time : Version_Trees.Version) return Boolean is
begin
return Versioned_Booleans.Get (Self.Exist, Time);
end Exists;
-----------------
-- Child_Index --
-----------------
function Child_Index
(Self : Node'Class;
Child : Constant_Node_Access;
Time : Version_Trees.Version) return Natural is
begin
for J in 1 .. Self.Arity loop
if Constant_Node_Access (Self.Child (J, Time)) = Child then