de.upb.hni.vmagic.output
Class VhdlOutput

java.lang.Object
  extended by de.upb.hni.vmagic.output.VhdlOutput

public class VhdlOutput
extends java.lang.Object

Collection of functions to generate VHDL output. This class provides methods to convert an instance of a meta class to VHDL code. The generated VHDL code can be converted to a String, printed to System.out or can be written directly to a file or a Writer.


Method Summary
static void print(VhdlElement element)
          Prints the VHDL representation of a VhdlElement to System.out.
static void print(VhdlElement element, VhdlCodeFormat format)
          Prints the VHDL representation of a VhdlElement to System.out using a custom code format.
static void toFile(VhdlElement element, java.lang.String fileName)
          Writes the VHDL representation of a VhdlElement to a file.
static void toFile(VhdlElement element, VhdlCodeFormat format, java.lang.String fileName)
          Writes the VHDL representation of a VhdlElement to a file using a custom code format.
static java.lang.String toVhdlString(VhdlElement element)
          Converts a VhdlElement to a string using the default code format.
static java.lang.String toVhdlString(VhdlElement element, VhdlCodeFormat format)
          Converts a VhdlElement to a string using a custom code format.
static void toWriter(VhdlElement element, VhdlCodeFormat format, java.io.Writer writer)
          Outputs the VHDL representation of a VhdlElement to a Writer using a custom code format.
static void toWriter(VhdlElement element, java.io.Writer writer)
          Outputs the VHDL representation of a VhdlElement to a Writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toVhdlString

public static java.lang.String toVhdlString(VhdlElement element)
Converts a VhdlElement to a string using the default code format.

Parameters:
element - the VHDL element
Returns:
the converted string

toVhdlString

public static java.lang.String toVhdlString(VhdlElement element,
                                            VhdlCodeFormat format)
Converts a VhdlElement to a string using a custom code format.

Parameters:
element - the VHDL element
format - the custom code format
Returns:
the converted string

toFile

public static void toFile(VhdlElement element,
                          java.lang.String fileName)
                   throws java.io.IOException
Writes the VHDL representation of a VhdlElement to a file. The default code format is used to convert the VhdlElement to VHDL code.

Parameters:
element - the VHDL element
fileName - the name of the file
Throws:
java.io.IOException - if an error occured while accessing the file

toFile

public static void toFile(VhdlElement element,
                          VhdlCodeFormat format,
                          java.lang.String fileName)
                   throws java.io.IOException
Writes the VHDL representation of a VhdlElement to a file using a custom code format.

Parameters:
element - the VHDL element
format - the custom code format
fileName - the name of the file
Throws:
java.io.IOException - if an error occured while accessing the file

toWriter

public static void toWriter(VhdlElement element,
                            java.io.Writer writer)
                     throws java.io.IOException
Outputs the VHDL representation of a VhdlElement to a Writer. The default code format is used to generate the VHDL output.

Parameters:
element - the VHDL element
writer - the Writer
Throws:
java.io.IOException - if an error occured during writing

toWriter

public static void toWriter(VhdlElement element,
                            VhdlCodeFormat format,
                            java.io.Writer writer)
                     throws java.io.IOException
Outputs the VHDL representation of a VhdlElement to a Writer using a custom code format.

Parameters:
element - the VHDL element
format - the custom code format
writer - the Writer
Throws:
java.io.IOException - if an error occured during writing

print

public static void print(VhdlElement element)
Prints the VHDL representation of a VhdlElement to System.out. The default code format is used to convert the VhdlElement to the string that is printed.

Parameters:
element - the VHDL element

print

public static void print(VhdlElement element,
                         VhdlCodeFormat format)
Prints the VHDL representation of a VhdlElement to System.out using a custom code format.

Parameters:
element - the VHDL element
format - the custom code format