org.pz.platypus
Class Symbol

java.lang.Object
  extended by org.pz.platypus.Symbol
All Implemented Interfaces:
ICommand

public class Symbol
extends java.lang.Object
implements ICommand

Entry in command table for all symbols and special characters (such as foreign characters)

Author:
alb

Field Summary
protected  ParamType parameterType
          what kind of parameter does this command take, if any?
protected  java.lang.String root
          the command root
protected  java.lang.String rootSubstitute
          the substitute root, if this command is shorthand for another
protected  boolean validInCode
          is this command executed in a listing or code section?
 
Constructor Summary
Symbol(java.lang.String symRoot)
           
 
Method Summary
 ParamType getParamType()
          required by Commandable, but not used by symbols
 java.lang.String getRoot()
          get the root of the command/symbol.
 java.lang.String getRootSubstitute()
          required by commandable, but not used by symbols
 boolean isAllowedInCode()
          Is this command processed or ignored in a code listing?
 int process(GDD gdd, ParseContext context, TokenList tl, boolean inCode)
          method for processing this symbol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parameterType

protected ParamType parameterType
what kind of parameter does this command take, if any?


root

protected java.lang.String root
the command root


rootSubstitute

protected java.lang.String rootSubstitute
the substitute root, if this command is shorthand for another


validInCode

protected boolean validInCode
is this command executed in a listing or code section?

Constructor Detail

Symbol

public Symbol(java.lang.String symRoot)
Method Detail

getRoot

public java.lang.String getRoot()
get the root of the command/symbol. For symbols, which don't take parameters, it's the whole symbol.

Specified by:
getRoot in interface ICommand
Returns:
the root as a string

getRootSubstitute

public java.lang.String getRootSubstitute()
required by commandable, but not used by symbols

Specified by:
getRootSubstitute in interface ICommand
Returns:
the actual command string for which the current command is shorthand

getParamType

public ParamType getParamType()
required by Commandable, but not used by symbols

Specified by:
getParamType in interface ICommand
Returns:
ParamType for the command

isAllowedInCode

public boolean isAllowedInCode()
Is this command processed or ignored in a code listing?

Specified by:
isAllowedInCode in interface ICommand
Returns:
boolean indicating whether command is/is not processed in a code listing

process

public int process(GDD gdd,
                   ParseContext context,
                   TokenList tl,
                   boolean inCode)
method for processing this symbol. Note that many of these parameters are unneeded by symbols, but .

Specified by:
process in interface ICommand
Parameters:
gdd - the GDD
tl - TokenList to which the generated tokens are added
inCode - Are we currently in a code section?
context - the parsing context
Returns:
number of chars to skip to get past the command string in the input. If negative, means an error occurred.


Copyright © 2008-10 Pacific Data Works LLC