[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.4

1.4     ! aaron       1: .\"    $OpenBSD: vgrindefs.5,v 1.3 1998/10/30 00:24:42 aaron 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
1.3       aaron      56: The following table names and describes each field:
1.1       deraadt    57: .Bl -column Namexxx Tpexxx
                     58: .Sy Name       Type    Description
                     59: .It "pb        str     regular expression for start of a procedure"
                     60: .It "bb        str     regular expression for start of a lexical block"
                     61: .It "be        str     regular expression for the end of a lexical block"
                     62: .It "cb        str     regular expression for the start of a comment"
                     63: .It "ce        str     regular expression for the end of a comment"
                     64: .It "sb        str     regular expression for the start of a string"
                     65: .It "se        str     regular expression for the end of a string"
                     66: .It "lb        str     regular expression for the start of a character constant"
                     67: .It "le        str     regular expression for the end of a character constant"
                     68: .It "tl        bool    present means procedures are only defined at the top lexical level"
                     69: .It "oc        bool    present means upper and lower case are equivalent"
                     70: .It "kw        str     a list of keywords separated by spaces"
                     71: .El
                     72: .Pp
                     73: .Sh EXAMPLES
                     74: The following entry, which describes the C language, is
1.3       aaron      75: typical of a language entry:
1.1       deraadt    76: .Bd -literal
                     77: C|c:\
                     78: :pb=^\ed?*?\ed?\ep\ed?\e(\ea?\e):bb={:be=}:cb=/*:ce=*/:sb=":se=\ee":\e
                     79: :lb=':le=\ee':tl:\e
                     80: :kw=asm auto break case char continue default do double else enum\e
                     81: extern float for fortran goto if int long register return short\e
                     82: sizeof static struct switch typedef union unsigned while #define\e
                     83: #else #endif #if #ifdef #ifndef #include #undef # define else endif\e
                     84: if ifdef ifndef include undef:
                     85: .Ed
                     86: .Pp
                     87: Note that the first field is just the language name (and any variants
                     88: of it).  Thus the C language could be specified to
                     89: .Xr vgrind 1
                     90: as "c" or "C".
                     91: .Pp
                     92: Entries may continue onto multiple lines by giving a \e as the last
                     93: character of a line.
                     94: Capabilities in
                     95: .Nm vgrindefs
                     96: are of two types:
                     97: Boolean capabilities which indicate that the language has
                     98: some particular feature
                     99: and string
                    100: capabilities which give a regular expression or
                    101: keyword list.
                    102: .Sh REGULAR  EXPRESSIONS
1.3       aaron     103: .Nm vgrindefs
1.1       deraadt   104: uses regular expression which are very similar to those of
                    105: .Xr ex 1
                    106: and
                    107: .Xr lex 1 .
                    108: The characters `^', `$', `:' and `\e'
                    109: are reserved characters and must be
                    110: "quoted" with a preceding
                    111: .Ql \e
                    112: if they
                    113: are to be included as normal characters.
                    114: The metasymbols and their meanings are:
                    115: .Bl -tag -width indent
                    116: .It $
1.3       aaron     117: End of a line.
1.1       deraadt   118: .It \&^
1.3       aaron     119: Beginning of a line.
1.1       deraadt   120: .It \ed
1.3       aaron     121: A delimiter (space, tab, newline, start of line).
1.1       deraadt   122: .It \ea
1.3       aaron     123: Matches any string of symbols (like .* in lex).
1.1       deraadt   124: .It \ep
1.3       aaron     125: Matches any alphanumeric name.  In a procedure definition (pb) the string
1.1       deraadt   126: that matches this symbol is used as the procedure name.
                    127: .It ()
1.3       aaron     128: Grouping.
1.1       deraadt   129: .It \&|
1.3       aaron     130: Alternation.
1.1       deraadt   131: .It ?
1.3       aaron     132: Last item is optional.
1.1       deraadt   133: .It \ee
1.3       aaron     134: Preceding any string means that the string will not match an
1.1       deraadt   135: input string if the input string is preceded by an escape character (\e).
                    136: This is typically used for languages (like C) which can include the
                    137: string delimiter in a string by escaping it.
                    138: .El
                    139: .Pp
                    140: Unlike other regular expressions in the system,  these match words
                    141: and not characters.  Hence something like "(tramp|steamer)flies?"
                    142: would match "tramp", "steamer", "trampflies", or "steamerflies".
                    143: .Sh KEYWORD  LIST
                    144: The keyword list is just a list of keywords in the language separated
                    145: by spaces.  If the "oc" boolean is specified, indicating that upper
                    146: and lower case are equivalent, then all the keywords should be
                    147: specified in lower case.
                    148: .Sh FILES
                    149: .Bl -tag -width /usr/share/misc/vgrindefs -compact
                    150: .It Pa /usr/share/misc/vgrindefs
1.3       aaron     151: file containing terminal descriptions
1.1       deraadt   152: .El
                    153: .Sh SEE ALSO
1.3       aaron     154: .Xr troff 1 ,
                    155: .Xr vgrind 1
1.1       deraadt   156: .Sh HISTORY
                    157: The
                    158: .Nm
                    159: file format appeared in
                    160: .Bx 4.2 .