public class TREXSequencedStringChecker extends java.lang.Object implements ExpressionVisitor
In this checker, we introduce a function "f" that takes a string and computes the string-sensitivity of the pattern.
"f" returns 3 bits of information. One is whether it contains elements. Another is whehter it contains text. And the last is whether it contains DataExp/ValueExp.
"f" is computed recursively through the pattern.
Modifier and Type | Field and Description |
---|---|
private java.util.Set |
checkedExps
set of checked Expressions.
|
private java.util.Map |
checkedRefExps
set of checked ReferenceExps.
|
private static int |
HAS_ANYSTRING |
private static int |
HAS_DATA |
private static int |
HAS_ELEMENT |
private static java.lang.Integer[] |
intPool
integer pool implementation.
|
private TREXBaseReader |
reader |
private boolean |
rejectTextInInterleave
If this flag is set to true, this class raises an error for
anyStrings in two branches of interleave.
|
Constructor and Description |
---|
TREXSequencedStringChecker(TREXBaseReader reader,
boolean _rejectTextInInterleave) |
Modifier and Type | Method and Description |
---|---|
private static boolean |
isError(java.lang.Object o1,
java.lang.Object o2)
It is an error if a pattern with data is combined to other patterns.
|
private static java.lang.Object |
merge(java.lang.Object o1,
java.lang.Object o2) |
java.lang.Object |
onAnyString() |
java.lang.Object |
onAttribute(AttributeExp exp) |
java.lang.Object |
onChoice(ChoiceExp exp) |
java.lang.Object |
onConcur(ConcurExp exp) |
java.lang.Object |
onData(DataExp exp) |
java.lang.Object |
onElement(ElementExp exp) |
java.lang.Object |
onEpsilon() |
java.lang.Object |
onInterleave(InterleaveExp exp) |
java.lang.Object |
onList(ListExp exp) |
java.lang.Object |
onMixed(MixedExp exp) |
java.lang.Object |
onNullSet() |
java.lang.Object |
onOneOrMore(OneOrMoreExp exp) |
java.lang.Object |
onOther(OtherExp exp) |
java.lang.Object |
onRef(ReferenceExp exp) |
java.lang.Object |
onSequence(SequenceExp exp) |
java.lang.Object |
onValue(ValueExp exp) |
private static int |
toInt(java.lang.Object o) |
private final boolean rejectTextInInterleave
private static final java.lang.Integer[] intPool
private static final int HAS_ELEMENT
private static final int HAS_ANYSTRING
private static final int HAS_DATA
private final TREXBaseReader reader
private final java.util.Set checkedExps
private final java.util.Map checkedRefExps
public TREXSequencedStringChecker(TREXBaseReader reader, boolean _rejectTextInInterleave)
public java.lang.Object onRef(ReferenceExp exp)
onRef
in interface ExpressionVisitor
public java.lang.Object onOther(OtherExp exp)
onOther
in interface ExpressionVisitor
public java.lang.Object onInterleave(InterleaveExp exp)
onInterleave
in interface ExpressionVisitor
public java.lang.Object onSequence(SequenceExp exp)
onSequence
in interface ExpressionVisitor
public java.lang.Object onEpsilon()
onEpsilon
in interface ExpressionVisitor
public java.lang.Object onNullSet()
onNullSet
in interface ExpressionVisitor
public java.lang.Object onData(DataExp exp)
onData
in interface ExpressionVisitor
public java.lang.Object onValue(ValueExp exp)
onValue
in interface ExpressionVisitor
public java.lang.Object onList(ListExp exp)
onList
in interface ExpressionVisitor
public java.lang.Object onAnyString()
onAnyString
in interface ExpressionVisitor
public java.lang.Object onAttribute(AttributeExp exp)
onAttribute
in interface ExpressionVisitor
public java.lang.Object onElement(ElementExp exp)
onElement
in interface ExpressionVisitor
private static final int toInt(java.lang.Object o)
private static java.lang.Object merge(java.lang.Object o1, java.lang.Object o2)
private static boolean isError(java.lang.Object o1, java.lang.Object o2)
public java.lang.Object onChoice(ChoiceExp exp)
onChoice
in interface ExpressionVisitor
public java.lang.Object onConcur(ConcurExp exp)
onConcur
in interface ExpressionVisitor
public java.lang.Object onOneOrMore(OneOrMoreExp exp)
onOneOrMore
in interface ExpressionVisitor
public java.lang.Object onMixed(MixedExp exp)
onMixed
in interface ExpressionVisitor