|
|
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 - metrics - downloadIndex: B T
Length: 3675 (0xe5b)
Types: TextFile
Names: »B«
└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
└─⟦5cb1d1d7f⟧ »DATA«
└─⟦3b1ee7bd8⟧
└─⟦this⟧
separate (Compilation_Unit.Produce_Metrics)
procedure Case_Statement
(Current_Compilation_Unit : in out Ada_Compilation_Unit;
Program_Unit : in Program_Unit_State_Machine;
Halstead : in Halstead_State_Machine;
Loc : in Loc_State_Machine;
Mccabe : in Mccabe_State_Machine) is
--=====================================================================
-- CASE_Statement ::=
-- "CASE" Expression "IS"
-- Case_Statement_Alternative { Case_Statement_Alternative }
-- "END" "CASE" ";"
--=====================================================================
Current_Token : Token_Package.Token;
No_More_Case_Alternatives : Boolean := False;
begin
-- CASE_Statement
Get_Next_Token (Out_Token => Current_Token,
From => Current_Compilation_Unit,
Current_Loc => Loc);
if "/=" (Token_Package.Value_Of (Current_Token),
Token_Package.Case_Token) then
raise Syntax_Error;
end if;
-- until "IS" is found
Expression (Current_Compilation_Unit => Current_Compilation_Unit,
Program_Unit => Program_Unit,
Halstead => Halstead,
Loc => Loc,
Mccabe => Mccabe,
Terminate_Tokens =>
Set_Of_Tokens'(1 => Token_Package.Is_Token));
Get_Next_Token (Out_Token => Current_Token,
From => Current_Compilation_Unit,
Current_Loc => Loc);
if "/=" (Token_Package.Value_Of (Current_Token),
Token_Package.Is_Token) then
raise Syntax_Error;
end if;
Process_Case_Statement_Alternatives:
-- repeat for every alternative
loop
Case_Statement_Alternative
(Current_Compilation_Unit => Current_Compilation_Unit,
Program_Unit => Program_Unit,
Halstead => Halstead,
Loc => Loc,
Mccabe => Mccabe);
if "/=" (Token_Package.Value_Of
(Peek (From => Current_Compilation_Unit)),
Token_Package.When_Token) then
No_More_Case_Alternatives := True;
end if;
exit Process_Case_Statement_Alternatives when
No_More_Case_Alternatives;
end loop Process_Case_Statement_Alternatives;
Get_Next_Token (Out_Token => Current_Token,
From => Current_Compilation_Unit,
Current_Loc => Loc);
if "/=" (Token_Package.Value_Of (Current_Token),
Token_Package.End_Token) then
raise Syntax_Error;
end if;
Get_Next_Token (Out_Token => Current_Token,
From => Current_Compilation_Unit,
Current_Loc => Loc);
if "/=" (Token_Package.Value_Of (Current_Token),
Token_Package.Case_Token) then
raise Syntax_Error;
end if;
-- increment Halstead CASE_IS_END_CASE operator count
Halstead.Store_Operator ((Kind =>
Halstead_Operator.Case_Is_End_Case_Halstead));
-- decrease McCabe PI
Mccabe.Change_Pi (The_Amount_To_Change => -1);
Get_Next_Token (Out_Token => Current_Token,
From => Current_Compilation_Unit,
Current_Loc => Loc);
if "/=" (Token_Package.Value_Of (Current_Token),
Token_Package.Semicolon_Token) then
raise Syntax_Error;
end if;
-- increment Halstead SEMICOLON operator count
Halstead.Store_Operator ((Kind => Halstead_Operator.Semicolon_Halstead));
end Case_Statement;