dk.brics.xsugar.reversibility
Class ReversibilityChecker
java.lang.Object
dk.brics.xsugar.reversibility.ReversibilityChecker
public class ReversibilityChecker
- extends Object
Reversibility analyzer for XSugar stylesheets.
- See Also:
StylesheetChecker
|
Method Summary |
boolean |
check(Grammar left,
Grammar right,
int left_unfold_level,
String left_unfold_left,
String left_unfold_right,
boolean tokenize)
Checks unambiguity of the given pair of stylesheet grammars. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReversibilityChecker
public ReversibilityChecker(PrintWriter out,
boolean verbose)
throws InstantiationException,
IllegalAccessException,
ClassNotFoundException
- Constructs a new reversibility analyzer.
Assumes that
StylesheetChecker has been executed first.
- Parameters:
out - print writer for output messages (if null, use System.out with default encoding)verbose - verbose output if true
- Throws:
ClassNotFoundException - if an approximation strategy class was not found
IllegalAccessException - if an approximation strategy class or its nullary constructor is not accessible
InstantiationException - if an approximation strategy class cannot be instantiated
check
public boolean check(Grammar left,
Grammar right,
int left_unfold_level,
String left_unfold_left,
String left_unfold_right,
boolean tokenize)
throws IllegalArgumentException
- Checks unambiguity of the given pair of stylesheet grammars.
- Parameters:
left - left grammarright - right grammarleft_unfold_level - unfold number (only for left grammar!)left_unfold_left - unfolding left parentheses symbolsleft_unfold_right - unfolding right parentheses symbolstokenize - if true, tokenize grammars before ambiguity analysis
- Returns:
- true if the stylesheet is definitely reversible
- Throws:
IllegalArgumentException - if the grammar is not balanced with the given unfolding parentheses
Copyright © 2004-2007 Anders Møller & Claus Brabrand.