Click here to Skip to main content
15,881,204 members
Articles / Web Development / CSS3

AngleSharp

Rate me:
Please Sign up or sign in to vote.
5.00/5 (87 votes)
3 Jul 2013BSD28 min read 260.3K   4.3K   166  
Bringing the DOM to C# with a HTML5/CSS3 parser written in C#.
using System;

namespace AngleSharp.Css
{
    /// <summary>
    /// An enumation of all possible tokens.
    /// </summary>
    enum CssTokenType
    {
        /// <summary>
        /// A string token (usually in quotation marks).
        /// </summary>
        String,
        /// <summary>
        /// A URL token.
        /// </summary>
        Url,
        /// <summary>
        /// A hash token (starts with #).
        /// </summary>
        Hash,
        /// <summary>
        /// An @-keyword token (starts with @).
        /// </summary>
        AtKeyword,
        /// <summary>
        /// An identifier token.
        /// </summary>
        Ident,
        /// <summary>
        /// An function token.
        /// </summary>
        Function,
        /// <summary>
        /// An number token.
        /// </summary>
        Number,
        /// <summary>
        /// An percentage token.
        /// </summary>
        Percentage,
        /// <summary>
        /// An dimension token.
        /// </summary>
        Dimension,
        /// <summary>
        /// An unicode range token.
        /// </summary>
        Range,
        /// <summary>
        /// The comment open token to start comments.
        /// </summary>
        Cdo,
        /// <summary>
        /// The comment close to end comments.
        /// </summary>
        Cdc,
        /// <summary>
        /// The colum token.
        /// </summary>
        Column,
        /// <summary>
        /// The delimiter token to delimiter character.
        /// </summary>
        Delim,
        /// <summary>
        /// The include match ~= token (with attributes, i.e. spaces).
        /// </summary>
        IncludeMatch,
        /// <summary>
        /// The dash match |= token (with attributes, i.e. hyphen).
        /// </summary>
        DashMatch,
        /// <summary>
        /// The prefix match ^= token (with attributes, i.e. beginning).
        /// </summary>
        PrefixMatch,
        /// <summary>
        /// The suffix match $= token (with attributes, i.e. ending).
        /// </summary>
        SuffixMatch,
        /// <summary>
        /// The substring match *= token (with attributes, i.e. somewhere).
        /// </summary>
        SubstringMatch,
        /// <summary>
        /// The not match != token (with attributes, i.e. somewhere).
        /// </summary>
        NotMatch,
        /// <summary>
        /// The RoundBracketOpen ( ( ) token.
        /// </summary>
        RoundBracketOpen,
        /// <summary>
        /// The RoundBracketClose ( ) ) token.
        /// </summary>
        RoundBracketClose,
        /// <summary>
        /// The CurlyBracketOpen ( { ) token.
        /// </summary>
        CurlyBracketOpen,
        /// <summary>
        /// The CurlyBracketClose ( } ) token.
        /// </summary>
        CurlyBracketClose,
        /// <summary>
        /// The SquareBracketOpen ( [ ) token.
        /// </summary>
        SquareBracketOpen,
        /// <summary>
        /// The SquareBracketClose ( ] ) token.
        /// </summary>
        SquareBracketClose,
        /// <summary>
        /// The special character colon ( : ).
        /// </summary>
        Colon,
        /// <summary>
        /// The special character comma ( , ).
        /// </summary>
        Comma,
        /// <summary>
        /// The special character semi-colon ( ; ).
        /// </summary>
        Semicolon,
        /// <summary>
        /// The special character whitespace ( ).
        /// </summary>
        Whitespace
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The BSD License


Written By
Chief Technology Officer
Germany Germany
Florian lives in Munich, Germany. He started his programming career with Perl. After programming C/C++ for some years he discovered his favorite programming language C#. He did work at Siemens as a programmer until he decided to study Physics.

During his studies he worked as an IT consultant for various companies. After graduating with a PhD in theoretical particle Physics he is working as a senior technical consultant in the field of home automation and IoT.

Florian has been giving lectures in C#, HTML5 with CSS3 and JavaScript, software design, and other topics. He is regularly giving talks at user groups, conferences, and companies. He is actively contributing to open-source projects. Florian is the maintainer of AngleSharp, a completely managed browser engine.

Comments and Discussions