Class TREXSequencedStringChecker

  • All Implemented Interfaces:
    ExpressionVisitor

    public class TREXSequencedStringChecker
    extends java.lang.Object
    implements ExpressionVisitor
    makes sure that there is no sequenced string. "sequenced string" is something like this. <oneOrMore> <string> abc </string> </oneOrMore> Also, TREX prohibits sequence of typed strings and elements.

    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.

    • Field Detail

      • rejectTextInInterleave

        private final boolean rejectTextInInterleave
        If this flag is set to true, this class raises an error for anyStrings in two branches of interleave.
      • intPool

        private static final java.lang.Integer[] intPool
        integer pool implementation.
      • checkedExps

        private final java.util.Set checkedExps
        set of checked Expressions. once an ElementExp/AttributeExp is checked, it will be added to this set. this set is used to prevent infinite recursion.
      • checkedRefExps

        private final java.util.Map checkedRefExps
        set of checked ReferenceExps. Once a ReferenceExp is checked, it will be added (with its result) to this map. This is useful to speed up the check.
    • Constructor Detail

      • TREXSequencedStringChecker

        public TREXSequencedStringChecker​(TREXBaseReader reader,
                                          boolean _rejectTextInInterleave)