sleep.parser

Class Rule

public class Rule extends Object

Field Summary
protected LinkedListclose
protected LinkedListopen
static intPRESERVE_ENTITY
static intPRESERVE_SINGLE
Constructor Summary
Rule(String errorDesc1, String errorDesc2, char l, char r)
Rule(String errorDesc, char s)
Rule()
Method Summary
RulecopyRule()
chargetLeft()
chargetRight()
SyntaxErrorgetSyntaxError()
intgetType()
booleanisBalanced()
booleanisLeft(char n)
booleanisMatch(char n)
booleanisRight(char n)
StringtoString()
voidwitnessClose(Token token)
Used to keep track of closing braces to check balance later on
voidwitnessOpen(Token token)
Used to keep track of opening braces to check balance later on
Stringwrap(String value)

Field Detail

close

protected LinkedList close

open

protected LinkedList open

PRESERVE_ENTITY

public static int PRESERVE_ENTITY

PRESERVE_SINGLE

public static int PRESERVE_SINGLE

Constructor Detail

Rule

public Rule(String errorDesc1, String errorDesc2, char l, char r)

Rule

public Rule(String errorDesc, char s)

Rule

public Rule()

Method Detail

copyRule

public Rule copyRule()

getLeft

public char getLeft()

getRight

public char getRight()

getSyntaxError

public SyntaxError getSyntaxError()

getType

public int getType()

isBalanced

public boolean isBalanced()

isLeft

public boolean isLeft(char n)

isMatch

public boolean isMatch(char n)

isRight

public boolean isRight(char n)

toString

public String toString()

witnessClose

public void witnessClose(Token token)
Used to keep track of closing braces to check balance later on

witnessOpen

public void witnessOpen(Token token)
Used to keep track of opening braces to check balance later on

wrap

public String wrap(String value)