|
|
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: 8648 (0x21c8)
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 Name (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;
Out_Name_Kind : out Name_Kind) is
--===================================================================
-- Name returns Simple_Name, Attribute, Selected_Component, or
-- Indexed_Component_Or_Slice in Out_Name_Kind.
-- If Name is a Selected_Component, then everything up to the
-- last "." counts as one Halstead OPERATOR, "." counts as one
-- Halstead OPERATOR, and the last IDENTIFIER counts as one
-- Halstead OPERAND.
-- If Name is an Attribute, then everything up to the last "'" counts
-- as one Halstead OPERATOR, "'" counts as one Halstead OPERATOR,
-- and the last IDENTIFIER counts as one Halstead OPERAND.
-- Name ::= Name_Prefix { Name_Suffix }
--===================================================================
No_More_Suffixes : Boolean := False;
Operator : Halstead_Operator.Definition;
--===================================================================
-- The following four pointers are needed to mark the beginning
-- of the operator list, the end of the operator list, the
-- beginning of the operand list, and the end of the operand
-- list. If Name is a Simple_Name (i.e., contains Name_Prefix
-- only), then First_Operator will be pointing to the same
-- location First_Operand is pointing to. If this is the case,
-- then it means that the name we are currently parsing does
-- NOT contain any OPERATORS; it only contains an OPERAND. Another
-- case where Name can only contain operands is when there is NO
-- DOTS or APOSTROPHES in the given name.
--===================================================================
-- save the location of the first operator token.
First_Operator : Ada_Compilation_Unit;
-- save the location of the last operator token.
Last_Operator : Ada_Compilation_Unit;
-- save the location of the first operand token.
First_Operand : Ada_Compilation_Unit;
-- save the location of the last operand token.
Last_Operand : Ada_Compilation_Unit;
begin
-- Name
--** changed 9/26/85 by J. Margono
--** reason: due to change in the doubly-linked list spec,
--** now List is of type PRIVATE, thus assignment
--** is allowed
-- save the location of the first operator token
First_Operator := Seek (Origin => Current_Compilation_Unit, Offset => +1);
--** changed 9/26/85 by J. Margono
--** reason: due to change in the doubly-linked list spec,
--** now List is of type PRIVATE, thus assignment
--** is allowed
-- save the location of the first operand token.
First_Operand := Seek (Origin => Current_Compilation_Unit, Offset => +1);
Out_Name_Kind := Simple_Name;
Name_Prefix (Current_Compilation_Unit => Current_Compilation_Unit,
Program_Unit => Program_Unit,
Halstead => Halstead,
Loc => Loc,
Mccabe => Mccabe);
Process_Name_Suffixes:
loop
case Token_Package.Value_Of
(Peek (From => Current_Compilation_Unit)) is
when Token_Package.Left_Parenthesis_Token =>
Out_Name_Kind := Indexed_Component_Or_Slice;
Name_Suffix
(Current_Compilation_Unit => Current_Compilation_Unit,
Program_Unit => Program_Unit,
Halstead => Halstead,
Loc => Loc,
Mccabe => Mccabe);
when Token_Package.Dot_Token =>
Out_Name_Kind := Selected_Component;
--** changed 9/26/85 by J. Margono
--** reason: due to change in the doubly-linked list spec,
--** now List is of type PRIVATE, thus assignment
--** is allowed
-- modify position of Last_Operator to previous
-- significant token
Last_Operator :=
Seek (Origin => Current_Compilation_Unit, Offset => +1);
--** changed 9/26/85 by J. Margono
--** reason: due to change in the doubly-linked list spec,
--** now List is of type PRIVATE, thus assignment
--** is allowed
-- modify position of First_Operand to first
-- significant token after the DOT
First_Operand :=
Seek (Origin => Current_Compilation_Unit, Offset => +2);
Name_Suffix
(Current_Compilation_Unit => Current_Compilation_Unit,
Program_Unit => Program_Unit,
Halstead => Halstead,
Loc => Loc,
Mccabe => Mccabe);
when Token_Package.Apostrophe_Token =>
if Token_Package.Value_Of
(Peek (From => Current_Compilation_Unit,
Offset => 2)) =
Token_Package.Left_Parenthesis_Token then
-- found a QUALIFIED EXPRESSION
No_More_Suffixes := True;
else
Out_Name_Kind := Attribute;
--** changed 9/26/85 by J. Margono
--** reason: due to change in the doubly-linked list spec,
--** now List is of type PRIVATE, thus assignment
--** is allowed
-- modify position of Last_Operator to previous
-- significant token
Last_Operator :=
Seek (Origin => Current_Compilation_Unit,
Offset => +1);
--** changed 9/26/85 by J. Margono
--** reason: due to change in the doubly-linked list spec,
--** now List is of type PRIVATE, thus assignment
--** is allowed
-- modify position of First_Operand to first
-- significant token after the DOT
First_Operand :=
Seek (Origin => Current_Compilation_Unit,
Offset => +2);
Name_Suffix (Current_Compilation_Unit =>
Current_Compilation_Unit,
Program_Unit => Program_Unit,
Halstead => Halstead,
Loc => Loc,
Mccabe => Mccabe);
end if;
when others =>
No_More_Suffixes := True;
end case;
exit Process_Name_Suffixes when No_More_Suffixes;
end loop Process_Name_Suffixes;
-- everything up to the last dot or tick counts as one
-- Halstead operator, dot or tick counts as one Halstead
-- operator, and everyting after last dot or tick
-- counts as one Halstead operand
if not New_List.Is_Equal (New_List.List (First_Operator),
New_List.List (First_Operand)) then
-- concatenate all significant tokens beginning at First_Location
-- First_Operator up to Last_Operator
Operator := Halstead_Operator.Convert
(Concatenate (First_Operator, Last_Operator));
Halstead.Store_Operator (Operator);
end if;
--** changed 9/26/85 by J. Margono
--** reason: due to change in the doubly-linked list spec,
--** now List is of type PRIVATE, thus assignment
--** is allowed
-- modify position of Last_Operand
Last_Operand := Seek (Origin => Current_Compilation_Unit, Offset => -1);
-- concatenate all significant tokens beginning at
-- First_Operand up to Last_Operand
-- increment Halstead operand count
Halstead.Store_Operand (Halstead_Operand.Definition
(Concatenate (First_Operand, Last_Operand)));
end Name;