1*49654Scael.\" Copyright (c) 1989, 1991 The Regents of the University of California. 237560Sbostic.\" All rights reserved. 320829Smckusick.\" 4*49654Scael.\" %sccs.include.redist.roff% 520829Smckusick.\" 6*49654Scael.\" @(#)vgrindefs.5 6.6 (Berkeley) 05/10/91 737560Sbostic.\" 8*49654Scael.Dd 9*49654Scael.Dt VGRINDEFS 5 10*49654Scael.Os BSD 4.2 11*49654Scael.Sh NAME 12*49654Scael.Nm vgrindefs 13*49654Scael.Nd language definition data base for 14*49654Scael.Xr vgrind 1 15*49654Scael.Sh SYNOPSIS 16*49654Scael.Nm vgrindefs 17*49654Scael.Sh DESCRIPTION 18*49654ScaelThe 19*49654Scael.Nm vgrindefs 20*49654Scaelfile 21*49654Scaelcontains all language definitions for 22*49654Scael.Xr vgrind 1 . 23*49654ScaelThe data base is 2420829Smckusickvery similar to 25*49654Scael.Xr termcap 5 . 26*49654Scael.Sh FIELDS 2720829SmckusickThe following table names and describes each field. 28*49654Scael.Pp 29*49654Scael.Bl -column Namexxx Tpexxx 30*49654Scael.Sy Name Type Description 31*49654Scael.It "pb str regular expression for start of a procedure" 32*49654Scael.It "bb str regular expression for start of a lexical block" 33*49654Scael.It "be str regular expression for the end of a lexical block" 34*49654Scael.It "cb str regular expression for the start of a comment" 35*49654Scael.It "ce str regular expression for the end of a comment" 36*49654Scael.It "sb str regular expression for the start of a string" 37*49654Scael.It "se str regular expression for the end of a string" 38*49654Scael.It "lb str regular expression for the start of a character constant" 39*49654Scael.It "le str regular expression for the end of a character constant" 40*49654Scael.It "tl bool present means procedures are only defined at the top lexical level" 41*49654Scael.It "oc bool present means upper and lower case are equivalent" 42*49654Scael.It "kw str a list of keywords separated by spaces" 43*49654Scael.El 44*49654Scael.Pp 45*49654Scael.Sh EXAMPLES 4620829SmckusickThe following entry, which describes the C language, is 4720829Smckusicktypical of a language entry. 48*49654Scael.Bd -literal 4920829SmckusickC|c:\ 50*49654Scael:pb=^\ed?*?\ed?\ep\ed?\(\ea?\):bb={:be=}:cb=/*:ce=*/:sb=":se=\ee":\e 51*49654Scael:lb=':le=\ee':tl:\e 52*49654Scael:kw=asm auto break case char continue default do double else enum\e 53*49654Scaelextern float for fortran goto if int long register return short\e 54*49654Scaelsizeof static struct switch typedef union unsigned while #define\e 55*49654Scael#else #endif #if #ifdef #ifndef #include #undef # define else endif\e 56*49654Scaelif ifdef ifndef include undef: 57*49654Scael.Ed 58*49654Scael.Pp 5920829SmckusickNote that the first field is just the language name (and any variants 6020829Smckusickof it). Thus the C language could be specified to 61*49654Scael.Xr vgrind 1 6220829Smckusickas "c" or "C". 63*49654Scael.Pp 6420829SmckusickEntries may continue onto multiple lines by giving a \e as the last 6520829Smckusickcharacter of a line. 6620829SmckusickCapabilities in 67*49654Scael.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. 74*49654Scael.Sh REGULAR EXPRESSIONS 75*49654Scael.Nm Vgrindefs 7620829Smckusickuses regular expression which are very similar to those of 77*49654Scael.Xr ex 1 7820829Smckusickand 79*49654Scael.Xr lex 1 . 8020829SmckusickThe characters `^', `$', `:' and `\e' 8120829Smckusickare reserved characters and must be 82*49654Scael"quoted" with a preceding 83*49654Scael.Ql \e 84*49654Scaelif they 8520829Smckusickare to be included as normal characters. 8620829SmckusickThe metasymbols and their meanings are: 87*49654Scael.Bl -tag -width indent 88*49654Scael.It $ 8920829Smckusickthe end of a line 90*49654Scael.It \&^ 9120829Smckusickthe beginning of a line 92*49654Scael.It \ed 9320829Smckusicka delimiter (space, tab, newline, start of line) 94*49654Scael.It \ea 9520829Smckusickmatches any string of symbols (like .* in lex) 96*49654Scael.It \ep 9720829Smckusickmatches any alphanumeric name. In a procedure definition (pb) the string 9820829Smckusickthat matches this symbol is used as the procedure name. 99*49654Scael.It () 10020829Smckusickgrouping 101*49654Scael.It \&| 10220829Smckusickalternation 103*49654Scael.It ? 10420829Smckusicklast item is optional 105*49654Scael.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. 110*49654Scael.El 111*49654Scael.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". 115*49654Scael.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. 120*49654Scael.Sh FILES 121*49654Scael.Bl -tag -width /usr/share/misc/vgrindefs -compact 122*49654Scael.It Pa /usr/share/misc/vgrindefs 123*49654ScaelFile containing terminal descriptions. 124*49654Scael.El 125*49654Scael.Sh SEE ALSO 126*49654Scael.Xr vgrind 1 , 127*49654Scael.Xr troff 1 128*49654Scael.Sh HISTORY 129*49654ScaelThe 130*49654Scael.Nm 131*49654Scaelfile format appeared in 132*49654Scael.Bx 4.2 . 133