| 1 |
Syntax: bf(%include) tt(pathname) |
| 2 |
|
| 3 |
This directive is used to switch to tt(pathname) while processing a grammar |
| 4 |
specification. Unless tt(pathname) defines an absolute file-path, tt(pathname) |
| 5 |
is searched relative to the location of bic()'s main grammar specification |
| 6 |
file (i.e., the grammar file that was specified as bic()'s command-line |
| 7 |
option). This directive can be used to split long grammar specification files |
| 8 |
in shorter, meaningful units. After processing tt(pathname) processing |
| 9 |
continues beyond the tt(%include pathname) directive. |
| 10 |
|
| 11 |
Bic()'s main grammar specification file could simply be: |
| 12 |
verb( |
| 13 |
%include spec/declarations |
| 14 |
%% |
| 15 |
%include spec/rules |
| 16 |
) |
| 17 |
where tt(spec/declarations) contains declarations and tt(spec/rules) |
| 18 |
contains the rules. Each of the files included using tt(%include) may itself |
| 19 |
use tt(%include) directives (which are then processed relative to their |
| 20 |
locations). The default nesting limit for tt(%include) directives is 10, but |
| 21 |
the option link(--max-inclusion-depth)(MAXDEPTH) can be used to change this |
| 22 |
default. |
| 23 |
|
| 24 |
tt(%include) directives should be specified on their own lines, not containing |
| 25 |
any other information. |