dk.brics.servletvalidator.balancing
Class AbstractBalancingVisitor
java.lang.Object
dk.brics.servletvalidator.grammar.AbstractGrammarEntityVisitor
dk.brics.servletvalidator.balancing.AbstractBalancingVisitor
- All Implemented Interfaces:
- GrammarEntityVisitor
- Direct Known Subclasses:
- BalanceChecker, DecoratingBalancingVisitor
public abstract class AbstractBalancingVisitor
- extends AbstractGrammarEntityVisitor
Super class for the classes that assign c and d values to grammar entities.
| Methods inherited from class dk.brics.servletvalidator.grammar.AbstractGrammarEntityVisitor |
apply, apply, apply, apply, getPath, in, in, in, isMarked, mark, out, out, out, print, shouldPrettyPrint |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractBalancingVisitor
protected AbstractBalancingVisitor(ParenthesisModel model)
c
public int c(AlphabetSymbol a)
c
protected int c(List<? extends AlphabetSymbol> s)
- Returns the value of the c function for the string represented as
parametger s.
- Parameters:
s -
- Returns:
c
public abstract Integer c(NonTerminal n)
- Returns the value of the c function for the nonterminal n. May
return null if the c value is unknown for n (I.E if the non terminal was
added after the c values were calculated)
- Parameters:
n -
- Returns:
c
public int c(Terminal t)
d
protected Integer d(List<AlphabetSymbol> string)
- Calculates d for at string assuming that d is well defined and fixed for all non terminals in the string
- Parameters:
string -
d
public int d(List<Terminal> list)
d
public abstract Integer d(NonTerminal d)
d
public int d(Terminal t)
setC
public abstract void setC(NonTerminal n,
Integer c)
setD
public abstract void setD(NonTerminal n,
Integer d)
- Sets the d value for the non terminal n to d
- Parameters:
n - d -
Copyright © 2008 Mathias Schwarz.