public StoneParser Maybe(StoneParser P) { var P2 = new StoneParser(P); P2.Reset(); Elements_.Add(new OrTree(new [] { P, P2 })); return(this); }
public StoneParser InsertChoice(StoneParser P) { var Ele = Elements_[0]; if (Ele is OrTree OrT) { OrT.Insert(P); } else { var Otherwise = new StoneParser(this); Reset(null); Or(P, Otherwise); } return(this); }
public RepeatTree(StoneParser P, bool Once) { StoneParser_ = P; OnlyOnce_ = Once; }
public void Insert(StoneParser P) { Parsers_.Add(P); }
public StoneParser Expression(Type T, StoneParser SubExp, Operators Ops) { Elements_.Add(new Expr(T, SubExp, Ops)); return(this); }
public StoneParser Repeat(StoneParser P) { Elements_.Add(new RepeatTree(P, false)); return(this); }
public StoneParser Option(StoneParser P) { Elements_.Add(new RepeatTree(P, true)); return(this); }
public StoneParser Ast(StoneParser P) { Elements_.Add(new Tree(P)); return(this); }
public StoneParser(StoneParser P) { Elements_ = P.Elements_; Factory_ = P.Factory_; }
public Expr(Type T, StoneParser Exp, Operators Map) { Factory_ = Factory.GetForSyntax(T); Ops_ = Map; Factor_ = Exp; }
public Tree(StoneParser P) { StoneParser_ = P; }