home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_01 / 1001108a < prev    next >
Text File  |  1991-11-22  |  2KB  |  112 lines

  1.    CMENU Specification Language
  2.    ----------------------------
  3.  
  4. Explanation of my "loose BNF" form:
  5.  
  6.  := reads "is defined as".
  7.  
  8.  Terms in <>s are syntactic objects.
  9.  
  10.  Terms in CAPITALS are keywords.
  11.  
  12.  An item in [] is optional
  13.  
  14.  If a set of items is enclosed in {} with |
  15.     between each item, or a range is shown
  16.     using the - character, exactly one of
  17.     those items must be picked.
  18.  
  19.  * to the right of an object denotes 0
  20.     or more occurrences.
  21.  
  22.  + to the right of an object denotes 1
  23.     or more occurrences.
  24.  
  25.  Wherever a separator is necessary to
  26.     delimit tokens, the characters ';' and
  27.     ',' are both valid separators along
  28.     with the usual whitespace characters 
  29.     (space, tab and newline.)
  30. ------------------------------------------
  31.         
  32. <cmenu-source-file> :=
  33.     <menu-defn> +
  34.  
  35. <menu-defn> :=
  36.     MENU [<identifer>] :
  37.         <menu-option> *
  38.         <item-defn> +
  39.     ENDMENU
  40.  
  41. <identifier> :=
  42.     { a-z | A-Z }+  { a-z | A-Z | 0-9 } *
  43.  
  44. <menu-optiion> :=
  45.     PATH <text>
  46.     ALIGN { LEFT | CENTER } |
  47.     ESCAPE |
  48.     NOESCAPE |
  49.     SPACING { 1 | 2 } |
  50.     COLUMNS <integer>
  51.  
  52. <integer> :=
  53.     {0-9} +
  54.  
  55. <text> :=
  56.     {
  57.         "<ascii-string>"  |
  58.         '<ascii-string>'  |
  59.          <no-space-string> 
  60.  
  61.     }
  62.  
  63. <item_defn> :=
  64.     ITEM [<identifier>] : [<text>]
  65.     [<item-option>] *
  66.     <action-code>
  67.  
  68. <item-option> :=
  69.     NEXTITEM
  70.         {
  71.             <identifier> |
  72.             FIRST  |
  73.             LAST  |
  74.             NEXT
  75.         }  |
  76.     TEXT <text> |
  77.     HELP <text>  |
  78.     PATH <text> |
  79.     PROMPT  |
  80.     PAUSE |
  81.     NOPROMPT  |
  82.     NOPAUSE |
  83.     NOPRECLEAR  |
  84.     PRECLEAR 
  85.     
  86. <action-code> :=
  87.     {
  88.         ACTION  <text> |
  89.         EXIT |
  90.         LMENU <identifer>  |
  91.         EMENU <text>
  92.     }
  93.  
  94. <ascii-string> := string containing any
  95.     ASCII characters, delimited by either
  96.     single (') or double (") quotes.
  97.     Line continuation is NOT permitted.
  98.     
  99. <no-space-string> := string without
  100.     quotes, containing no whitespace 
  101.     characters whatsoever. Terminated
  102.     by first whitespace character.
  103.  
  104. Note: the <text> displayed for any one
  105.     item may be specified either as an
  106.     <item-option> (the TEXT clause) or 
  107.     immediately following the colon after
  108.     the ITEM declaration. Exactly ONE
  109.     of these methods must be used for
  110.     each item in the menu file.
  111.  
  112.