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