| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<!DOCTYPE chapter SYSTEM "docbook-dtd-45/docbookx.dtd"> |
| 3 |
|
| 4 |
<chapter id="streamcmds"> |
| 5 |
<title>Input Stream Commands</title> |
| 6 |
|
| 7 |
<para> |
| 8 |
These are commands that exist in the input stream. They must be alone and at the beginning |
| 9 |
of the line to be respected. They will also be passed along to the output stream. |
| 10 |
</para> |
| 11 |
|
| 12 |
<section id="cmd-exit"> |
| 13 |
<title>Exit</title> |
| 14 |
<indexterm> |
| 15 |
<primary>Exit</primary> |
| 16 |
</indexterm> |
| 17 |
<para> |
| 18 |
When encountered, this command will halt input. No further input will be read, |
| 19 |
no output will be written, and the existing buffers will be silently discarded. |
| 20 |
After that, the process will exit. If you were considering using Exit, take a look |
| 21 |
at whether Ignore would suit your needs better. |
| 22 |
<emphasis>It is strongly recommended to precede an Exit with a Flush.</emphasis> |
| 23 |
</para> |
| 24 |
<screen> |
| 25 |
<STREAMCMD:EXIT> |
| 26 |
</screen> |
| 27 |
</section> |
| 28 |
|
| 29 |
<section id="cmd-flush"> |
| 30 |
<title>Flush</title> |
| 31 |
<indexterm> |
| 32 |
<primary>Flush</primary> |
| 33 |
</indexterm> |
| 34 |
<para> |
| 35 |
When encountered, this command will process all windows in the current buffer before continuing. |
| 36 |
This means that any window spanning contextual tests would not be able to see beyond a |
| 37 |
FLUSH point. |
| 38 |
</para> |
| 39 |
<screen> |
| 40 |
<STREAMCMD:FLUSH> |
| 41 |
</screen> |
| 42 |
</section> |
| 43 |
|
| 44 |
<section id="cmd-ignore"> |
| 45 |
<title>Ignore</title> |
| 46 |
<indexterm> |
| 47 |
<primary>Ignore</primary> |
| 48 |
</indexterm> |
| 49 |
<para> |
| 50 |
When encountered, this command will cause all subsequent input to be passed along to the output |
| 51 |
stream without any disambiguation, until it finds a Resume command. Useful for excluding parts |
| 52 |
of the input if it differs in e.g. genre or language. |
| 53 |
<emphasis>It is strongly recommended to precede an Ignore with a Flush.</emphasis> |
| 54 |
</para> |
| 55 |
<screen> |
| 56 |
<STREAMCMD:IGNORE> |
| 57 |
</screen> |
| 58 |
</section> |
| 59 |
|
| 60 |
<section id="cmd-resume"> |
| 61 |
<title>Resume</title> |
| 62 |
<indexterm> |
| 63 |
<primary>Resume</primary> |
| 64 |
</indexterm> |
| 65 |
<para> |
| 66 |
When encountered, this command resume disambiguation. If disambiguation is already in progress, |
| 67 |
it has no effect. |
| 68 |
</para> |
| 69 |
<screen> |
| 70 |
<STREAMCMD:RESUME> |
| 71 |
</screen> |
| 72 |
</section> |
| 73 |
|
| 74 |
<section id="cmd-setvar"> |
| 75 |
<title>Set Variable</title> |
| 76 |
<indexterm> |
| 77 |
<primary>Set Variable</primary> |
| 78 |
</indexterm> |
| 79 |
<para> |
| 80 |
Sets <link linkend="global-variables">global variables</link>. Same effect as the |
| 81 |
<link linkend="setvariable">SETVARIABLE</link> rule type, but applicable for a whole parsing chain. |
| 82 |
Takes a comma-separated list of variables to set, where each variable may have a value. |
| 83 |
</para> |
| 84 |
<screen> |
| 85 |
<STREAMCMD:SETVAR:poetry,year=1764> |
| 86 |
<STREAMCMD:SETVAR:news> |
| 87 |
<STREAMCMD:SETVAR:greek=ancient> |
| 88 |
</screen> |
| 89 |
</section> |
| 90 |
|
| 91 |
<section id="cmd-remvar"> |
| 92 |
<title>Unset Variable</title> |
| 93 |
<indexterm> |
| 94 |
<primary>Unset Variable</primary> |
| 95 |
</indexterm> |
| 96 |
<para> |
| 97 |
Unsets <link linkend="global-variables">global variables</link>. Same effect as the |
| 98 |
<link linkend="remvariable">REMVARIABLE</link> rule type, but applicable for a whole parsing chain. |
| 99 |
Takes a comma-separated list of variables to unset. |
| 100 |
</para> |
| 101 |
<screen> |
| 102 |
<STREAMCMD:REMVAR:poetry,year> |
| 103 |
<STREAMCMD:REMVAR:news> |
| 104 |
<STREAMCMD:REMVAR:greek> |
| 105 |
</screen> |
| 106 |
</section> |
| 107 |
|
| 108 |
</chapter> |