add argument/usage message, correct exit status
[unix-history] / usr / src / usr.bin / vgrind / vgrindefs.5
CommitLineData
57474d4f
KB
1.\" Copyright (c) 1989 The Regents of the University of California.
2.\" All rights reserved.
7f6d710d 3.\"
57474d4f
KB
4.\" Redistribution and use in source and binary forms are permitted
5.\" provided that the above copyright notice and this paragraph are
6.\" duplicated in all such forms and that any documentation,
7.\" advertising materials, and other materials related to such
8.\" distribution and use acknowledge that the software was developed
9.\" by the University of California, Berkeley. The name of the
10.\" University may not be used to endorse or promote products derived
11.\" from this software without specific prior written permission.
12.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15.\"
16.\" @(#)vgrindefs.5 6.3 (Berkeley) %G%
7f6d710d
KM
17.\"
18.tr ||
e57131a7 19.TH VGRINDEFS 5 ""
7f6d710d
KM
20.UC 5
21.SH NAME
22vgrindefs \- vgrind's language definition data base
23.SH SYNOPSIS
24.B /usr/lib/vgrindefs
25.SH DESCRIPTION
26.I Vgrindefs
27contains all language definitions for vgrind. The data base is
28very similar to
29.IR termcap (5).
30.SH FIELDS
31The following table names and describes each field.
32.PP
33.nf
34.ta \w'k0-k9 'u +\w'Type 'u
35\fBName Type Description\fR
36pb str regular expression for start of a procedure
37bb str regular expression for start of a lexical block
38be str regular expression for the end of a lexical block
39cb str regular expression for the start of a comment
40ce str regular expression for the end of a comment
41sb str regular expression for the start of a string
42se str regular expression for the end of a string
43lb str regular expression for the start of a character constant
44le str regular expression for the end of a character constant
45tl bool present means procedures are only defined at the top
46 lexical level
47oc bool present means upper and lower case are equivalent
48kw str a list of keywords separated by spaces
49.fi
50.PP
51.B Example
52.PP
53The following entry, which describes the C language, is
54typical of a language entry.
55.PP
56.nf
57C|c:\
58 :pb=^\ed?*?\ed?\ep\ed?\(\ea?\):bb={:be=}:cb=/*:ce=*/:sb=":se=\ee":\e
59 :lb=':le=\ee':tl:\e
60 :kw=asm auto break case char continue default do double else enum\e
61 extern float for fortran goto if int long register return short\e
62 sizeof static struct switch typedef union unsigned while #define\e
63 #else #endif #if #ifdef #ifndef #include #undef # define else endif\e
64 if ifdef ifndef include undef:
65.fi
66.PP
67Note that the first field is just the language name (and any variants
68of it). Thus the C language could be specified to
69.IR vgrind (1)
70as "c" or "C".
71.PP
72Entries may continue onto multiple lines by giving a \e as the last
73character of a line.
74Capabilities in
75.I vgrindefs
76are of two types:
77Boolean capabilities which indicate that the language has
78some particular feature
79and string
80capabilities which give a regular expression or
81keyword list.
82.PP
83.B REGULAR EXPRESSIONS
84.PP
85.I Vgrindefs
86uses regular expression which are very similar to those of
87.IR ex (1)
88and
89.IR lex (1).
90The characters `^', `$', `:' and `\e'
91are reserved characters and must be
92"quoted" with a preceding \e if they
93are to be included as normal characters.
94The metasymbols and their meanings are:
95.IP $
96the end of a line
97.IP ^
98the beginning of a line
99.IP \ed
100a delimiter (space, tab, newline, start of line)
101.IP \ea
102matches any string of symbols (like .* in lex)
103.IP \ep
104matches any alphanumeric name. In a procedure definition (pb) the string
105that matches this symbol is used as the procedure name.
106.IP ()
107grouping
108.IP |
109alternation
110.IP ?
111last item is optional
112.IP \ee
113preceding any string means that the string will not match an
114input string if the input string is preceded by an escape character (\e).
115This is typically used for languages (like C) which can include the
29fbea5a 116string delimiter in a string by escaping it.
7f6d710d
KM
117.PP
118Unlike other regular expressions in the system, these match words
119and not characters. Hence something like "(tramp|steamer)flies?"
120would match "tramp", "steamer", "trampflies", or "steamerflies".
121.PP
122.B KEYWORD LIST
123.PP
124The keyword list is just a list of keywords in the language separated
125by spaces. If the "oc" boolean is specified, indicating that upper
126and lower case are equivalent, then all the keywords should be
127specified in lower case.
128.SH FILES
129.DT
130/usr/lib/vgrindefs file containing terminal descriptions
131.SH SEE ALSO
132vgrind(1), troff(1)
133.SH AUTHOR
134Dave Presotto
135.SH BUGS