diff options
author | Ed Schonberg <schonberg@adacore.com> | 2017-01-23 11:29:17 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-23 12:29:17 +0100 |
commit | ae33543ca51ec15393064ab2075fed28c33ce2d0 (patch) | |
tree | 0d42deb5fa5f86755159535db76effcdd549b3f5 /gcc/ada/scans.ads | |
parent | 13230c68da020c55d3369b489c0b49032637e242 (diff) | |
download | gcc-ae33543ca51ec15393064ab2075fed28c33ce2d0.zip gcc-ae33543ca51ec15393064ab2075fed28c33ce2d0.tar.gz gcc-ae33543ca51ec15393064ab2075fed28c33ce2d0.tar.bz2 |
scans.ads: New token At_Sign.
2017-01-23 Ed Schonberg <schonberg@adacore.com>
* scans.ads: New token At_Sign. Remove '@' from list of illegal
characters for future version of the language. '@' is legal name.
* scng.ads, scng.adb (Scan): Handle '@' appropriately.
* scn.adb (Scan_Reserved_Identifier): An occurrence of '@'
denotes a Target_Name.
* par-ch4.adb (P_Name, P_Primary): Handle Target_Name.
* sinfo.ads, sinfo.adb (N_Target_Name): New non-terminal node.
(Has_Target_Names): New flag on N_Assignment_Statement, to
indicate that RHS has occurrences of N_Target_Name.
* sem.adb: Call Analyze_Target_Name.
* sem_ch5.ads, sem_ch5.adb (Analyze_Target_Name): New subpogram.
(urrent_LHS): Global variable that denotes LHS of assignment,
used in the analysis of Target_Name nodes.
* sem_res.adb (Resolve_Target_Name): New procedure.
* exp_ch5.adb (Expand_Assign_With_Target_Names): (AI12-0125):
N is an assignment statement whose RHS contains occurences of @
that designate the value of the LHS of the assignment. If the
LHS is side-effect free the target names can be replaced with
a copy of the LHS; otherwise the semantics of the assignment
is described in terms of a procedure with an in-out parameter,
and expanded as such.
(Expand_N_Assignment_Statement): Call
Expand_Assign_With_Target_Names when needed.
* exp_util.adb (Insert_Actions): Take into account N_Target_Name.
* sprint.adb: Handle N_Target_Name.
From-SVN: r244783
Diffstat (limited to 'gcc/ada/scans.ads')
-rw-r--r-- | gcc/ada/scans.ads | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/gcc/ada/scans.ads b/gcc/ada/scans.ads index afbdf96..8ff3f9d 100644 --- a/gcc/ada/scans.ads +++ b/gcc/ada/scans.ads @@ -61,6 +61,8 @@ package Scans is Tok_Identifier, -- identifier Name, Lit_Or_Name, Desig + Tok_At_Sign, -- @ AI12-0125-3 : target name + Tok_Double_Asterisk, -- ** Tok_Ampersand, -- & Binary_Addop @@ -213,8 +215,10 @@ package Scans is -- also when scanning project files (where it is needed because of ???) Tok_Special, - -- Used only in preprocessor scanning (to represent one of the - -- characters '#', '$', '?', '@', '`', '\', '^', '~', or '_'. The + -- AI12-0125-03 : target name as abbreviation for LHS + + -- Otherwise used only in preprocessor scanning (to represent one of + -- the characters '#', '$', '?', '@', '`', '\', '^', '~', or '_'. The -- character value itself is stored in Scans.Special_Character. Tok_SPARK_Hide, @@ -269,12 +273,13 @@ package Scans is -- of Pascal style not equal operator). subtype Token_Class_Name is - Token_Type range Tok_Char_Literal .. Tok_Identifier; + Token_Type range Tok_Char_Literal .. Tok_At_Sign; -- First token of name (4.1), -- (identifier, char literal, operator symbol) + -- Includes '@' after Ada2012 corrigendum. subtype Token_Class_Desig is - Token_Type range Tok_Operator_Symbol .. Tok_Identifier; + Token_Type range Tok_Operator_Symbol .. Tok_At_Sign; -- Token which can be a Designator (identifier, operator symbol) subtype Token_Class_Namext is @@ -397,6 +402,11 @@ package Scans is -- file being compiled. This CRC includes only program tokens, and -- excludes comments. + Limited_Checksum : Word := 0; + -- Used to accumulate a CRC representing significant tokens in the + -- limited view of a package, i.e. visible type names and related + -- tagged indicators. + First_Non_Blank_Location : Source_Ptr := No_Location; -- init for -gnatVa -- Location of first non-blank character on the line containing the -- current token (i.e. the location of the character whose column number @@ -461,8 +471,9 @@ package Scans is -- Wide_Character). Special_Character : Character; + -- AI12-0125-03 : '@' as target name is handled elsewhere. -- Valid only when Token = Tok_Special. Returns one of the characters - -- '#', '$', '?', '@', '`', '\', '^', '~', or '_'. + -- '#', '$', '?', '`', '\', '^', '~', or '_'. -- -- Why only this set? What about wide characters??? |