BioLegato 0.7.3 Core API

org.biolegato.core.pcdmenu.parser
Class PCDFile

java.lang.Object
  extended by org.biolegato.core.pcdmenu.parser.PCDFile
All Implemented Interfaces:
PCDFileConstants

public class PCDFile
extends java.lang.Object
implements PCDFileConstants


Field Summary
 Token jj_nt
          Next token.
 Token token
          Current token.
 PCDFileTokenManager token_source
          Generated Token Manager.
 
Fields inherited from interface org.biolegato.core.pcdmenu.parser.PCDFileConstants
COMMA, COMMENT, DATA, DECIMAL, DEFAULT, DIGITS, DOUBLEQ, EOF, EOL, ID, IND, NL, NUMBER, SP, T_ALL, T_AMD64, T_AND, T_BUTTON, T_CANVAS, T_CHECK, T_CHOICES, T_CHOOSER, T_CLOSE, T_CMDNAME, T_COMBOBOX, T_CONTENT, T_DECIMAL, T_DEFAULT, T_FALSE, T_FASTA, T_FILE, T_FLAT, T_FORMAT, T_GDE, T_GENBANK, T_ICON, T_IF, T_IN, T_LABEL, T_LINUX, T_LIST, T_MAX, T_MIN, T_NUMBER, T_OR, T_OSX, T_OUT, T_OVERWRITE, T_PARAM, T_RAW, T_SAVE, T_SELECTION, T_SHELL, T_SOLARIS, T_SPARC, T_SYSTEM, T_TAB, T_TEMPFILE, T_TEXT, T_THEN, T_TIP, T_TRUE, T_TYPE, T_UNIX, T_WINDOWS, T_X86, T_XOR, TAB, TEXT, tokenImage
 
Constructor Summary
PCDFile(java.io.InputStream stream)
          Constructor with InputStream.
PCDFile(java.io.InputStream stream, java.lang.String encoding)
          Constructor with InputStream and supplied encoding
PCDFile(PCDFileTokenManager tm)
          Constructor with generated Token Manager.
PCDFile(java.io.Reader stream)
          Constructor.
 
Method Summary
 boolean ArchList()
          Parses a list of supported system architectures in a PCD file The list is then compared with the current system architecture to see if it is supported by the PCD command.
 boolean ArchName()
          Matches an architecture name and returns whether it is supported by the current architecture.
 void assertIndent(int scope)
          Asserts indentation level (calls token_source.testIndent)
 boolean Bool()
          Parses a boolean token into a java boolean
 Widget buttonFields(int scope)
          Parses all of the fields that should be part of any button field
 Widget chooserFields(int scope)
          Parses all of the fields that should be part of any chooser object
 Widget comboFields(int scope)
          Parses all of the fields that should be part of any combobox object
 void ContentValue()
           
 double Decimal()
          Parses a decimal number from a PCD file into a Java double
 Widget decimalFields(int scope)
          Parses all of the fields that should be part of any decimal field
 void disable_tracing()
          Disable tracing.
 void enable_tracing()
          Enable tracing.
 ParseException generateParseException()
          Generate ParseException.
 Token getNextToken()
          Get the next Token.
 Token getToken(int index)
          Get the specific Token.
 java.lang.String Ident()
          Parses an identifier token from a PCD file into a Java String
 void inorsp(int scope)
          Parses an optional indent (this is useful for values that can be spaced or indented onto a new line (e.g.
 Widget listFields(int scope)
          Parses all of the fields that should be part of any list object
 int Number()
          Parses a non-decimal number from a PCD file into a Java integer
 Widget numberFields(int scope)
          Parses all of the fields that should be part of any number field
 void Param(int scope, WidgetContainer wcontainer)
          Generates a parameter component according to the PCD file's production(s).
 javax.swing.JMenuItem Parse()
          Parses PCD files The format for a PCD file is: [ Optional Blank Space ] [ PCD Options ] Tabs and Parameters
 void PCDOption()
          Parses a list of supported PCD options Currently supported options: Option name Description name the name of the PCD command tip the tool-tip text for the PCD command icon the path of the PCD command's icon file system a list of supported system configurations for the PCD command
 void ReInit(java.io.InputStream stream)
          Reinitialise.
 void ReInit(java.io.InputStream stream, java.lang.String encoding)
          Reinitialise.
 void ReInit(PCDFileTokenManager tm)
          Reinitialise.
 void ReInit(java.io.Reader stream)
          Reinitialise.
 void SystemName()
          Parses a list of supported operating systems in a PCD file The list is then compared with the current operating system to see if it is supported by the PCD command.
 void Tab(int scope, WidgetContainer wcontainer)
          Generates a tabbed pane based on reading the tab tag from the PCD file.
 Widget tempfileFields(int scope)
          Parses all of the fields that should be part of any temporary file field
 boolean testIndent(int scope)
          Tests indentation (NOTE: this calls the token manager)
 java.lang.String Text()
          Parses a text token from a PCD file into a Java String
 Widget textFields(int scope)
          Parses all of the fields that should be part of any text field
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public PCDFileTokenManager token_source
Generated Token Manager.


token

public Token token
Current token.


jj_nt

public Token jj_nt
Next token.

Constructor Detail

PCDFile

public PCDFile(java.io.InputStream stream)
Constructor with InputStream.


PCDFile

public PCDFile(java.io.InputStream stream,
               java.lang.String encoding)
Constructor with InputStream and supplied encoding


PCDFile

public PCDFile(java.io.Reader stream)
Constructor.


PCDFile

public PCDFile(PCDFileTokenManager tm)
Constructor with generated Token Manager.

Method Detail

Parse

public final javax.swing.JMenuItem Parse()
                                  throws ParseException
Parses PCD files The format for a PCD file is: [ Optional Blank Space ] [ PCD Options ] Tabs and Parameters

Throws:
ParseException

PCDOption

public final void PCDOption()
                     throws ParseException
Parses a list of supported PCD options Currently supported options:
Option name Description
name the name of the PCD command
tip the tool-tip text for the PCD command
icon the path of the PCD command's icon file
system a list of supported system configurations for the PCD command

Throws:
ParseException

SystemName

public final void SystemName()
                      throws ParseException
Parses a list of supported operating systems in a PCD file The list is then compared with the current operating system to see if it is supported by the PCD command. Currently supported operating systems: ALL (the command supports any operating system) Linux OSX Solaris Unix (the command will only work in UNIX-compatible systems) Windows (the command will only work in Windows-compatible systems)

Throws:
ParseException

ArchList

public final boolean ArchList()
                       throws ParseException
Parses a list of supported system architectures in a PCD file The list is then compared with the current system architecture to see if it is supported by the PCD command.

Returns:
whether the current system architecture is supported by the PCD command
Throws:
ParseException

ArchName

public final boolean ArchName()
                       throws ParseException
Matches an architecture name and returns whether it is supported by the current architecture. Currently supported machine architectures: ALL (the command supports any machine architecture - may be useful for shell-scripts) X86 (any x86 compatible machine) AMD64 (any amd64 compatible machine) Sparc (any amd64 compatible machine)

Returns:
whether the architecture is supported
Throws:
ParseException

Tab

public final void Tab(int scope,
                      WidgetContainer wcontainer)
               throws ParseException
Generates a tabbed pane based on reading the tab tag from the PCD file. This function reads the tag, parses the name, and creates a new panel object that all sub-components can be added to. The tab is then added to a tabbed pane in the main window. Each tab can only contain paramter objects, and each tab MUST contain at least one parameter object.

Throws:
ParseException

Param

public final void Param(int scope,
                        WidgetContainer wcontainer)
                 throws ParseException
Generates a parameter component according to the PCD file's production(s). This function reads the tag, parses the name, and creates a new parameter component corresponding to the type of parameter read. Each parameter MUST contain a type as its first field! Currently the following types are supported:
Type field Description
button Buttons which can run commands or perform functions
list A JList containing options
chooser A radio button field
text A text-field
number A slider/spinner combination to set numbers
decimal A decimal number widget
file A file used for I/O

Parameters:
scope - the scope to parse the parameter object in
Throws:
ParseException

buttonFields

public final Widget buttonFields(int scope)
                          throws ParseException
Parses all of the fields that should be part of any button field

Parameters:
scope - the scope level to read the objects at
Throws:
ParseException

chooserFields

public final Widget chooserFields(int scope)
                           throws ParseException
Parses all of the fields that should be part of any chooser object

Parameters:
scope - the scope level to read the objects at
Throws:
ParseException

comboFields

public final Widget comboFields(int scope)
                         throws ParseException
Parses all of the fields that should be part of any combobox object

Parameters:
scope - the scope level to read the objects at
Throws:
ParseException

listFields

public final Widget listFields(int scope)
                        throws ParseException
Parses all of the fields that should be part of any list object

Parameters:
scope - the scope level to read the objects at
Throws:
ParseException

textFields

public final Widget textFields(int scope)
                        throws ParseException
Parses all of the fields that should be part of any text field

Parameters:
scope - the scope level to read the objects at
Throws:
ParseException

numberFields

public final Widget numberFields(int scope)
                          throws ParseException
Parses all of the fields that should be part of any number field

Parameters:
scope - the scope level to read the objects at
Throws:
ParseException

decimalFields

public final Widget decimalFields(int scope)
                           throws ParseException
Parses all of the fields that should be part of any decimal field

Parameters:
scope - the scope level to read the objects at
Throws:
ParseException

tempfileFields

public final Widget tempfileFields(int scope)
                            throws ParseException
Parses all of the fields that should be part of any temporary file field

Parameters:
scope - the scope level to read the objects at
Throws:
ParseException

ContentValue

public final void ContentValue()
                        throws ParseException
Throws:
ParseException

Ident

public final java.lang.String Ident()
                             throws ParseException
Parses an identifier token from a PCD file into a Java String

Returns:
the coresponding Java String object
Throws:
ParseException

Text

public final java.lang.String Text()
                            throws ParseException
Parses a text token from a PCD file into a Java String

Returns:
the coresponding Java String object
Throws:
ParseException

Decimal

public final double Decimal()
                     throws ParseException
Parses a decimal number from a PCD file into a Java double

Returns:
the coresponding Java double value
Throws:
ParseException

Number

public final int Number()
                 throws ParseException
Parses a non-decimal number from a PCD file into a Java integer

Returns:
the coresponding Java int value
Throws:
ParseException

Bool

public final boolean Bool()
                   throws ParseException
Parses a boolean token into a java boolean

Returns:
the value of the boolean
Throws:
ParseException

inorsp

public final void inorsp(int scope)
                  throws ParseException
Parses an optional indent (this is useful for values that can be spaced or indented onto a new line (e.g. type can be represented as: type slider - OR - type slider

Parameters:
scope - the number of indents to consume if we match a new line token
Throws:
ParseException

assertIndent

public final void assertIndent(int scope)
                        throws ParseException
Asserts indentation level (calls token_source.testIndent)

Parameters:
scope - the number of indents required
Throws:
ParseException

testIndent

public final boolean testIndent(int scope)
                         throws ParseException
Tests indentation (NOTE: this calls the token manager)

Parameters:
scope - the number of indents required
Throws:
ParseException

ReInit

public void ReInit(java.io.InputStream stream)
Reinitialise.


ReInit

public void ReInit(java.io.InputStream stream,
                   java.lang.String encoding)
Reinitialise.


ReInit

public void ReInit(java.io.Reader stream)
Reinitialise.


ReInit

public void ReInit(PCDFileTokenManager tm)
Reinitialise.


getNextToken

public final Token getNextToken()
Get the next Token.


getToken

public final Token getToken(int index)
Get the specific Token.


generateParseException

public ParseException generateParseException()
Generate ParseException.


enable_tracing

public final void enable_tracing()
Enable tracing.


disable_tracing

public final void disable_tracing()
Disable tracing.


BioLegato 0.7.3 Core API

Copyright © 2008-2010 University of Manitoba.