byucc.jhdl.util.xmac
Class DocInfo

java.lang.Object
  extended bybyucc.jhdl.util.xmac.DocInfo

public class DocInfo
extends java.lang.Object

This class is essentially a container for frequently used data. It is passed as an object between the various classes.

Author:
Isaac E. Wagner

Constructor Summary
DocInfo(org.w3c.dom.Document domDocument)
          Constructs a new DocInfo object.
 
Method Summary
 java.lang.String getBaseDirectory()
          Fetch the current base of the tree.
 java.lang.String getClassName()
          Get the name of the current class.
 org.w3c.dom.Document getConfigDoc()
          Get the current configuration DOM document.
 org.w3c.dom.Document getDOMDoc()
          Get the DOM document that is currently being parsed.
 int getIndentLevel()
          Fetch the current indent level.
 java.lang.String getInputFileName()
          Fetch the name of the input .xmac file.
 boolean getMainMethodGeneration()
          Do we want to generate a main method?
 boolean getOutputIsQuiet()
          Get the output verbosity mode.
 java.io.Writer getOutputStream()
          Fetch the current output file stream.
 java.lang.Object getParser(java.lang.String tag)
          Get a parser associated with a tag name from the hashtable.
 java.lang.String getPkgName()
          Get the name of the current package.
 int getSpacesPerIndentLevel()
          Fetch the current number of spaces per indent level.
 boolean getTestVectorGenerationSetting()
          Do we want to generate test vectors?
 void setBaseDirectory(java.lang.String basedir)
          Set the base directory of the tree.
 void setClassName(java.lang.String className)
          Set the name of the current class.
 void setConfigDoc(org.w3c.dom.Document configDoc)
          Set the configuration DOM document.
 void setDefaultParsers()
          Sets up the default parsers to use.
 void setIndentLevel(int indentLevel)
          Set the current indent level for the output java code.
 void setInputFileName(java.lang.String fileName)
          Sets the name of the input .xmac file.
 void setMainMethodGeneration(boolean generateMainMethod)
          Set whether or not to generate a main method.
 void setOutputQuiet(boolean quiet)
          Set the output to quiet.
 void setOutputStream(java.io.FileWriter fw)
          Set the output stream of the output file.
 void setParser(java.lang.String tag, java.lang.Object parser)
          Add a new parser to the hashtable.
 void setPkgName(java.lang.String pkgName)
          Set the current name of the package that is being parsed.
 void setSpacesPerIndentLevel(int spacesPerIndent)
          Set the number of spaces for each indent level.
 void setTestVectorGeneration(boolean generateVect)
          Set whether or not to generate test vectors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocInfo

public DocInfo(org.w3c.dom.Document domDocument)
Constructs a new DocInfo object.

Parameters:
domDocument - The DOM Document that we're parsing.
Method Detail

getTestVectorGenerationSetting

public boolean getTestVectorGenerationSetting()
Do we want to generate test vectors?

Returns:
true if we want test vectors.

setTestVectorGeneration

public void setTestVectorGeneration(boolean generateVect)
Set whether or not to generate test vectors.

Parameters:
generateVect - A boolean to determine if we want to generate test vectors.

getMainMethodGeneration

public boolean getMainMethodGeneration()
Do we want to generate a main method?

Returns:
true if a main method needs to be generated

setMainMethodGeneration

public void setMainMethodGeneration(boolean generateMainMethod)
Set whether or not to generate a main method.

Parameters:
generateMainMethod - To generate a main method or not, that is the question.

getDOMDoc

public org.w3c.dom.Document getDOMDoc()
Get the DOM document that is currently being parsed.

Returns:
The DOM Document that is currently being parsed.

setConfigDoc

public void setConfigDoc(org.w3c.dom.Document configDoc)
Set the configuration DOM document.

Parameters:
configDoc - The DOM Document of the current configuration file.
Returns:
None

getConfigDoc

public org.w3c.dom.Document getConfigDoc()
Get the current configuration DOM document.

Returns:
The DOM Document of the current configuration file.

setOutputStream

public void setOutputStream(java.io.FileWriter fw)
Set the output stream of the output file.

Parameters:
fw - The FileWriter of the output file stream.
Returns:
None

getOutputStream

public java.io.Writer getOutputStream()
Fetch the current output file stream.

Returns:
The FileWriter of the output file stream.

setParser

public void setParser(java.lang.String tag,
                      java.lang.Object parser)
Add a new parser to the hashtable.

Parameters:
tag - A String representing the name of the tag this object will parse.
parser - The Object that will parse the tag.
Returns:
None

getParser

public java.lang.Object getParser(java.lang.String tag)
Get a parser associated with a tag name from the hashtable.

Parameters:
tag - A String representing the tagname to find the parser for.
Returns:
The parser Object if found, null otherwise.

setPkgName

public void setPkgName(java.lang.String pkgName)
Set the current name of the package that is being parsed. This is used by some of the parser objects so it's a good idea to always set this.

Parameters:
pkgName - A String representing the name of the current package. Note this is in fully qualified form, i.e. byucc.jhdl.Xilinx.Virtex
Returns:
None

getPkgName

public java.lang.String getPkgName()
Get the name of the current package.

Returns:
A String representing the name of the current package.

setClassName

public void setClassName(java.lang.String className)
Set the name of the current class. Many of the parser objects need this to be set, so it's a really good idea to set it.

Parameters:
className - A String representing the name of this class.
Returns:
None

getClassName

public java.lang.String getClassName()
Get the name of the current class.

Returns:
A String representing the name of the current class.

setOutputQuiet

public void setOutputQuiet(boolean quiet)
Set the output to quiet.

Parameters:
quiet - Set the verbosity - true if output is quieted, false to have output.
Returns:
None

getOutputIsQuiet

public boolean getOutputIsQuiet()
Get the output verbosity mode.

Returns:
true if output is quieted, false if it's noisy.

setBaseDirectory

public void setBaseDirectory(java.lang.String basedir)
Set the base directory of the tree. All the resulting java files are tossed relative to this directory.

Parameters:
basedir - The base directory of the tree.
Returns:
None

getBaseDirectory

public java.lang.String getBaseDirectory()
Fetch the current base of the tree.

Returns:
The base directory of the tree.

setIndentLevel

public void setIndentLevel(int indentLevel)
Set the current indent level for the output java code.

Parameters:
indentLevel - The level to indent to.

getIndentLevel

public int getIndentLevel()
Fetch the current indent level.

Returns:
The level of indenting.

setSpacesPerIndentLevel

public void setSpacesPerIndentLevel(int spacesPerIndent)
Set the number of spaces for each indent level. Example, if this is 2 and the current indent level is 3 then there will be 6 spaces output before the line of code in the output file.

Parameters:
spacesPerIndent - The number of spaces for each indent level.

getSpacesPerIndentLevel

public int getSpacesPerIndentLevel()
Fetch the current number of spaces per indent level. See also setSpacesPerIndentLevel().

Returns:
The number of spaces per indent level.

setInputFileName

public void setInputFileName(java.lang.String fileName)
Sets the name of the input .xmac file. It's important that this is set because some methods use it.


getInputFileName

public java.lang.String getInputFileName()
Fetch the name of the input .xmac file.

Returns:
A String of the name of the input .xmac file.

setDefaultParsers

public void setDefaultParsers()
                       throws java.lang.Exception
Sets up the default parsers to use. If the user doesn't like the defaults they can stuff the hashtable in this class with their own parsing objects.

Throws:
java.lang.Exception


Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.