1*62423Sbostic.\" Copyright (c) 1989, 1991, 1993 2*62423Sbostic.\" The Regents of the University of California. All rights reserved. 320829Smckusick.\" 449654Scael.\" %sccs.include.redist.roff% 520829Smckusick.\" 6*62423Sbostic.\" @(#)vgrindefs.5 8.1 (Berkeley) 06/06/93 737560Sbostic.\" 849654Scael.Dd 949654Scael.Dt VGRINDEFS 5 1049654Scael.Os BSD 4.2 1149654Scael.Sh NAME 1249654Scael.Nm vgrindefs 1349654Scael.Nd language definition data base for 1449654Scael.Xr vgrind 1 1549654Scael.Sh SYNOPSIS 1649654Scael.Nm vgrindefs 1749654Scael.Sh DESCRIPTION 1849654ScaelThe 1949654Scael.Nm vgrindefs 2049654Scaelfile 2149654Scaelcontains all language definitions for 2249654Scael.Xr vgrind 1 . 2349654ScaelThe data base is 2420829Smckusickvery similar to 2549654Scael.Xr termcap 5 . 2649654Scael.Sh FIELDS 2720829SmckusickThe following table names and describes each field. 2849654Scael.Pp 2949654Scael.Bl -column Namexxx Tpexxx 3049654Scael.Sy Name Type Description 3149654Scael.It "pb str regular expression for start of a procedure" 3249654Scael.It "bb str regular expression for start of a lexical block" 3349654Scael.It "be str regular expression for the end of a lexical block" 3449654Scael.It "cb str regular expression for the start of a comment" 3549654Scael.It "ce str regular expression for the end of a comment" 3649654Scael.It "sb str regular expression for the start of a string" 3749654Scael.It "se str regular expression for the end of a string" 3849654Scael.It "lb str regular expression for the start of a character constant" 3949654Scael.It "le str regular expression for the end of a character constant" 4049654Scael.It "tl bool present means procedures are only defined at the top lexical level" 4149654Scael.It "oc bool present means upper and lower case are equivalent" 4249654Scael.It "kw str a list of keywords separated by spaces" 4349654Scael.El 4449654Scael.Pp 4549654Scael.Sh EXAMPLES 4620829SmckusickThe following entry, which describes the C language, is 4720829Smckusicktypical of a language entry. 4849654Scael.Bd -literal 4920829SmckusickC|c:\ 5050732Scael:pb=^\ed?*?\ed?\ep\ed?\e(\ea?\e):bb={:be=}:cb=/*:ce=*/:sb=":se=\ee":\e 5149654Scael:lb=':le=\ee':tl:\e 5249654Scael:kw=asm auto break case char continue default do double else enum\e 5349654Scaelextern float for fortran goto if int long register return short\e 5449654Scaelsizeof static struct switch typedef union unsigned while #define\e 5549654Scael#else #endif #if #ifdef #ifndef #include #undef # define else endif\e 5649654Scaelif ifdef ifndef include undef: 5749654Scael.Ed 5849654Scael.Pp 5920829SmckusickNote that the first field is just the language name (and any variants 6020829Smckusickof it). Thus the C language could be specified to 6149654Scael.Xr vgrind 1 6220829Smckusickas "c" or "C". 6349654Scael.Pp 6420829SmckusickEntries may continue onto multiple lines by giving a \e as the last 6520829Smckusickcharacter of a line. 6620829SmckusickCapabilities in 6749654Scael.Nm vgrindefs 6820829Smckusickare of two types: 6920829SmckusickBoolean capabilities which indicate that the language has 7020829Smckusicksome particular feature 7120829Smckusickand string 7220829Smckusickcapabilities which give a regular expression or 7320829Smckusickkeyword list. 7449654Scael.Sh REGULAR EXPRESSIONS 7549654Scael.Nm Vgrindefs 7620829Smckusickuses regular expression which are very similar to those of 7749654Scael.Xr ex 1 7820829Smckusickand 7949654Scael.Xr lex 1 . 8020829SmckusickThe characters `^', `$', `:' and `\e' 8120829Smckusickare reserved characters and must be 8249654Scael"quoted" with a preceding 8349654Scael.Ql \e 8449654Scaelif they 8520829Smckusickare to be included as normal characters. 8620829SmckusickThe metasymbols and their meanings are: 8749654Scael.Bl -tag -width indent 8849654Scael.It $ 8920829Smckusickthe end of a line 9049654Scael.It \&^ 9120829Smckusickthe beginning of a line 9249654Scael.It \ed 9320829Smckusicka delimiter (space, tab, newline, start of line) 9449654Scael.It \ea 9520829Smckusickmatches any string of symbols (like .* in lex) 9649654Scael.It \ep 9720829Smckusickmatches any alphanumeric name. In a procedure definition (pb) the string 9820829Smckusickthat matches this symbol is used as the procedure name. 9949654Scael.It () 10020829Smckusickgrouping 10149654Scael.It \&| 10220829Smckusickalternation 10349654Scael.It ? 10420829Smckusicklast item is optional 10549654Scael.It \ee 10620829Smckusickpreceding any string means that the string will not match an 10720829Smckusickinput string if the input string is preceded by an escape character (\e). 10820829SmckusickThis is typically used for languages (like C) which can include the 10932283Sbosticstring delimiter in a string by escaping it. 11049654Scael.El 11149654Scael.Pp 11220829SmckusickUnlike other regular expressions in the system, these match words 11320829Smckusickand not characters. Hence something like "(tramp|steamer)flies?" 11420829Smckusickwould match "tramp", "steamer", "trampflies", or "steamerflies". 11549654Scael.Sh KEYWORD LIST 11620829SmckusickThe keyword list is just a list of keywords in the language separated 11720829Smckusickby spaces. If the "oc" boolean is specified, indicating that upper 11820829Smckusickand lower case are equivalent, then all the keywords should be 11920829Smckusickspecified in lower case. 12049654Scael.Sh FILES 12149654Scael.Bl -tag -width /usr/share/misc/vgrindefs -compact 12249654Scael.It Pa /usr/share/misc/vgrindefs 12349654ScaelFile containing terminal descriptions. 12449654Scael.El 12549654Scael.Sh SEE ALSO 12649654Scael.Xr vgrind 1 , 12749654Scael.Xr troff 1 12849654Scael.Sh HISTORY 12949654ScaelThe 13049654Scael.Nm 13149654Scaelfile format appeared in 13249654Scael.Bx 4.2 . 133