public class PCD extends java.lang.Object implements PCDTreeConstants, PCDConstants
A class used to parse PCD files into BioLegato.
The modified EBNF specification of the PCD files read by this parser is as follows:
parseFullMenu ::= ( indent(scope) <T_MENU> <WSP> menuName=<TEXT> nl()
( indent(scope + 1) <T_ITEM> nl() parseMenuItem() )+
)+
parseMenuItem ::= [ nl() ]
indent(scope) <T_CMDNAME> <WSP> <TEXT> nl()
[ indent(scope) <T_ICON> <WSP> <TEXT> nl() ]
[ indent(scope) <T_TIP> <WSP> <TEXT> nl() ]
[ indent(scope) <T_SYS> ( <WSP> SystemName() nl() | nl()
( indent(scope + 1) SystemName() nl() )+ ) ]
[ indent(scope) <T_EXEC> <WSP> <TEXT> nl() ]
[ indent(scope) ParseDBConnect() nl() ]
Body(scope, pcdio)
Body ::= ( Content(scope) )* [ <EOF> ]
Content ::= ( Param(scope) | Act (scope)
| Tab (scope) | Panel(scope) )
Tab ::= indent(scope) <T_TABSET> nl()
( indent(scope + 1) ( <T_TAB> <WSP> <TEXT> nl()
( indent(scope + 2) Content(scope + 2) )+
)+
Panel ::= indent(scope) <T_PANEL> nl()
( indent(scope + 1) Content(scope) )+ )+
Act ::= indent(scope)
<T_ACT> <WSP> <TEXT> nl() indent(scope + 1)
<T_SHELL> <WSP> <TEXT> nl()
[ indent(scope + 1) <T_CLOSE> <WSP> Bool() nl() ]
Param ::= indent(scope) <T_PARAM> <WSP> name=<TEXT> nl()
indent(scope + 1) <T_TYPE> <WSP>
(
<T_BUTTON> nl() buttonFields (scope + 1)
| <T_CHOOSER> nl() listFields (scope + 1)
| <T_COMBOBOX> nl() listFields (scope + 1)
| <T_LIST> nl() listFields (scope + 1)
| <T_TEXT> nl() textFields (scope + 1)
| <T_TEXTAREA> nl() textAreaFields (scope + 1)
| <T_NUMBER> nl() numberFields (scope + 1)
| <T_DECIMAL> nl() decimalFields (scope + 1)
| <T_FILE> nl() fileFields (scope + 1)
| <T_DIR> nl() dirFields (scope + 1)
| <T_TEMPFILE> nl() tempfileFields (scope + 1)
)
buttonFields ::= indent(scope)
[ <T_LABEL> <WSP> <TEXT> nl() indent(scope) ]
<T_SHELL> <WSP> <TEXT> nl()
[ indent(scope) <T_CLOSE> <WSP> Bool() nl() ]
listFields ::= indent(scope)
[ <T_LABEL> <WSP> <TEXT> nl() indent(scope) ]
[ <T_DEFAULT> <WSP> <NUMBER> nl() indent(scope) ]
<T_CHOICES>
( <WSP> ( <T_QUERY> <WSP> <TEXT>
| FullSQLQuery() ) nl()
| nl() ( indent(scope + 1) <TEXT> <WSP> <TEXT> nl() )+ )
textFields ::= [ indent(scope) <T_LABEL> <WSP> <TEXT> nl() ]
[ indent(scope) <T_DEFAULT> <WSP> <TEXT> nl() ]
textAreaFields ::= [ indent(scope) <T_LABEL> <WSP> <TEXT> nl() ]
[ indent(scope) <T_DEFAULT> <WSP> <TEXT> nl() ]
[ indent(scope) <T_SAVE> <WSP> Bool() nl() ]
numberFields ::= indent(scope)
<T_LABEL> <WSP> <TEXT> nl() indent(scope)
<T_MIN> <WSP> <NUMBER> nl() indent(scope)
<T_MAX> <WSP> <NUMBER> nl()
[ indent(scope) <T_DEFAULT> <WSP> <NUMBER> nl() ]
decimalFields ::= indent(scope)
[ <T_LABEL> <WSP> <TEXT> nl() indent(scope) ]
<T_MIN> <WSP> Decimal() nl() indent(scope)
<T_MAX> <WSP> Decimal() nl()
[ indent(scope) <T_DEFAULT> <WSP> Decimal() nl() ]
fileFields ::= indent(scope) <T_LABEL> <WSP> <TEXT> nl()
[ indent(scope) <T_DEFAULT> <WSP> <TEXT> nl() ]
dirFields ::= indent(scope) <T_LABEL> <WSP> <TEXT> nl()
[ indent(scope) <T_DEFAULT> <WSP> <TEXT> nl() ]
tempfileFields ::= indent(scope) <T_DIRECTION> <WSP>
( <T_IN> | <T_OUT> ) nl()
indent(scope) <T_FORMAT> <WSP> FileFormat() nl()
[ indent(scope) <T_SAVE> <WSP> Bool() nl() ]
[ indent(scope) <T_OVERWRITE> <WSP> Bool() nl() ]
[ indent(scope) <T_CONTENT> <WSP>
( <T_CANVAS> | <T_SELECTION> ) nl() ]
ParseDBConnect ::= <T_DATABASE> <WSP>
( DBDriver() <WSP> DBURL() [ <WSP> DBLogin() ]
| <T_MYSQL> <WSP> DBURL()
<WSP> DBName() [ <WSP> DBLogin() ]
| <T_HSQLDB> <WSP> DBURL() [ <WSP> DBLogin() ]
)
DBLogin ::= <T_LOGIN> <WSP> DBUser() <WSP> DBPassword()
DBURL ::= <TEXT>
DBDriver ::= <TEXT>
DBUser ::= <TEXT>
DBPassword ::= <TEXT>
FullSQLQuery ::= ParseDBConnect() <WSP> <T_QUERY> <WSP> <TEXT>
FileFormat ::= ( <T_CSV> | <T_TSV> | <T_FASTA> | <T_FLAT> | <T_GDE>
| <T_GENBANK> | <T_RAW> | <T_MASK> | <TEXT> )
SystemName ::= ( <T_ALL> | <T_LINUX> | <T_OSX> | <T_SOLARIS>
| <T_UNIX> | <T_WINDOWS> ) [ <WSP> ArchList () ]
ArchList ::= ArchName() ( [ <WSP> ] <COMMA> [ <WSP> ] ArchName() )*
ArchName ::= ( <T_ALL> | <T_X86> | <T_AMD64> | <T_SPARC> )
Decimal ::= ( t=<DECIMAL> | value = <NUMBER> )
Bool ::= ( <T_TRUE> | <T_FALSE> )
nl ::= [ <WSP> ] ( <NL> | <EOF> )
NOTE: in JavaCC indentation is handled by
LOOKAHEAD({testIndent(scope)})
, and
assetIndent(scope)
. To simplify the EBNF code above, I
have replaced both instances with a pseudo-function "indent", which does
not exist. Additionally, DBLogin, DBUser, DBURL, DBName, DBPassword and
DBDriver were created for the EBNF to assist readers with interpreting
the semantics of the EBNF. In the JavaCC code, the DBLogin, DBUser,
DBURL, DBName, DBPassword and DBDriver productions are done inline
(instead of in a separate function).
The token symbols for the parser are as follows (as context dependent regular expressions):
1. Tokens which can be read in any context, but switch the context to DATA
when parsed:
T_BUTTON ::= "button"
T_CHOOSER ::= "chooser"
T_COMBOBOX ::= "combobox"
T_DECIMAL ::= "decimal"
T_DIR ::= "dir"
T_FILE ::= "file"
T_LIST ::= "list"
T_NUMBER ::= "number"
T_TEXT ::= ( "text" | "textbox" )
T_TEXTAREA ::= "textarea"
T_TEMPFILE ::= "tempfile"
T_LINUX ::= "linux"
T_OSX ::= "osx"
T_SOLARIS ::= "solaris"
T_UNIX ::= "unix"
T_WINDOWS ::= "windows"
T_X86 ::= ( "x86" | "intel" )
T_AMD64 ::= ( "amd64" | "x86_64")
T_SPARC ::= "sparc"
T_FALSE ::= "false"
T_TRUE ::= "true"
T_CSV ::= "csv"
T_TSV ::= "tsv"
T_FASTA ::= "fasta"
T_FLAT ::= "flat"
T_GDE ::= "gde"
T_GENBANK ::= "genbank"
T_RAW ::= "raw"
T_MASK ::= "colormask"
T_IN ::= "in"
T_OUT ::= "out"
T_CHECK ::= "check"
T_CHOICES ::= "choices"
T_CLOSE ::= "close"
T_CONTENT ::= "content"
T_DIRECTION ::= "direction"
T_FORMAT ::= "format"
T_MAX ::= "max"
T_MIN ::= "min"
T_OVERWRITE ::= "overwrite"
T_TYPE ::= "type"
T_SAVE ::= "save"
T_SHELL ::= "shell"
T_ICON ::= "icon"
T_SYS ::= "system"
T_TIP ::= "tip"
T_CANVAS ::= "canvas"
T_SELECTION ::= "selection"
T_AND ::= "and"
T_IF ::= "if"
T_OR ::= "or"
T_THEN ::= "then"
T_XOR ::= "xor"
T_QUERY ::= "query"
T_DATABASE ::= "database"
T_JDBC ::= "jdbc"
T_MYSQL ::= "mysql"
T_HSQLDB ::= ( "hsql" | "hsqldb" )
T_LOGIN ::= "login"
T_PROMPT ::= "prompt"
T_ALL ::= "all"
T_DEFAULT ::= "default"
T_EXEC ::= "exec"
T_LABEL ::= "label"
T_ITEM ::= "item"
T_MENU ::= "menu"
T_CMDNAME ::= "name"
T_ACT ::= "act"
T_PARAM ::= "var"
T_TABSET ::= "tabset"
T_TAB ::= "tab"
T_PANEL ::= "panel"
COMMA ::= ","
TEXT ::= "\"([^\"]|\"\")*\""
DECIMAL ::= "\-?([0-9]+)?.[0-9]+"
NUMBER ::= "\-?[0-9]+"
ENVVAR ::== "$"(["a"-"z","A"-"Z"])(["a"-"z","A"-"Z","_","0"-"9", "."])*"
ID ::= "(["a"-"z","A"-"Z"])(["a"-"z","A"-"Z","_","0"-"9", "."])*"
2. Tokens which can only be read in the DATA context (and do NOT switch the
context when read):
WSP ::= ( <SP> | <TAB> )+ >
3. Tokens which can only be read in the DATA context and switch the context
to DEFAULT when read:
NL ::= ( <EOL> | <COEL> )
4. Tokens to be skipped in the DEFAULT context (and do NOT switch the context
when read):
EOL ::= "\r\n"
TAB ::= "\t"
INDENT ::= " {4}" // NOTE: this increments scope in DEFAULT context!
JUNKSP ::= " {1,3}" // ANY non-divisible by 4 spacing before a line.
5. Tokens to be skipped in any context, and switch the context to DEFAULT
when read:
COMMENT ::= "#[^\n\r]+"
NOTE: the DEFAULT context refers to any leading space before a token is read; the data context refers to anything read after the first non-whitespace token on a line. We use two contexts because whitespace at the beginning of a line can affect scope, while whitespace in the middle of a line only delimits fields. Specifically, 4 space characters at the beginning of a line increments the level of scope by one.
Modifier and Type | Class and Description |
---|---|
static class |
PCD.ARCH
An enumeration representing all of the system architectures
detectable by BioLegato.
|
static class |
PCD.ListType
An enumeration to store which type of list to create using list
parameters.
|
static class |
PCD.OS
An enumeration representing all of the operating systems
detectable by BioLegato.
|
class |
PCD.PCDMetaTokenManager |
Modifier and Type | Field and Description |
---|---|
static PCD.ARCH |
CURRENT_ARCH
Stores the current machine architecture
|
static PCD.OS |
CURRENT_OS
Stores the current operating system
|
static boolean |
debug
Whether to operate in debug mode
|
Token |
jj_nt
Next token.
|
protected JJTPCDState |
jjtree |
Token |
token
Current token.
|
PCDTokenManager |
token_source
Generated Token Manager.
|
JJTACT, JJTARCHLIST, JJTARCHNAME, JJTBODY, JJTBOOL, JJTBUTTONFIELDS, JJTCONTENT, JJTDECIMAL, JJTDECIMALFIELDS, JJTDIRFIELDS, JJTFILEFIELDS, JJTFILEFORMAT, JJTFULLSQLQUERY, JJTIDENT, JJTLISTFIELDS, jjtNodeName, JJTNUMBER, JJTNUMBERFIELDS, JJTPANEL, JJTPARAM, JJTPARSEDBCONNECT, JJTPARSEFULLMENU, JJTPARSEMENUITEM, JJTSYSTEMNAME, JJTTAB, JJTTEMPFILEFIELDS, JJTTEXT, JJTTEXTAREAFIELDS, JJTTEXTFIELDS, JJTVOID
COEL, COMMA, COMMENT, DATA, DECIMAL, DEFAULT, DIGITS, DOLLAR, DOUBLEQ, ENVVAR, EOF, EOL, ID, NL, NUMBER, SIGN, SP, T_ACT, 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_CSV, T_DATABASE, T_DECIMAL, T_DEFAULT, T_DIR, T_DIRECTION, T_EXEC, T_FALSE, T_FASTA, T_FILE, T_FLAT, T_FORMAT, T_GDE, T_GENBANK, T_HSQLDB, T_ICON, T_IF, T_IN, T_ITEM, T_JDBC, T_LABEL, T_LINUX, T_LIST, T_LOGIN, T_MASK, T_MAX, T_MENU, T_MIN, T_MYSQL, T_NUMBER, T_OR, T_OSX, T_OUT, T_OVERWRITE, T_PANEL, T_PARAM, T_PROMPT, T_QUERY, T_RAW, T_SAVE, T_SELECTION, T_SHELL, T_SOLARIS, T_SPARC, T_SYS, T_TAB, T_TABSET, T_TEMPFILE, T_TEXT, T_TEXTAREA, T_THEN, T_TIP, T_TRUE, T_TSV, T_TYPE, T_UNIX, T_WINDOWS, T_X86, T_XOR, TAB, TEXT, tokenImage, WSP
Constructor and Description |
---|
PCD(java.io.InputStream stream)
Constructor with InputStream.
|
PCD(java.io.InputStream stream,
java.lang.String encoding)
Constructor with InputStream and supplied encoding
|
PCD(PCDTokenManager tm)
Constructor with generated Token Manager.
|
PCD(java.io.Reader stream)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
Act(int scope,
java.util.Map<java.lang.String,Widget> widgetList)
Generates a parameter component according to the PCD file's
<T_ACT> production(s).
|
java.util.Set<SystemToken.ARCH> |
ArchList()
Parses a list of supported system architectures in a PCD file
|
SystemToken.ARCH |
ArchName()
Matches an architecture name and returns the
appropriate
SystemToken.ARCH value. |
void |
assertIndent(int scope)
Asserts indentation level (calls token_source.testIndent)
|
java.util.Map<java.lang.String,Widget> |
Body(int scope,
PCDIO pcdio)
Parses PCD menu item content
|
boolean |
Bool()
Parses a boolean token into a java boolean
|
Widget |
buttonFields(int scope,
java.lang.String name)
Parses all of the fields that should be part of any button field
|
void |
Content(int scope,
java.util.Map<java.lang.String,Widget> widgetList,
PCDIO pcdio)
Parses PCD file content
|
double |
Decimal()
Parses a decimal number from a PCD file into a Java double
|
Widget |
decimalFields(int scope,
java.lang.String name)
Parses all of the fields that should be part of any decimal field
|
Widget |
dirFields(int scope,
java.lang.String name)
Parses all of the fields that should be part of any directory chooser
|
void |
disable_tracing()
Disable tracing.
|
void |
enable_tracing()
Enable tracing.
|
Widget |
fileFields(int scope,
java.lang.String name)
Parses all of the fields that should be part of any file chooser
|
java.lang.String |
FileFormat()
Parses file formats supported by BioPCD
|
PCDSQL |
FullSQLQuery()
Parses an SQL database production
|
ParseException |
generateParseException()
Generate ParseException.
|
static java.io.File |
getCurrentPWD()
Gets the present working directory "PWD" for all PCD widgets
(this does NOT change CURRENT_DIR!) This value can be used to
cache which directory file dialog boxes should use as their
"current working directory"
|
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
|
Widget |
listFields(int scope,
java.lang.String name,
PCD.ListType lType)
Parses all of the fields that should be part of any list object
|
static PCDObject |
loadPCDFile(java.io.File path,
PCDIO canvas)
Parses a PCD file into its corresponding PCDObject.
|
static void |
loadPCDPath(java.io.File path,
java.util.Map<java.lang.String,java.util.Map<java.lang.String,PCDObject>> menu,
PCDIO canvas,
javax.swing.JFrame parent)
Loads a path of PCD files into BioLegato
|
static PCDObject |
loadPCDStream(java.io.Reader in,
java.io.File path,
PCDIO canvas)
Parses a PCD input stream into its corresponding PCDObject
|
void |
nl()
Matches new line characters including preceding whitespace
|
int |
Number()
Parses a non-decimal number from a PCD file into a Java integer
|
Widget |
numberFields(int scope,
java.lang.String name)
Parses all of the fields that should be part of any number field.
|
void |
Panel(int scope,
java.util.Map<java.lang.String,Widget> widgetList,
PCDIO pcdio)
Generates a non-tabbed panel based on reading the panel tag from the PCD
file.
|
void |
Param(int scope,
java.util.Map<java.lang.String,Widget> widgetList,
PCDIO pcdio)
Generates a parameter component according to the PCD file's
<T_PARAM> production(s).
|
JDBCDBConnection |
ParseDBConnect()
Parses an SQL database production
|
void |
parseFullMenu(java.util.Map<java.lang.String,java.util.Map<java.lang.String,PCDObject>> menuMap,
int scope,
java.io.File home,
PCDIO canvas,
javax.swing.JFrame parent)
Parses a PCD menu.
|
PCDObject |
parseMenuItem(int scope,
java.io.File path,
PCDIO pcdio)
Parses a PCD menu item.
|
void |
ReInit(java.io.InputStream stream)
Reinitialise.
|
void |
ReInit(java.io.InputStream stream,
java.lang.String encoding)
Reinitialise.
|
void |
ReInit(PCDTokenManager tm)
Reinitialise.
|
void |
ReInit(java.io.Reader stream)
Reinitialise.
|
static void |
setCurrentPWD(java.io.File newPWD)
Sets the present working directory "PWD" for all PCD widgets
(this does NOT change CURRENT_DIR!) This value can be used to
cache which directory file dialog boxes should use as their
"current working directory"
|
SystemToken |
SystemName()
Parses a list of supported operating systems in a PCD file
|
void |
Tab(int scope,
java.util.Map<java.lang.String,Widget> widgetList,
PCDIO pcdio)
Generates a tabbed pane based on reading the tab tag from the PCD file.
|
Widget |
tempfileFields(int scope,
java.lang.String name,
PCDIO pcdio)
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 |
textAreaFields(int scope,
java.lang.String name)
Parses all of the fields that should be part of any textarea
|
Widget |
textFields(int scope,
java.lang.String name)
Parses all of the fields that should be part of any text field
|
static java.lang.String |
textString(java.lang.String tokenstr)
Parses a text string and converts environment variables to their
corresponding values (e.g.
|
protected JJTPCDState jjtree
public static final PCD.OS CURRENT_OS
public static final PCD.ARCH CURRENT_ARCH
public static boolean debug
public PCDTokenManager token_source
public Token token
public Token jj_nt
public PCD(java.io.InputStream stream)
public PCD(java.io.InputStream stream, java.lang.String encoding)
public PCD(java.io.Reader stream)
public PCD(PCDTokenManager tm)
public static PCDObject loadPCDFile(java.io.File path, PCDIO canvas) throws java.io.IOException, ParseException
path
- the path for the filecanvas
- the canvas for the PCD menu to interact withjava.io.IOException
ParseException
public static PCDObject loadPCDStream(java.io.Reader in, java.io.File path, PCDIO canvas) throws java.io.IOException, ParseException
in
- the reader object to read the menu from.path
- the path for the file.canvas
- the canvas for the PCD menu to interact with.java.io.IOException
ParseException
public static void loadPCDPath(java.io.File path, java.util.Map<java.lang.String,java.util.Map<java.lang.String,PCDObject>> menu, PCDIO canvas, javax.swing.JFrame parent)
path
- the relative path of the PCD file(s) to load
- used for making the command path relativemenu
- the object to store all menu itemscanvas
- the parent canvas of the PCD menu itemsparent
- the parent window for displaying the PCD menu items inpublic static java.lang.String textString(java.lang.String tokenstr)
tokenstr
- the string to parsepublic static java.io.File getCurrentPWD()
public static void setCurrentPWD(java.io.File newPWD)
newPWD
- the new directory to use as the "PWD"public final void parseFullMenu(java.util.Map<java.lang.String,java.util.Map<java.lang.String,PCDObject>> menuMap, int scope, java.io.File home, PCDIO canvas, javax.swing.JFrame parent) throws ParseException
Parses a PCD menu.
The format for a PCD menu is:
menu Name MenuItem data
menuMap
- the menu hashtable to add the menus and menu items to.scope
- the indentation scope to parse the objects in.home
- the relative path of the PCD file(s) to load
- used for making the command paths relative.canvas
- the parent canvas of the PCD menu items.parent
- the parent window for displaying the PCD menu items in.ParseException
public final PCDObject parseMenuItem(int scope, java.io.File path, PCDIO pcdio) throws ParseException
Parses a PCD menu item.
The format for a PCD menu item is:
Header Content
The format for a PCD menu item header is:
[ Optional Blank Space ] [ PCD Options ] Tabs and Parameters
Currently supported PCD 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 |
scope
- the indentation scope to parse the objects inpath
- the parent directory of the menu being read.pcdio
- the PCD I/O object for all temporary files to interact withParseException
public final java.util.Map<java.lang.String,Widget> Body(int scope, PCDIO pcdio) throws ParseException
Parses PCD menu item content
The format for a PCD menu item is:
[ Optional Blank Space ] [ PCD Options ]
Tabs and Parameters
scope
- the scope to parse the objects inpcdio
- the PCD I/O object for all temporary files to interact withParseException
public final void Content(int scope, java.util.Map<java.lang.String,Widget> widgetList, PCDIO pcdio) throws ParseException
Parses PCD file content
PCD file content can be any of the following:
Tabs, panels, action (buttons) and Parameters
scope
- the scope to parse the objects inwidgetList
- the list of all widgets within
the current BioPCD menu item bodypcdio
- the PCD I/O object for all temporary
files to interact withParseException
public final void Tab(int scope, java.util.Map<java.lang.String,Widget> widgetList, PCDIO pcdio) throws ParseException
Generates a tabbed pane based on reading the tab tag from the PCD file.
This function reads the <T_TAB> 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.
scope
- the scope to parse the tabset object intowidgetList
- the list of widgets to add the tab topcdio
- the PCD I/O object for all temporary files to interact withParseException
public final void Panel(int scope, java.util.Map<java.lang.String,Widget> widgetList, PCDIO pcdio) throws ParseException
Generates a non-tabbed panel based on reading the panel tag from the PCD file.
This function reads the <T_PANEL> tag, parses it, and creates a panel.
Panels are used so related parameters can be positioned together for example, related buttons can be positioned side by side.
scope
- the scope to parse the panel object intowidgetList
- the list of widgets to add the panel topcdio
- the PCD I/O object for all temporary files to interact withParseException
public final void Act(int scope, java.util.Map<java.lang.String,Widget> widgetList) throws ParseException
Generates a parameter component according to the PCD file's <T_ACT> production(s).
This function reads the <T_ACT> tag, and creates a new button for running commands in BioLegato.
scope
- the scope to parse the action object inwidgetList
- the list of widgets to add the action toParseException
public final void Param(int scope, java.util.Map<java.lang.String,Widget> widgetList, PCDIO pcdio) throws ParseException
Generates a parameter component according to the PCD file's <T_PARAM> production(s).
This function reads the <T_PARAM> 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 |
dir | A directory used for file I/O |
scope
- the scope to parse the parameter object inwidgetList
- the list of widgets to add the parameter topcdio
- the PCD I/O object for all temporary files to interact withParseException
public final Widget buttonFields(int scope, java.lang.String name) throws ParseException
scope
- the scope level to read the objects atname
- the name of the widgetParseException
public final Widget listFields(int scope, java.lang.String name, PCD.ListType lType) throws ParseException
scope
- the scope level to read the objects atname
- the name of the widgetlType
- the type of list object to createParseException
public final Widget textFields(int scope, java.lang.String name) throws ParseException
scope
- the scope level to read the objects atname
- the name of the widgetParseException
public final Widget textAreaFields(int scope, java.lang.String name) throws ParseException
scope
- the scope level to read the objects atname
- the name of the widgetParseException
public final Widget numberFields(int scope, java.lang.String name) throws ParseException
Parses all of the fields that should be part of any number field.
NOTE: the default maximum value is 500,000 and the default minimum value is zero (0).
scope
- the scope level to read the objects atname
- the name of the widgetParseException
public final Widget decimalFields(int scope, java.lang.String name) throws ParseException
scope
- the scope level to read the objects atname
- the name of the widgetParseException
public final Widget fileFields(int scope, java.lang.String name) throws ParseException
scope
- the scope level to read the objects atname
- the name of the widgetParseException
public final Widget dirFields(int scope, java.lang.String name) throws ParseException
scope
- the scope level to read the objects atname
- the name of the widgetParseException
public final Widget tempfileFields(int scope, java.lang.String name, PCDIO pcdio) throws ParseException
scope
- the scope level to read the objects atname
- the name of the widgetpcdio
- the PCD I/O object for the temporary file to interact withParseException
public final java.lang.String FileFormat() throws ParseException
ParseException
public final SystemToken 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. The comparison is done in another function (isSystemSupported).
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)
ParseException
public final java.util.Set<SystemToken.ARCH> 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. This comparsion
is performed by the function isSystemSupported()
ParseException
public final SystemToken.ARCH ArchName() throws ParseException
Matches an architecture name and returns the
appropriate SystemToken.ARCH
value.
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)
ParseException
public final JDBCDBConnection ParseDBConnect() throws ParseException
ParseException
public final PCDSQL FullSQLQuery() throws ParseException
ParseException
public final java.lang.String Ident() throws ParseException
ParseException
public final java.lang.String Text() throws ParseException
ParseException
public final double Decimal() throws ParseException
ParseException
public final int Number() throws ParseException
ParseException
public final boolean Bool() throws ParseException
ParseException
public final void assertIndent(int scope) throws ParseException
scope
- the number of indents requiredParseException
public final boolean testIndent(int scope) throws ParseException
scope
- the number of indents requiredParseException
public final void nl() throws ParseException
ParseException
public void ReInit(java.io.InputStream stream)
public void ReInit(java.io.InputStream stream, java.lang.String encoding)
public void ReInit(java.io.Reader stream)
public void ReInit(PCDTokenManager tm)
public final Token getNextToken()
public final Token getToken(int index)
public ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()
Copyright © 2008-2022 University of Manitoba.