Пример #1
0
			/// <summary>
			/// create identity pattern from given captor delegates
			/// </summary>
			/// <param name="preProcess">make a basic captor using this value as prepocessor</param>
			/// <param name="preProcess">make a basic captor using this value as postpocessor</param>
			/// <returns>the created pattern wrapper</returns>
			public Patt Capture(CaptorPreProcessFunc preProcess, CaptorPostProcessFunc postProcess)
			{
				return P(Peg.Identity(Value, new SimpleCaptor(preProcess, postProcess)));
			}
Пример #2
0
			public SimpleCaptor(CaptorPreProcessFunc pre, CaptorPostProcessFunc post)
			{
				m_pre = pre;
				m_post = post;
			}
Пример #3
0
		/// <summary>
		/// create a match time captor master pattern
		/// </summary>
		/// <param name="innerPatt">the real pattern</param>
		/// <param name="preProcess">use this value to implement ICaptor</param>
		/// <param name="postProcess">use this value to implement ICaptor</param>
		/// <param name="judger">use this value to implement IMatchTimeJudger</param>
		/// <returns>the created pattern</returns>
		public static Patt MatchTimeMaster(Patt innerPatt, CaptorPreProcessFunc preProcess, CaptorPostProcessFunc postProcess, MatchTimeJudgerFunc judger)
		{
			return P(Peg.MatchTimeMaster(innerPatt.Value, new SimpleCaptor(preProcess, postProcess), new SimpleMatchTimeJudger(judger)));
		}
Пример #4
0
			/// <summary>
			/// create MatchTime pattern from given captor delegates
			/// </summary>
			/// <param name="preProcess">make a basic captor using this value as prepocessor</param>
			/// <param name="preProcess">make a basic captor using this value as postpocessor</param>
			/// <returns>the created pattern wrapper</returns>
			public Patt MatchTime(CaptorPreProcessFunc preProcess, CaptorPostProcessFunc postProcess)
			{
				return P(Peg.MatchTime(Value, new SimpleCaptor(preProcess, postProcess)));
			}