next up previous contents
Next: Definition of Flex-Target Up: D Examples of External Previous: D Examples of External

Definition of Bison-Target

The Bison-Target implemented by the vm::BisonFile is subclassed from the built-in vm::YaccFile used by the Yacc-Target (see Yacc-Target), since it is a free implementation of this parser. The class definitions are shown in Listing D.1. Most of the methods are inherited, but new execution and termination methods are required for executing the parser and cleaning up temporary files The generated output depends on the parser definition file, the parser executable, and the parser template file. No additional instance variables are necessary for the vm::BisonFile, because all information can be stored in the inherited part of the vm::YaccFile.


 listing5322

As usual the generated output is marked read only. The include file which is generated when the key include is set in the Bison-Target rule, is associated with the vm::BisonIncludeFile. This class is derived from the built-in vm::YaccIncludeFile without any changes to methods. The implementation is shown in Listing D.2.


 listing5333

With these definitions the Bison-Target is available with the syntax given in Bison-Target.
vmrule5341
The key bison 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 Yacc-Target (see Yacc-Target) due to unimplemented options of the system program. The include file may be exported by the key global to other projects or within the project by the key project and the C/C++ file is automatically compiled with the correct compiler. The symbolicName is associated to the generated object file of the compilation.

Using the Bison-Target instead of Yacc-Target has the advantage of being system independent because BISON is now available on any platform supported by VMake.



IUE WWW server
Fri Jan 3 17:00:13 MET 1997