SystemC::Vregs::Language - File processing for various Languages
use SystemC::Vregs::Language; my $fh = SystemC::Vregs::Language->new (filename=>"foo.c", language=>'C',); $fh->comment ("This file is generated automatically\n"); $fh->define ("TRUE",1, "Set true"); $fh->print ("void main();\n");
This package creates a file handle with language specific semantics. This allows similar operators to be called, such as comment, for many different file formats.
The output data is stored in an array and dumped when the file is complete. This allows the file to only be written if the data changes, to reduce makefile rebuilding.
These fields may be specified with the new() function.
The filename to write the data to.
If true, the file will only be written if the data being written differs from the present file contents.
The language for the file. May be C, Perl, Assembler, TCL, or Verilog. A new language Foo may be defined by making a SystemC::Vregs::Language::Foo class which is an @ISA of SystemC::Vregs::Language.
Returns the type of file, for example 'C'.
Output a string with the appropriate comment delimiters.
Output a comment and Doxygen document before-the-fact.
Output a comment and Doxygen document after-the-fact.
Output a standard #ifndef around the file to prevent multiple inclusion. Closing the file will automatically add the #endif
Return a string representing the value as a hex number. Second argument is number of bits.
Output a preprocessor directive.
Output plain text. This function is called by all other functions. You will probably want to make a inherited class and override this method.
Output printf text.
Copyright 2001-2010 by Wilson Snyder. This package is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0.
Wilson Snyder <firstname.lastname@example.org>