Parses a input string into a CSSOM style declaration.

@param styleDecl the input string
@param sd the CSSOM style declaration
@throws IOException if the underlying SAC parser throws an IOException
518196
public void parseStyleDeclaration(final CSSStyleDeclarationImpl sd, final String styleDecl) throws IOException {
        try (InputSource source = new InputSource(new StringReader(styleDecl))) {
            final Stack<Object> nodeStack = new Stack<>();
            nodeStack.push(sd);
            final CSSOMHandler handler = new CSSOMHandler(nodeStack);
            parser_.setDocumentHandler(handler);
            parser_.parseStyleDeclaration(source);
        }
    }
803620
@Override
	public InputSource resolveStylesheet(String identifier, ScssStylesheet parentStylesheet) {

		return resolver.resolve(parentStylesheet, identifier);
	}
204333
@SuppressWarnings("static-method")
	protected StyledString text(SarlCapacityUses element) {
		return new StyledString(Messages.SARLLabelProvider_0, StyledString.QUALIFIER_STYLER);
	}
773252
protected void appendHeaderVarDecl(
      ImmutableList<? extends TemplateHeaderVarDefn> headerVars, StringBuilder sb) {

    for (TemplateHeaderVarDefn headerVar : headerVars) {
      sb.append("  {").append(getDeclName(headerVar));
      if (!headerVar.isRequired()) {
        sb.append("?");
      }
      sb.append(" ")
          .append(headerVar.name())
          .append(": ")
          .append(headerVar.hasType() ? headerVar.type() : headerVar.getTypeNode())
          .append("}");
      if (headerVar.desc() != null) {
        sb.append("  /** ").append(headerVar.desc()).append(" */");
      }
      sb.append("\n");
    }
  }
1135751
private CssDeclaration handleDeclaration(CssToken name, CssTokenIterator iter,
      CssContentHandler doc, CssErrorHandler err, boolean isStyleAttribute) throws
      CssException
  {

    if (name.type != CssToken.Type.IDENT)
    {
      err.error(new CssGrammarException(GRAMMAR_EXPECTING_TOKEN, name.location,
          messages.getLocale(), name.getChars(), messages.get("a_property_name")));
      return null;
    }

    CssDeclaration declaration = new CssDeclaration(name.getChars(), name.location);

    try
    {
      if (!MATCH_COLON.apply(iter.next()))
      {
        err.error(new CssGrammarException(GRAMMAR_EXPECTING_TOKEN, name.location,
            messages.getLocale(), iter.last.getChars(), ":"));
        return null;
      }
    }
    catch (NoSuchElementException nse)
    {
      err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location,
          messages.getLocale(), ":"));
      throw new PrematureEOFException();
    }

    try
    {
      while (true)
      {
        CssToken value = iter.next();
        if (MATCH_SEMI_CLOSEBRACE.apply(value))
        {
          if (declaration.components.size() < 1)
          {
            err.error(new CssGrammarException(GRAMMAR_EXPECTING_TOKEN, iter.last.location,
                messages.getLocale(), value.getChar(), messages.get("a_property_value")));
            return null;
          }
          else
          {
            return declaration;
          }
        }
        else
        {
          if (!handlePropertyValue(declaration, value, iter, isStyleAttribute))
          {
            err.error(new CssGrammarException(GRAMMAR_UNEXPECTED_TOKEN, iter.last.location,
                messages.getLocale(), iter.last.getChars()));
            return null;
          }
          else
          {
            if (isStyleAttribute && !iter.hasNext())
            {
              return declaration;
            }
          }
        }
      }
    }
    catch (NoSuchElementException nse)
    {
      err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location,
          messages.getLocale(), "';' " + messages.get("or") + " '}'"));
      throw new PrematureEOFException();
    }

  }
1303920
public final void mWS() throws RecognitionException {
		try {
			int _type = WS;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// src/main/resources/org/drools/compiler/lang/DRL6Lexer.g:71:9: ( ( ' ' | '\\t' | '\\f' | EOL )+ )
			// src/main/resources/org/drools/compiler/lang/DRL6Lexer.g:71:17: ( ' ' | '\\t' | '\\f' | EOL )+
			{
			// src/main/resources/org/drools/compiler/lang/DRL6Lexer.g:71:17: ( ' ' | '\\t' | '\\f' | EOL )+
			int cnt1=0;
			loop1:
			while (true) {
				int alt1=5;
				switch ( input.LA(1) ) {
				case ' ':
					{
					alt1=1;
					}
					break;
				case '\t':
					{
					alt1=2;
					}
					break;
				case '\f':
					{
					alt1=3;
					}
					break;
				case '\n':
				case '\r':
					{
					alt1=4;
					}
					break;
				}
				switch (alt1) {
				case 1 :
					// src/main/resources/org/drools/compiler/lang/DRL6Lexer.g:71:19: ' '
					{
					match(' '); if (state.failed) return;
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/lang/DRL6Lexer.g:72:19: '\\t'
					{
					match('\t'); if (state.failed) return;
					}
					break;
				case 3 :
					// src/main/resources/org/drools/compiler/lang/DRL6Lexer.g:73:19: '\\f'
					{
					match('\f'); if (state.failed) return;
					}
					break;
				case 4 :
					// src/main/resources/org/drools/compiler/lang/DRL6Lexer.g:74:19: EOL
					{
					mEOL(); if (state.failed) return;

					}
					break;

				default :
					if ( cnt1 >= 1 ) break loop1;
					if (state.backtracking>0) {state.failed=true; return;}
					EarlyExitException eee = new EarlyExitException(1, input);
					throw eee;
				}
				cnt1++;
			}

			if ( state.backtracking==0 ) { _channel=HIDDEN; }
			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
619828
public void compose(StylesheetRoot sroot) 
    throws javax.xml.transform.TransformerException
  {
    super.compose(sroot);
    StylesheetRoot.ComposeState cstate = sroot.getComposeState();
    java.util.Vector vnames = cstate.getVariableNames();
    if(null != m_caseorder_avt)
      m_caseorder_avt.fixupVariables(vnames, cstate.getGlobalsSize());
    if(null != m_dataType_avt)
      m_dataType_avt.fixupVariables(vnames, cstate.getGlobalsSize());
    if(null != m_lang_avt)
      m_lang_avt.fixupVariables(vnames, cstate.getGlobalsSize());
    if(null != m_order_avt)
      m_order_avt.fixupVariables(vnames, cstate.getGlobalsSize());
    if(null != m_selectExpression)
      m_selectExpression.fixupVariables(vnames, cstate.getGlobalsSize());
  }
365928
function(id, cssString) {
        var style = document.createElement('style');

        style.type = 'text/css';
        style.id = id;

        if (style.styleSheet) {
            style.styleSheet.cssText = cssString;
        } else {
            style.appendChild(document.createTextNode(cssString));
        }

        document.getElementsByTagName('head')[0].appendChild(style);
    }
485647
private void _ws() throws
      IOException
  {
    builder.type = Type.S;
    // no need to preserve exact whitespace
    // but append an S char to keep the token
    // contract of always having a value
    builder.append(' ');
    reader.forward(NOT_WHITESPACE);

    if (debug)
    {
      int nxt = reader.peek();
      checkArgument(WHITESPACE.matches((char) reader.curChar));
      if (nxt > -1)
      {
        checkArgument(NOT_WHITESPACE.matches((char) nxt));
      }
    }
  }
1269706
static HeaderEntry parse(final String elementLine) throws IOException {
        if (!elementLine.startsWith("element ")) {
            throw new IOException("not an element: '"
                    + elementLine + "'");
        }
        String definition = elementLine.substring("element ".length());

        String[] parts = definition.split(" +", 2);
        if (parts.length != 2) {
            throw new IOException("Expected two parts in element definition: '"
                    + elementLine + "'");
        }
        String name = parts[0];
        String countStr = parts[1];
        int count;
        try {
            count = Integer.parseInt(countStr);
        }
        catch (NumberFormatException e) {
            throw new IOException("Invalid element entry. Not an integer: '"
                    + countStr + "'.");
        }
        return new HeaderEntry(name, count);
    }
296369
private void _string() throws
      IOException,
      CssException
  {

    if (debug)
    {
      checkState(QUOTES.matches((char) reader.curChar));
    }

    /*
       * Note: resulting token excludes start+end quotes
       */

    builder.type = Type.STRING;
    int quoteType = reader.curChar;

    // in strings, we let escapes in general pass through
    while (true)
    {
      CssReader.Mark mark = reader.mark();
      int ch = reader.next();
      if (ch == -1)
      {
        builder.error(SCANNER_PREMATURE_EOF, reader);
        reader.unread(ch, mark);
        break;
      }
      else if (ch == '\n' || ch == '\r' || ch == '\f')
      {
        builder.error(SCANNER_ILLEGAL_CHAR, reader, "NEWLINE",
            Type.STRING.name());
        reader.forward(TERMINATOR);
        break;
      }
      else if (ch == '\\')
      {
        int[] peek = reader.peek(2);
        int nl = isNewLine(peek);
        if (nl > 0)
        {
          // in strings, ignore backslash followed by a literal
          // newline
          reader.forward(nl);
          continue;
        }

      }
      else if (ch == quoteType && reader.prevChar != '\\')
      {
        break;
      }

      builder.append(ch);
    }

    if (debug && builder.errors.size() == 0)
    {
      checkState(QUOTES.matches((char) reader.curChar));
    }
  }
504721
public void compose(StylesheetRoot sroot) throws TransformerException
  {
    super.compose(sroot);
    
    StylesheetRoot.ComposeState cstate = sroot.getComposeState();
    m_selectExpression.fixupVariables(cstate.getVariableNames(), cstate.getGlobalsSize());
  }
579797
function parseLexicalBinding(kind, options) {
        var init = null, id, node = new Node(), params = [];

        id = parsePattern(params, kind);

        // ECMA-262 12.2.1
        if (strict && id.type === Syntax.Identifier && isRestrictedWord(id.name)) {
            tolerateError(Messages.StrictVarName);
        }

        if (kind === 'const') {
            if (!matchKeyword('in') && !matchContextualKeyword('of')) {
                expect('=');
                init = isolateCoverGrammar(parseAssignmentExpression);
            }
        } else if ((!options.inFor && id.type !== Syntax.Identifier) || match('=')) {
            expect('=');
            init = isolateCoverGrammar(parseAssignmentExpression);
        }

        return node.finishVariableDeclarator(id, init);
    }
1302271
def parse_style_decl(style: str, owner: AbstractNode = None
                     ) -> CSSStyleDeclaration:
    
    _style = CSSStyleDeclaration(style, owner=owner)
    return _style
1091214
public void checkCssFile(File file, boolean asUTF8) throws IOException,
            SAXException {
        validator.reset();
        InputSource is = new InputSource(new FileInputStream(file));
        is.setSystemId(file.toURI().toURL().toString());
        if (asUTF8) {
            is.setEncoding("UTF-8");
        }
        checkAsCss(is);
    }
606969
@Override
	protected String postcss(HttpServletRequest request, String css, IResource resource) throws IOException {
		final String sourceMethod = "postcss"; //$NON-NLS-1$
		final boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(sourceClass, sourceMethod, new Object[]{css, resource});
		}
		if (resource.getPath().toLowerCase().endsWith(LESS_SUFFIX)) {
			css = processLess(resource.getReferenceURI().toString(), css);
			if (inlineImports) {
				css = _inlineImports(request, css, resource, ""); //$NON-NLS-1$
			}
		}
		css = super.postcss(request, css, resource);

		if (isTraceLogging) {
			log.exiting(sourceMethod, sourceMethod, css);
		}
		return css;
	}
1169925
private void _ident() throws
      IOException,
      CssException
  {

    builder.type = Type.IDENT;

    Optional<CssEscape> esc = escapes.get(0);

    // first NMSTART char or '-'
    if (esc.isPresent())
    {
      int length = esc.get().render(builder, NMSTART);
      reader.forward(length);
    }
    else
    {
      builder.append(cur);
    }

    if (cur == '-' || (esc.isPresent() && esc.get().character == '-'))
    {
      // The NMSTART that matched in the main loop if clause
      if (escapes.get(1).isPresent())
      {
        reader.forward(escapes.get(1).get().render(builder, NMSTART));
      }
      else
      {
        builder.append(reader.next());
      }

    }
    append(NMCHAR);
  }