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