de.upb.swt.mcie.parser.token
Class Brack

java.lang.Object
  extended by de.upb.swt.mcie.parser.token.Token
      extended by de.upb.swt.mcie.parser.token.Brack

public class Brack
extends Token

Implements the token for brackets. Whether it is an opening or a closing bracket is defined by its type. Moreover, there can be different versions of brackets version.

Author:
Ekkart Kindler, kindler@upb.de

Field Summary
static int BRACE
          The code for a brace.
static int CLOSE
          The code for a closing bracket.
static int NORMAL
          The code for a normal bracket (parenthesis).
static int OPEN
          The code for an opening bracket.
static int SQUARE
          The code for a square bracket.
private  int type
          The type of the bracket.
private  int version
          The version of this bracket.
 
Constructor Summary
Brack(int type, int version)
          Creates a token for a bracket with the corresponding type and version.
 
Method Summary
 int getType()
          Returns the type of the bracket.
 int getVersion()
          Returns the version of the bracket.
 
Methods inherited from class de.upb.swt.mcie.parser.token.Token
setReference, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPEN

public static final int OPEN
The code for an opening bracket.

See Also:
Constant Field Values

CLOSE

public static final int CLOSE
The code for a closing bracket.

See Also:
Constant Field Values

NORMAL

public static final int NORMAL
The code for a normal bracket (parenthesis).

See Also:
Constant Field Values

SQUARE

public static final int SQUARE
The code for a square bracket.

See Also:
Constant Field Values

BRACE

public static final int BRACE
The code for a brace.

See Also:
Constant Field Values

type

private int type
The type of the bracket.


version

private int version
The version of this bracket.

Constructor Detail

Brack

public Brack(int type,
             int version)
Creates a token for a bracket with the corresponding type and version.

Parameters:
type - the type of the bracket OPEN or CLOSE
version - the version
Method Detail

getType

public int getType()
Returns the type of the bracket.

Returns:
type of the bracket

getVersion

public int getVersion()
Returns the version of the bracket.

Returns:
the version of the bracket