Пример #1
0
        private ParseContext(TokenTable <TToken> table)
        {
            if (table == null)
            {
                throw new ArgumentNullException(nameof(table));
            }

            TokenTable      = table;
            _sequenceChecks = new List <ParseBranch <TToken> >();

            Environment = new ParseEnvironment();
        }
Пример #2
0
 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;
 }
Пример #3
0
        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);
        }
Пример #4
0
 internal ParseRuleBranch(ParseBranch <TToken> branch, ParseEnvironment ruleEnvironment = null, bool skip = true)
 {
     _branch          = branch;
     _ruleEnvironment = ruleEnvironment;
     _skip            = skip;
 }