Next: , Previous: , Up: Auxiliary Programs   [Contents][Index]


8.5 rege-asm

The purpose of this program is debugging generating an assembler program and context-free grammar for a regular expression.

See Dumping Assembler Programs for example assembler programs generated for regular expressions. See Initial Context-Free Grammar for an example context-free grammar generated for regular expressions. Those regular expressions are at the right-hand sides of productions of regular expression grammars.

The instruction set of a generated assembler program includes instructions for analyzing look-ahead terminal symbols, consuming terminal symbols, incrementing the frequencies of productions of a context-free grammar, transferring control to subroutines for parsing nonterminal symbols, and returning control from those subroutines.

A sequence of subexpressions in a regular expression results in a sequence of code blocks for those subexpressions in a generated assembler program. Assembler code blocks for ‘?’ and ‘*’ quantifiers and sets of alternatives separated by ‘|’ have specific structure.