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