[BACK]Return to vgrindefs.5 CVS log [TXT][DIR] Up to [local] / src / usr.bin / vgrind

Annotation of src/usr.bin/vgrind/vgrindefs.5, Revision 1.2

1.2     ! deraadt     1: .\"    $OpenBSD: vgrindefs.5,v 1.3 1994/11/17 08:28:07 jtc Exp $
1.1       deraadt     2: .\"    $NetBSD: vgrindefs.5,v 1.3 1994/11/17 08:28:07 jtc Exp $
                      3: .\"
                      4: .\" Copyright (c) 1989, 1991, 1993
                      5: .\"    The Regents of the University of California.  All rights reserved.
                      6: .\"
                      7: .\" Redistribution and use in source and binary forms, with or without
                      8: .\" modification, are permitted provided that the following conditions
                      9: .\" are met:
                     10: .\" 1. Redistributions of source code must retain the above copyright
                     11: .\"    notice, this list of conditions and the following disclaimer.
                     12: .\" 2. Redistributions in binary form must reproduce the above copyright
                     13: .\"    notice, this list of conditions and the following disclaimer in the
                     14: .\"    documentation and/or other materials provided with the distribution.
                     15: .\" 3. All advertising materials mentioning features or use of this software
                     16: .\"    must display the following acknowledgement:
                     17: .\"    This product includes software developed by the University of
                     18: .\"    California, Berkeley and its contributors.
                     19: .\" 4. Neither the name of the University nor the names of its contributors
                     20: .\"    may be used to endorse or promote products derived from this software
                     21: .\"    without specific prior written permission.
                     22: .\"
                     23: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     24: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     25: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     26: .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     27: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     28: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     29: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     30: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     31: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     32: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     33: .\" SUCH DAMAGE.
                     34: .\"
                     35: .\"     @(#)vgrindefs.5        8.1 (Berkeley) 6/6/93
                     36: .\"
                     37: .Dd June 6, 1993
                     38: .Dt VGRINDEFS 5
                     39: .Os BSD 4.2
                     40: .Sh NAME
                     41: .Nm vgrindefs
                     42: .Nd language definition data base for
                     43: .Xr vgrind 1
                     44: .Sh SYNOPSIS
                     45: .Nm vgrindefs
                     46: .Sh DESCRIPTION
                     47: The
                     48: .Nm vgrindefs
                     49: file
                     50: contains all language definitions for
                     51: .Xr vgrind 1 .
                     52: The data base is
                     53: very similar to
                     54: .Xr termcap 5 .
                     55: .Sh FIELDS
                     56: The following table names and describes each field.
                     57: .Pp
                     58: .Bl -column Namexxx Tpexxx
                     59: .Sy Name       Type    Description
                     60: .It "pb        str     regular expression for start of a procedure"
                     61: .It "bb        str     regular expression for start of a lexical block"
                     62: .It "be        str     regular expression for the end of a lexical block"
                     63: .It "cb        str     regular expression for the start of a comment"
                     64: .It "ce        str     regular expression for the end of a comment"
                     65: .It "sb        str     regular expression for the start of a string"
                     66: .It "se        str     regular expression for the end of a string"
                     67: .It "lb        str     regular expression for the start of a character constant"
                     68: .It "le        str     regular expression for the end of a character constant"
                     69: .It "tl        bool    present means procedures are only defined at the top lexical level"
                     70: .It "oc        bool    present means upper and lower case are equivalent"
                     71: .It "kw        str     a list of keywords separated by spaces"
                     72: .El
                     73: .Pp
                     74: .Sh EXAMPLES
                     75: The following entry, which describes the C language, is
                     76: typical of a language entry.
                     77: .Bd -literal
                     78: C|c:\
                     79: :pb=^\ed?*?\ed?\ep\ed?\e(\ea?\e):bb={:be=}:cb=/*:ce=*/:sb=":se=\ee":\e
                     80: :lb=':le=\ee':tl:\e
                     81: :kw=asm auto break case char continue default do double else enum\e
                     82: extern float for fortran goto if int long register return short\e
                     83: sizeof static struct switch typedef union unsigned while #define\e
                     84: #else #endif #if #ifdef #ifndef #include #undef # define else endif\e
                     85: if ifdef ifndef include undef:
                     86: .Ed
                     87: .Pp
                     88: Note that the first field is just the language name (and any variants
                     89: of it).  Thus the C language could be specified to
                     90: .Xr vgrind 1
                     91: as "c" or "C".
                     92: .Pp
                     93: Entries may continue onto multiple lines by giving a \e as the last
                     94: character of a line.
                     95: Capabilities in
                     96: .Nm vgrindefs
                     97: are of two types:
                     98: Boolean capabilities which indicate that the language has
                     99: some particular feature
                    100: and string
                    101: capabilities which give a regular expression or
                    102: keyword list.
                    103: .Sh REGULAR  EXPRESSIONS
                    104: .Nm Vgrindefs
                    105: uses regular expression which are very similar to those of
                    106: .Xr ex 1
                    107: and
                    108: .Xr lex 1 .
                    109: The characters `^', `$', `:' and `\e'
                    110: are reserved characters and must be
                    111: "quoted" with a preceding
                    112: .Ql \e
                    113: if they
                    114: are to be included as normal characters.
                    115: The metasymbols and their meanings are:
                    116: .Bl -tag -width indent
                    117: .It $
                    118: the end of a line
                    119: .It \&^
                    120: the beginning of a line
                    121: .It \ed
                    122: a delimiter (space, tab, newline, start of line)
                    123: .It \ea
                    124: matches any string of symbols (like .* in lex)
                    125: .It \ep
                    126: matches any alphanumeric name.  In a procedure definition (pb) the string
                    127: that matches this symbol is used as the procedure name.
                    128: .It ()
                    129: grouping
                    130: .It \&|
                    131: alternation
                    132: .It ?
                    133: last item is optional
                    134: .It \ee
                    135: preceding any string means that the string will not match an
                    136: input string if the input string is preceded by an escape character (\e).
                    137: This is typically used for languages (like C) which can include the
                    138: string delimiter in a string by escaping it.
                    139: .El
                    140: .Pp
                    141: Unlike other regular expressions in the system,  these match words
                    142: and not characters.  Hence something like "(tramp|steamer)flies?"
                    143: would match "tramp", "steamer", "trampflies", or "steamerflies".
                    144: .Sh KEYWORD  LIST
                    145: The keyword list is just a list of keywords in the language separated
                    146: by spaces.  If the "oc" boolean is specified, indicating that upper
                    147: and lower case are equivalent, then all the keywords should be
                    148: specified in lower case.
                    149: .Sh FILES
                    150: .Bl -tag -width /usr/share/misc/vgrindefs -compact
                    151: .It Pa /usr/share/misc/vgrindefs
                    152: File containing terminal descriptions.
                    153: .El
                    154: .Sh SEE ALSO
                    155: .Xr vgrind 1 ,
                    156: .Xr troff 1
                    157: .Sh HISTORY
                    158: The
                    159: .Nm
                    160: file format appeared in
                    161: .Bx 4.2 .