Commit | Line | Data |
---|---|---|
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 | |
22 | vgrindefs \- vgrind's language definition data base | |
23 | .SH SYNOPSIS | |
24 | .B /usr/lib/vgrindefs | |
25 | .SH DESCRIPTION | |
26 | .I Vgrindefs | |
27 | contains all language definitions for vgrind. The data base is | |
28 | very similar to | |
29 | .IR termcap (5). | |
30 | .SH FIELDS | |
31 | The 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 | |
36 | pb str regular expression for start of a procedure | |
37 | bb str regular expression for start of a lexical block | |
38 | be str regular expression for the end of a lexical block | |
39 | cb str regular expression for the start of a comment | |
40 | ce str regular expression for the end of a comment | |
41 | sb str regular expression for the start of a string | |
42 | se str regular expression for the end of a string | |
43 | lb str regular expression for the start of a character constant | |
44 | le str regular expression for the end of a character constant | |
45 | tl bool present means procedures are only defined at the top | |
46 | lexical level | |
47 | oc bool present means upper and lower case are equivalent | |
48 | kw str a list of keywords separated by spaces | |
49 | .fi | |
50 | .PP | |
51 | .B Example | |
52 | .PP | |
53 | The following entry, which describes the C language, is | |
54 | typical of a language entry. | |
55 | .PP | |
56 | .nf | |
57 | C|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 | |
67 | Note that the first field is just the language name (and any variants | |
68 | of it). Thus the C language could be specified to | |
69 | .IR vgrind (1) | |
70 | as "c" or "C". | |
71 | .PP | |
72 | Entries may continue onto multiple lines by giving a \e as the last | |
73 | character of a line. | |
74 | Capabilities in | |
75 | .I vgrindefs | |
76 | are of two types: | |
77 | Boolean capabilities which indicate that the language has | |
78 | some particular feature | |
79 | and string | |
80 | capabilities which give a regular expression or | |
81 | keyword list. | |
82 | .PP | |
83 | .B REGULAR EXPRESSIONS | |
84 | .PP | |
85 | .I Vgrindefs | |
86 | uses regular expression which are very similar to those of | |
87 | .IR ex (1) | |
88 | and | |
89 | .IR lex (1). | |
90 | The characters `^', `$', `:' and `\e' | |
91 | are reserved characters and must be | |
92 | "quoted" with a preceding \e if they | |
93 | are to be included as normal characters. | |
94 | The metasymbols and their meanings are: | |
95 | .IP $ | |
96 | the end of a line | |
97 | .IP ^ | |
98 | the beginning of a line | |
99 | .IP \ed | |
100 | a delimiter (space, tab, newline, start of line) | |
101 | .IP \ea | |
102 | matches any string of symbols (like .* in lex) | |
103 | .IP \ep | |
104 | matches any alphanumeric name. In a procedure definition (pb) the string | |
105 | that matches this symbol is used as the procedure name. | |
106 | .IP () | |
107 | grouping | |
108 | .IP | | |
109 | alternation | |
110 | .IP ? | |
111 | last item is optional | |
112 | .IP \ee | |
113 | preceding any string means that the string will not match an | |
114 | input string if the input string is preceded by an escape character (\e). | |
115 | This is typically used for languages (like C) which can include the | |
29fbea5a | 116 | string delimiter in a string by escaping it. |
7f6d710d KM |
117 | .PP |
118 | Unlike other regular expressions in the system, these match words | |
119 | and not characters. Hence something like "(tramp|steamer)flies?" | |
120 | would match "tramp", "steamer", "trampflies", or "steamerflies". | |
121 | .PP | |
122 | .B KEYWORD LIST | |
123 | .PP | |
124 | The keyword list is just a list of keywords in the language separated | |
125 | by spaces. If the "oc" boolean is specified, indicating that upper | |
126 | and lower case are equivalent, then all the keywords should be | |
127 | specified in lower case. | |
128 | .SH FILES | |
129 | .DT | |
130 | /usr/lib/vgrindefs file containing terminal descriptions | |
131 | .SH SEE ALSO | |
132 | vgrind(1), troff(1) | |
133 | .SH AUTHOR | |
134 | Dave Presotto | |
135 | .SH BUGS |