예제 #1
0
        public CssParser(CssTokenizer tokenizer, CssGrammar grammar)
        {
            ArgChecker.AssertArgNotNull(tokenizer, nameof(tokenizer));
            _tokenizer        = tokenizer;
            _rootScope        = new RootScope(this, tokenizer.Tokenize().GetEnumerator(), grammar ?? DefaultGrammar);
            _namespaceManager = new XmlNamespaceManager(new NameTable());

            var parseErrorNotifier = new ParseErrorNotifier(this);

            _parseErrorNotifier    = parseErrorNotifier;
            _tokenizer.ParseError += (sender, e) => parseErrorNotifier.NotifyParseError(e);
        }
예제 #2
0
 public CssParser(CssTokenizer tokenizer)
     : this(tokenizer, null)
 {
 }