/// <summary> /// This constructor is for parsing data terms and rules. /// </summary> internal ParseResult() { Name = new API.ProgramName("dummy.4ml"); Program = new ASTConcr <Program>(new Program(Name), false); Flags = new ImmutableCollection <Flag>(flags); Succeeded = true; }
internal ParseResult(Program program) { Name = program.Name; Program = new ASTConcr <Program>(program, false); Flags = new ImmutableCollection <Flag>(flags); Succeeded = true; }
internal ASTConcr <T> ShallowClone() { var clone = new ASTConcr <T>(); var crnt = path.Last; Node n = null, p = null; int pos = -1; while (crnt != null) { n = crnt.Value.Node.ShallowClone(p, pos); pos = crnt.Value.AbsolutePos; p = n; clone.path.AddFirst(new ChildInfo(n, crnt.Value.Context, pos, crnt.Value.RelativePos)); crnt = crnt.Previous; } clone.root = clone.path.First.Value.Node; clone.node = (T)clone.path.Last.Value.Node; return(clone); }