Beispiel #1
0
        /// <summary>
        /// Initializer all fields, used also by deserializer of SymbolicRegexMatcher
        /// </summary>
        private void InitilizeFields(ICharAlgebra <S> solver)
        {
            this.solver  = solver;
            this.nothing = SymbolicRegexNode <S> .MkFalse(this, solver.False);

            this.dot = SymbolicRegexNode <S> .MkTrue(this, solver.True);

            this.dotStar = SymbolicRegexNode <S> .MkDotStar(this, this.dot);

            this.newLine = SymbolicRegexNode <S> .MkNewline(this, solver.MkCharConstraint('\n'));

            this.bolRegex = SymbolicRegexNode <S> .MkLoop(this, SymbolicRegexNode <S> .MkConcat(this, this.dotStar, this.newLine), 0, 1);

            this.eolRegex = SymbolicRegexNode <S> .MkLoop(this, SymbolicRegexNode <S> .MkConcat(this, this.newLine, this.dotStar), 0, 1);

            // --- initialize caches ---
            this.singletonCache[this.solver.False] = this.nothing;
            this.singletonCache[this.newLine.set]  = this.newLine;
            this.singletonCache[this.solver.True]  = this.dot;
            //---
            this.nodeCache[this.nothing]  = this.nothing;
            this.nodeCache[this.dot]      = this.dot;
            this.nodeCache[this.dotStar]  = this.dotStar;
            this.nodeCache[this.newLine]  = this.newLine;
            this.nodeCache[this.bolRegex] = this.bolRegex;
            this.nodeCache[this.eolRegex] = this.eolRegex;
        }