Exemple #1
0
        public CssScanner(TextReader reader)
        {
            m_context = new CssContext();

            m_reader = reader;
            //m_readAhead = null;

            // get the first character
            NextChar();
        }
 public CssToken(TokenType tokenType, char ch, CssContext context)
     : this(tokenType, new string(ch, 1), context)
 {
 }
 public CssToken(TokenType tokenType, [Localizable(false)] string text, CssContext context)
 {
     m_tokenType = tokenType;
     m_text = text;
     m_context = context.Clone();
 }
        private void ReportError(int severity, CssErrorCode errorNumber, CssContext context, params object[] arguments)
        {
            // guide: 0 == syntax error
            //        1 == the programmer probably did not intend to do this
            //        2 == this can lead to problems in the future.
            //        3 == this can lead to performance problems
            //        4 == this is just not right

            string message = CssStrings.ResourceManager.GetString(errorNumber.ToString(), CssStrings.Culture).FormatInvariant(arguments);
            CssParserException exc = new CssParserException(
                (int)errorNumber,
                severity,
                (context != null) ? context.Start.Line : 0,
                (context != null) ? context.Start.Char : 0,
                message);

            // but warnings we want to just report and carry on
            OnCssError(exc);
        }
Exemple #5
0
 public CssToken(TokenType tokenType, char ch, CssContext context)
     : this(tokenType, new string(ch, 1), context)
 {
 }
Exemple #6
0
 public CssToken(TokenType tokenType, [Localizable(false)] string text, CssContext context)
 {
     m_tokenType = tokenType;
     m_text      = text;
     m_context   = context.Clone();
 }