1 .\" $NetBSD: vgrindefs.5,v 1.9 2003/08/07 11:17:02 agc Exp $
3 .\" Copyright (c) 1989, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)vgrindefs.5 8.1 (Berkeley) 6/6/93
37 .Nd language definition data base for
45 contains all language definitions for
51 The following table names and describes each field.
53 .Bl -column Namexxx Tpexxx
54 .It 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"
69 The following entry, which describes the C language, is
70 typical of a language entry.
73 :pb=^\ed?*?\ed?\ep\ed?\e(\ea?\e):bb={:be=}:cb=/*:ce=*/:sb=":se=\ee":\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:
82 Note that the first field is just the language name (and any variants
84 Thus the C language could be specified to
88 Entries may continue onto multiple lines by giving a \e as the last
93 Boolean capabilities which indicate that the language has
94 some particular feature
96 capabilities which give a regular expression or
98 .Sh REGULAR EXPRESSIONS
100 uses regular expression which are very similar to those of
104 The characters `^', `$', `:' and `\e'
105 are reserved characters and must be
106 "quoted" with a preceding
109 are to be included as normal characters.
110 The metasymbols and their meanings are:
111 .Bl -tag -width indent
115 the beginning of a line
117 a delimiter (space, tab, newline, start of line)
119 matches any string of symbols (like .* in lex)
121 matches any alphanumeric name.
122 In a procedure definition (pb) the string
123 that matches this symbol is used as the procedure name.
129 last item is optional
131 preceding any string means that the string will not match an
132 input string if the input string is preceded by an escape character (\e).
133 This is typically used for languages (like C) which can include the
134 string delimiter in a string by escaping it.
137 Unlike other regular expressions in the system, these match words
139 Hence something like "(tramp|steamer)flies?"
140 would match "tramp", "steamer", "trampflies", or "steamerflies".
142 The keyword list is just a list of keywords in the language separated
144 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.
148 .Bl -tag -width /usr/share/misc/vgrindefs -compact
149 .It Pa /usr/share/misc/vgrindefs
150 File containing terminal descriptions.
158 file format appeared in