home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / gnat-2.06-src.tgz / tar.out / fsf / gnat / ada / style.ads < prev    next >
Text File  |  1996-09-28  |  7KB  |  139 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --                                S T Y L E                                 --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.6 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  22. --                                                                          --
  23. ------------------------------------------------------------------------------
  24.  
  25. --  This package collects all the routines used for style checking, as
  26. --  activated by the relevant command line option. These are gathered in
  27. --  a separate package so that they can more easily be customized. Calls
  28. --  to these subprograms are only made if Opt.Style_Check is set True.
  29.  
  30. with Types; use Types;
  31.  
  32. package Style is
  33.  
  34.    procedure Body_With_No_Spec (N : Node_Id);
  35.    --  Called where N is a subprogram body node for a subprogram body
  36.    --  for which no spec was given, i.e. a body acting as its own spec.
  37.  
  38.    procedure Check_Abs_Not;
  39.    --  Called after scanning an ABS or NOT operator to check spacing
  40.  
  41.    procedure Check_Arrow;
  42.    --  Called after scanning out an arrow to check spacing
  43.  
  44.    procedure Check_Attribute_Name (Reserved : Boolean);
  45.    --  The current token is an attribute designator. Check that it is
  46.    --  capitalized in an appropriate manner. Reserved is set if the
  47.    --  attribute designator is a reserved word (access, digits, delta
  48.    --  or range) to allow differing rules for the two cases.
  49.  
  50.    procedure Check_Box;
  51.    --  Called after scanning out a box to check spacing
  52.  
  53.    procedure Check_Binary_Operator;
  54.    --  Called after scanning out a binary operator other than a plus, minus
  55.    --  or exponentiation operator. Intended for checking spacing rules.
  56.  
  57.    procedure Check_Exponentiation_Operator;
  58.    --  Called after scanning out an exponentiation operator. Intended for
  59.    --  checking spacing rules.
  60.  
  61.    procedure Check_Colon;
  62.    --  Called after scanning out colon to check spacing
  63.  
  64.    procedure Check_Colon_Equal;
  65.    --  Called after scanning out colon equal to check spacing
  66.  
  67.    procedure Check_Comma;
  68.    --  Called after scanning out comma to check spacing
  69.  
  70.    procedure Check_Comment;
  71.    --  Called with Scan_Ptr pointing to the first minus sign of a comment.
  72.    --  Intended for checking any specific rules for comment placement/format.
  73.  
  74.    procedure Check_Dot_Dot;
  75.    --  Called after scanning out dot dot to check spacing
  76.  
  77.    procedure Check_HT;
  78.    --  Called with Scan_Ptr pointing to a horizontal tab character
  79.  
  80.    procedure Check_Identifier (Ref : Node_Id; Def : Node_Id);
  81.    --  Check style of identifier occurrence. Ref is an N_Identifier node whose
  82.    --  spelling is to be checked against the Chars spelling in identifier node
  83.    --  Def (which may be either an N_Identifier, or N_Defining_Identifier node)
  84.  
  85.    procedure Check_Indentation;
  86.    --  Called at the start of a new statement or declaration, with Token_Ptr
  87.    --  pointing to the first token of the statement or declaration. The check
  88.    --  is that the starting column is appropriate to the indentation rules if
  89.    --  Token_Ptr is the first token on the line.
  90.  
  91.    procedure Check_Left_Paren;
  92.    --  Called after scanning out a left parenthesis to check spacing.
  93.  
  94.    procedure Check_Line_Terminator;
  95.    --  Called with Scan_Ptr pointing to the first line terminator terminating
  96.    --  the current line, used to check for appropriate line terminator.
  97.  
  98.    procedure Check_Pragma_Name;
  99.    --  The current token is a pragma identifier. Check that it is spelled
  100.    --  properly (i.e. with an appropriate casing convention).
  101.  
  102.    procedure Check_Right_Paren;
  103.    --  Called after scanning out a right parenthesis to check spacing.
  104.  
  105.    procedure Check_Semicolon;
  106.    --  Called after scanning out a semicolon to check spacing
  107.  
  108.    procedure Check_Then (If_Loc : Source_Ptr);
  109.    --  Called to check that THEN and IF keywords are appropriately positioned.
  110.    --  The parameters show the first characters of the two keywords. This
  111.    --  procedure is called only if THEN appears at the start of a line with
  112.    --  Token_Ptr pointing to the THEN keyword.
  113.  
  114.    procedure Check_Unary_Plus_Or_Minus;
  115.    --  Called after scanning a unary plus or minus to check spacing
  116.  
  117.    procedure Check_Vertical_Bar;
  118.    --  Called after scanning a vertical bar to check spacing
  119.  
  120.    procedure No_End (Name : Node_Id);
  121.    --  Called if an END is encountered where a name is allowed but not present.
  122.    --  The parameter is the node whose name is the name that is permitted in
  123.    --  the END line, and the scan pointer is positioned so that if an error
  124.    --  message is to be generated in this situation, it should be generated
  125.    --  using Error_Msg_SP.
  126.  
  127.    procedure Non_Lower_Case_Keyword;
  128.    --  Called if a reserved keyword is scanned which is not spelled in all
  129.    --  lower case letters. On entry Token_Ptr points to the keyword token.
  130.    --  This is not used for keywords appearing as attribute designators,
  131.    --  where instead Check_Attribute_Name (True) is called.
  132.  
  133.    procedure Set_Max_Line_Length (N : in out Nat);
  134.    --  This procedure has the opportunity of setting a new value for the
  135.    --  maximum line length which is less than the standard maximum value
  136.    --  permitted by the system (which is the value passed in on entry).
  137.  
  138. end Style;
  139.