The Flex-Target implemented by the vm::FlexFile subclassed from the built-in vm::LexFile used by the Lex-Target (see Lex-Target). The class definitions are shown in Listing D.3. Most of the methods are inherited, but new execution and termination methods are required to executing the parser and cleaning up after execution. In addition to the source file, the generated output depends on the lexical analyzer and its definition files. No instance variables are necessary for the vm::FlexFile, since this can be stored in the inherited part of the vm::LexFile. The executable itself of the lexical analyzer is generated partly by BISON using the Bison-Target.
As usual the generated output is marked read only. The implementation of the rule is shown in Listing D.4.
With this definitions the Flex-Target is made available with the
syntax given in Flex-Target.
This rule is almost identical to Lex-Target, but has the
advantage, that it is independent of the underlying operating system and
works even if no LEX is available. The key flex again defines
the parser definition file and key prefix is now required in order
to make the parser unique. All other keys remain optional with the same
meaning, but without the restrictions of the Lex-Target (see
Lex-Target).