/* C.LXL - IBM LPEX language-sensitive editor profile for C/C++. */
TRACE OFF

/* C/C++ document */
'SET DOCTYPE C'

/* C/C++ classes - DO NOT MODIFY!! */
'SET CLASSES CODE SPACE ',
'FWDLINK BWDLINK SEMICOLON FUNCTION BRACE ERROR COMMENT CONTROL CXXCLASS'

/* create our own menu items */
MENU.1  = "~Options.Automatic_~indenting..."
MENU.2  = "~Options.~Language_editing."
MENU.3  = "~Options.~Language_editing.~Token_highlighting"
MENU.4  = "~Options.~Language_editing.Automatic_~indenting"
MENU.12 = "~View." || 'SEPARATOR'
MENU.13 = "~View.F~unctions\tCtrl+C"
MENU.14 = "~View.~Outline_logic"
MENU.15 = "~View.~Errors"
MENU.16 = "~Help.C_~help"
MENU.17 = "~Options.~Language_editing.~Lexical_errors"
MENUITEMS = 17

MENUCMD.   = ''
MENUCMD.1  = '2 EVFEC370 AIDLG'
MENUCMD.2  = '5'
MENUCMD.3  = 'EVFEC370 TOKOPT'
MENUCMD.4  = 'EVFEC370 AIOPT'
MENUCMD.12 = '2'
MENUCMD.13 = '3 ;SET INCLUDE FUNCTION;SET EXCLUDE;SET VIEWNAME Functions'
MENUCMD.14 = '4 ;SET INCLUDE FUNCTION BRACE CONTROL;SET EXCLUDE'
MENUCMD.15 = '5 ;SET INCLUDE ERROR;SET EXCLUDE'
MENUCMD.16 = '6 EVFEC370 LANGHELP'
MENUCMD.17 = 'EVFEC370 LEOPT'

HELPID.   = 0
HELPID.1  = 16093
HELPID.2  = 16099
HELPID.3  = 16100
HELPID.4  = 16101
HELPID.13 = 16057
HELPID.14 = 16057
HELPID.15 = 16057
HELPID.16 = 16137
HELPID.17 = 16108

GROUPS. = ''
GROUPS.13 = 'FUNCTION'
GROUPS.14 = 'FUNCTION BRACE CONTROL'
GROUPS.15 = 'ERROR'

DO I = 1 TO MENUITEMS
   IF MENUCMD.I <> '' THEN DO
      'SET ACTIONBAR.' || MENU.I MENUCMD.I
      IF HELPID.I > 0 THEN
         'SET HELP.' HELPID.I
      IF GROUPS.I <> '' THEN
         'SET GROUP.' GROUPS.I
   END
END

MENUIDSTR = ' ACTIONBARID.' || MENU.3  'INTO ID3',    /* menu IDs for options */
            ' ACTIONBARID.' || MENU.4  'INTO ID4',
            ' ACTIONBARID.' || MENU.16 'INTO ID16',
            ' ACTIONBARID.' || MENU.17 'INTO ID17'
'EXTRACT' MENUIDSTR
MENUIDSTR = ID3 ID4 ID16 ID17

DROP MENU. MENUCMD. HELPID. MENUITEMS I GROUPS.         /* free excess memory */
DROP ID3 ID4 ID16 ID17

'SET ACTION.C-C ;SET INCLUDE FUNCTION;SET EXCLUDE;SET VIEWNAME Functions'

/* set up full & incremental parse */
'SET FULLPARSE EVFEC370 ALL'
'SET PARSER    EVFEC370 PARSE'

/* auto-indent */
'SET SYNONYM.NEWLINE EVFEC370 AIEXIST'
'SET SYNONYM.SPLITLINE MULT ;SPLITJOIN SPLIT;EVFEC370 AIEXIST'
'SET SYNONYM.OPENLINE MULT ;INSERT;EVFEC370 AINEW'
'SET ACTION.ENTER SPLITLINE'
'SET ACTION.C-ENTER OPENLINE'

/* bracket matching */
'SET ACTION.C-M MATCH'

/* template insertion (first character = new line) */
'SET GLOBAL.PROTO.C.if /if (?) {//   }/else {//   }'
'SET GLOBAL.PROTO.C.for _for (?; ?; ?) {__   }'
'SET GLOBAL.PROTO.C.while /while (?) {//   }'
'SET GLOBAL.PROTO.C.do /do {/   ?/   } while (?);'
'SET GLOBAL.PROTO.C.switch /switch (?) {/   case ?://      break;/   default://   }'
'SET GLOBAL.PROTO.C.case /case ?://   break;'
'SET GLOBAL.PROTO.C.main /main(int argc, char *argv[], char *envp)/{/   ? /}'
'SET ACTION.C-R PROTO PROTO.C.'

/* initial fonts settings */
'SET FONT.!  BLACK/WHITE                  "Default style"'
'SET FONT._  BLACK/WHITE                  "Layout blanks"'
'SET FONT.K  BRIGHT BLUE/WHITE            "Keyword"'
'SET FONT.X  BRIGHT BLUE/WHITE            "OS/2 keyword"'
'SET FONT.I  BLACK/WHITE                  "Identifier"'
'SET FONT.N  RED/WHITE                    "Constant"'
'SET FONT.Q  PINK/WHITE                   "String literal"'
'SET FONT.O  BLACK/WHITE                  "Operator"'
'SET FONT.P  BLACK/WHITE                  "Punctuator"'
'SET FONT.M  BLACK/WHITE                  "Continuation character"'
'SET FONT.C  CYAN/WHITE                   "Comment"'
'SET FONT.F  BLUE/WHITE                   "C library function"'
'SET FONT.B  BLACK/WHITE                  "Brace"'
'SET FONT.H  UNDERLINE BRIGHT BLUE/WHITE  "CPP directive"'
'SET FONT.E  REVERSE BRIGHT RED/WHITE     "Lexical error"'
'SET BASEFONT !'                          /* default style */

'SET TABS 4 7 10 13 16 19 42 EVERY 3'

/* init LS component: INIT HELP <default help id> <help lib> <LSX> <menu ids> */
'EVFEC370 INIT HELP 37001 EVFECLSH.HLP C.LSX' MENUIDSTR
/* OR init LS component: INIT NDX <C Help INF> <NDX API> <LSX> <menu ids> */
/*    'EVFEC370 INIT NDX CPPLNG DDE4TRIB C.LSX' MENUIDSTR                 */
'SET ACTION.F1 EVFEC370 HELP'

/* do a full parse */
'TRIGGER FULLPARSE'

'MACRO NAVIG.LX'
