|
|
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: 3410 (0xd52)
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_Alternative
(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_Alternative ::=
-- "WHEN" Expression { "|" Expression } "=>" Sequence_Of_Statements
--====================================================================
Current_Token : Token_Package.Token;
No_More_Choices : Boolean := False;
begin
-- Case_Statement_Alternative
Get_Next_Token (Out_Token => Current_Token,
From => Current_Compilation_Unit,
Current_Loc => Loc);
if "/=" (Token_Package.Value_Of (Current_Token),
Token_Package.When_Token) then
raise Syntax_Error;
end if;
-- increment Halstead WHEN operator count
Halstead.Store_Operator ((Kind => Halstead_Operator.When_Halstead));
-- increment McCabe PI
Mccabe.Change_Pi;
Process_Choices:
loop
-- repeat until "|", "!" or "=> is found
Expression (Current_Compilation_Unit => Current_Compilation_Unit,
Program_Unit => Program_Unit,
Halstead => Halstead,
Loc => Loc,
Mccabe => Mccabe,
Terminate_Tokens =>
Set_Of_Tokens'(Token_Package.Vertical_Bar_Token,
Token_Package.Exclamation_Mark_Token,
Token_Package.Arrow_Token));
Get_Next_Token (Out_Token => Current_Token,
From => Current_Compilation_Unit,
Current_Loc => Loc);
case Token_Package.Value_Of (Current_Token) is
when Token_Package.Vertical_Bar_Token =>
-- increment Halstead VERTICAL_BAR operator count
Halstead.Store_Operator
((Kind => Halstead_Operator.Vertical_Bar_Halstead));
-- increment McCabe PI
Mccabe.Change_Pi;
when Token_Package.Exclamation_Mark_Token =>
-- increment Halstead EXCLAMATION_MARK operator count
Halstead.Store_Operator
((Kind => Halstead_Operator.Exclamation_Mark_Halstead));
-- increment McCabe PI
Mccabe.Change_Pi;
when Token_Package.Arrow_Token =>
-- increment Halstead ARROW operator count
Halstead.Store_Operator
((Kind => Halstead_Operator.Arrow_Halstead));
No_More_Choices := True;
when others =>
raise Syntax_Error;
end case;
exit Process_Choices when No_More_Choices;
end loop Process_Choices;
Sequence_Of_Statements
(Current_Compilation_Unit => Current_Compilation_Unit,
Program_Unit => Program_Unit,
Halstead => Halstead,
Loc => Loc,
Mccabe => Mccabe);
end Case_Statement_Alternative;