sleep.parser

Class Rule

Known Direct Subclasses:
CommentRule

public class Rule
extends Object

Field Summary

static int
PRESERVE_ENTITY
static int
PRESERVE_SINGLE
protected LinkedList
close
protected LinkedList
open

Constructor Summary

Rule()
Rule(String errorDesc1, String errorDesc2, char l, char r)
Rule(String errorDesc, char s)

Method Summary

Rule
copyRule()
char
getLeft()
char
getRight()
SyntaxError
getSyntaxError()
int
getType()
boolean
isBalanced()
boolean
isLeft(char n)
boolean
isMatch(char n)
boolean
isRight(char n)
String
toString()
void
witnessClose(Token token)
Used to keep track of closing braces to check balance later on
void
witnessOpen(Token token)
Used to keep track of opening braces to check balance later on
String
wrap(String value)

Field Details

PRESERVE_ENTITY

public static int PRESERVE_ENTITY

PRESERVE_SINGLE

public static int PRESERVE_SINGLE

close

protected LinkedList close

open

protected LinkedList open

Constructor Details

Rule

public Rule()

Rule

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

Rule

public Rule(String errorDesc,
            char s)

Method Details

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)