home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / t / tex / !dvips / Documents / Fonts / Source / !lgrind / lg-docs / lgrindefs < prev   
Encoding:
Text File  |  1994-02-15  |  5.1 KB  |  121 lines

  1.  
  2. LGRINDEFS(5) FILE FORMATS LGRINDEFS(5)
  3.  
  4. NAME     
  5.  lgrindefs - lgrind's language definition data base
  6.  
  7. SYNOPSIS     
  8.  /cs/src/lgrind/lgrindefs
  9.  
  10. DESCRIPTION     
  11.  lgrindefs contains all language definitions for lgrind(1). The data base is very similar to vgrind(5) and
  12.  termcap(5), and it is upward-compatible with that of vgrind(5). Capabilities in lgrindefs are of two
  13.  types: Boolean capabilities which indicate that the language has some particular feature and string capa-
  14.  bilities which give a regular expression or keyword list. Entries may continue onto multiple lines by
  15.  giving a \ as the last character of a line. Lines starting with # are comments.
  16.  
  17.  Capabilities     
  18.  The following table names and describes each capability.
  19.  
  20.  Name Type Description
  21.  ab str Regular expression for the start of an alternate form comment
  22.  ae str Regular expression for the end of an alternate form comment
  23.  bb str Regular expression for the start of a block
  24.  be str Regular expression for the end of a lexical block
  25.  cb str Regular expression for the start of a comment
  26.  ce str Regular expression for the end of a comment
  27.  id str String giving characters other than letters and digits that may legally occur in identifiers
  28.  (default `_')
  29.  kw str A list of keywords separated by spaces
  30.  lb str Regular expression for the start of a character constant
  31.  le str Regular expression for the end of a character constant
  32.  mb str Regular expression for the start of TeX math within a comment
  33.  me str Regular expression for the end of TeX math within a comment
  34.  oc bool Present means upper and lower case are equivalent
  35.  pb str Regular expression for start of a procedure
  36.  pl bool Procedure definitions are constrained to the lexical level matched by the `px' capability
  37.  px str A match for this regular expression indicates that procedure definitions may occur at the
  38.  next lexical level. Useful for lisp-like languages in which procedure definitions occur as
  39.  subexpressions of defuns.
  40.  sb str Regular expression for the start of a string
  41.  se str Regular expression for the end of a string
  42.  tb str Regular expression for the start of TeX text within a comment
  43.  tc str Use the named entry as a continuation of this one
  44.  te str Regular expression for the end of TeX text within a comment
  45.  tl bool Present means procedures are only defined at the top lexical level
  46.  vb str Regular expression for the start of typewriter text within a comment
  47.  ve str Regular expression for the end of typewriter text within a comment
  48.  zb str Regular expression for the start of program text within a comment
  49.  ze str Regular expression for the end of program text within a comment
  50.  
  51.  Regular Expressions     
  52.  lgrindefs uses regular expressions similar to those of ex(1) and lex(1). The characters `^', `$', `|', `:',
  53.  and `\' are reserved characters and must be `quoted' with a preceding \ if they are to be included as
  54.  normal characters. The metasymbols and their meanings are:
  55.  
  56.  $ The end of a line
  57.  
  58.  ^ The beginning of a line
  59.  
  60.  \d A delimiter (space, tab, newline, start of line)
  61.  
  62.  \a Matches any string of symbols (like `.\(**' in lex)
  63.  
  64.  
  65. Sun Release 4.1 Last change: 9 September 1991 1
  66.  
  67.  
  68. LGRINDEFS(5) FILE FORMATS LGRINDEFS(5)
  69.  
  70.  \p Matches any identifier. In a procedure definition (the `pb' capability) the string that matches
  71.  this symbol is used as the procedure name.
  72.  
  73.  () Grouping
  74.  
  75.  | Alternation
  76.  
  77.  ? Last item is optional
  78.  
  79.  \e Preceding any string means that the string will not match an input string if the input string is
  80.  preceded by an escape character (\). This is typically used for languages (like C) that can
  81.  include the string delimiter in a string by escaping it.
  82.  
  83.  Unlike other regular expressions in the system, these match words and not characters. Hence something
  84.  like `(tramp|steamer)flies?' would match `tramp', `steamer', `trampflies', or `steamerflies'. Contrary to
  85.  some forms of regular expressions, lgrindef alternation binds very tightly. Grouping parentheses are
  86.  likely to be necessary in expressions involving alternation.
  87.  
  88.  Keyword List     
  89.  The keyword list is just a list of keywords in the language separated by spaces. If the `oc' boolean is
  90.  specified, indicating that upper and lower case are equivalent, then all the keywords should be specified
  91.  in lower case.
  92.  
  93. EXAMPLE     
  94.  The following entry, which describes the C language, is typical of a language entry.
  95.  
  96.   
  97.  C|c|the C programming language:\
  98.   :pb=^\d?\(**?\d?\p\d??):bb={:be=}:cb=/\(**:ce=\(**/:\
  99.   :sb=":se=\e":lb=':le=\e':tl:\
  100.   :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\
  101.   :kw=asm auto break case char continue default do double\
  102.   else enum extern float for fortran goto if int long\
  103.   register return short sizeof static struct switch typedef\
  104.   union unsigned while #define #else #endif #if #ifdef\
  105.   #ifndef #include #undef # define else endif if ifdef\
  106.   ifndef include undef:
  107.  
  108.  Note that the first field is just the language name (and any variants of it). Thus the C language could
  109.  be specified to lgrind(1) as `c' or `C'.
  110.  
  111. FILES     
  112.  /cs/src/lgrind/lgrindefs file containing terminal descriptions
  113.  
  114. SEE ALSO     
  115.  latex(1), lgrind(1), vgrindefs(5)
  116.  
  117.  
  118.  
  119. Sun Release 4.1 Last change: 9 September 1991 2
  120.  
  121.