at.dms.optgen
Class DefinitionFile

java.lang.Object
  |
  +--at.dms.optgen.DefinitionFile

class DefinitionFile
extends java.lang.Object

Parsed file containing GNU getopt definitions for a command-line tool.


Constructor Summary
DefinitionFile(java.lang.String sourceFile, java.lang.String packageName, java.lang.String parent, java.lang.String prefix, java.lang.String version, java.lang.String usage, java.util.List definitions)
          Constructs a definition file.
 
Method Summary
 void checkIdentifiers(java.util.Map identifiers)
          Check for duplicate identifiers.
 void checkShortcuts(java.util.Map identifiers)
          Check for duplicate identifiers.
 java.lang.String getClassName()
          Returns the class name.
 java.lang.String getPackageName()
          Returns the package name.
 java.lang.String getPrefix()
          Returns the literal prefix.
 void printFile(java.io.PrintWriter out)
          Prints the token definition to interface file (java).
static DefinitionFile read(java.lang.String sourceFile)
          Reads and parses an token definition file.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefinitionFile

public DefinitionFile(java.lang.String sourceFile,
                      java.lang.String packageName,
                      java.lang.String parent,
                      java.lang.String prefix,
                      java.lang.String version,
                      java.lang.String usage,
                      java.util.List definitions)
Constructs a definition file.
Method Detail

read

public static DefinitionFile read(java.lang.String sourceFile)
                           throws OptgenError
Reads and parses an token definition file.
Parameters:
sourceFile - The name of the source file.
Returns:
A class info structure holding the information from the source.

checkIdentifiers

public void checkIdentifiers(java.util.Map identifiers)
                      throws OptgenError
Check for duplicate identifiers.
Parameters:
identifiers - a table of all token identifiers.
prefix - the literal prefix.
id - the id of the first token.

checkShortcuts

public void checkShortcuts(java.util.Map identifiers)
                    throws OptgenError
Check for duplicate identifiers.
Parameters:
identifiers - a table of all token identifiers.
prefix - the literal prefix
id - the id of the first token

printFile

public void printFile(java.io.PrintWriter out)
Prints the token definition to interface file (java).
Parameters:
out - the output stream.

getClassName

public java.lang.String getClassName()
Returns the class name.

getPackageName

public java.lang.String getPackageName()
Returns the package name.

getPrefix

public java.lang.String getPrefix()
Returns the literal prefix.