Annotation of src/usr.bin/vgrind/vgrindefs.5, Revision 1.1
1.1 ! deraadt 1: .\" $NetBSD: vgrindefs.5,v 1.3 1994/11/17 08:28:07 jtc Exp $
! 2: .\"
! 3: .\" Copyright (c) 1989, 1991, 1993
! 4: .\" The Regents of the University of California. All rights reserved.
! 5: .\"
! 6: .\" Redistribution and use in source and binary forms, with or without
! 7: .\" modification, are permitted provided that the following conditions
! 8: .\" are met:
! 9: .\" 1. Redistributions of source code must retain the above copyright
! 10: .\" notice, this list of conditions and the following disclaimer.
! 11: .\" 2. Redistributions in binary form must reproduce the above copyright
! 12: .\" notice, this list of conditions and the following disclaimer in the
! 13: .\" documentation and/or other materials provided with the distribution.
! 14: .\" 3. All advertising materials mentioning features or use of this software
! 15: .\" must display the following acknowledgement:
! 16: .\" This product includes software developed by the University of
! 17: .\" California, Berkeley and its contributors.
! 18: .\" 4. Neither the name of the University nor the names of its contributors
! 19: .\" may be used to endorse or promote products derived from this software
! 20: .\" without specific prior written permission.
! 21: .\"
! 22: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
! 23: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! 24: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! 25: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
! 26: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! 27: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
! 28: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
! 29: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
! 30: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
! 31: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! 32: .\" SUCH DAMAGE.
! 33: .\"
! 34: .\" @(#)vgrindefs.5 8.1 (Berkeley) 6/6/93
! 35: .\"
! 36: .Dd June 6, 1993
! 37: .Dt VGRINDEFS 5
! 38: .Os BSD 4.2
! 39: .Sh NAME
! 40: .Nm vgrindefs
! 41: .Nd language definition data base for
! 42: .Xr vgrind 1
! 43: .Sh SYNOPSIS
! 44: .Nm vgrindefs
! 45: .Sh DESCRIPTION
! 46: The
! 47: .Nm vgrindefs
! 48: file
! 49: contains all language definitions for
! 50: .Xr vgrind 1 .
! 51: The data base is
! 52: very similar to
! 53: .Xr termcap 5 .
! 54: .Sh FIELDS
! 55: The following table names and describes each field.
! 56: .Pp
! 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
! 75: typical of a language entry.
! 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
! 103: .Nm Vgrindefs
! 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 $
! 117: the end of a line
! 118: .It \&^
! 119: the beginning of a line
! 120: .It \ed
! 121: a delimiter (space, tab, newline, start of line)
! 122: .It \ea
! 123: matches any string of symbols (like .* in lex)
! 124: .It \ep
! 125: matches any alphanumeric name. In a procedure definition (pb) the string
! 126: that matches this symbol is used as the procedure name.
! 127: .It ()
! 128: grouping
! 129: .It \&|
! 130: alternation
! 131: .It ?
! 132: last item is optional
! 133: .It \ee
! 134: preceding any string means that the string will not match an
! 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
! 151: File containing terminal descriptions.
! 152: .El
! 153: .Sh SEE ALSO
! 154: .Xr vgrind 1 ,
! 155: .Xr troff 1
! 156: .Sh HISTORY
! 157: The
! 158: .Nm
! 159: file format appeared in
! 160: .Bx 4.2 .