Annotation of src/usr.bin/vgrind/vgrindefs.5, Revision 1.6
1.6 ! aaron 1: .\" $OpenBSD: vgrindefs.5,v 1.5 1999/05/23 14:11:06 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
1.5 aaron 39: .Os
1.1 deraadt 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: .Sh EXAMPLES
73: The following entry, which describes the C language, is
1.3 aaron 74: typical of a language entry:
1.1 deraadt 75: .Bd -literal
76: C|c:\
77: :pb=^\ed?*?\ed?\ep\ed?\e(\ea?\e):bb={:be=}:cb=/*:ce=*/:sb=":se=\ee":\e
78: :lb=':le=\ee':tl:\e
79: :kw=asm auto break case char continue default do double else enum\e
80: extern float for fortran goto if int long register return short\e
81: sizeof static struct switch typedef union unsigned while #define\e
82: #else #endif #if #ifdef #ifndef #include #undef # define else endif\e
83: if ifdef ifndef include undef:
84: .Ed
85: .Pp
86: Note that the first field is just the language name (and any variants
87: of it). Thus the C language could be specified to
88: .Xr vgrind 1
89: as "c" or "C".
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
99: capabilities which give a regular expression or
100: keyword list.
101: .Sh REGULAR EXPRESSIONS
1.3 aaron 102: .Nm vgrindefs
1.1 deraadt 103: uses regular expression which are very similar to those of
104: .Xr ex 1
105: and
106: .Xr lex 1 .
107: The characters `^', `$', `:' and `\e'
108: are reserved characters and must be
109: "quoted" with a preceding
110: .Ql \e
111: if they
112: are to be included as normal characters.
113: The metasymbols and their meanings are:
114: .Bl -tag -width indent
115: .It $
1.3 aaron 116: End of a line.
1.1 deraadt 117: .It \&^
1.3 aaron 118: Beginning of a line.
1.1 deraadt 119: .It \ed
1.3 aaron 120: A delimiter (space, tab, newline, start of line).
1.1 deraadt 121: .It \ea
1.3 aaron 122: Matches any string of symbols (like .* in lex).
1.1 deraadt 123: .It \ep
1.3 aaron 124: Matches any alphanumeric name. In a procedure definition (pb) the string
1.1 deraadt 125: that matches this symbol is used as the procedure name.
126: .It ()
1.3 aaron 127: Grouping.
1.1 deraadt 128: .It \&|
1.3 aaron 129: Alternation.
1.1 deraadt 130: .It ?
1.3 aaron 131: Last item is optional.
1.1 deraadt 132: .It \ee
1.3 aaron 133: Preceding any string means that the string will not match an
1.1 deraadt 134: input string if the input string is preceded by an escape character (\e).
135: This is typically used for languages (like C) which can include the
136: string delimiter in a string by escaping it.
137: .El
138: .Pp
139: Unlike other regular expressions in the system, these match words
140: and not characters. Hence something like "(tramp|steamer)flies?"
141: would match "tramp", "steamer", "trampflies", or "steamerflies".
1.6 ! aaron 142: .Sh KEYWORD LIST
1.1 deraadt 143: The keyword list is just a list of keywords in the language separated
144: by spaces. If the "oc" boolean is specified, indicating that upper
145: and lower case are equivalent, then all the keywords should be
146: specified in lower case.
147: .Sh FILES
148: .Bl -tag -width /usr/share/misc/vgrindefs -compact
149: .It Pa /usr/share/misc/vgrindefs
1.3 aaron 150: file containing terminal descriptions
1.1 deraadt 151: .El
152: .Sh SEE ALSO
1.3 aaron 153: .Xr troff 1 ,
154: .Xr vgrind 1
1.1 deraadt 155: .Sh HISTORY
156: The
157: .Nm
158: file format appeared in
159: .Bx 4.2 .