NAME

SystemC::Vregs::Language - File processing for various Languages

SYNOPSIS

    use SystemC::Vregs::Languages;

    my $fh = SystemC::Vregs::Languages->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");

DESCRIPTION

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.

FIELDS

These fields may be specified with the new() function.

filename

The filename to write the data to.

keep_timestamp

If true, the file will only be written if the data being written differs from the present file contents.

language

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.

ACCESSORS
language

Returns the type of file, for example 'C'.

OUTPUT FUNCTIONS
comment

Output a string with the appropriate comment delimiters.

include_guard

Output a standard #ifndef around the file to prevent multiple inclusion. Closing the file will automatically add the #endif

sprint_hex_value

Return a string representing the value as a hex number. Second argument is number of bits.

preproc

Output a preprocessor directive.

print

Output plain text. This function is called by all other functions. You will probably want to make a inherited class and override this method.

printf

Output printf text.

SEE ALSO

IO::File

AUTHORS

Wilson Snyder <wsnyder@wsnyder.org>

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 455:

'=item' outside of any '=over'

Around line 521:

You forgot a '=back' before '=head1'