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