![]() |
<Lexical Structure> |
[ Tokens | Case-sensitivity | Comments | Lexical Inclusion | Macros ]
The table below contains an explanation of the seven token kinds, INT, FLOAT, CHAR, STRING, IDENTIFIER, DEFATTR, and WHATEVER.
| Token | Regexp (Yacc) | Examples |
|---|---|---|
| INT | [0-9]+ | 0, 7, 42, 087 |
| FLOAT | [0-9]* \. [0-9]+ | 0.0, .99, 3.14, 01.10 |
| CHAR | '[^\"'\n\t]' | 'c', ' ', 'ø', '\n', '\t' |
| STRING | \"((\\\")|([^\"\n\t]))*\" | "", "c", "foo", "hello !\n" |
| IDENTIFIER | [a-zA-Z]([a-zA-Z0-9]| (_[a-zA-Z0-9]))* |
x, x87, X_1, name, Amount |
| DEFATTR | [^ \n\t&<>\"=\[\]]+ | x, 87, -8a, xyz, år, foo' |
| WHATEVER | [^<>\n]* | basically, any!, ' $line@# |
| HTMLCOMMENT | [^->]*|-+[^->]*|>+[^->]* | basically, any!, ' <--line--@# |
<bigwig> is case-sensitive meaning that it distinguishes between upper and lower-case characters. Thus the identifiers "amount", "Amount", and "AMOUNT" are different. However, within HTML documents (excepting gap names), <bigwig> is case-insensitive. For instance, <textarea>, <Textarea>, and <TEXTAREA> mean the same.
There are two way of forming comments in <bigwig>. As in C or Java, comments are written within /* (slash-asterisk) and */ (asterisk-slash). However, unlike the two languages, <bigwig> supports arbitrary nesting of comments. Also, comments can be formed using // (double-slash), with the effect that the rest of the line is taken as a comment. The two ways of forming comments are respectively referred to as region comments and line comments. In HTML mode the usual <!-- ... --> comments apply, meaning that anything within is ignored by <bigwig>. Note, however, that such comments are generated in the document output.
As in C, lexical file inclusion is performed by the directive "#include". This directive takes one argument, namely a URL in quotes. The URL can be either a file or a hyper-reference (beginning with "http://"). If a file is specified, <bigwig> will fetch the file from the file-system, as in C. If a hyper-reference is specified, the URL-file will be fetched from the Internet (using W3C's Libwww) at compile-time. The URL can also be supplied in angled brackets, in which case the URL is prepended with a string (defaulting to a local macro directory containing various macro packages). This prepend string can be altered in <bigwig>'s configuration file ".bigwig".
<bigwig> provides no lexical macro concept, but has a much more powerful syntactic macro concept.
|
bigwig@brics.dk Last updated: November 2, 2001 |
|