org.argouml.util
Class ExprSeparatorWithStrings

java.lang.Object
  extended byorg.argouml.util.CustomSeparator
      extended byorg.argouml.util.ExprSeparatorWithStrings

class ExprSeparatorWithStrings
extends CustomSeparator

A descendent of CustomSeparator that recognizes tokens on the form:
( " \" ) " ' \' ) ' )

This is, an expression inside parentheses with proper consideration for quoted strings inside the the expression.


Field Summary
private  boolean _isDQuot
           
private  boolean _isEsc
           
private  boolean _isSQuot
           
private  int _tokLen
           
private  int _tokLevel
           
 
Fields inherited from class org.argouml.util.CustomSeparator
 
Constructor Summary
ExprSeparatorWithStrings()
          The constructor.
 
Method Summary
 boolean endChar(char c)
          Called to check if more characters are expected in the free part of the token. Overridden to find the end of the token.
 boolean hasFreePart()
          Called to check if more characters are expected to follow after addChar has returned true. If true, then any following characters will be fed to endChar until endChar returns true.

The default behaviour is to return false. Overridden to return true.

 void reset()
          Called to reset the separator before staring to look for a new token.
 int tokenLength()
          Returns the length of the matched token. It is not required to be meaningful unless addChar has returned true and hasFreePart returned false or endChar returned true. Overridden to return the entire length of the token.
 
Methods inherited from class org.argouml.util.CustomSeparator
addChar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_isSQuot

private boolean _isSQuot

_isDQuot

private boolean _isDQuot

_isEsc

private boolean _isEsc

_tokLevel

private int _tokLevel

_tokLen

private int _tokLen
Constructor Detail

ExprSeparatorWithStrings

public ExprSeparatorWithStrings()
The constructor. No choices available.

Method Detail

reset

public void reset()
Description copied from class: CustomSeparator
Called to reset the separator before staring to look for a new token.

Overrides:
reset in class CustomSeparator

tokenLength

public int tokenLength()
Returns the length of the matched token. It is not required to be meaningful unless addChar has returned true and hasFreePart returned false or endChar returned true. Overridden to return the entire length of the token.

Overrides:
tokenLength in class CustomSeparator
Returns:
The length of the matched token.

hasFreePart

public boolean hasFreePart()
Called to check if more characters are expected to follow after addChar has returned true. If true, then any following characters will be fed to endChar until endChar returns true.

The default behaviour is to return false. Overridden to return true.

Overrides:
hasFreePart in class CustomSeparator
Returns:
true

endChar

public boolean endChar(char c)
Called to check if more characters are expected in the free part of the token. Overridden to find the end of the token.

Overrides:
endChar in class CustomSeparator
Parameters:
c - The next character in the sequence being tokenized.
Returns:
true to indicate that the token is complete, or false to continue feeding characters through endChar.


ArgoUML © 1996-2004 (20040316)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook