Next: ret Instruction, Previous: putback Instruction, Up: Assembler Instruction Set [Contents][Index]

This instruction has a short and long form:

rdLENGTHrdNONT_QUOTED,RHS,POS,LENGTH

The option `--dump-asm[=simple]` dumps an assembler program with `rd`

instructions in the short form.
The option `--dump-asm=extended` dumps an assembler program with `rd`

instructions in the long form.
The program `topdown`

uses `rd`

instructions in the long form.

The instruction consumes `LENGTH` symbols from a training terminal symbol sequence—increments the current position in the training sequence by `LENGTH`.

Optionally, the instruction increments the frequency of a production with an auxiliary nonterminal symbol `_`

or `X`_`i`T`_`

at the left-hand side and a consumed terminal symbol sequence at the right-hand side and updates the spur accordingly.
The parameters `X`_`i`T`j``NONT_QUOTED`, `RHS`, and `POS` identify this auxiliary nonterminal symbol in the right-hand side of a production of a context-free grammar for a regular expression.

The parameter `NONT_QUOTED` is a nonterminal symbol specified in double quotation marks and located at the left-hand side of a production that contains the auxiliary nonterminal symbol.
The parameter `RHS` is the index of a right-hand side containing the auxiliary nonterminal symbol.
The parameter `POS` is the position of this auxiliary nonterminal symbol in the right-hand side.

Example:

rd "E", 2, 3, 4

This instruction consumes a sequence of four terminal symbols from a training terminal symbol sequence.
Additionally, the instruction increments the frequency of a production for an auxiliary nonterminal symbol at the left-hand side and the consumed terminal symbol sequence at the right-hand side.
The occurrence of this auxiliary nonterminal symbol is at zero-based position 3 in a right-hand side at zero-based index 2 for the nonterminal symbol `E`

at the left-hand side.
For example, this auxiliary nonterminal symbol could be the symbol `_E_2T4`

in the following excerpt of a context-free grammar:

E: A | B | _E_1T C C _E_2T4 D ;