Class TSFleStack

java.lang.Object
  extended by TSFleTok
      extended by TSFleStack
All Implemented Interfaces:
java.io.Serializable

 class TSFleStack
extends TSFleTok

.

======================================================================
 Class TSFleStack - Hold iteration-values for expand/reduce
 This class is used to save values if expand/reduce enters an
   embeded or a virtual token. So no restriction about 'size' is
   given.
 This class also holds a counter, which is filled with the
   values from the connected token-definition and which can be
   modified independently. This includes a reload with a new value.

 The state of this class describes the NEXT item, which is required
 from input and must be processed. Such an item may also be a new
 'embedded token'. If it was found, the state of this class can be
 'advanced' to the next type-definition of the current token
 (or to EOT).
 ##TSFleStack (Eyecatcher)
======================================================================
 


Field Summary
private  int Cmd
           
private  int Cnt1
           
private  int Cnt2
           
private  boolean Flg1
           
private  boolean Flg2
           
private  boolean Flg3
           
private  boolean Flg4
           
static java.lang.String IdStr
           
private  int Ix
           
private  boolean LF
           
private  boolean Opt
           
private  int Pos
           
 
Constructor Summary
protected TSFleStack()
          .
protected TSFleStack(TSFleTok cT)
          .
protected TSFleStack(TSFleTok cT, int cP)
          .
 
Method Summary
protected  boolean advDef()
          .
protected  boolean chkAdv(boolean skp)
          .
protected  boolean chkFlg2()
          .
protected  boolean chkFlg3()
          .
protected  boolean chkFlg4()
          .
protected  boolean chkOpt(int cP)
          .
protected  int chkPos(int cP)
          .
protected  boolean clrFlg1(int mv)
          .
protected  boolean clrFlg2()
          .
protected  java.lang.String clrFlg4_EE(int cP, int mx)
          .
protected  boolean clrFlg4_RE(int rc)
          .
protected  boolean clrFlg4()
          .
protected  int getCmd(boolean cmd)
          .
protected  int getCnt()
          .
protected  int getRep(int cP)
          .
protected  java.lang.String isEOT()
          .
protected  boolean isOpt()
          .
protected  boolean runCnt(boolean inc)
          .
protected  boolean setLF(boolean nS)
          .
protected  int setPos(int nV)
          .
protected  java.lang.String toStr()
          .
 
Methods inherited from class TSFleTok
getKey, getName, getTyp, isCmt, isVT
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IdStr

public static final java.lang.String IdStr
See Also:
Constant Field Values

Ix

private int Ix

Pos

private int Pos

Cmd

private int Cmd

Cnt1

private int Cnt1

Cnt2

private int Cnt2

LF

private boolean LF

Opt

private boolean Opt

Flg1

private boolean Flg1

Flg2

private boolean Flg2

Flg3

private boolean Flg3

Flg4

private boolean Flg4
Constructor Detail

TSFleStack

protected TSFleStack()
.
=====================================================================
 Constructor: (1) Create Default-Entry
=====================================================================
  


TSFleStack

protected TSFleStack(TSFleTok cT)
.
=====================================================================
 Constructor: (2) Create Standard-Entry
=====================================================================
  


TSFleStack

protected TSFleStack(TSFleTok cT,
                     int cP)
.
=====================================================================
 Constructor: (3) Create Special Loop-Entry ('Virtual Token')

 This method is used to create a 'virtual token'-definition which
  is used to realize repeatable groups of items. Such a token can
  neither be a 'comment' nor be followed by a LF.
=====================================================================
  

Method Detail

advDef

protected final boolean advDef()
.
=====================================================================
 Method "advDef"
 Advance to next type-definition and set new values.
 Method returns 'true', if EOT (End-Of-Token) is (already) reached.
 ##advDef.TSFleStack (Eyecatcher)
=====================================================================
  


chkAdv

protected final boolean chkAdv(boolean skp)
.
=====================================================================
 Method "chkAdv"
 Check if advance to next type-definition should be done.
 Method returns 'true', if 'advDef' could be tried. However, this
   is also returned if EOT (End-Of-Token) is already reached.
 If 'skp' is set(true), type-definition may be advanced to next one
   even if 'until-end'-attribute is active or the (valid) counter
   is NOT expired.
 Attention: If method returns 'true', the internal counter may not
            be modified.
 ##chkAdv.TSFleStack (Eyecatcher)
=====================================================================
  


chkFlg2

protected final boolean chkFlg2()
.
=====================================================================
 Method "chkFlg2"
 Examine current Flag-Definition (do not change) and return state.
 Meaning: 'Switch to NL before type-definition is used'
 Attention: Method is used if the flag MUST NOT be reset within
            first argument.
 ##chkFlg2.TSFleStack (Eyecatcher)
=====================================================================
  


chkFlg3

protected final boolean chkFlg3()
.
=====================================================================
 Method "chkFlg3"
 Examine current Flag-Definition (do not change) and return state.
 Meaning: 'Switch to NL before advance to next type'
 Attention: Method is used if the flag MUST NOT be reset within
            first argument.
 ##chkFlg3.TSFleStack (Eyecatcher)
=====================================================================
  


chkFlg4

protected final boolean chkFlg4()
.
=====================================================================
 Method "chkFlg4"
 Examine current Flag-Definition (do not change) and return state.
 Meaning: 'Option depends on type of entry'
 Attention: Method is used if the flag MUST NOT be reset within
            first argument.
 ##chkFlg4.TSFleStack (Eyecatcher)
=====================================================================
  


chkOpt

protected final boolean chkOpt(int cP)
.
=====================================================================
 Method "chkOpt"
 Check current type-definion if it is an optional one.
 Method returns 'true' if the current type-definition is an optional
   one but the preconditions are NOT met, so that it cannot be
   used.
 If all preconditions are met, the 'optional'-attribute is reset and
   'false' is returned.
 If method returns 'false' the current type-definition should be
   used. Else it should be skipped.
 Attention: If 'cP==0' a special request is scheduled, which returns
            the current state of the 'Opt'-flag.
 ##chkOpt.TSFleStack (Eyecatcher)
=====================================================================
  


chkPos

protected final int chkPos(int cP)
.
=====================================================================
 Method "chkPos"
 Check current position relative to provided value.
 If '0' is used as the argument, the original, unmodified value is
   returned.
 ##chkPos.TSFleStack (Eyecatcher)
=====================================================================
  


clrFlg1

protected final boolean clrFlg1(int mv)
.
=====================================================================
 Method "clrFlg1"
 Process 'repeat-counter' if current Flag-Definition request this.
   Reset flag and return previous state.
 Meaning: 'Multiply repeat-value with group-counter'
 ##clrFlg1.TSFleStack (Eyecatcher)
=====================================================================
  


clrFlg2

protected final boolean clrFlg2()
.
=====================================================================
 Method "clrFlg2"
 Clear current Flag-Definition and return PREVIOUS state.
 Meaning: 'Switch to NL before type-definition is used'
 ##clrFlg2.TSFleStack (Eyecatcher)
=====================================================================
  


clrFlg4

protected final boolean clrFlg4()
.
=====================================================================
 Method "clrFlg4"
 Clear current Flag-Definition and return PREVIOUS state.
 This is the common version with NO special actions and used with
   either 'Expand' or 'Reduce'.
 Meaning: 'Option depends on type of entry'
 ##clrFlg4.TSFleStack (Eyecatcher)
=====================================================================
  


clrFlg4_EE

protected final java.lang.String clrFlg4_EE(int cP,
                                            int mx)
.
=====================================================================
 Method "clrFlg4_EE" (Version: Type14-Expand)
 Clear current Flag-Definition and return number of items.
 Add aditional actions needed for type-definition.
 Meaning: 'Option depends on type of entry'
 ##clrFlg4_EE.TSFleStack (Eyecatcher)
=====================================================================
  


clrFlg4_RE

protected final boolean clrFlg4_RE(int rc)
.
=====================================================================
 Method "clrFlg4_RE" (Version: Type14-Reduce)
 Clear current Flag-Definition and return PREVIOUS state.
 Add aditional actions needed for type-definition.
 Meaning: 'Option depends on type of entry'
 ##clrFlg4_RE.TSFleStack (Eyecatcher)
=====================================================================
  


getCmd

protected final int getCmd(boolean cmd)
.
=====================================================================
 Method "getCmd"
 Resolve current item-type.
 Attention: If 'cmd' is NOT set, the whole type-definition is
            returned (if possible). (used for debugging purposes)
 ##getCmd.TSFleStack (Eyecatcher)
=====================================================================
  


getCnt

protected final int getCnt()
.
=====================================================================
 Method "getCnt"
 Return current value of alternate counter.
 ##getCnt.TSFleStack (Eyecatcher)
=====================================================================
  


getRep

protected final int getRep(int cP)
.
=====================================================================
 Method "getRep"
 Return number of items of same type to be resolved from buffer.
 Reset internal counter to '0'.
 If 'until-end'-function is active, number is computed as distance
  to EOT.
 ##getRep.TSFleStack (Eyecatcher)
=====================================================================
  


isEOT

protected final java.lang.String isEOT()
.
=====================================================================
 Method "isEOT"
 Check if token is completely processed.
 Return current type-definiton if it is NOT.
 ##isEOT.TSFleStack (Eyecatcher)
=====================================================================
  


isOpt

protected final boolean isOpt()
.
=====================================================================
 Method "isOpt"
 Check current type-definion if it is (as per definition) an
   optional one.
 Attention: The 'Optional'-attribute may be modified due to
            external conditions. So, the original attribute-setting
            is again extracted and returned.
 ##isOpt.TSFleStack (Eyecatcher)
=====================================================================
  


runCnt

protected final boolean runCnt(boolean inc)
.
=====================================================================
 Method "runCnt"
 Handle alternate counter. Increment / decrement it, and test if it
   terminates.
 ##runCnt.TSFleStack (Eyecatcher)
=====================================================================
  


setLF

protected final boolean setLF(boolean nS)
.
=====================================================================
 Method "setLF"
 Set new value of current 'Linefeed'-Status and return previous one.
 ##setLF.TSFleStack (Eyecatcher)
=====================================================================
  


setPos

protected final int setPos(int nV)
.
=====================================================================
 Method "setPos"
 Set new value of input-position and return previous one.
 ##setPos.TSFleStack (Eyecatcher)
=====================================================================
  


toStr

protected final java.lang.String toStr()
.
=====================================================================
 Method "toStr"
 Build an String-representation of all values of this class
 ##toStr.TSFleStack (Eyecatcher)
=====================================================================
  

Overrides:
toStr in class TSFleTok