home *** CD-ROM | disk | FTP | other *** search
-
- STYLE CHECKER
-
-
-
- This document describes a general overview of the
-
- structure of the Ada Style Checker's package structure. The
-
- description includes information that will be of value in
-
- understanding the interaction of the software and the
-
- interfaces necessary for the software to function properly.
-
- This document should also serve as a guide for any future
-
- maintenance that may become necessary or desired.
-
-
-
- The following list is a list of the source files
-
- required to build the Style Checker. They are listed in
-
- compilation order
-
-
-
- 1. DYN.ADA - DYN (dynamic string) package (specification
-
- and body)
-
-
-
- 2. FILE_SPEC.ADA - FILE_HANDLING package specification
-
-
-
- 3. TOKENIZER_SPEC.ADA - TOKENIZER package specification
-
-
-
- 4. STYLE_PARAM_SPEC.ADA - STYLE_PARAMETERS package
-
- specification
-
-
-
- 5. REPORT_GEN_SPEC.ADA - REPORT_GENERATOR package
-
- specification
-
-
-
- 6. STACK_PACKAGE.ADA - STACK_PACKAGE package (specification
-
- and body)
-
-
-
- 7. TOKEN_DEFINITION.ADA - TOKEN_DEFINITION package
-
- (specification and body)
-
-
-
- 8. MANAGER.ADA - MANAGER package (specification and body)
-
-
-
- 9. HELP_FILE_SPEC.ADA - HELP package specification
-
-
-
- 10. COMMAND_LINE.ADA - COMMAND_LINE_HANDLER package
-
- (specification and body)
-
-
-
- 11. HELP_FILE_SPEC.ADA - HELP package specification
-
-
-
- 12. HELP_FILE_BODY.ADA - HELP package body
-
-
-
- 13. HELP_INFO_SPEC.ADA - HELP_INFO package specification
-
-
-
- 14. HELP_INFO_BODY.ADA - HELP_INFO package body
-
-
-
- 15. HELP_DIS_ALL.ADA - a separate procedure in HELP_UTILITY
-
-
-
- 16. HELP_EXIT.ADA - a separate procedure in HELP_UTILITY
-
-
-
- 17. HELP_FIND.ADA - a separate procedure in HELP_UTILITY
-
- Page 2
-
-
-
-
-
- 18. HELP_GET.ADA - a separate procedure in HELP_UTILITY
-
-
-
- 19. HELP_INIT.ADA - a separate procedure in HELP_UTILITY
-
-
-
- 20. HELP_ME.ADA - a separate procedure in HELP_UTILITY
-
-
-
- 21. HELP_MENU.ADA - a separate procedure in HELP_UTILITY
-
-
-
- 22. HELP_PROMPT.ADA - a separate procedure in HELP_UTILITY
-
-
-
- 23. HELP_RESET.ADA - a separate procedure in HELP_UTILITY
-
-
-
- 24. HELP_TEXT.ADA - a separate procedure in HELP_UTILITY
-
-
-
- 25. FILE_BODY.ADA - FILE_HANDLING package body
-
-
-
- 26. TOKENIZER_BODY.ADA - TOKENIZER package body
-
-
-
- 27. INSERT.ADA - A separate procedure in the TOKENIZER
-
-
-
- 28. IS_A_RESERVED_WORD.ADA - A separate procedure in the
-
- TOKENIZER
-
-
-
- 29. RESERVED_WORD.ADA - A separate procedure in the
-
- TOKENIZER
-
-
-
- 30. NEXT_CHARACTER.ADA - A separate procedure in the
-
- TOKENIZER
-
-
-
- 31. NEXT_IDENTIFIER.ADA - A separate procedure in the
-
- TOKENIZER
-
-
-
- 32. BUILD_TOKENS.ADA - A separate procedure in the TOKENIZER
-
-
-
- 33. LINE_CONTAINING.ADA - A separate procedure in the
-
- TOKENIZER
-
-
-
- 34. TREE_ROOT.ADA - A separate procedure in the TOKENIZER
-
-
-
- 35. STYLE_PARAM_BODY.ADA - STYLE_PARAMETERS package body
-
-
-
- 36. REPORT_GEN_BODY.ADA - REPORT_GENERATOR package body
-
-
-
- 37. STYLE_CHECKER.ADA - main procedure (STYLE_CHECKER)
-
-
-
- 38. BEGIN_OF_LINE_INDENT.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 39. CHECK_STATEMENTS.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 40. CHECK_END_OF_BLOCKS.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
- Page 3
-
-
-
-
-
- 41. CHECK_THE_STYLE.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 42. CHECK_FOR_ATTRIBUTE.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 43. CHECK_OBJECT_NAMES.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 44. CHECK_UNIVERSAL.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 45. COMMENT_TOKEN.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 46. CURRENT_TOKEN.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 47. ENTERING_BLOCK.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 48. ENTERING_SUB_BLOCK.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 49. EXITING_BLOCK.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 50. GET_NEXT_TOKEN.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 51. IS_STATEMENT.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 52. LITERAL.ADA - A separate procedure in the STYLE_CHECKER
-
-
-
- 53. NEW_LINE_TOKEN.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 54. NON_TRIVIAL_TOKEN.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 55. OBJECT_NAME.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 56. RESERVE_WORD.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 57. SEARCH_BACKWARD.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 58. SEARCH_BACK_ONE_OF.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
- Page 4
-
-
-
-
-
- 59. SEARCH_FORWARD.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 60. SEARCH_FORE_ONE_OF.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- 61. TYPE_DECLARATION.ADA - A separate procedure in the
-
- STYLE_CHECKER
-
-
-
- Page 5
-
-
-
-
-
- THE PACKAGES
-
-
-
- In the next section each package is outlined
-
- separately. The packages are listed in compilation order.
-
-
-
-
-
-
-
- Package DYN
-
-
-
- This package is contained in the file DYN.ADA. It is a
-
- dynamic string package, modeled after the dynamic string
-
- package described by Sylvan Rubin of Ford Aerospace and
-
- Communications Corporation in the Nov/Dec 1984 issue of the
-
- Journal of Pascal, Ada and Modula-2. It is primarily used
-
- by the TOKENIZER package, but is used a little by most all
-
- of the packages in the STYLE_CHECKER. A possible problem
-
- with this package is that on a system with no
-
- UNCHECKED_DEALLOCATION and no automatic "garbage collection"
-
- of access objects problems with heap size may arise. A
-
- proposed solution is to change the dynamic string
-
- representation. Since it is a private type this should
-
- cause few problems with the rest of the system.
-
- Page 6
-
-
-
-
-
- Package FILE_HANDLING
-
-
-
- This package is contained in the files
-
-
-
- 1. FILE_SPEC.ADA
-
-
-
- 2. FILE_BODY.ADA
-
-
-
- The FILE_HANDLING package controls the initial
-
- identification and opening of the input and output files.
-
- Page 7
-
-
-
-
-
- Package TOKENIZER
-
-
-
- The TOKENIZER package is contained in the following
-
- files:
-
-
-
- 1. TOKENIZER_SPEC.ADA
-
-
-
- 2. TOKENIZER_BODY.ADA
-
-
-
- 3. INSERT.ADA
-
-
-
- 4. IS_A_RESERVED_WORD.ADA
-
-
-
- 5. RESERVED_WORD.ADA
-
-
-
- 6. NEXT_CHARACTER.ADA
-
-
-
- 7. NEXT_IDENTIFIER.ADA
-
-
-
- 8. BUILD_TOKENS.ADA
-
-
-
- 9. LINE_CONTAINING.ADA
-
-
-
- 10. TREE_ROOT.ADA
-
-
-
-
-
- The TOKENIZER package processes the Ada input file and
-
- produces tokens to be processed by the subsequent packages
-
- of the Style Checker. It also serves as the interface to
-
- the stream of tokens. All the calls to TEXT_IO GET's from
-
- the input files are localized to the NEXT_CHARACTER
-
- function.
-
-
-
- This package has a procedure BUILD_TOKENS that is
-
- called first, and then the functions FIRST_TOKEN, NEXT_TOKEN
-
- and PREVIOUS_TOKEN are used to move through the token
-
- stream. Since the TOKEN type is a private type changes in
-
- the internal representation of TOKENs should cause few
-
- problems with the other packages.
-
- Page 8
-
-
-
-
-
- Package STYLE_PARAMETERS
-
-
-
- The STYLE_PARAMETERS package is contained in the files
-
- :
-
-
-
- 1. STYLE_PARAM_SPEC.ADA
-
-
-
- 2. STYLE_PARAM_BODY.ADA
-
-
-
-
-
- This package contains the functions and procedures
-
- called to get the parameters that drive the style checking.
-
- In order to alter the parameters the file
-
- STYLE_PARAM_BODY.ADA must be edited, and the procedure
-
- SET_STYLE_PARAMETERS must be altered to reflect the
-
- appropriate parameter(s). For more information concerning
-
- the individual parameters and their meaning see the source
-
- code documentation and the on-line help facility.
-
- Page 9
-
-
-
-
-
- Package REPORT_GENERATOR
-
-
-
- This package is contained in the files:
-
-
-
- 1. REPORT_GEN_SPEC.ADA
-
-
-
- 2. REPORT_GEN_BODY.ADA
-
-
-
-
-
- This package contains the procedures that generate both
-
- the flaws report file and the style report file. If any new
-
- style checks are to be added to the STYLE_CHECKER needed to
-
- be added to several places in the REPORT_GENERATOR package.
-
- They must be added to the record that contains the count
-
- information for all the flaws. They need to be added to the
-
- enumeration type that lists the flaws. This enumeration
-
- type is a parameter to the PUT_FLAW procedure. Then the
-
- code to add them to the style report must be added to the
-
- GENERATE_REPORT procedure.
-
- Page 10
-
-
-
-
-
- Package STACK_PACKAGE
-
-
-
- This package is contained in the file:
-
-
-
- 1. STACK_PACKAGE.ADA
-
-
-
-
-
- This package is a generic stack package.
-
- Page 11
-
-
-
-
-
- Packages TOKEN_DEFINITION and MANAGER
-
-
-
- These packages are contained in the files:
-
-
-
- 1. TOKEN_DEFINITION.ADA
-
-
-
- 2. MANAGER.ADA
-
-
-
-
-
- These two pacakges are inhereted from the
-
- SPELLING_CHECKER tool. They currently are stubbed out. If
-
- it was desired to have the STYLE_CHECKER check that each
-
- variable name was a word these two packages could be moved
-
- from the SPELLING_CHECKER (and any further packages they
-
- needed) and code could be added in the STYLE_CHECKER
-
- procedure CHECK_OBJECT_NAMES. Currently the code to check
-
- if a variable is a word is included, but nothing is done if
-
- the result is false.
-
- Page 12
-
-
-
-
-
- Packages HELP, HELP_INFO_SUPPORT and HELP_UTILITY
-
-
-
- These packages are contained in the files:
-
-
-
- 1. HELP_FILE_SPEC.ADA
-
-
-
- 2. HELP_FILE_BODY.ADA
-
-
-
- 3. HELP_INFO_SPEC.ADA
-
-
-
- 4. HELP_INFO_BODY.ADA
-
-
-
- 5. HELP_SPEC.ADA
-
-
-
- 6. HELP_BODY.ADA
-
-
-
- 7. HELP_DIS_ALL.ADA
-
-
-
- 8. HELP_EXIT.ADA
-
-
-
- 9. HELP_FIND.ADA
-
-
-
- 10. HELP_GET.ADA
-
-
-
- 11. HELP_INIT.ADA
-
-
-
- 12. HELP_ME.ADA
-
-
-
- 13. HELP_MENU.ADA
-
-
-
- 14. HELP_PROMPT.ADA
-
-
-
- 15. HELP_RESET.ADA
-
-
-
- 16. HELP_TEXT.ADA
-
-
-
- 17. STYLE_HELP.INI (Not a compiled unit, a text file)
-
-
-
-
-
- These packages are the help utility. The file
-
- STYLE_HELP.INI contains the source used by the help
-
- facility. Any change of the name of the STYLE_HELP.INI
-
- filename will require a change of the initialization
-
- filename constant in the FILE_HANDLING package.
-
-
-
- The text file used by the HELP_UTILITY Package is
-
- required to have a particular format. If the file is not in
-
- this format, an exception will be raised. The following
-
- explains the required format.
-
-
-
- COMMENTS: Comments may be embeded in the text file.
-
- All comments are ignored when the file is read into memory.
-
- A text line is considered a comment if the first and second
-
- characters of the line are minus signs ( -- ).
-
- Page 13
-
-
-
-
-
- TOPICS: The first non-comment text line MUST begin
-
- with the digit 1 in column one. This number is the topic
-
- level. In other words, text (as defined below) cannot be
-
- found in the text file before a topic is found to which the
-
- text can be associated. Topics are those subjects for which
-
- information is being provided. A topic name may contain any
-
- printable character except blanks. Embedded blanks are NOT
-
- allowed in a topic name. This will not be flagged as an
-
- error but the name will be truncated at the first blank.
-
- All letters in the name must be capitals. It is not
-
- required to have a space separating the topic level from the
-
- topic name. Any line beginning with a digit will be
-
- considered a topic line.
-
-
-
- SUBTOPICS: A topic may have subtopics. Subtopics are
-
- denoted by having a level exactly one greater than the
-
- associated topic level. Subtopics follow the same rules as
-
- topics in all other aspects. There is no constraint (other
-
- than a lack of memory) on the number of subtopic levels.
-
-
-
- TEXT: All text lines not beginning with two
-
- consecutive minus signs or a digit will be considered text.
-
-
-
- The text file is saved exactly as the user sees it
-
- (including blank lines) with the follow exceptions:
-
-
-
- - topic and subtopic names have leading blanks stripped
-
- off
-
-
-
- - if the topic or subtopic name is longer than one half
-
- the screen size, it may be truncated when a menu of
-
- information is output
-
-
-
- - if the text line is longer than the screen size, the
-
- text line is truncated before output
-
-
-
- - the text file lines are assumed to be eighty characters
-
- maximum.
-
-
-
- Page 14
-
-
-
-
-
- Package COMMAND_LINE_HANDLER
-
-
-
- This package is contained in the file COMMAND_LINE.ADA.
-
- This package contains routines which return words from the
-
- command line. It expects an external file to created that
-
- contains each word that follows the inkoking command, one
-
- word per line. These lines are interpreted as file names
-
- and opened by a procedure in this package.
-
-
-