Ejemplo n.º 1
0
        /// <summary>The <see cref="CombinatorSimpleSelectorSequenceNode"/> visit implementation</summary>
        /// <param name="combinatorSimpleSelectorSequenceNode">The CombinatorSimpleSelector AST node</param>
        /// <returns>The modified AST node if modified otherwise the original node</returns>
        public override AstNode VisitCombinatorSimpleSelectorSequenceNode(CombinatorSimpleSelectorSequenceNode combinatorSimpleSelectorSequenceNode)
        {
            // combinator
            // /* combinators can be surrounded by whitespace */
            // : PLUS S* | GREATER S* | TILDE S* | S+
            // ;

            // Add the appropriate combinator
            switch (combinatorSimpleSelectorSequenceNode.Combinator)
            {
            case Combinator.PlusSign:
                _printerFormatter.Append(CssConstants.Plus);
                break;

            case Combinator.GreaterThanSign:
                _printerFormatter.Append(CssConstants.Greater);
                break;

            case Combinator.Tilde:
                _printerFormatter.Append(CssConstants.Tilde);
                break;

            case Combinator.SingleSpace:
                _printerFormatter.Append(CssConstants.SingleSpace);
                break;
            }

            // add the simple_selector
            combinatorSimpleSelectorSequenceNode.SimpleSelectorSequenceNode.Accept(this);

            return(combinatorSimpleSelectorSequenceNode);
        }
Ejemplo n.º 2
0
 public virtual AstNode VisitCombinatorSimpleSelectorSequenceNode(CombinatorSimpleSelectorSequenceNode combinatorSimpleSelectorSequenceNode)
 {
     return(combinatorSimpleSelectorSequenceNode);
 }
 /// <summary>The <see cref="CombinatorSimpleSelectorSequenceNode"/> visit implementation</summary>
 /// <param name="combinatorSimpleSelectorSequenceNode">The combinator simple selector sequence node.</param>
 /// <returns>The modified AST node if modified otherwise the original node</returns>
 public override AstNode VisitCombinatorSimpleSelectorSequenceNode(CombinatorSimpleSelectorSequenceNode combinatorSimpleSelectorSequenceNode)
 {
     return(new CombinatorSimpleSelectorSequenceNode(
                combinatorSimpleSelectorSequenceNode.Combinator,
                (SimpleSelectorSequenceNode)combinatorSimpleSelectorSequenceNode.SimpleSelectorSequenceNode.Accept(this)));
 }