!ASIS Issue #061 !topic Asis and statements'labels !from Alain Le Guennec !keywords label !discussion In the current ASIS draft, there is no way to query the _whole_ label attached to a statement, only label names through the query Asis.Statements.Label_Names. Now consider the two following (a bit pathological) examples : procedure Sample1 is begin << -- << inside comment :-) label_name >> null; end Sample1; procedure Sample2 is begin loop_name -- : inside comment :-) : loop null; end loop loop_name; end Sample2; Now if one wants (for example in a style-checker application) to get the _whole_ image corresponding to a label, there is no other way than getting the image of the whole statement, then manually parse to extract the relevant part. The Element_Image returned for A_Defining_Identifier corresponding to a label will only give the label_name, not the full text between '<<' and '>>' (or not until the ':' for loops and blocks identifier.) After reading the relevant part of the RM, I definitely think that labels (for gotos, loops and blocks) are an independant 'syntaxic construct' which has no counter-part in Asis. I think there is simply a missing Asis.Element_Kind : A_Label which could then be further qualified as Label_Kinds : - Not_A_Label - A_Statement_Label - A_Loop_Identifier_Label - A_Block_Identifier_Label (the fact that a statement label and a loop identifier can not have the same name in a given sub-program clearly suggests that they are of the same kind: A_Label.) With this new category, there wouldn't be any more ambiguities about what to return as an Element_Image. And there would be one more structural query to return the label name of A_Label element. Asis.Statements.Label_Names would have to be renamed Asis.Statements.Labels which should return a list of A_Label elements instead of a list of A_Defining_Identifier elements. !resolution Accepted, with Modifications. !date 97-03-26 !Notes See resolution of Issue #060, which also resolves this issue. Changes made in ASIS version 2.0.M.