Example #1
0
 //X → A B
 public static ProductionBase <TR> SelectMany <T1, T2, TR>(
     this ProductionBase <T1> p1,
     Func <T1, ProductionBase <T2> > p2Selector,
     Func <T1, T2, TR> resultSelector)
 {
     return(new ConcatenationProduction <T1, T2, TR>(p1, p2Selector, resultSelector));
 }
 public ConcatenationProduction(
     ProductionBase <T1> p1,
     Func <T1, ProductionBase <T2> > p2Selector,
     Func <T1, T2, TR> resultSelector)
 {
     m_p1             = p1;
     m_p2Selector     = p2Selector;
     m_resultSelector = resultSelector;
 }
Example #3
0
 public MappingProduction(ProductionBase <T> p, Func <T, TR> resultSelector)
 {
     m_p = p;
     m_resultSelector = resultSelector;
 }
Example #4
0
 //X → A
 public static ProductionBase <TR> Select <T, TR>(
     this ProductionBase <T> p1,
     Func <T, TR> resultSelector)
 {
     return(new MappingProduction <T, TR>(p1, resultSelector));
 }
Example #5
0
 //X → A
 //X → B
 public static ProductionBase <T> Union <T>(
     this ProductionBase <T> p1,
     ProductionBase <T> p2)
 {
     return(new AlternationProduction <T>(p1, p2));
 }
Example #6
0
 public ParserRunner(ProductionBase <T> parseFunc)
 {
     m_parseFunc = parseFunc.BuildParse(FinalFuture);
 }