Package com.google.gwt.thirdparty.common.css.compiler.ast

Examples of com.google.gwt.thirdparty.common.css.compiler.ast.GssParser


    String cssProperty = propertyBuilder.toString();

    // See if we can parse the rule using the GSS parser and thus verify that the
    // rule is indeed correct CSS.
    try {
      new GssParser(new SourceCode(null, "body{" + cssProperty + "}")).parse();
    } catch (GssParserException e) {
      if (lenient) {
        // print a warning message and don't print the rule.
        treeLogger.log(Type.WARN, "The following rule is not valid and will be skipped: " +
            cssProperty);
View Full Code Here


    }

    CssTree tree;

    try {
      tree = new GssParser(sourceCodes).parse();
    } catch (GssParserException e) {
      logger.log(TreeLogger.ERROR, "Unable to parse CSS", e);
      throw new UnableToCompleteException();
    }
View Full Code Here

    String gss = IOUtils.toString(stream, "UTF-8");
    Assert.assertEquals(gss, convertedGss);

    // assert the convertedGss is compatible with GSS
    try {
      new GssParser(new SourceCode("[conversion of " + inputCssFile + "]", convertedGss)).parse();
    } catch (GssParserException e) {
      e.printStackTrace();
      fail("The conversion produces invalid GSS code.");
    }
  }
View Full Code Here

    private static Set<String> getCssClassNames(String fileName, String cssSource,
        Set<JClassType> imports, TreeLogger logger) throws UnableToCompleteException {
      SourceCode sourceCode = new SourceCode(fileName, cssSource);
      CssTree tree;
      try {
        tree = new GssParser(sourceCode).parse();
      } catch (GssParserException e) {
        logger.log(TreeLogger.ERROR, "Unable to parse CSS", e);
        throw new UnableToCompleteException();
      }
      return new ClassNamesCollector().getClassNames(tree, imports);
View Full Code Here

    return Joiner.on("\n").join(lines);
  }

  private CssTree parse(String source) {
    try {
      return new GssParser(new SourceCode("test", source)).parse();
    } catch (GssParserException e) {
      fail(e.getMessage());
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.thirdparty.common.css.compiler.ast.GssParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.