!************************************************************************* ! * ! © Copyright 2005 Hewlett-Packard Development Company, L.P. * ! * ! Confidential computer software. Valid license from HP required for * ! possession, use or copying. Consistent with FAR 12.211 and 12.212, * ! Commercial Computer Software, Computer Software Documentation, and * ! Technical Data for Commercial Items are licensed to the U.S. * ! Government under vendor's standard commercial license. * ! * !************************************************************************* !++ ! Facility: ! XLSE (eXtended LSE) ! ! Abstract: ! This module modifies LSE's C language support to conform to the ! C coding conventions described in the _Digital Software Engineering ! Manual, 1988_. It provides the definitions that are common to the ! three recommended statement formatting styles: ! ! Kernighan & Ritchie style (see C-SEM-K-R.LSE) ! BEGIN-END style, the LSE default (see C-SEM-BEGIN-END.LSE) ! Indented BEGIN-END style (see C-SEM-INDENTED-BEGIN-END.LSE) ! ! Author: ! Doug Rayner, CASEE Group ! André Pavanello, LinkWorks Project ! W. Ward Clark, LinkWorks Project ! ! Creation Date: 15-Oct-87 ! ! Modification History: ! X1.2-1 WWC 1-Dec-87 conform to tags in PDS Specification (13-Oct-87) ! restructured module and function comments ! X1.2-2 WWC 14-Feb-88 1987 --> 1988 ! X1.3 WWC 7-Oct-88 CASEE_C.LSE --> C-SEM.LSE ! X1.3-1 WWC 15-Jan-89 normalize LSE command syntax ! 1988 --> 1989 ! X2.0 WWC 12-Apr-89 add COMPILATION_UNIT and MODULE tokens ! fix template errors ! X2.1 WWC 5-Jul-89 upgrade to VAXC V3.0-006 (LSE V2.3) ! C-SEM.LSE --> C-SEM-COMMON, C-SEM-K-R, ! C-SEM-BEGIN-END, C-SEM-INDENT-BEGIN-END ! X3.0 WWC 1-Jan-90 upgrade to LSE V3.0 ! 1989 --> 1990 ! X3.0-1 WWC 28-Jan-90 normalize PDF definitions ! X3.0-2 WWC 4-Feb-90 remove some spaces before '(' ! X3.1 WWC 29-Oct-91 1990 --> 1991 ! X4.0a WWC 24-Feb-93 1991 --> 1993 !-- ! DELETE LANGUAGE C DEFINE LANGUAGE C - /COMMENT=( - ASSOCIATED_IDENTIFIER = PREVIOUS, - BEGIN=("/*"), - END=("*/"), - NOFIXED, - LINE=("**++","**--","**"), - NOTRAIL) - /CAPABILITIES=DIAGNOSTICS - /COMPILE_COMMAND="CC" - /EXPAND_CASE=AS_IS - /FILE_TYPES=(.C,.H) - /NOHELP_LIBRARY - /IDENTIFIER_CHARACTERS= - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$0123456789" - /INITIAL_STRING="{@compilation unit@}" - /LEFT_MARGIN=CONTEXT_DEPENDENT - /OVERVIEW_OPTIONS=( - MINIMUM_LINES=1, - TAB_RANGE=(4,8)) - /PLACEHOLDER_DELIMITERS=( - REQUIRED= ("{@","@}"), - REQUIRED_LIST= ("{@","@}..."), - OPTIONAL= ("[@","@]"), - OPTIONAL_LIST= ("[@","@]..."), - PSEUDOCODE= ("«","»")) - /PUNCTUATION_CHARACTERS=",;:()" - /QUOTED_ITEM=(QUOTES="""'",ESCAPES="\") - /RIGHT_MARGIN=80 - /TAB_INCREMENT=4 - /TOPIC_STRING="CC " - /VERSION="VAXC V3.1 (XLSE X4.0a)" - /WRAP !+ ! Assume /LANGUAGE=C for all following definitions. !- SET LANGUAGE C ! !+ ! Language-independent definitions !- DELETE PLACEHOLDER "lse$block_comment" DEFINE PLACEHOLDER "lse$block_comment" - /TYPE=NONTERMINAL "/*" "** {@tbs@}" "*/" END DEFINE DELETE PLACEHOLDER "lse$generic" DEFINE PLACEHOLDER "lse$generic" - /TYPE=NONTERMINAL "{@tbs@}" END DEFINE DELETE PLACEHOLDER "lse$line_comment" DEFINE PLACEHOLDER "lse$line_comment" - /TYPE=NONTERMINAL "/* {@tbs@} */" END DEFINE ! !+ ! Module-level constructs !- DELETE PLACEHOLDER "compilation unit" DEFINE PLACEHOLDER "compilation unit" - /DESCRIPTION="" - /TYPE=NONTERMINAL "[@#module@]" "[@module level comments@]" "[@include files@]" "[@table of contents@]" "[@macro definitions@]" "[@type definitions@]" "[@static data definitions@]" "[@global data definitions@]" "[@external data declarations@]" "[@function definition@]..." END DEFINE DELETE TOKEN "compilation_unit" DEFINE TOKEN "compilation_unit" /PLACEHOLDER="compilation unit" DELETE TOKEN "module" DEFINE TOKEN "module" /PLACEHOLDER="compilation unit" DELETE PLACEHOLDER "module level comments" DEFINE PLACEHOLDER "module level comments" - /PLACEHOLDER="XLSE module level comments" DELETE PLACEHOLDER "XLSE module level comments" DEFINE PLACEHOLDER "XLSE module level comments" - /DESCRIPTION="" - /TYPE=NONTERMINAL "/*" "**++" "** Facility:" "**" "** {@description@}" "**" "** Version: {@version number@}" "**" "** Abstract:" "**" "** {@description@}" "**" "** Keywords:" "** {@keywords or None@}" "** [@optional module tags@]..." "**" "** Author:" "** {@author information@}..." "**" "** Creation Date: {@date@}" "**" "** Modification History:" "**--" "*/" " " END DEFINE DELETE PLACEHOLDER "text string" DEFINE PLACEHOLDER "text string" - /DESCRIPTION="a string of text" - /LEADING="," - /TYPE=TERMINAL "enter some text" END DEFINE DELETE PLACEHOLDER "version number" DEFINE PLACEHOLDER "version number" /PLACEHOLDER="text string" DELETE PLACEHOLDER "author information" DEFINE PLACEHOLDER "author information" - /DESCRIPTION="identification of a module author" - /DUPLICATION=VERTICAL - /TYPE=NONTERMINAL "{@author's name@}, [@author's group@], [@author's project@]" END DEFINE DELETE PLACEHOLDER "author's name" DEFINE PLACEHOLDER "author's name" /PLACEHOLDER="text string" DELETE PLACEHOLDER "author's group" DEFINE PLACEHOLDER "author's group" /PLACEHOLDER="text string" DELETE PLACEHOLDER "author's project" DEFINE PLACEHOLDER "author's project" /PLACEHOLDER="text string" DELETE PLACEHOLDER "date" DEFINE PLACEHOLDER "date" /PLACEHOLDER="text string" DELETE PLACEHOLDER "optional module tags" DEFINE PLACEHOLDER "optional module tags" - /TYPE=MENU "CDD Pathnames" /TOKEN/DESCRIPTION="" "Compilation Qualifiers" /TOKEN/DESCRIPTION="" "Design Issues" /TOKEN/DESCRIPTION="" "Environment" /TOKEN/DESCRIPTION="" "Files Used" /TOKEN/DESCRIPTION="" "Included Files" /TOKEN/DESCRIPTION="" "Portability Issues" /TOKEN/DESCRIPTION="" "Subsystem" /TOKEN/DESCRIPTION="" "Text Library Modules Included" /TOKEN/DESCRIPTION="" END DEFINE DELETE TOKEN "CDD pathnames" DEFINE TOKEN "CDD pathnames" - /DESCRIPTION="CDD Pathnames used in this module." " " "CDD Pathnames:" " " " {@tbs@}" END DEFINE DELETE TOKEN "compilation qualifiers" DEFINE TOKEN "compilation qualifiers" - /DESCRIPTION="Qualifiers to use to successfully compile this module." " " "Compilation Qualifiers:" " " " {@tbs@}" END DEFINE DELETE TOKEN "design issues" DEFINE TOKEN "design issues" - /DESCRIPTION="Design issues in this module" " " "Design Issues:" " " " {@environment description@}" END DEFINE DELETE TOKEN "environment" DEFINE TOKEN "environment" - /DESCRIPTION="Environment in which this module executes" " " "Environment:" " " " {@environment description@}" END DEFINE DELETE PLACEHOLDER "environment description" DEFINE PLACEHOLDER "environment description" - /DESCRIPTION="environment description" - /TYPE=MENU "User mode, executable image" "Supervisor mode, executable image" "Executive mode, executable image" "Kernel mode, executable image" "Global data" END DEFINE DELETE TOKEN "files used" DEFINE TOKEN "files used" - /DESCRIPTION="Any files used by this procedure." " " "Files Used:" " " " {@tbs@}" END DEFINE DELETE TOKEN "included files" DEFINE TOKEN "included files" - /DESCRIPTION="Any files that are included into this module." " " "Included Files:" " " " {@tbs@}" END DEFINE DELETE TOKEN "portability issues" DEFINE TOKEN "portability issues" - /DESCRIPTION="Any issues that relate to the portability of this module." " " "Portability Issues:" " " " {@tbs@}" END DEFINE DELETE TOKEN "subsystem" DEFINE TOKEN "subsystem" - /DESCRIPTION="The subsystem of which this module is a part." " " "Subsystem:" " " " {@tbs@}" END DEFINE DELETE TOKEN "text library modules included" DEFINE TOKEN "text library modules included" - /DESCRIPTION="Any modules included from a text library." " " "Text Library Modules Included:" " " " {@tbs@}" END DEFINE DELETE PLACEHOLDER "include files" DEFINE PLACEHOLDER "include files" - /DESCRIPTION="" - /TYPE=NONTERMINAL "/*" "** Include Files" "*/" "{@#include@}..." END DEFINE DELETE PLACEHOLDER "#include" DEFINE PLACEHOLDER "#include" - /DESCRIPTION="File inclusion (include the contents of the file)" - /DUPLICATION=VERTICAL - /TOPIC="Language_topics Preprocessor #include" - /TYPE=MENU "#include <{@file-spec@}>" /DESCRIPTION="system header file (in SYS$LIBRARY directory)" "#include ""{@file-spec@}""" /DESCRIPTION="application header file (in source directory)" "#include {@module name@}" /DESCRIPTION="header file (in C$INCLUDE directory)" END DEFINE DELETE PLACEHOLDER "macro definitions" DEFINE PLACEHOLDER "macro definitions" - /DESCRIPTION="" - /TYPE=NONTERMINAL "" "/*" "** Macro Definitions" "*/" "{@#define@}..." END DEFINE DELETE PLACEHOLDER "type definitions" DEFINE PLACEHOLDER "type definitions" - /DESCRIPTION="token replacement (replace the identifier with the given string)" - /SEPARATOR=";" - /TOPIC="Language_topics Preprocessor typedef" - /TYPE=NONTERMINAL "" "/*" "** Type Definitions" "*/" "{@typedef@}..." END DEFINE DELETE PLACEHOLDER "typedef" DEFINE PLACEHOLDER "typedef" - /DESCRIPTION="An abbreviated name for a lengthy type definition" - /DUPLICATION=VERTICAL - /TOPIC="Language_topics Data_Types typedef" - /TYPE=NONTERMINAL "typedef [@data type modifier@]... {@data type@} {@declarator@}...;" END DEFINE DELETE TOKEN "typedef" DEFINE TOKEN "typedef" /PLACEHOLDER="typedef" DELETE PLACEHOLDER "static data definitions" DEFINE PLACEHOLDER "static data definitions" - /DESCRIPTION="token replacement (replace the identifier with the given string)" - /TYPE=NONTERMINAL "" "/*" "** Static Data Definitions" "*/" "{@static@}..." END DEFINE DELETE PLACEHOLDER "static" DEFINE PLACEHOLDER "static" - /DESCRIPTION="" - /DUPLICATION=VERTICAL - /TYPE=NONTERMINAL "static [@readonly@] [@data type modifier@]... {@data type@} {@declarator and initializer@}...;" END DEFINE DELETE TOKEN "static" DEFINE TOKEN "static" /PLACEHOLDER="static" DELETE PLACEHOLDER "external data declarations" DEFINE PLACEHOLDER "external data declarations" - /DESCRIPTION="token replacement (replace the identifier with the given string)" - /TYPE=NONTERMINAL "" "/*" "** External Data Declarations" "*/" "{@external declaration@}..." END DEFINE DELETE PLACEHOLDER "external declaration" DEFINE PLACEHOLDER "external declaration" - /DESCRIPTION="its scope persists to the end of the file" - /DUPLICATION=VERTICAL - /TOPIC="Language_topics Declarations" - /TYPE=MENU "extern" /TOKEN/DESCRIPTION="" "globaldef" /TOKEN/DESCRIPTION="" "globalref" /TOKEN/DESCRIPTION="" "globalvalue" /TOKEN/DESCRIPTION="" "readonly" /TOKEN/DESCRIPTION="" "noshare" /TOKEN/DESCRIPTION="" END DEFINE DELETE PLACEHOLDER "global data definitions" DEFINE PLACEHOLDER "global data definitions" - /DESCRIPTION="token replacement (replace the identifier with the given string)" - /TYPE=NONTERMINAL "" "/*" "** Global Data Definitions" "*/" "{@global definition@}..." END DEFINE DELETE PLACEHOLDER "global definition" DEFINE PLACEHOLDER "global definition" - /DESCRIPTION="its scope persists to the end of the file" - /DUPLICATION=VERTICAL - /TOPIC="Language_topics Declarations" - /TYPE=NONTERMINAL "[@data type modifier@]... {@data type@} [@declarator and initializer@]...;" END DEFINE DELETE PLACEHOLDER "table of contents" DEFINE PLACEHOLDER "table of contents" - /DESCRIPTION="token replacement (replace the identifier with the given string)" - /TYPE=NONTERMINAL "" "/*" "** Table of Contents" "*/" "{@function prototype declaration@}..." END DEFINE ! !+ ! Function-level constructs !- DELETE PLACEHOLDER "function prototype declaration" DEFINE PLACEHOLDER "function prototype declaration" - /DESCRIPTION="Declares a function prototype" - /DUPLICATION=VERTICAL - /TOPIC="Language_topics functions" - /TYPE=NONTERMINAL "[@static or extern@] {@data type@} [@*@]{@function name@}({@proto param list@}, [@ellipsis@] );" END DEFINE DELETE TOKEN "function_prototype_declaration" DEFINE TOKEN "function_prototype_declaration" /PLACEHOLDER="function prototype declaration" DELETE PLACEHOLDER "function level comments" DEFINE PLACEHOLDER "function level comments" - /PLACEHOLDER="XLSE function level comments" DELETE PLACEHOLDER "XLSE function level comments" DEFINE PLACEHOLDER "XLSE function level comments" - /DESCRIPTION="" - /TYPE=NONTERMINAL "/*" "**++" "** Functional Description:" "**" "** {@description@}" "**" "** Keywords:" "** {@keywords or None@}" "**" "** Formal Parameters:" "**" "** {@identifiers or None@}" "** [@non-local references@]" "** [@conditions@]" "** [@optional function tags@]..." "**" "** Result:" "**" "** {@return values or None@}" "**" "** Exceptions:" "**" "** {@identifiers or None@}" "**--" "*/" END DEFINE DELETE PLACEHOLDER "non-local references" DEFINE PLACEHOLDER "non-local references" - /DESCRIPTION="" - /TYPE=NONTERMINAL " " "Implicit Input Parameters:" " " " {@identifiers or None@}" " " "Implicit Output Parameters:" " " " {@identifiers or None@}" " " "Side effects:" " " " {@description or None@}" END DEFINE DELETE PLACEHOLDER "conditions" DEFINE PLACEHOLDER "conditions" - /DESCRIPTION="" - /TYPE=NONTERMINAL " " "Preconditions:" " " " {@description or None@}" " " "Postconditions:" " " " {@description or None@}" " " "Invariants:" " " " {@description or None@}" " " "Client Obligations:" " " " {@description or None@}" END DEFINE DELETE PLACEHOLDER "optional function tags" DEFINE PLACEHOLDER "optional function tags" - /TYPE=MENU "Calling Sequence" /TOKEN/DESCRIPTION="" "Design" /TOKEN/DESCRIPTION="" "Included Files" /TOKEN/DESCRIPTION="" "Text Library Modules Included" /TOKEN/DESCRIPTION="" END DEFINE DELETE TOKEN "calling sequence" DEFINE TOKEN "calling sequence" - /DESCRIPTION="The calling sequence for this function." " " "Calling Sequence:" " " " {@tbs@}" END DEFINE DELETE TOKEN "design" DEFINE TOKEN "design" - /DESCRIPTION="Design for this function" " " "Design:" " " " {@description or None@}" END DEFINE DELETE PLACEHOLDER "description" DEFINE PLACEHOLDER "description" /PLACEHOLDER="text string" DELETE PLACEHOLDER "keywords or None" DEFINE PLACEHOLDER "keywords or None" - /DESCRIPTION="" - /TYPE=MENU "{@keyword@}, [@keyword@]..." /DESCRIPTION="1 or more keywords" "None" /DESCRIPTION="no keywords" END DEFINE DELETE PLACEHOLDER "keyword" DEFINE PLACEHOLDER "keyword" - /DESCRIPTION="classification keyword" - /DUPLICATION=HORIZONTAL - /SEPARATOR=", " - /TYPE=TERMINAL "Enter a classification keyword" END DEFINE DELETE PLACEHOLDER "identifiers or None" DEFINE PLACEHOLDER "identifiers or None" - /DESCRIPTION="identifiers" - /TYPE=MENU "identifiers" /PLACEHOLDER /DESCRIPTION="with descriptions" "None" /DESCRIPTION="" END DEFINE DELETE PLACEHOLDER "identifiers" DEFINE PLACEHOLDER "identifiers" - /DESCRIPTION="list of identifiers" - /DUPLICATION=VERTICAL - /TYPE=NONTERMINAL "{@identifier@} :" " {@description@}" "[@another identifier@]..." END DEFINE DELETE PLACEHOLDER "another identifier" DEFINE PLACEHOLDER "another identifier" - /DESCRIPTION="description of a single identifier" - /DUPLICATION=VERTICAL - /TYPE=NONTERMINAL " " "{@identifier@} :" " {@description@}" END DEFINE DELETE PLACEHOLDER "return values or None" DEFINE PLACEHOLDER "return values or None" - /DESCRIPTION="list of return values" - /TYPE=MENU "function value" /PLACEHOLDER /DESCRIPTION="with description" "completion codes" /PLACEHOLDER /DESCRIPTION="with descriptions" "None" /DESCRIPTION="" END DEFINE DELETE PLACEHOLDER "function value" DEFINE PLACEHOLDER "function value" - /DESCRIPTION="return value of a function" - /DUPLICATION=VERTICAL - /TYPE=NONTERMINAL "{@identifier@} :" " {@description@}" END DEFINE DELETE PLACEHOLDER "completion codes" DEFINE PLACEHOLDER "completion codes" - /DESCRIPTION="list of completion codes" - /DUPLICATION=VERTICAL - /TYPE=NONTERMINAL "{@completion code@} :" " {@description@}" "[@another completion code@]..." END DEFINE DELETE PLACEHOLDER "another completion code" DEFINE PLACEHOLDER "another completion code" - /DESCRIPTION="description of a single completion code" - /DUPLICATION=VERTICAL - /TYPE=NONTERMINAL " " "{@completion code@} :" " {@description@}" END DEFINE DELETE PLACEHOLDER "completion code" DEFINE PLACEHOLDER "completion code" - /DESCRIPTION="function completion code" - /TYPE=TERMINAL "Enter a possible completion code (literal or symbolic)" END DEFINE DELETE PLACEHOLDER "description or None" DEFINE PLACEHOLDER "description or None" - /DESCRIPTION="descriptive text" - /TYPE=MENU "{@description@}" /DESCRIPTION="descriptive text" "None" /DESCRIPTION="no description" END DEFINE DELETE PLACEHOLDER "main() or main function that accept arguments from the command line" DEFINE PLACEHOLDER "main() or main function that accept arguments from the command line" - /DESCRIPTION="Defines a main function" - /TYPE=MENU "{@main function name@}()"/DESCRIPTION="" "{@main function name@}(int argc, char *argv[])"/DESCRIPTION="" "{@main function name@}(int argc, char *argv[], char *envp[])"/DESCRIPTION="" END DEFINE ! !+ ! Statement constructs !- DELETE TOKEN "{" DEFINE TOKEN "{" /PLACEHOLDER="compound statement" DELETE TOKEN "compound_statement" DEFINE TOKEN "compound_statement" /PLACEHOLDER="compound statement" DELETE TOKEN "=" DEFINE TOKEN "=" - /DESCRIPTION="assignment statement" - /TOPIC="" "{@identifier@} = {@expression@};" END DEFINE DELETE PLACEHOLDER "if1" DEFINE PLACEHOLDER "if1" - /DESCRIPTION="Simple 'if' statement (with no 'else' clause)" - /DUPLICATION=VERTICAL - /TOPIC="Language_topics Statements if" - /TYPE=NONTERMINAL "if ({@expression@})" " {@statement@};" END DEFINE DELETE TOKEN "if1" DEFINE TOKEN "if1" /PLACEHOLDER="if1" DELETE TOKEN "ifthen" DEFINE TOKEN "ifthen" /PLACEHOLDER="if1" DELETE TOKEN "while1" DEFINE TOKEN "while1" - /DESCRIPTION="Simple 'while' statement (with a single loop statement)" - /TOPIC="Language_topics Statements while" "while ({@expression@})" " {@statement@};" END DEFINE DELETE PLACEHOLDER "another case" DEFINE PLACEHOLDER "another case" - /DESCRIPTION="single case in a switch statement" - /DUPLICATION=VERTICAL - /TYPE=NONTERMINAL "case {@constant expression@}:" "[@case constant_expression:@]..." " {@statement@}..." " break;" END DEFINE DELETE PLACEHOLDER "default case" DEFINE PLACEHOLDER "default case" - /DESCRIPTION="default clause of a switch statement" - /TYPE=NONTERMINAL "default:" " {@statement@}..." " break;" END DEFINE DELETE PLACEHOLDER "function call" DEFINE PLACEHOLDER "function call" - /DESCRIPTION="function call" - /TOPIC="Language_topics Functions" - /TYPE=NONTERMINAL "{@primary@}([@actual argument@]...)" END DEFINE DELETE PLACEHOLDER "primary" DEFINE PLACEHOLDER "primary" - /DESCRIPTION="Identifier,constant,string,function call,array/structure/union reference" - /TOPIC="" - /TYPE=MENU "identifier" /PLACEHOLDER/NOLIST/DESCRIPTION="" "constant" /PLACEHOLDER/NOLIST/DESCRIPTION="" """{@string text@}"""/DESCRIPTION="" "array_reference" /TOKEN/DESCRIPTION="" "function call" /PLACEHOLDER/NOLIST/DESCRIPTION="" "structure or union reference" /PLACEHOLDER/NOLIST/DESCRIPTION="" "({@expression@})"/DESCRIPTION="" END DEFINE DELETE PLACEHOLDER "sizeof function" DEFINE PLACEHOLDER "sizeof function" - /DESCRIPTION="the size, in bytes, of some object" - /TYPE=MENU "sizeof({@expression@})"/DESCRIPTION="" "sizeof({@type name@})"/DESCRIPTION="" END DEFINE ! !+ ! Data type constructs !- DELETE TOKEN "auto" DEFINE TOKEN "auto" - /DESCRIPTION="Declares a variable that is local to its enclosing block" - /TOPIC="Language_topics Storage_classes" "auto [@data type modifier@]... {@data type@} {@declarator and initializer@}...;" END DEFINE DELETE PLACEHOLDER "member declaration" DEFINE PLACEHOLDER "member declaration" - /DESCRIPTION="" - /DUPLICATION=VERTICAL - /TYPE=MENU "{@data type@} {@declarator@}...;"/DESCRIPTION="" "[@bit field data type@] {@bit field@}...;"/DESCRIPTION="" "[@variant type@] {@identifier@};"/DESCRIPTION="" END DEFINE