private ParseContext(TokenTable <TToken> table) { if (table == null) { throw new ArgumentNullException(nameof(table)); } TokenTable = table; _sequenceChecks = new List <ParseBranch <TToken> >(); Environment = new ParseEnvironment(); }
internal ParseBranch(ParseContext <TToken> context, ParseEnvironment environment, string branchName, string assertName) { if (context == null) { throw new ArgumentNullException(nameof(context)); } Context = context; BranchName = branchName; AssertName = assertName; Asserts = new List <AssertResult>(); Environment = environment; }
public ParseEnvironment Clone(ParseEnvironment env) { if (env == null) { throw new ArgumentNullException(nameof(env)); } env._environment.Clear(); foreach (var pair in _environment) { env._environment.Add(pair.Key, pair.Value); } return(env); }
internal ParseRuleBranch(ParseBranch <TToken> branch, ParseEnvironment ruleEnvironment = null, bool skip = true) { _branch = branch; _ruleEnvironment = ruleEnvironment; _skip = skip; }