System.Text.RegularExpressions.PatternCompiler.GetMachineFactory C# (CSharp) Method

GetMachineFactory() public method

public GetMachineFactory ( ) : IMachineFactory
return IMachineFactory
		public IMachineFactory GetMachineFactory () {
			ushort[] image = new ushort[pgm.Count];
			pgm.CopyTo (image);

			return new InterpreterFactory (image);
		}

Usage Example

示例#1
0
文件: regex.cs 项目: ForNeVeR/pnet
        public Regex(string pattern, RegexOptions options)
        {
            this.pattern  = pattern;
            this.roptions = options;

            this.machineFactory = cache.Lookup(pattern, options);

            if (this.machineFactory == null)
            {
                // parse and install group mapping

                Parser            psr = new Parser();
                RegularExpression re  = psr.ParseRegularExpression(pattern, options);
                this.group_count = re.GroupCount;
                this.mapping     = psr.GetMapping();

                // compile

                ICompiler cmp;
                //if ((options & RegexOptions.Compiled) != 0)
                //	//throw new Exception ("Not implemented.");
                //	cmp = new CILCompiler ();
                //else
                cmp = new PatternCompiler();

                re.Compile(cmp, RightToLeft);

                // install machine factory and add to pattern cache

                this.machineFactory         = cmp.GetMachineFactory();
                this.machineFactory.Mapping = mapping;
                cache.Add(pattern, options, this.machineFactory);
            }
            else
            {
                this.group_count = this.machineFactory.GroupCount;
                this.mapping     = this.machineFactory.Mapping;
            }
        }
All Usage Examples Of System.Text.RegularExpressions.PatternCompiler::GetMachineFactory