text
stringlengths
0
234
Next_Char;
N_Params := N_Params + 1;
Parameters (N_Params) := Parse_Expr;
end loop;
end if;
Expect (')');
Fine;
exception
when others =>
for I in Parameters'First .. N_Params - 1 loop
Free (Parameters (I));
end loop;
raise;
end Parse_Parameter_List;
procedure Resolve_Identifier (Raw_ID : in Identifier;
Pos : out ID_Tables.Cursor;
N_Matches : out Natural;
Resolved : out Identifier;
No_Prefix_Needed : out Boolean)
with Post =>
(
(ID_Tables."=" (Pos, ID_Tables.No_Element) = (N_Matches = 0))
);
procedure Resolve_Identifier (Raw_ID : in Identifier;
Pos : out ID_Tables.Cursor;
N_Matches : out Natural;
Resolved : out Identifier;
No_Prefix_Needed : out Boolean)
is
use ID_Tables;
begin
No_Prefix_Needed := False;
N_Matches := 0;
Pos := ID_Table.T.Find (Raw_ID);
if Pos /= No_Element then
Resolved := Raw_ID;
No_Prefix_Needed := True;
N_Matches := 1;
end if;
declare
Tmp : Identifier;
begin
for I in Prefix_List'Range loop
Tmp := Join (Prefix_List (I), Raw_ID);
Pos := ID_Table.T.Find (Tmp);
if Pos /= No_Element then
N_Matches := N_Matches + 1;
if N_Matches = 1 then
Resolved := Tmp;
end if;
end if;
end loop;
Function Definition: procedure Do_Checks is
Function Body: new Do_Suite (Test_Case => Test_Case,
Test_Case_Array => Test_Case_Array,
Check => Check);
type Syntax_ID_Case is
record
Expr : Unbounded_String;
Action : Unknown_ID_Action_Type;
Success : Boolean;
end record;
type Syntax_ID_Case_Array is
array (Positive range <>) of Syntax_ID_Case;
Syntax_Cases : constant Syntax_ID_Case_Array :=
((Expr => +"4*foo",
Action => Die,
Success => False),
(Expr => +"4*foo",
Action => OK,
Success => True),
(Expr => +"4*foo()",
Action => Accept_As_Var,
Success => False),
(Expr => +"4*bar(2,3) + pippo",
Action => Die,
Success => True),
(Expr => +"4*pippo(2,3)",
Action => OK,
Success => False),
(Expr => +"4*bar",
Action => OK,
Success => False),
(Expr => +"4*bar(2)",