diff options
Diffstat (limited to 'theme-compiler/src')
25 files changed, 1407 insertions, 1259 deletions
diff --git a/theme-compiler/src/com/vaadin/sass/CustomConsoleHandler.java b/theme-compiler/src/com/vaadin/sass/CustomConsoleHandler.java new file mode 100644 index 0000000000..44c9e345db --- /dev/null +++ b/theme-compiler/src/com/vaadin/sass/CustomConsoleHandler.java @@ -0,0 +1,52 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.sass; + +import java.io.PrintStream; +import java.util.logging.ConsoleHandler; +import java.util.logging.Level; +import java.util.logging.LogRecord; + +/** + * + * @since + * @author Vaadin Ltd + */ +public class CustomConsoleHandler extends ConsoleHandler { + + private ConsoleHandler stdoutHandler; + + public CustomConsoleHandler() { + PrintStream err = System.err; + /* + * ConsoleHandler uses System.err to output all messages. Replace + * System.err temporary to construct ConsoleHandler and set it back + * after construction. + */ + System.setErr(System.out); + stdoutHandler = new ConsoleHandler(); + System.setErr(err); + } + + @Override + public void publish(LogRecord record) { + if (!Level.SEVERE.equals(record.getLevel())) { + stdoutHandler.publish(record); + } else { + super.publish(record); + } + } +} diff --git a/theme-compiler/src/com/vaadin/sass/internal/ScssStylesheet.java b/theme-compiler/src/com/vaadin/sass/internal/ScssStylesheet.java index dbb3e571dc..63f59cdfab 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/ScssStylesheet.java +++ b/theme-compiler/src/com/vaadin/sass/internal/ScssStylesheet.java @@ -19,24 +19,27 @@ package com.vaadin.sass.internal; import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; +import java.util.logging.LogManager; import java.util.logging.Logger; import org.w3c.css.sac.CSSException; import org.w3c.css.sac.InputSource; +import com.vaadin.buildhelpers.CompileTheme; import com.vaadin.sass.internal.handler.SCSSDocumentHandler; import com.vaadin.sass.internal.handler.SCSSDocumentHandlerImpl; import com.vaadin.sass.internal.handler.SCSSErrorHandler; import com.vaadin.sass.internal.parser.ParseException; import com.vaadin.sass.internal.parser.Parser; import com.vaadin.sass.internal.parser.SCSSParseException; +import com.vaadin.sass.internal.resolver.ClassloaderResolver; +import com.vaadin.sass.internal.resolver.FilesystemResolver; import com.vaadin.sass.internal.resolver.ScssStylesheetResolver; -import com.vaadin.sass.internal.resolver.VaadinResolver; import com.vaadin.sass.internal.tree.BlockNode; import com.vaadin.sass.internal.tree.MixinDefNode; import com.vaadin.sass.internal.tree.Node; @@ -59,10 +62,12 @@ public class ScssStylesheet extends Node { private static HashMap<Node, Node> lastNodeAdded = new HashMap<Node, Node>(); - private String fileName; + private File file; private String charset; + private List<ScssStylesheetResolver> resolvers = new ArrayList<ScssStylesheetResolver>(); + /** * Read in a file SCSS and parse it into a ScssStylesheet * @@ -90,18 +95,48 @@ public class ScssStylesheet extends Node { } /** - * Main entry point for the SASS compiler. Takes in a file and encoding then - * builds up a ScssStylesheet tree out of it. Calling compile() on it will - * transform SASS into CSS. Calling toString() will print out the SCSS/CSS. + * Main entry point for the SASS compiler. Takes in a file and an optional + * parent style sheet, then builds up a ScssStylesheet tree out of it. + * Calling compile() on it will transform SASS into CSS. Calling toString() + * will print out the SCSS/CSS. + * + * @param identifier + * The file path. If null then null is returned. + * @param parentStylesheet + * Style sheet from which to inherit resolvers and encoding. May + * be null. + * @return + * @throws CSSException + * @throws IOException + */ + public static ScssStylesheet get(String identifier, + ScssStylesheet parentStylesheet) throws CSSException, IOException { + return get(identifier, parentStylesheet, new SCSSDocumentHandlerImpl(), + new SCSSErrorHandler()); + } + + /** + * Main entry point for the SASS compiler. Takes in a file, an optional + * parent stylesheet, and document and error handlers. Then builds up a + * ScssStylesheet tree out of it. Calling compile() on it will transform + * SASS into CSS. Calling toString() will print out the SCSS/CSS. * * @param identifier * The file path. If null then null is returned. - * @param encoding + * @param parentStylesheet + * Style sheet from which to inherit resolvers and encoding. May + * be null. + * @param documentHandler + * Instance of document handler. May not be null. + * @param errorHandler + * Instance of error handler. May not be null. * @return * @throws CSSException * @throws IOException */ - public static ScssStylesheet get(String identifier, String encoding) + public static ScssStylesheet get(String identifier, + ScssStylesheet parentStylesheet, + SCSSDocumentHandler documentHandler, SCSSErrorHandler errorHandler) throws CSSException, IOException { /* * The encoding to be used is passed through "encoding" parameter. the @@ -120,18 +155,27 @@ public class ScssStylesheet extends Node { File file = new File(identifier); file = file.getCanonicalFile(); - SCSSDocumentHandler handler = new SCSSDocumentHandlerImpl(); - ScssStylesheet stylesheet = handler.getStyleSheet(); - - InputSource source = stylesheet.resolveStylesheet(identifier); + ScssStylesheet stylesheet = documentHandler.getStyleSheet(); + if (parentStylesheet == null) { + // Use default resolvers + stylesheet.addResolver(new FilesystemResolver()); + stylesheet.addResolver(new ClassloaderResolver()); + } else { + // Use parent resolvers + stylesheet.setResolvers(parentStylesheet.getResolvers()); + } + InputSource source = stylesheet.resolveStylesheet(identifier, + parentStylesheet); if (source == null) { return null; } - source.setEncoding(encoding); + if (parentStylesheet != null) { + source.setEncoding(parentStylesheet.getCharset()); + } Parser parser = new Parser(); - parser.setErrorHandler(new SCSSErrorHandler()); - parser.setDocumentHandler(handler); + parser.setErrorHandler(errorHandler); + parser.setDocumentHandler(documentHandler); try { parser.parseStyleSheet(source); @@ -145,24 +189,13 @@ public class ScssStylesheet extends Node { return stylesheet; } - private static ScssStylesheetResolver[] resolvers = null; - - public static void setStylesheetResolvers( - ScssStylesheetResolver... styleSheetResolvers) { - resolvers = Arrays.copyOf(styleSheetResolvers, - styleSheetResolvers.length); - } - - public InputSource resolveStylesheet(String identifier) { - if (resolvers == null) { - setStylesheetResolvers(new VaadinResolver()); - } - - for (ScssStylesheetResolver resolver : resolvers) { - InputSource source = resolver.resolve(identifier); + public InputSource resolveStylesheet(String identifier, + ScssStylesheet parentStylesheet) { + for (ScssStylesheetResolver resolver : getResolvers()) { + InputSource source = resolver.resolve(parentStylesheet, identifier); if (source != null) { File f = new File(source.getURI()); - setFileName(f.getParent()); + setFile(f); return source; } } @@ -171,6 +204,38 @@ public class ScssStylesheet extends Node { } /** + * Retrieves a list of resolvers to use when resolving imports + * + * @since 7.2 + * @return the resolvers used to resolving imports + */ + public List<ScssStylesheetResolver> getResolvers() { + return Collections.unmodifiableList(resolvers); + } + + /** + * Sets the list of resolvers to use when resolving imports + * + * @since 7.2 + * @param resolvers + * the resolvers to set + */ + public void setResolvers(List<ScssStylesheetResolver> resolvers) { + this.resolvers = new ArrayList<ScssStylesheetResolver>(resolvers); + } + + /** + * Adds the given resolver to the resolver list + * + * @since 7.2 + * @param resolver + * The resolver to add + */ + public void addResolver(ScssStylesheetResolver resolver) { + resolvers.add(resolver); + } + + /** * Applies all the visitors and compiles SCSS into Css. * * @throws Exception @@ -355,12 +420,28 @@ public class ScssStylesheet extends Node { return mixinDefs.get(name); } - public void setFileName(String fileName) { - this.fileName = fileName; + public void setFile(File file) { + this.file = file; } + /** + * Returns the directory containing this style sheet + * + * @since 7.2 + * @return The directory containing this style sheet + */ + public String getDirectory() { + return file.getParent(); + } + + /** + * Returns the full file name for this style sheet + * + * @since 7.2 + * @return The full file name for this style sheet + */ public String getFileName() { - return fileName; + return file.getPath(); } public static HashMap<Node, Node> getLastNodeAdded() { @@ -378,4 +459,19 @@ public class ScssStylesheet extends Node { public void setCharset(String charset) { this.charset = charset; } + + static { + String logFile = System.getProperty("java.util.logging.config.file"); + if (logFile == null) { + try { + LogManager.getLogManager().readConfiguration( + CompileTheme.class + .getResourceAsStream("/logging.properties")); + } catch (SecurityException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/handler/SCSSDocumentHandlerImpl.java b/theme-compiler/src/com/vaadin/sass/internal/handler/SCSSDocumentHandlerImpl.java index 99f00e3889..aa6d39fd77 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/handler/SCSSDocumentHandlerImpl.java +++ b/theme-compiler/src/com/vaadin/sass/internal/handler/SCSSDocumentHandlerImpl.java @@ -20,6 +20,8 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Stack; +import java.util.logging.Level; +import java.util.logging.Logger; import org.w3c.css.sac.CSSException; import org.w3c.css.sac.InputSource; @@ -98,7 +100,7 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler { public ForNode forDirective(String var, String from, String to, boolean exclusive, String body) { ForNode node = new ForNode(var, from, to, exclusive, body); - System.out.println(node); + log(node); return node; } @@ -126,7 +128,7 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler { @Override public WhileNode whileDirective(String condition, String body) { WhileNode node = new WhileNode(condition, body); - System.out.println(node); + log(node); return node; } @@ -138,14 +140,14 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler { @Override public void ignorableAtRule(String atRule) throws CSSException { - System.out.println("ignorableAtRule(String atRule): " + atRule); + log("ignorableAtRule(String atRule): " + atRule); } @Override public void namespaceDeclaration(String prefix, String uri) throws CSSException { - System.out.println("namespaceDeclaration(String prefix, String uri): " - + prefix + ", " + uri); + log("namespaceDeclaration(String prefix, String uri): " + prefix + ", " + + uri); } @Override @@ -167,14 +169,14 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler { @Override public void startPage(String name, String pseudo_page) throws CSSException { - System.out.println("startPage(String name, String pseudo_page): " - + name + ", " + pseudo_page); + log("startPage(String name, String pseudo_page): " + name + ", " + + pseudo_page); } @Override public void endPage(String name, String pseudo_page) throws CSSException { - System.out.println("endPage(String name, String pseudo_page): " + name - + ", " + pseudo_page); + log("endPage(String name, String pseudo_page): " + name + ", " + + pseudo_page); } @Override @@ -386,4 +388,17 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler { public void endIncludeContentBlock() { nodeStack.pop(); } + + private void log(Object object) { + if (object != null) { + log(object.toString()); + } else { + log(null); + } + } + + private void log(String msg) { + Logger.getLogger(SCSSDocumentHandlerImpl.class.getName()).log( + Level.INFO, msg); + } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/handler/SCSSErrorHandler.java b/theme-compiler/src/com/vaadin/sass/internal/handler/SCSSErrorHandler.java index 2e51c686d4..a7c65073ee 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/handler/SCSSErrorHandler.java +++ b/theme-compiler/src/com/vaadin/sass/internal/handler/SCSSErrorHandler.java @@ -15,34 +15,42 @@ */ package com.vaadin.sass.internal.handler; +import java.util.logging.Level; +import java.util.logging.Logger; + import org.w3c.css.sac.CSSException; import org.w3c.css.sac.CSSParseException; import org.w3c.css.sac.ErrorHandler; public class SCSSErrorHandler implements ErrorHandler { + public SCSSErrorHandler() { + } + @Override public void error(CSSParseException arg0) throws CSSException { - System.out.println("Error when parsing file \n" + arg0.getURI() - + " on line " + arg0.getLineNumber() + ", column " - + arg0.getColumnNumber()); - System.out.println(arg0.getMessage() + "\n"); + log("Error when parsing file \n" + arg0.getURI() + " on line " + + arg0.getLineNumber() + ", column " + arg0.getColumnNumber()); + log(arg0.getMessage() + "\n"); } @Override public void fatalError(CSSParseException arg0) throws CSSException { - System.out.println("FATAL Error when parsing file \n" + arg0.getURI() - + " on line " + arg0.getLineNumber() + ", column " - + arg0.getColumnNumber()); - System.out.println(arg0.getMessage() + "\n"); + log("FATAL Error when parsing file \n" + arg0.getURI() + " on line " + + arg0.getLineNumber() + ", column " + arg0.getColumnNumber()); + log(arg0.getMessage() + "\n"); } @Override public void warning(CSSParseException arg0) throws CSSException { - System.out.println("Warning when parsing file \n" + arg0.getURI() - + " on line " + arg0.getLineNumber() + ", column " - + arg0.getColumnNumber()); - System.out.println(arg0.getMessage() + "\n"); + log("Warning when parsing file \n" + arg0.getURI() + " on line " + + arg0.getLineNumber() + ", column " + arg0.getColumnNumber()); + log(arg0.getMessage() + "\n"); + } + + private void log(String msg) { + Logger.getLogger(SCSSDocumentHandlerImpl.class.getName()).log( + Level.SEVERE, msg); } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/CharStream.java b/theme-compiler/src/com/vaadin/sass/internal/parser/CharStream.java index c22f19451b..e43320453c 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/parser/CharStream.java +++ b/theme-compiler/src/com/vaadin/sass/internal/parser/CharStream.java @@ -127,4 +127,4 @@ interface CharStream { void Done(); } -/* JavaCC - OriginalChecksum=deb80d024b50bdc8bfaadaf528157233 (do not edit this line) */ +/* JavaCC - OriginalChecksum=18aae0a549695f0fec96a11297b442bb (do not edit this line) */ diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java b/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java index cfd428e094..e03cea8cfe 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java +++ b/theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java @@ -731,13 +731,6 @@ public class LexicalUnitImpl implements LexicalUnit, SCSSLexicalUnit, previous); } - @Override - public LexicalUnitImpl clone() { - LexicalUnitImpl cloned = new LexicalUnitImpl(type, line, column, prev); - cloned.replaceValue(this); - return cloned; - } - /** * Tries to return the value for this {@link LexicalUnitImpl} without * considering any related units. diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/LocatorImpl.java b/theme-compiler/src/com/vaadin/sass/internal/parser/LocatorImpl.java index ac244a9582..35589e0a94 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/parser/LocatorImpl.java +++ b/theme-compiler/src/com/vaadin/sass/internal/parser/LocatorImpl.java @@ -23,8 +23,13 @@ */ package com.vaadin.sass.internal.parser; +import java.util.logging.Level; +import java.util.logging.Logger; + import org.w3c.css.sac.Locator; +import com.vaadin.sass.internal.handler.SCSSDocumentHandlerImpl; + /** * @version $Revision: 1.2 $ * @author Philippe Le Hegaret @@ -51,14 +56,17 @@ public class LocatorImpl implements Locator { int line; int column; + @Override public String getURI() { return uri; } + @Override public int getLineNumber() { return line; } + @Override public int getColumnNumber() { return column; } @@ -68,7 +76,7 @@ public class LocatorImpl implements Locator { */ public LocatorImpl(Parser p) { if (W3CDebug) { - System.err.println("LocatorImpl::newLocator(" + p + ");"); + log("LocatorImpl::newLocator(" + p + ");"); } uri = p.source.getURI(); line = p.token.beginLine; @@ -80,8 +88,7 @@ public class LocatorImpl implements Locator { */ public LocatorImpl(Parser p, Token tok) { if (W3CDebug) { - System.err.println("LocatorImpl::newLocator(" + p + ", " + tok - + ");"); + log("LocatorImpl::newLocator(" + p + ", " + tok + ");"); } uri = p.source.getURI(); line = tok.beginLine; @@ -93,8 +100,8 @@ public class LocatorImpl implements Locator { */ public LocatorImpl(Parser p, int line, int column) { if (W3CDebug) { - System.err.println("LocatorImpl::newLocator(" + p + ", " + line - + ", " + column + ");"); + log("LocatorImpl::newLocator(" + p + ", " + line + ", " + column + + ");"); } uri = p.source.getURI(); this.line = line; @@ -106,7 +113,7 @@ public class LocatorImpl implements Locator { */ public LocatorImpl reInit(Parser p) { if (W3CDebug) { - System.err.println("LocatorImpl::reInit(" + p + ");"); + log("LocatorImpl::reInit(" + p + ");"); } uri = p.source.getURI(); line = p.token.beginLine; @@ -119,7 +126,7 @@ public class LocatorImpl implements Locator { */ public LocatorImpl reInit(Parser p, Token tok) { if (W3CDebug) { - System.err.println("LocatorImpl::reInit(" + p + ", " + tok + ");"); + log("LocatorImpl::reInit(" + p + ", " + tok + ");"); } uri = p.source.getURI(); line = tok.beginLine; @@ -132,12 +139,16 @@ public class LocatorImpl implements Locator { */ public LocatorImpl reInit(Parser p, int line, int column) { if (W3CDebug) { - System.err.println("LocatorImpl::reInit(" + p + ", " + line + ", " - + column + ");"); + log("LocatorImpl::reInit(" + p + ", " + line + ", " + column + ");"); } uri = p.source.getURI(); this.line = line; this.column = column; return this; } + + private void log(String msg) { + Logger.getLogger(SCSSDocumentHandlerImpl.class.getName()).log( + Level.SEVERE, msg); + } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java index 679e696aa3..79dd65e805 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java +++ b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java @@ -22,6 +22,8 @@ import java.util.ArrayList; import java.util.Locale; import java.util.Map; import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; import org.w3c.css.sac.ConditionFactory; import org.w3c.css.sac.Condition; @@ -1158,6 +1160,7 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { case NONASCII: case DEBUG_SYM: case WARN_SYM: + case CONTENT_SYM: case STRING: case IDENT: case NUMBER: @@ -1180,53 +1183,7 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { jj_la1[37] = jj_gen; break label_28; } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case DEBUG_SYM: - case WARN_SYM: - debuggingDirective(); - break; - case PLUS: - case PRECEDES: - case SIBLING: - case LBRACKET: - case ANY: - case PARENT: - case DOT: - case COLON: - case INTERPOLATION: - case IDENT: - case HASH: - styleRule(); - break; - case CDO: - case LBRACE: - case DASHMATCH: - case INCLUDES: - case MINUS: - case COMMA: - case SEMICOLON: - case NONASCII: - case STRING: - case NUMBER: - case URL: - case PERCENTAGE: - case IMPORT_SYM: - case MEDIA_SYM: - case CHARSET_SYM: - case PAGE_SYM: - case FONT_FACE_SYM: - case ATKEYWORD: - case IMPORTANT_SYM: - case UNICODERANGE: - case FUNCTION: - case UNKNOWN: - skipUnknownRule(); - break; - default: - jj_la1[38] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } + mediaDirective(); } jj_consume_token(RBRACE); label_29: @@ -1236,7 +1193,7 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { ; break; default: - jj_la1[39] = jj_gen; + jj_la1[38] = jj_gen; break label_29; } jj_consume_token(S); @@ -1248,11 +1205,64 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { } finally { if (start) { - documentHandler.endMedia(ml); + documentHandler.endMedia(ml); } } } + final public void mediaDirective() throws ParseException { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case DEBUG_SYM: + case WARN_SYM: + debuggingDirective(); + break; + case PLUS: + case PRECEDES: + case SIBLING: + case LBRACKET: + case ANY: + case PARENT: + case DOT: + case COLON: + case INTERPOLATION: + case IDENT: + case HASH: + styleRule(); + break; + case CDO: + case LBRACE: + case DASHMATCH: + case INCLUDES: + case MINUS: + case COMMA: + case SEMICOLON: + case NONASCII: + case STRING: + case NUMBER: + case URL: + case PERCENTAGE: + case IMPORT_SYM: + case MEDIA_SYM: + case CHARSET_SYM: + case PAGE_SYM: + case FONT_FACE_SYM: + case ATKEYWORD: + case IMPORTANT_SYM: + case UNICODERANGE: + case FUNCTION: + case UNKNOWN: + skipUnknownRule(); + break; + case CONTENT_SYM: + contentDirective(); + break; + default: + jj_la1[39] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + final public void mediaStatement(MediaListImpl ml) throws ParseException { Token t; t = getToken(1); @@ -2194,88 +2204,13 @@ char connector = ' '; } } break; - case HASH: - cond = hash(cond); - label_58: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case DOT: - case COLON: - ; - break; - default: - jj_la1[82] = jj_gen; - break label_58; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case DOT: - cond = _class(cond); - break; - case LBRACKET: - cond = attrib(cond); - break; - case COLON: - cond = pseudo(cond); - break; - default: - jj_la1[83] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; + case LBRACKET: case DOT: - cond = _class(cond); - label_59: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case DOT: - case COLON: - case HASH: - ; - break; - default: - jj_la1[84] = jj_gen; - break label_59; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case HASH: - cond = hash(cond); - break; - case DOT: - cond = _class(cond); - break; - case LBRACKET: - cond = attrib(cond); - break; - case COLON: - cond = pseudo(cond); - break; - default: - jj_la1[85] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; case COLON: - cond = pseudo(cond); - label_60: + case HASH: + label_58: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case DOT: - case COLON: - case HASH: - ; - break; - default: - jj_la1[86] = jj_gen; - break label_60; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case HASH: cond = hash(cond); break; @@ -2289,16 +2224,10 @@ char connector = ' '; cond = pseudo(cond); break; default: - jj_la1[87] = jj_gen; + jj_la1[82] = jj_gen; jj_consume_token(-1); throw new ParseException(); } - } - break; - case LBRACKET: - cond = attrib(cond); - label_61: - while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: case DOT: @@ -2307,31 +2236,13 @@ char connector = ' '; ; break; default: - jj_la1[88] = jj_gen; - break label_61; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case HASH: - cond = hash(cond); - break; - case DOT: - cond = _class(cond); - break; - case LBRACKET: - cond = attrib(cond); - break; - case COLON: - cond = pseudo(cond); - break; - default: - jj_la1[89] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); + jj_la1[83] = jj_gen; + break label_58; } } break; default: - jj_la1[90] = jj_gen; + jj_la1[84] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2376,7 +2287,7 @@ char connector = ' '; Token t; String s = "."; jj_consume_token(DOT); - label_62: + label_59: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENT: @@ -2388,7 +2299,7 @@ String s = "."; s += t.image; break; default: - jj_la1[91] = jj_gen; + jj_la1[85] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2398,8 +2309,8 @@ String s = "."; ; break; default: - jj_la1[92] = jj_gen; - break label_62; + jj_la1[86] = jj_gen; + break label_59; } } if (pred == null) { @@ -2418,7 +2329,7 @@ String s = "."; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INTERPOLATION: case IDENT: - label_63: + label_60: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENT: @@ -2430,7 +2341,7 @@ String s = "."; s += t.image; break; default: - jj_la1[93] = jj_gen; + jj_la1[87] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2440,8 +2351,8 @@ String s = "."; ; break; default: - jj_la1[94] = jj_gen; - break label_63; + jj_la1[88] = jj_gen; + break label_60; } } {if (true) return s;} @@ -2455,7 +2366,7 @@ String s = "."; {if (true) return "&";} break; default: - jj_la1[95] = jj_gen; + jj_la1[89] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2471,28 +2382,28 @@ String s = "."; Token val = null; String attValue = null; jj_consume_token(LBRACKET); - label_64: + label_61: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[96] = jj_gen; - break label_64; + jj_la1[90] = jj_gen; + break label_61; } jj_consume_token(S); } att = jj_consume_token(IDENT); - label_65: + label_62: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[97] = jj_gen; - break label_65; + jj_la1[91] = jj_gen; + break label_62; } jj_consume_token(S); } @@ -2529,19 +2440,19 @@ String s = "."; cases = 6; break; default: - jj_la1[98] = jj_gen; + jj_la1[92] = jj_gen; jj_consume_token(-1); throw new ParseException(); } - label_66: + label_63: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[99] = jj_gen; - break label_66; + jj_la1[93] = jj_gen; + break label_63; } jj_consume_token(S); } @@ -2555,25 +2466,25 @@ String s = "."; attValue = val.image; break; default: - jj_la1[100] = jj_gen; + jj_la1[94] = jj_gen; jj_consume_token(-1); throw new ParseException(); } - label_67: + label_64: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[101] = jj_gen; - break label_67; + jj_la1[95] = jj_gen; + break label_64; } jj_consume_token(S); } break; default: - jj_la1[102] = jj_gen; + jj_la1[96] = jj_gen; ; } jj_consume_token(RBRACKET); @@ -2629,7 +2540,7 @@ boolean isPseudoElement = false; isPseudoElement=true; break; default: - jj_la1[103] = jj_gen; + jj_la1[97] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -2655,19 +2566,19 @@ boolean isPseudoElement = false; break; case FUNCTION: n = jj_consume_token(FUNCTION); - label_68: + label_65: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[104] = jj_gen; - break label_68; + jj_la1[98] = jj_gen; + break label_65; } jj_consume_token(S); } - d = skipStatementUntilRightParan(); + d = skipStatementUntilMatchingRightParan(); jj_consume_token(RPARAN); // accept anything between function and a right parenthesis String f = convertIdent(n.image); @@ -2680,7 +2591,7 @@ boolean isPseudoElement = false; } break; default: - jj_la1[105] = jj_gen; + jj_la1[99] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2710,15 +2621,15 @@ boolean isPseudoElement = false; try { name = variableName(); jj_consume_token(COLON); - label_69: + label_66: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[106] = jj_gen; - break label_69; + jj_la1[100] = jj_gen; + break label_66; } jj_consume_token(S); } @@ -2728,21 +2639,21 @@ boolean isPseudoElement = false; guarded = guarded(); break; default: - jj_la1[107] = jj_gen; + jj_la1[101] = jj_gen; ; } - label_70: + label_67: while (true) { jj_consume_token(SEMICOLON); - label_71: + label_68: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[108] = jj_gen; - break label_71; + jj_la1[102] = jj_gen; + break label_68; } jj_consume_token(S); } @@ -2751,8 +2662,8 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[109] = jj_gen; - break label_70; + jj_la1[103] = jj_gen; + break label_67; } } documentHandler.variable(name, exp, guarded); @@ -2792,7 +2703,7 @@ boolean isPseudoElement = false; eachDirective(); break; default: - jj_la1[110] = jj_gen; + jj_la1[104] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2831,7 +2742,7 @@ boolean isPseudoElement = false; keyframes(); break; default: - jj_la1[111] = jj_gen; + jj_la1[105] = jj_gen; if (jj_2_3(2147483647)) { variable(); } else { @@ -2847,7 +2758,7 @@ boolean isPseudoElement = false; atRuleDeclaration(); break; default: - jj_la1[112] = jj_gen; + jj_la1[106] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2860,7 +2771,7 @@ boolean isPseudoElement = false; String s = null; String evaluator = ""; jj_consume_token(IF_SYM); - label_72: + label_69: while (true) { s = booleanExpressionToken(); evaluator += s; @@ -2886,26 +2797,26 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[113] = jj_gen; - break label_72; + jj_la1[107] = jj_gen; + break label_69; } } jj_consume_token(LBRACE); - label_73: + label_70: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[114] = jj_gen; - break label_73; + jj_la1[108] = jj_gen; + break label_70; } jj_consume_token(S); } documentHandler.startIfElseDirective(); documentHandler.ifDirective(evaluator); - label_74: + label_71: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -2934,8 +2845,8 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[115] = jj_gen; - break label_74; + jj_la1[109] = jj_gen; + break label_71; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -2966,33 +2877,33 @@ boolean isPseudoElement = false; fontFace(); break; default: - jj_la1[116] = jj_gen; + jj_la1[110] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); - label_75: + label_72: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[117] = jj_gen; - break label_75; + jj_la1[111] = jj_gen; + break label_72; } jj_consume_token(S); } - label_76: + label_73: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ELSE_SYM: ; break; default: - jj_la1[118] = jj_gen; - break label_76; + jj_la1[112] = jj_gen; + break label_73; } elseDirective(); } @@ -3004,22 +2915,22 @@ boolean isPseudoElement = false; Token n = null; String s = null; jj_consume_token(ELSE_SYM); - label_77: + label_74: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[119] = jj_gen; - break label_77; + jj_la1[113] = jj_gen; + break label_74; } jj_consume_token(S); } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IF: jj_consume_token(IF); - label_78: + label_75: while (true) { s = booleanExpressionToken(); evaluator += s; @@ -3045,31 +2956,31 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[120] = jj_gen; - break label_78; + jj_la1[114] = jj_gen; + break label_75; } } break; default: - jj_la1[121] = jj_gen; + jj_la1[115] = jj_gen; ; } jj_consume_token(LBRACE); - label_79: + label_76: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[122] = jj_gen; - break label_79; + jj_la1[116] = jj_gen; + break label_76; } jj_consume_token(S); } if(!evaluator.trim().equals("")){ documentHandler.ifDirective(evaluator); } else{ documentHandler.elseDirective(); } - label_80: + label_77: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -3098,8 +3009,8 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[123] = jj_gen; - break label_80; + jj_la1[117] = jj_gen; + break label_77; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -3130,21 +3041,21 @@ boolean isPseudoElement = false; fontFace(); break; default: - jj_la1[124] = jj_gen; + jj_la1[118] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); - label_81: + label_78: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[125] = jj_gen; - break label_81; + jj_la1[119] = jj_gen; + break label_78; } jj_consume_token(S); } @@ -3209,7 +3120,7 @@ boolean isPseudoElement = false; n = jj_consume_token(NOT_EQ); break; default: - jj_la1[126] = jj_gen; + jj_la1[120] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3224,41 +3135,41 @@ boolean isPseudoElement = false; ArrayList<String> list = null; String listVariable = null; jj_consume_token(EACH_SYM); - label_82: + label_79: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[127] = jj_gen; - break label_82; + jj_la1[121] = jj_gen; + break label_79; } jj_consume_token(S); } var = jj_consume_token(VARIABLE); - label_83: + label_80: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[128] = jj_gen; - break label_83; + jj_la1[122] = jj_gen; + break label_80; } jj_consume_token(S); } jj_consume_token(EACH_IN); - label_84: + label_81: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[129] = jj_gen; - break label_84; + jj_la1[123] = jj_gen; + break label_81; } jj_consume_token(S); } @@ -3272,24 +3183,24 @@ boolean isPseudoElement = false; documentHandler.startEachDirective(var.image, listVariable); break; default: - jj_la1[130] = jj_gen; + jj_la1[124] = jj_gen; jj_consume_token(-1); throw new ParseException(); } jj_consume_token(LBRACE); - label_85: + label_82: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[131] = jj_gen; - break label_85; + jj_la1[125] = jj_gen; + break label_82; } jj_consume_token(S); } - label_86: + label_83: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -3317,21 +3228,21 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[132] = jj_gen; - break label_86; + jj_la1[126] = jj_gen; + break label_83; } ifContentStatement(); } jj_consume_token(RBRACE); - label_87: + label_84: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[133] = jj_gen; - break label_87; + jj_la1[127] = jj_gen; + break label_84; } jj_consume_token(S); } @@ -3342,53 +3253,53 @@ boolean isPseudoElement = false; ArrayList<String > strings = new ArrayList<String >(); Token input; input = jj_consume_token(IDENT); - label_88: + label_85: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[134] = jj_gen; - break label_88; + jj_la1[128] = jj_gen; + break label_85; } jj_consume_token(S); } strings.add(input.image); - label_89: + label_86: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: - jj_la1[135] = jj_gen; - break label_89; + jj_la1[129] = jj_gen; + break label_86; } jj_consume_token(COMMA); - label_90: + label_87: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[136] = jj_gen; - break label_90; + jj_la1[130] = jj_gen; + break label_87; } jj_consume_token(S); } input = jj_consume_token(IDENT); strings.add(input.image); - label_91: + label_88: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[137] = jj_gen; - break label_91; + jj_la1[131] = jj_gen; + break label_88; } jj_consume_token(S); } @@ -3402,15 +3313,15 @@ boolean isPseudoElement = false; ArrayList<VariableNode> args = null; String body; jj_consume_token(MIXIN_SYM); - label_92: + label_89: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[138] = jj_gen; - break label_92; + jj_la1[132] = jj_gen; + break label_89; } jj_consume_token(S); } @@ -3423,39 +3334,39 @@ boolean isPseudoElement = false; name = functionName(); args = arglist(); jj_consume_token(RPARAN); - label_93: + label_90: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[139] = jj_gen; - break label_93; + jj_la1[133] = jj_gen; + break label_90; } jj_consume_token(S); } break; default: - jj_la1[140] = jj_gen; + jj_la1[134] = jj_gen; jj_consume_token(-1); throw new ParseException(); } jj_consume_token(LBRACE); - label_94: + label_91: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[141] = jj_gen; - break label_94; + jj_la1[135] = jj_gen; + break label_91; } jj_consume_token(S); } documentHandler.startMixinDirective(name, args); - label_95: + label_92: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -3485,8 +3396,8 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[142] = jj_gen; - break label_95; + jj_la1[136] = jj_gen; + break label_92; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -3520,21 +3431,21 @@ boolean isPseudoElement = false; page(); break; default: - jj_la1[143] = jj_gen; + jj_la1[137] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); - label_96: + label_93: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[144] = jj_gen; - break label_96; + jj_la1[138] = jj_gen; + break label_93; } jj_consume_token(S); } @@ -3546,26 +3457,26 @@ boolean isPseudoElement = false; VariableNode arg; boolean hasNonOptionalArgument = false; arg = mixinArg(); - label_97: + label_94: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: - jj_la1[145] = jj_gen; - break label_97; + jj_la1[139] = jj_gen; + break label_94; } jj_consume_token(COMMA); - label_98: + label_95: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[146] = jj_gen; - break label_98; + jj_la1[140] = jj_gen; + break label_95; } jj_consume_token(S); } @@ -3606,45 +3517,45 @@ boolean isPseudoElement = false; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COLON: jj_consume_token(COLON); - label_99: + label_96: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[147] = jj_gen; - break label_99; + jj_la1[141] = jj_gen; + break label_96; } jj_consume_token(S); } first = nonVariableTerm(null); prev = first; - label_100: + label_97: while (true) { if (jj_2_5(3)) { ; } else { - break label_100; + break label_97; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: jj_consume_token(COMMA); - label_101: + label_98: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[148] = jj_gen; - break label_101; + jj_la1[142] = jj_gen; + break label_98; } jj_consume_token(S); } break; default: - jj_la1[149] = jj_gen; + jj_la1[143] = jj_gen; ; } prev = nonVariableTerm(prev); @@ -3656,13 +3567,13 @@ boolean isPseudoElement = false; prev, variable.image); break; default: - jj_la1[150] = jj_gen; + jj_la1[144] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: - jj_la1[151] = jj_gen; + jj_la1[145] = jj_gen; ; } VariableNode arg = new VariableNode(name, first, false); @@ -3677,7 +3588,7 @@ boolean isPseudoElement = false; LexicalUnitImpl prev = null; first = term(null); args.add(first); prev = first; - label_102: + label_99: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -3717,58 +3628,58 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[152] = jj_gen; - break label_102; + jj_la1[146] = jj_gen; + break label_99; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COLON: jj_consume_token(COLON); - label_103: + label_100: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[153] = jj_gen; - break label_103; + jj_la1[147] = jj_gen; + break label_100; } jj_consume_token(S); } break; default: - jj_la1[154] = jj_gen; + jj_la1[148] = jj_gen; ; } next = term(prev); prev.setNextLexicalUnit(next); prev = next; } - label_104: + label_101: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: - jj_la1[155] = jj_gen; - break label_104; + jj_la1[149] = jj_gen; + break label_101; } jj_consume_token(COMMA); - label_105: + label_102: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[156] = jj_gen; - break label_105; + jj_la1[150] = jj_gen; + break label_102; } jj_consume_token(S); } first = term(null); args.add(first); prev = first; - label_106: + label_103: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -3808,27 +3719,27 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[157] = jj_gen; - break label_106; + jj_la1[151] = jj_gen; + break label_103; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COLON: jj_consume_token(COLON); - label_107: + label_104: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[158] = jj_gen; - break label_107; + jj_la1[152] = jj_gen; + break label_104; } jj_consume_token(S); } break; default: - jj_la1[159] = jj_gen; + jj_la1[153] = jj_gen; ; } next = term(prev); @@ -3843,15 +3754,15 @@ boolean isPseudoElement = false; String name; ArrayList<LexicalUnitImpl> args=null; jj_consume_token(INCLUDE_SYM); - label_108: + label_105: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[160] = jj_gen; - break label_108; + jj_la1[154] = jj_gen; + break label_105; } jj_consume_token(S); } @@ -3868,38 +3779,38 @@ boolean isPseudoElement = false; name = functionName(); args = argValuelist(); jj_consume_token(RPARAN); - label_109: + label_106: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[161] = jj_gen; - break label_109; + jj_la1[155] = jj_gen; + break label_106; } jj_consume_token(S); } break; default: - jj_la1[162] = jj_gen; + jj_la1[156] = jj_gen; jj_consume_token(-1); throw new ParseException(); } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SEMICOLON: - label_110: + label_107: while (true) { jj_consume_token(SEMICOLON); - label_111: + label_108: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[163] = jj_gen; - break label_111; + jj_la1[157] = jj_gen; + break label_108; } jj_consume_token(S); } @@ -3908,28 +3819,28 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[164] = jj_gen; - break label_110; + jj_la1[158] = jj_gen; + break label_107; } } documentHandler.includeDirective(name, args); break; case LBRACE: jj_consume_token(LBRACE); - label_112: + label_109: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[165] = jj_gen; - break label_112; + jj_la1[159] = jj_gen; + break label_109; } jj_consume_token(S); } documentHandler.startIncludeContentBlock(name, args); - label_113: + label_110: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -3951,8 +3862,8 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[166] = jj_gen; - break label_113; + jj_la1[160] = jj_gen; + break label_110; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: @@ -3976,28 +3887,28 @@ boolean isPseudoElement = false; keyframeSelector(); break; default: - jj_la1[167] = jj_gen; + jj_la1[161] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } jj_consume_token(RBRACE); - label_114: + label_111: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[168] = jj_gen; - break label_114; + jj_la1[162] = jj_gen; + break label_111; } jj_consume_token(S); } documentHandler.endIncludeContentBlock(); break; default: - jj_la1[169] = jj_gen; + jj_la1[163] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -4020,28 +3931,28 @@ boolean isPseudoElement = false; //refactor, remove those 3 LOOKAHEAD(5). n = jj_consume_token(VARIABLE); variable = n.image; - label_115: + label_112: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[170] = jj_gen; - break label_115; + jj_la1[164] = jj_gen; + break label_112; } jj_consume_token(S); } jj_consume_token(COLON); - label_116: + label_113: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[171] = jj_gen; - break label_116; + jj_la1[165] = jj_gen; + break label_113; } jj_consume_token(S); } @@ -4056,19 +3967,19 @@ boolean isPseudoElement = false; type = jj_consume_token(CONTAINS); break; default: - jj_la1[172] = jj_gen; + jj_la1[166] = jj_gen; jj_consume_token(-1); throw new ParseException(); } - label_117: + label_114: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[173] = jj_gen; - break label_117; + jj_la1[167] = jj_gen; + break label_114; } jj_consume_token(S); } @@ -4078,19 +3989,19 @@ boolean isPseudoElement = false; jj_consume_token(RPARAN); break; default: - jj_la1[174] = jj_gen; + jj_la1[168] = jj_gen; ; } jj_consume_token(COMMA); - label_118: + label_115: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[175] = jj_gen; - break label_118; + jj_la1[169] = jj_gen; + break label_115; } jj_consume_token(S); } @@ -4098,35 +4009,35 @@ boolean isPseudoElement = false; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: jj_consume_token(COMMA); - label_119: + label_116: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[176] = jj_gen; - break label_119; + jj_la1[170] = jj_gen; + break label_116; } jj_consume_token(S); } n = jj_consume_token(IDENT); separator = n.image; - label_120: + label_117: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[177] = jj_gen; - break label_120; + jj_la1[171] = jj_gen; + break label_117; } jj_consume_token(S); } break; default: - jj_la1[178] = jj_gen; + jj_la1[172] = jj_gen; ; } jj_consume_token(RPARAN); @@ -4146,28 +4057,28 @@ boolean isPseudoElement = false; default: break; } - label_121: + label_118: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[179] = jj_gen; - break label_121; + jj_la1[173] = jj_gen; + break label_118; } jj_consume_token(S); } jj_consume_token(SEMICOLON); - label_122: + label_119: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[180] = jj_gen; - break label_122; + jj_la1[174] = jj_gen; + break label_119; } jj_consume_token(S); } @@ -4184,41 +4095,41 @@ boolean isPseudoElement = false; Token n = null; n = jj_consume_token(VARIABLE); variable = n.image; - label_123: + label_120: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[181] = jj_gen; - break label_123; + jj_la1[175] = jj_gen; + break label_120; } jj_consume_token(S); } jj_consume_token(COLON); - label_124: + label_121: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[182] = jj_gen; - break label_124; + jj_la1[176] = jj_gen; + break label_121; } jj_consume_token(S); } jj_consume_token(APPEND); - label_125: + label_122: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[183] = jj_gen; - break label_125; + jj_la1[177] = jj_gen; + break label_122; } jj_consume_token(S); } @@ -4228,19 +4139,19 @@ boolean isPseudoElement = false; jj_consume_token(RPARAN); break; default: - jj_la1[184] = jj_gen; + jj_la1[178] = jj_gen; ; } jj_consume_token(COMMA); - label_126: + label_123: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[185] = jj_gen; - break label_126; + jj_la1[179] = jj_gen; + break label_123; } jj_consume_token(S); } @@ -4248,35 +4159,35 @@ boolean isPseudoElement = false; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: jj_consume_token(COMMA); - label_127: + label_124: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[186] = jj_gen; - break label_127; + jj_la1[180] = jj_gen; + break label_124; } jj_consume_token(S); } n = jj_consume_token(IDENT); separator = n.image; - label_128: + label_125: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[187] = jj_gen; - break label_128; + jj_la1[181] = jj_gen; + break label_125; } jj_consume_token(S); } break; default: - jj_la1[188] = jj_gen; + jj_la1[182] = jj_gen; ; } jj_consume_token(RPARAN); @@ -4294,41 +4205,41 @@ boolean isPseudoElement = false; Token n = null; n = jj_consume_token(VARIABLE); variable = n.image; - label_129: + label_126: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[189] = jj_gen; - break label_129; + jj_la1[183] = jj_gen; + break label_126; } jj_consume_token(S); } jj_consume_token(COLON); - label_130: + label_127: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[190] = jj_gen; - break label_130; + jj_la1[184] = jj_gen; + break label_127; } jj_consume_token(S); } jj_consume_token(REMOVE); - label_131: + label_128: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[191] = jj_gen; - break label_131; + jj_la1[185] = jj_gen; + break label_128; } jj_consume_token(S); } @@ -4338,19 +4249,19 @@ boolean isPseudoElement = false; jj_consume_token(RPARAN); break; default: - jj_la1[192] = jj_gen; + jj_la1[186] = jj_gen; ; } jj_consume_token(COMMA); - label_132: + label_129: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[193] = jj_gen; - break label_132; + jj_la1[187] = jj_gen; + break label_129; } jj_consume_token(S); } @@ -4358,35 +4269,35 @@ boolean isPseudoElement = false; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: jj_consume_token(COMMA); - label_133: + label_130: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[194] = jj_gen; - break label_133; + jj_la1[188] = jj_gen; + break label_130; } jj_consume_token(S); } n = jj_consume_token(IDENT); separator = n.image; - label_134: + label_131: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[195] = jj_gen; - break label_134; + jj_la1[189] = jj_gen; + break label_131; } jj_consume_token(S); } break; default: - jj_la1[196] = jj_gen; + jj_la1[190] = jj_gen; ; } jj_consume_token(RPARAN); @@ -4406,46 +4317,46 @@ boolean isPseudoElement = false; case VARIABLE: n = jj_consume_token(VARIABLE); variable = n.image; - label_135: + label_132: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[197] = jj_gen; - break label_135; + jj_la1[191] = jj_gen; + break label_132; } jj_consume_token(S); } jj_consume_token(COLON); - label_136: + label_133: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[198] = jj_gen; - break label_136; + jj_la1[192] = jj_gen; + break label_133; } jj_consume_token(S); } break; default: - jj_la1[199] = jj_gen; + jj_la1[193] = jj_gen; ; } jj_consume_token(CONTAINS); - label_137: + label_134: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[200] = jj_gen; - break label_137; + jj_la1[194] = jj_gen; + break label_134; } jj_consume_token(S); } @@ -4455,19 +4366,19 @@ boolean isPseudoElement = false; jj_consume_token(RPARAN); break; default: - jj_la1[201] = jj_gen; + jj_la1[195] = jj_gen; ; } jj_consume_token(COMMA); - label_138: + label_135: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[202] = jj_gen; - break label_138; + jj_la1[196] = jj_gen; + break label_135; } jj_consume_token(S); } @@ -4475,35 +4386,35 @@ boolean isPseudoElement = false; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: jj_consume_token(COMMA); - label_139: + label_136: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[203] = jj_gen; - break label_139; + jj_la1[197] = jj_gen; + break label_136; } jj_consume_token(S); } n = jj_consume_token(IDENT); separator = n.image; - label_140: + label_137: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[204] = jj_gen; - break label_140; + jj_la1[198] = jj_gen; + break label_137; } jj_consume_token(S); } break; default: - jj_la1[205] = jj_gen; + jj_la1[199] = jj_gen; ; } jj_consume_token(RPARAN); @@ -4608,7 +4519,7 @@ boolean isPseudoElement = false; warnDirective(); break; default: - jj_la1[206] = jj_gen; + jj_la1[200] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -4618,16 +4529,16 @@ boolean isPseudoElement = false; jj_consume_token(DEBUG_SYM); String content = skipStatementUntilSemiColon(); // TODO should evaluate the content expression, call documentHandler.debugDirective() etc. - System.out.println(content); - label_141: + Logger.getLogger(Parser.class.getName()).log(Level.INFO, content); + label_138: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[207] = jj_gen; - break label_141; + jj_la1[201] = jj_gen; + break label_138; } jj_consume_token(S); } @@ -4637,16 +4548,16 @@ boolean isPseudoElement = false; jj_consume_token(WARN_SYM); String content = skipStatementUntilSemiColon(); // TODO should evaluate the content expression, call documentHandler.warnDirective() etc. - System.err.println(content); - label_142: + Logger.getLogger(Parser.class.getName()).log(Level.SEVERE, content); + label_139: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[208] = jj_gen; - break label_142; + jj_la1[202] = jj_gen; + break label_139; } jj_consume_token(S); } @@ -4672,20 +4583,20 @@ boolean isPseudoElement = false; exclusive = false; break; default: - jj_la1[209] = jj_gen; + jj_la1[203] = jj_gen; jj_consume_token(-1); throw new ParseException(); } to = skipStatementUntilLeftBrace(); - label_143: + label_140: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[210] = jj_gen; - break label_143; + jj_la1[204] = jj_gen; + break label_140; } jj_consume_token(S); } @@ -4706,31 +4617,31 @@ boolean isPseudoElement = false; final public void extendDirective() throws ParseException { ArrayList<String> list; jj_consume_token(EXTEND_SYM); - label_144: + label_141: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[211] = jj_gen; - break label_144; + jj_la1[205] = jj_gen; + break label_141; } jj_consume_token(S); } list = selectorList(); - label_145: + label_142: while (true) { jj_consume_token(SEMICOLON); - label_146: + label_143: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[212] = jj_gen; - break label_146; + jj_la1[206] = jj_gen; + break label_143; } jj_consume_token(S); } @@ -4739,8 +4650,8 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[213] = jj_gen; - break label_145; + jj_la1[207] = jj_gen; + break label_142; } } documentHandler.extendDirective(list); @@ -4748,30 +4659,30 @@ boolean isPseudoElement = false; final public void contentDirective() throws ParseException { jj_consume_token(CONTENT_SYM); - label_147: + label_144: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[214] = jj_gen; - break label_147; + jj_la1[208] = jj_gen; + break label_144; } jj_consume_token(S); } - label_148: + label_145: while (true) { jj_consume_token(SEMICOLON); - label_149: + label_146: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[215] = jj_gen; - break label_149; + jj_la1[209] = jj_gen; + break label_146; } jj_consume_token(S); } @@ -4780,8 +4691,8 @@ boolean isPseudoElement = false; ; break; default: - jj_la1[216] = jj_gen; - break label_148; + jj_la1[210] = jj_gen; + break label_145; } } documentHandler.contentDirective(); @@ -4808,28 +4719,28 @@ boolean isPseudoElement = false; LexicalUnit exp; name = property(); jj_consume_token(COLON); - label_150: + label_147: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[217] = jj_gen; - break label_150; + jj_la1[211] = jj_gen; + break label_147; } jj_consume_token(S); } jj_consume_token(LBRACE); - label_151: + label_148: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[218] = jj_gen; - break label_151; + jj_la1[212] = jj_gen; + break label_148; } jj_consume_token(S); } @@ -4840,29 +4751,29 @@ LexicalUnit exp; declaration(); break; default: - jj_la1[219] = jj_gen; + jj_la1[213] = jj_gen; ; } - label_152: + label_149: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SEMICOLON: ; break; default: - jj_la1[220] = jj_gen; - break label_152; + jj_la1[214] = jj_gen; + break label_149; } jj_consume_token(SEMICOLON); - label_153: + label_150: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[221] = jj_gen; - break label_153; + jj_la1[215] = jj_gen; + break label_150; } jj_consume_token(S); } @@ -4872,21 +4783,21 @@ LexicalUnit exp; declaration(); break; default: - jj_la1[222] = jj_gen; + jj_la1[216] = jj_gen; ; } } jj_consume_token(RBRACE); documentHandler.endNestedProperties(name); - label_154: + label_151: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[223] = jj_gen; - break label_154; + jj_la1[217] = jj_gen; + break label_151; } jj_consume_token(S); } @@ -4903,7 +4814,7 @@ LexicalUnit exp; debuggingDirective(); break; default: - jj_la1[224] = jj_gen; + jj_la1[218] = jj_gen; if (jj_2_6(2147483647)) { styleRule(); } else if (jj_2_7(3)) { @@ -4924,7 +4835,7 @@ LexicalUnit exp; styleRule(); break; default: - jj_la1[225] = jj_gen; + jj_la1[219] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -4969,15 +4880,15 @@ LexicalUnit exp; name = property(); save = token; jj_consume_token(COLON); - label_155: + label_152: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[226] = jj_gen; - break label_155; + jj_la1[220] = jj_gen; + break label_152; } jj_consume_token(S); } @@ -5021,7 +4932,7 @@ LexicalUnit exp; important = prio(); break; default: - jj_la1[227] = jj_gen; + jj_la1[221] = jj_gen; ; } Token next = getToken(1); @@ -5040,15 +4951,15 @@ LexicalUnit exp; break; case LBRACE: jj_consume_token(LBRACE); - label_156: + label_153: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[228] = jj_gen; - break label_156; + jj_la1[222] = jj_gen; + break label_153; } jj_consume_token(S); } @@ -5059,29 +4970,29 @@ LexicalUnit exp; declaration(); break; default: - jj_la1[229] = jj_gen; + jj_la1[223] = jj_gen; ; } - label_157: + label_154: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SEMICOLON: ; break; default: - jj_la1[230] = jj_gen; - break label_157; + jj_la1[224] = jj_gen; + break label_154; } jj_consume_token(SEMICOLON); - label_158: + label_155: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[231] = jj_gen; - break label_158; + jj_la1[225] = jj_gen; + break label_155; } jj_consume_token(S); } @@ -5091,27 +5002,27 @@ LexicalUnit exp; declaration(); break; default: - jj_la1[232] = jj_gen; + jj_la1[226] = jj_gen; ; } } jj_consume_token(RBRACE); - label_159: + label_156: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[233] = jj_gen; - break label_159; + jj_la1[227] = jj_gen; + break label_156; } jj_consume_token(S); } documentHandler.endNestedProperties(name); break; default: - jj_la1[234] = jj_gen; + jj_la1[228] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -5161,15 +5072,15 @@ LexicalUnit exp; name = property(); save = token; jj_consume_token(COLON); - label_160: + label_157: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[235] = jj_gen; - break label_160; + jj_la1[229] = jj_gen; + break label_157; } jj_consume_token(S); } @@ -5179,7 +5090,7 @@ LexicalUnit exp; important = prio(); break; default: - jj_la1[236] = jj_gen; + jj_la1[230] = jj_gen; ; } documentHandler.property(name, exp, important); @@ -5222,15 +5133,15 @@ LexicalUnit exp; */ final public boolean prio() throws ParseException { jj_consume_token(IMPORTANT_SYM); - label_161: + label_158: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[237] = jj_gen; - break label_161; + jj_la1[231] = jj_gen; + break label_158; } jj_consume_token(S); } @@ -5240,15 +5151,15 @@ LexicalUnit exp; final public boolean guarded() throws ParseException { jj_consume_token(GUARDED_SYM); - label_162: + label_159: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[238] = jj_gen; - break label_162; + jj_la1[232] = jj_gen; + break label_159; } jj_consume_token(S); } @@ -5273,15 +5184,15 @@ LexicalUnit exp; * 3. parenthesis is not supported now. */ n = jj_consume_token(COMMA); - label_163: + label_160: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[239] = jj_gen; - break label_163; + jj_la1[233] = jj_gen; + break label_160; } jj_consume_token(S); } @@ -5291,15 +5202,15 @@ LexicalUnit exp; break; case DIV: n = jj_consume_token(DIV); - label_164: + label_161: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[240] = jj_gen; - break label_164; + jj_la1[234] = jj_gen; + break label_161; } jj_consume_token(S); } @@ -5309,15 +5220,15 @@ LexicalUnit exp; break; case ANY: n = jj_consume_token(ANY); - label_165: + label_162: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[241] = jj_gen; - break label_165; + jj_la1[235] = jj_gen; + break label_162; } jj_consume_token(S); } @@ -5327,15 +5238,15 @@ LexicalUnit exp; break; case MOD: n = jj_consume_token(MOD); - label_166: + label_163: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[242] = jj_gen; - break label_166; + jj_la1[236] = jj_gen; + break label_163; } jj_consume_token(S); } @@ -5345,7 +5256,7 @@ LexicalUnit exp; break; case PLUS: n = jj_consume_token(PLUS); - label_167: + label_164: while (true) { jj_consume_token(S); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -5353,8 +5264,8 @@ LexicalUnit exp; ; break; default: - jj_la1[243] = jj_gen; - break label_167; + jj_la1[237] = jj_gen; + break label_164; } } {if (true) return LexicalUnitImpl.createAdd(n.beginLine, @@ -5363,7 +5274,7 @@ LexicalUnit exp; break; case MINUS: n = jj_consume_token(MINUS); - label_168: + label_165: while (true) { jj_consume_token(S); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -5371,8 +5282,8 @@ LexicalUnit exp; ; break; default: - jj_la1[244] = jj_gen; - break label_168; + jj_la1[238] = jj_gen; + break label_165; } } {if (true) return LexicalUnitImpl.createMinus(n.beginLine, @@ -5380,7 +5291,7 @@ LexicalUnit exp; prev);} break; default: - jj_la1[245] = jj_gen; + jj_la1[239] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -5395,12 +5306,12 @@ LexicalUnit exp; char op; first = term(null); res = first; - label_169: + label_166: while (true) { if (jj_2_8(2)) { ; } else { - break label_169; + break label_166; } if (jj_2_9(2)) { res = operator(res); @@ -5427,7 +5338,7 @@ LexicalUnit exp; {if (true) return '+';} break; default: - jj_la1[246] = jj_gen; + jj_la1[240] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -5480,7 +5391,7 @@ LexicalUnit exp; result = variableTerm(prev); break; default: - jj_la1[247] = jj_gen; + jj_la1[241] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -5533,7 +5444,7 @@ LexicalUnitImpl result = null; op = unaryOperator(); break; default: - jj_la1[248] = jj_gen; + jj_la1[242] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -5649,7 +5560,7 @@ LexicalUnitImpl result = null; result = function(op, prev); break; default: - jj_la1[249] = jj_gen; + jj_la1[243] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -5682,7 +5593,7 @@ LexicalUnitImpl result = null; s+="."; break; default: - jj_la1[250] = jj_gen; + jj_la1[244] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -5699,7 +5610,7 @@ LexicalUnitImpl result = null; n = jj_consume_token(FROM); break; default: - jj_la1[251] = jj_gen; + jj_la1[245] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -5746,25 +5657,25 @@ LexicalUnitImpl result = null; result = unicode(prev); break; default: - jj_la1[252] = jj_gen; + jj_la1[246] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: - jj_la1[253] = jj_gen; + jj_la1[247] = jj_gen; jj_consume_token(-1); throw new ParseException(); } - label_170: + label_167: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[254] = jj_gen; - break label_170; + jj_la1[248] = jj_gen; + break label_167; } jj_consume_token(S); } @@ -5780,15 +5691,15 @@ LexicalUnitImpl result = null; Token n; LexicalUnit params = null; n = jj_consume_token(FUNCTION); - label_171: + label_168: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[255] = jj_gen; - break label_171; + jj_la1[249] = jj_gen; + break label_168; } jj_consume_token(S); } @@ -5839,7 +5750,7 @@ LexicalUnitImpl result = null; params = expr(); break; default: - jj_la1[256] = jj_gen; + jj_la1[250] = jj_gen; ; } jj_consume_token(RPARAN); @@ -6109,9 +6020,35 @@ LexicalUnitImpl result = null; return skipStatementUntil(lBrace); } - String skipStatementUntilRightParan() throws ParseException { - int[] rParan = {RPARAN}; - return skipStatementUntil(rParan); + String skipStatementUntilMatchingRightParan() throws ParseException { + int[] leftTokens = {LPARAN, FUNCTION}; // a FUNCTION also contains "(" + int[] rightTokens = {RPARAN}; + StringBuffer s = new StringBuffer(); + int difference = 1; + Token tok; + while(difference != 0){ + tok = getToken(1); + if(tok.kind == EOF) { + return null; + } + for(int sym : leftTokens){ + if(tok.kind == sym){ + difference++; + } + } + for(int sym : rightTokens){ + if(tok.kind == sym){ + difference--; + } + } + if(difference != 0){ + if (tok.image != null) { + s.append(tok.image); + } + getNextToken(); + } + } + return s.toString().trim(); } String skipStatementUntil(int[] symbols) throws ParseException { @@ -6296,15 +6233,15 @@ LexicalUnitImpl result = null; // TODO required by original parser but not used by Vaadin? final public void _parseRule() throws ParseException { String ret = null; - label_172: + label_169: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[257] = jj_gen; - break label_172; + jj_la1[251] = jj_gen; + break label_169; } jj_consume_token(S); } @@ -6339,7 +6276,7 @@ LexicalUnitImpl result = null; fontFace(); break; default: - jj_la1[258] = jj_gen; + jj_la1[252] = jj_gen; ret = skipStatement(); if ((ret == null) || (ret.length() == 0)) { {if (true) return;} @@ -6354,15 +6291,15 @@ LexicalUnitImpl result = null; } final public void _parseImportRule() throws ParseException { - label_173: + label_170: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[259] = jj_gen; - break label_173; + jj_la1[253] = jj_gen; + break label_170; } jj_consume_token(S); } @@ -6370,15 +6307,15 @@ LexicalUnitImpl result = null; } final public void _parseMediaRule() throws ParseException { - label_174: + label_171: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[260] = jj_gen; - break label_174; + jj_la1[254] = jj_gen; + break label_171; } jj_consume_token(S); } @@ -6386,15 +6323,15 @@ LexicalUnitImpl result = null; } final public void _parseDeclarationBlock() throws ParseException { - label_175: + label_172: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[261] = jj_gen; - break label_175; + jj_la1[255] = jj_gen; + break label_172; } jj_consume_token(S); } @@ -6404,29 +6341,29 @@ LexicalUnitImpl result = null; declaration(); break; default: - jj_la1[262] = jj_gen; + jj_la1[256] = jj_gen; ; } - label_176: + label_173: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SEMICOLON: ; break; default: - jj_la1[263] = jj_gen; - break label_176; + jj_la1[257] = jj_gen; + break label_173; } jj_consume_token(SEMICOLON); - label_177: + label_174: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[264] = jj_gen; - break label_177; + jj_la1[258] = jj_gen; + break label_174; } jj_consume_token(S); } @@ -6436,7 +6373,7 @@ LexicalUnitImpl result = null; declaration(); break; default: - jj_la1[265] = jj_gen; + jj_la1[259] = jj_gen; ; } } @@ -6445,15 +6382,15 @@ LexicalUnitImpl result = null; final public ArrayList<String> _parseSelectors() throws ParseException { ArrayList<String> p = null; try { - label_178: + label_175: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case S: ; break; default: - jj_la1[266] = jj_gen; - break label_178; + jj_la1[260] = jj_gen; + break label_175; } jj_consume_token(S); } @@ -6528,7 +6465,7 @@ LexicalUnitImpl result = null; finally { jj_save(8, xla); } } - private boolean jj_3R_213() { + private boolean jj_3R_207() { if (jj_scan_token(MOD)) return true; Token xsp; while (true) { @@ -6538,7 +6475,7 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_212() { + private boolean jj_3R_206() { if (jj_scan_token(ANY)) return true; Token xsp; while (true) { @@ -6548,7 +6485,7 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_211() { + private boolean jj_3R_205() { if (jj_scan_token(DIV)) return true; Token xsp; while (true) { @@ -6558,7 +6495,7 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_210() { + private boolean jj_3R_204() { if (jj_scan_token(COMMA)) return true; Token xsp; while (true) { @@ -6568,20 +6505,20 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_188() { + private boolean jj_3R_185() { Token xsp; xsp = jj_scanpos; - if (jj_3R_210()) { + if (jj_3R_204()) { jj_scanpos = xsp; - if (jj_3R_211()) { + if (jj_3R_205()) { jj_scanpos = xsp; - if (jj_3R_212()) { + if (jj_3R_206()) { jj_scanpos = xsp; - if (jj_3R_213()) { + if (jj_3R_207()) { jj_scanpos = xsp; - if (jj_3R_214()) { + if (jj_3R_208()) { jj_scanpos = xsp; - if (jj_3R_215()) return true; + if (jj_3R_209()) return true; } } } @@ -6590,14 +6527,21 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_218() { - if (jj_3R_217()) return true; + private boolean jj_3R_212() { + if (jj_3R_211()) return true; return false; } - private boolean jj_3R_216() { - if (jj_scan_token(GUARDED_SYM)) return true; + private boolean jj_3R_211() { Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(18)) { + jj_scanpos = xsp; + if (jj_scan_token(22)) { + jj_scanpos = xsp; + if (jj_scan_token(23)) return true; + } + } while (true) { xsp = jj_scanpos; if (jj_scan_token(1)) { jj_scanpos = xsp; break; } @@ -6605,16 +6549,17 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_217() { + private boolean jj_3R_191() { + if (jj_scan_token(S)) return true; Token xsp; xsp = jj_scanpos; - if (jj_scan_token(18)) { - jj_scanpos = xsp; - if (jj_scan_token(22)) { - jj_scanpos = xsp; - if (jj_scan_token(23)) return true; - } - } + if (jj_3R_212()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_210() { + if (jj_scan_token(GUARDED_SYM)) return true; + Token xsp; while (true) { xsp = jj_scanpos; if (jj_scan_token(1)) { jj_scanpos = xsp; break; } @@ -6622,49 +6567,41 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_179() { - if (jj_3R_189()) return true; + private boolean jj_3R_176() { + if (jj_3R_186()) return true; if (jj_scan_token(COLON)) return true; Token xsp; while (true) { xsp = jj_scanpos; if (jj_scan_token(1)) { jj_scanpos = xsp; break; } } - if (jj_3R_190()) return true; + if (jj_3R_187()) return true; xsp = jj_scanpos; - if (jj_3R_191()) jj_scanpos = xsp; - if (jj_3R_192()) return true; + if (jj_3R_188()) jj_scanpos = xsp; + if (jj_3R_189()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_192()) { jj_scanpos = xsp; break; } + if (jj_3R_189()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_194() { - if (jj_scan_token(S)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_218()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_193() { - if (jj_3R_217()) return true; + private boolean jj_3R_190() { + if (jj_3R_211()) return true; return false; } - private boolean jj_3R_180() { + private boolean jj_3R_177() { Token xsp; xsp = jj_scanpos; - if (jj_3R_193()) { + if (jj_3R_190()) { jj_scanpos = xsp; - if (jj_3R_194()) return true; + if (jj_3R_191()) return true; } return false; } - private boolean jj_3R_200() { + private boolean jj_3R_194() { if (jj_scan_token(VARIABLE)) return true; Token xsp; while (true) { @@ -6679,10 +6616,10 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_182() { + private boolean jj_3R_179() { Token xsp; xsp = jj_scanpos; - if (jj_3R_200()) jj_scanpos = xsp; + if (jj_3R_194()) jj_scanpos = xsp; if (jj_scan_token(CONTAINS)) return true; while (true) { xsp = jj_scanpos; @@ -6692,17 +6629,17 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_220() { + private boolean jj_3R_262() { if (jj_scan_token(HASH)) return true; return false; } - private boolean jj_3R_290() { + private boolean jj_3R_279() { if (jj_scan_token(IDENT)) return true; return false; } - private boolean jj_3R_291() { + private boolean jj_3R_280() { if (jj_scan_token(FUNCTION)) return true; Token xsp; while (true) { @@ -6713,98 +6650,98 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_289() { + private boolean jj_3R_278() { if (jj_scan_token(COLON)) return true; return false; } - private boolean jj_3R_222() { + private boolean jj_3R_265() { if (jj_scan_token(COLON)) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_289()) jj_scanpos = xsp; + if (jj_3R_278()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_290()) { + if (jj_3R_279()) { jj_scanpos = xsp; - if (jj_3R_291()) return true; + if (jj_3R_280()) return true; } return false; } private boolean jj_3_7() { - if (jj_3R_186()) return true; + if (jj_3R_183()) return true; return false; } - private boolean jj_3R_207() { + private boolean jj_3R_201() { if (jj_scan_token(LBRACE)) return true; return false; } - private boolean jj_3R_310() { + private boolean jj_3R_290() { if (jj_scan_token(STRING)) return true; return false; } - private boolean jj_3R_308() { + private boolean jj_3R_288() { if (jj_scan_token(STARMATCH)) return true; return false; } - private boolean jj_3R_309() { - if (jj_scan_token(IDENT)) return true; + private boolean jj_3R_287() { + if (jj_scan_token(DOLLARMATCH)) return true; return false; } - private boolean jj_3R_307() { - if (jj_scan_token(DOLLARMATCH)) return true; + private boolean jj_3R_289() { + if (jj_scan_token(IDENT)) return true; return false; } - private boolean jj_3R_306() { + private boolean jj_3R_286() { if (jj_scan_token(CARETMATCH)) return true; return false; } - private boolean jj_3R_305() { + private boolean jj_3R_285() { if (jj_scan_token(DASHMATCH)) return true; return false; } - private boolean jj_3R_304() { + private boolean jj_3R_284() { if (jj_scan_token(INCLUDES)) return true; return false; } - private boolean jj_3R_271() { + private boolean jj_3R_270() { if (jj_scan_token(INTERPOLATION)) return true; return false; } - private boolean jj_3R_303() { + private boolean jj_3R_283() { if (jj_scan_token(EQ)) return true; return false; } - private boolean jj_3R_206() { - if (jj_3R_190()) return true; + private boolean jj_3R_200() { + if (jj_3R_187()) return true; return false; } - private boolean jj_3R_296() { + private boolean jj_3R_277() { Token xsp; xsp = jj_scanpos; - if (jj_3R_303()) { + if (jj_3R_283()) { jj_scanpos = xsp; - if (jj_3R_304()) { + if (jj_3R_284()) { jj_scanpos = xsp; - if (jj_3R_305()) { + if (jj_3R_285()) { jj_scanpos = xsp; - if (jj_3R_306()) { + if (jj_3R_286()) { jj_scanpos = xsp; - if (jj_3R_307()) { + if (jj_3R_287()) { jj_scanpos = xsp; - if (jj_3R_308()) return true; + if (jj_3R_288()) return true; } } } @@ -6815,9 +6752,9 @@ LexicalUnitImpl result = null; if (jj_scan_token(1)) { jj_scanpos = xsp; break; } } xsp = jj_scanpos; - if (jj_3R_309()) { + if (jj_3R_289()) { jj_scanpos = xsp; - if (jj_3R_310()) return true; + if (jj_3R_290()) return true; } while (true) { xsp = jj_scanpos; @@ -6827,12 +6764,12 @@ LexicalUnitImpl result = null; } private boolean jj_3_6() { - if (jj_3R_185()) return true; + if (jj_3R_182()) return true; if (jj_scan_token(LBRACE)) return true; return false; } - private boolean jj_3R_223() { + private boolean jj_3R_264() { if (jj_scan_token(LBRACKET)) return true; Token xsp; while (true) { @@ -6845,13 +6782,13 @@ LexicalUnitImpl result = null; if (jj_scan_token(1)) { jj_scanpos = xsp; break; } } xsp = jj_scanpos; - if (jj_3R_296()) jj_scanpos = xsp; + if (jj_3R_277()) jj_scanpos = xsp; if (jj_scan_token(RBRACKET)) return true; return false; } - private boolean jj_3R_186() { - if (jj_3R_205()) return true; + private boolean jj_3R_183() { + if (jj_3R_199()) return true; if (jj_scan_token(COLON)) return true; Token xsp; while (true) { @@ -6859,72 +6796,72 @@ LexicalUnitImpl result = null; if (jj_scan_token(1)) { jj_scanpos = xsp; break; } } xsp = jj_scanpos; - if (jj_3R_206()) { + if (jj_3R_200()) { jj_scanpos = xsp; - if (jj_3R_207()) return true; + if (jj_3R_201()) return true; } return false; } - private boolean jj_3R_302() { + private boolean jj_3R_282() { if (jj_scan_token(INTERPOLATION)) return true; return false; } - private boolean jj_3R_269() { - if (jj_3R_190()) return true; + private boolean jj_3R_268() { + if (jj_3R_187()) return true; return false; } - private boolean jj_3R_257() { + private boolean jj_3R_248() { if (jj_scan_token(PARENT)) return true; return false; } - private boolean jj_3R_256() { + private boolean jj_3R_247() { if (jj_scan_token(ANY)) return true; return false; } - private boolean jj_3R_266() { + private boolean jj_3R_261() { Token xsp; xsp = jj_scanpos; - if (jj_3R_270()) { + if (jj_3R_269()) { jj_scanpos = xsp; - if (jj_3R_271()) return true; + if (jj_3R_270()) return true; } return false; } - private boolean jj_3R_270() { + private boolean jj_3R_269() { if (jj_scan_token(IDENT)) return true; return false; } - private boolean jj_3R_219() { + private boolean jj_3R_213() { Token xsp; xsp = jj_scanpos; - if (jj_3R_255()) { + if (jj_3R_246()) { jj_scanpos = xsp; - if (jj_3R_256()) { + if (jj_3R_247()) { jj_scanpos = xsp; - if (jj_3R_257()) return true; + if (jj_3R_248()) return true; } } return false; } - private boolean jj_3R_255() { + private boolean jj_3R_246() { Token xsp; - if (jj_3R_266()) return true; + if (jj_3R_261()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_266()) { jj_scanpos = xsp; break; } + if (jj_3R_261()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_259() { + private boolean jj_3R_254() { if (jj_scan_token(FUNCTION)) return true; Token xsp; while (true) { @@ -6932,12 +6869,12 @@ LexicalUnitImpl result = null; if (jj_scan_token(1)) { jj_scanpos = xsp; break; } } xsp = jj_scanpos; - if (jj_3R_269()) jj_scanpos = xsp; + if (jj_3R_268()) jj_scanpos = xsp; if (jj_scan_token(RPARAN)) return true; return false; } - private boolean jj_3R_183() { + private boolean jj_3R_180() { if (jj_scan_token(COMMA)) return true; Token xsp; while (true) { @@ -6947,256 +6884,172 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_250() { - if (jj_3R_263()) return true; - return false; - } - - private boolean jj_3R_301() { - if (jj_scan_token(IDENT)) return true; + private boolean jj_3R_241() { + if (jj_3R_258()) return true; return false; } - private boolean jj_3R_284() { + private boolean jj_3R_276() { Token xsp; xsp = jj_scanpos; - if (jj_3R_301()) { + if (jj_3R_281()) { jj_scanpos = xsp; - if (jj_3R_302()) return true; + if (jj_3R_282()) return true; } return false; } - private boolean jj_3R_249() { - if (jj_3R_262()) return true; + private boolean jj_3R_281() { + if (jj_scan_token(IDENT)) return true; return false; } - private boolean jj_3R_248() { - if (jj_3R_261()) return true; + private boolean jj_3R_240() { + if (jj_3R_257()) return true; return false; } - private boolean jj_3R_300() { - if (jj_3R_222()) return true; + private boolean jj_3R_239() { + if (jj_3R_256()) return true; return false; } private boolean jj_3_5() { Token xsp; xsp = jj_scanpos; - if (jj_3R_183()) jj_scanpos = xsp; - if (jj_3R_184()) return true; + if (jj_3R_180()) jj_scanpos = xsp; + if (jj_3R_181()) return true; return false; } - private boolean jj_3R_221() { + private boolean jj_3R_263() { if (jj_scan_token(DOT)) return true; Token xsp; - if (jj_3R_284()) return true; + if (jj_3R_276()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_284()) { jj_scanpos = xsp; break; } + if (jj_3R_276()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_298() { - if (jj_3R_221()) return true; + private boolean jj_3R_252() { + if (jj_3R_265()) return true; return false; } - private boolean jj_3R_293() { - if (jj_3R_221()) return true; + private boolean jj_3R_275() { + if (jj_3R_265()) return true; return false; } - private boolean jj_3R_295() { - if (jj_3R_222()) return true; + private boolean jj_3R_273() { + if (jj_3R_263()) return true; return false; } - private boolean jj_3R_283() { - if (jj_3R_222()) return true; + private boolean jj_3R_250() { + if (jj_3R_263()) return true; return false; } - private boolean jj_3R_286() { - if (jj_3R_221()) return true; + private boolean jj_3R_251() { + if (jj_3R_264()) return true; return false; } - private boolean jj_3R_288() { - if (jj_3R_222()) return true; + private boolean jj_3R_274() { + if (jj_3R_264()) return true; return false; } - private boolean jj_3R_299() { - if (jj_3R_223()) return true; + private boolean jj_3R_255() { + if (jj_scan_token(DOT)) return true; return false; } - private boolean jj_3R_276() { + private boolean jj_3R_271() { Token xsp; xsp = jj_scanpos; - if (jj_3R_297()) { + if (jj_3R_272()) { jj_scanpos = xsp; - if (jj_3R_298()) { + if (jj_3R_273()) { jj_scanpos = xsp; - if (jj_3R_299()) { + if (jj_3R_274()) { jj_scanpos = xsp; - if (jj_3R_300()) return true; + if (jj_3R_275()) return true; } } } return false; } - private boolean jj_3R_297() { - if (jj_3R_220()) return true; + private boolean jj_3R_272() { + if (jj_3R_262()) return true; return false; } - private boolean jj_3R_275() { + private boolean jj_3R_238() { Token xsp; xsp = jj_scanpos; - if (jj_3R_292()) { - jj_scanpos = xsp; - if (jj_3R_293()) { - jj_scanpos = xsp; - if (jj_3R_294()) { - jj_scanpos = xsp; - if (jj_3R_295()) return true; - } - } - } - return false; - } - - private boolean jj_3R_292() { - if (jj_3R_220()) return true; - return false; - } - - private boolean jj_3R_280() { - if (jj_3R_222()) return true; - return false; - } - - private boolean jj_3R_274() { - Token xsp; + if (jj_3R_255()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_285()) { + if (jj_scan_token(72)) { jj_scanpos = xsp; - if (jj_3R_286()) { + if (jj_scan_token(49)) { jj_scanpos = xsp; - if (jj_3R_287()) { + if (jj_scan_token(50)) { jj_scanpos = xsp; - if (jj_3R_288()) return true; - } - } + if (jj_scan_token(52)) return true; } - return false; - } - - private boolean jj_3R_285() { - if (jj_3R_220()) return true; - return false; - } - - private boolean jj_3R_294() { - if (jj_3R_223()) return true; - return false; - } - - private boolean jj_3R_282() { - if (jj_3R_223()) return true; - return false; - } - - private boolean jj_3R_287() { - if (jj_3R_223()) return true; - return false; - } - - private boolean jj_3R_273() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_281()) { - jj_scanpos = xsp; - if (jj_3R_282()) { - jj_scanpos = xsp; - if (jj_3R_283()) return true; } } return false; } - private boolean jj_3R_278() { - if (jj_3R_221()) return true; - return false; - } - - private boolean jj_3R_281() { - if (jj_3R_221()) return true; - return false; - } - - private boolean jj_3R_260() { - if (jj_scan_token(DOT)) return true; + private boolean jj_3R_237() { + if (jj_scan_token(STRING)) return true; return false; } - private boolean jj_3R_247() { + private boolean jj_3R_214() { Token xsp; xsp = jj_scanpos; - if (jj_3R_260()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(72)) { + if (jj_3R_249()) { jj_scanpos = xsp; - if (jj_scan_token(49)) { + if (jj_3R_250()) { jj_scanpos = xsp; - if (jj_scan_token(50)) { + if (jj_3R_251()) { jj_scanpos = xsp; - if (jj_scan_token(52)) return true; + if (jj_3R_252()) return true; } } } return false; } - private boolean jj_3R_246() { - if (jj_scan_token(STRING)) return true; - return false; - } - - private boolean jj_3R_245() { - if (jj_3R_259()) return true; + private boolean jj_3R_249() { + if (jj_3R_262()) return true; return false; } - private boolean jj_3R_199() { - if (jj_3R_223()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_276()) { jj_scanpos = xsp; break; } - } + private boolean jj_3R_236() { + if (jj_3R_254()) return true; return false; } - private boolean jj_3R_202() { + private boolean jj_3R_196() { Token xsp; xsp = jj_scanpos; - if (jj_3R_246()) { + if (jj_3R_237()) { jj_scanpos = xsp; - if (jj_3R_247()) { + if (jj_3R_238()) { jj_scanpos = xsp; - if (jj_3R_248()) { + if (jj_3R_239()) { jj_scanpos = xsp; - if (jj_3R_249()) { + if (jj_3R_240()) { jj_scanpos = xsp; - if (jj_3R_250()) return true; + if (jj_3R_241()) return true; } } } @@ -7204,205 +7057,140 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_198() { - if (jj_3R_222()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_275()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_279() { - if (jj_3R_223()) return true; - return false; - } - - private boolean jj_3R_197() { - if (jj_3R_221()) return true; + private boolean jj_3R_193() { Token xsp; + if (jj_3R_214()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_274()) { jj_scanpos = xsp; break; } + if (jj_3R_214()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_196() { - if (jj_3R_220()) return true; + private boolean jj_3R_192() { + if (jj_3R_213()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_273()) { jj_scanpos = xsp; break; } + if (jj_3R_271()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_272() { + private boolean jj_3R_178() { Token xsp; xsp = jj_scanpos; - if (jj_3R_277()) { + if (jj_3R_192()) { jj_scanpos = xsp; - if (jj_3R_278()) { - jj_scanpos = xsp; - if (jj_3R_279()) { - jj_scanpos = xsp; - if (jj_3R_280()) return true; - } - } + if (jj_3R_193()) return true; } return false; } - private boolean jj_3R_277() { - if (jj_3R_220()) return true; - return false; - } - - private boolean jj_3R_195() { - if (jj_3R_219()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_272()) { jj_scanpos = xsp; break; } - } + private boolean jj_3R_243() { + if (jj_3R_211()) return true; + if (jj_3R_178()) return true; return false; } - private boolean jj_3R_244() { + private boolean jj_3R_235() { if (jj_scan_token(DIMEN)) return true; return false; } - private boolean jj_3R_181() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_195()) { - jj_scanpos = xsp; - if (jj_3R_196()) { - jj_scanpos = xsp; - if (jj_3R_197()) { - jj_scanpos = xsp; - if (jj_3R_198()) { - jj_scanpos = xsp; - if (jj_3R_199()) return true; - } - } - } - } - return false; - } - - private boolean jj_3R_243() { + private boolean jj_3R_234() { if (jj_scan_token(KHZ)) return true; return false; } - private boolean jj_3R_252() { - if (jj_3R_217()) return true; - if (jj_3R_181()) return true; - return false; - } - - private boolean jj_3R_242() { + private boolean jj_3R_233() { if (jj_scan_token(HZ)) return true; return false; } - private boolean jj_3R_241() { + private boolean jj_3R_232() { if (jj_scan_token(MS)) return true; return false; } - private boolean jj_3R_240() { + private boolean jj_3R_231() { if (jj_scan_token(SECOND)) return true; return false; } - private boolean jj_3R_239() { + private boolean jj_3R_230() { if (jj_scan_token(GRAD)) return true; return false; } - private boolean jj_3R_238() { + private boolean jj_3R_229() { if (jj_scan_token(RAD)) return true; return false; } - private boolean jj_3R_237() { + private boolean jj_3R_228() { if (jj_scan_token(DEG)) return true; return false; } - private boolean jj_3R_236() { + private boolean jj_3R_227() { if (jj_scan_token(EXS)) return true; return false; } - private boolean jj_3R_235() { + private boolean jj_3R_226() { if (jj_scan_token(REM)) return true; return false; } - private boolean jj_3R_234() { - if (jj_scan_token(LEM)) return true; - return false; - } - - private boolean jj_3R_233() { - if (jj_scan_token(EMS)) return true; - return false; - } - private boolean jj_3_2() { - if (jj_3R_180()) return true; - if (jj_3R_181()) return true; + if (jj_3R_177()) return true; + if (jj_3R_178()) return true; return false; } - private boolean jj_3R_232() { - if (jj_scan_token(PX)) return true; + private boolean jj_3R_225() { + if (jj_scan_token(LEM)) return true; return false; } - private boolean jj_3R_231() { - if (jj_scan_token(IN)) return true; + private boolean jj_3R_224() { + if (jj_scan_token(EMS)) return true; return false; } - private boolean jj_3R_204() { + private boolean jj_3R_198() { if (jj_scan_token(COMMA)) return true; Token xsp; while (true) { xsp = jj_scanpos; if (jj_scan_token(1)) { jj_scanpos = xsp; break; } } - if (jj_3R_203()) return true; + if (jj_3R_197()) return true; return false; } - private boolean jj_3R_251() { - if (jj_3R_181()) return true; + private boolean jj_3R_242() { + if (jj_3R_178()) return true; return false; } - private boolean jj_3R_230() { - if (jj_scan_token(PC)) return true; + private boolean jj_3R_223() { + if (jj_scan_token(PX)) return true; return false; } - private boolean jj_3R_229() { - if (jj_scan_token(MM)) return true; + private boolean jj_3R_222() { + if (jj_scan_token(IN)) return true; return false; } - private boolean jj_3R_203() { + private boolean jj_3R_197() { Token xsp; xsp = jj_scanpos; - if (jj_3R_251()) { + if (jj_3R_242()) { jj_scanpos = xsp; - if (jj_3R_252()) return true; + if (jj_3R_243()) return true; } while (true) { xsp = jj_scanpos; @@ -7415,41 +7203,79 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_228() { + private boolean jj_3R_221() { + if (jj_scan_token(PC)) return true; + return false; + } + + private boolean jj_3R_220() { + if (jj_scan_token(MM)) return true; + return false; + } + + private boolean jj_3R_219() { if (jj_scan_token(CM)) return true; return false; } - private boolean jj_3R_227() { + private boolean jj_3R_218() { if (jj_scan_token(PT)) return true; return false; } - private boolean jj_3R_226() { + private boolean jj_3R_217() { if (jj_scan_token(PERCENTAGE)) return true; return false; } - private boolean jj_3R_209() { - if (jj_3R_254()) return true; + private boolean jj_3R_203() { + if (jj_3R_245()) return true; return false; } - private boolean jj_3R_225() { + private boolean jj_3R_182() { + if (jj_3R_197()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_198()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_216() { if (jj_scan_token(NUMBER)) return true; return false; } - private boolean jj_3R_224() { - if (jj_3R_258()) return true; + private boolean jj_3R_215() { + if (jj_3R_253()) return true; return false; } - private boolean jj_3R_201() { + private boolean jj_3R_195() { Token xsp; xsp = jj_scanpos; - if (jj_3R_224()) jj_scanpos = xsp; + if (jj_3R_215()) jj_scanpos = xsp; xsp = jj_scanpos; + if (jj_3R_216()) { + jj_scanpos = xsp; + if (jj_3R_217()) { + jj_scanpos = xsp; + if (jj_3R_218()) { + jj_scanpos = xsp; + if (jj_3R_219()) { + jj_scanpos = xsp; + if (jj_3R_220()) { + jj_scanpos = xsp; + if (jj_3R_221()) { + jj_scanpos = xsp; + if (jj_3R_222()) { + jj_scanpos = xsp; + if (jj_3R_223()) { + jj_scanpos = xsp; + if (jj_3R_224()) { + jj_scanpos = xsp; if (jj_3R_225()) { jj_scanpos = xsp; if (jj_3R_226()) { @@ -7472,25 +7298,7 @@ LexicalUnitImpl result = null; jj_scanpos = xsp; if (jj_3R_235()) { jj_scanpos = xsp; - if (jj_3R_236()) { - jj_scanpos = xsp; - if (jj_3R_237()) { - jj_scanpos = xsp; - if (jj_3R_238()) { - jj_scanpos = xsp; - if (jj_3R_239()) { - jj_scanpos = xsp; - if (jj_3R_240()) { - jj_scanpos = xsp; - if (jj_3R_241()) { - jj_scanpos = xsp; - if (jj_3R_242()) { - jj_scanpos = xsp; - if (jj_3R_243()) { - jj_scanpos = xsp; - if (jj_3R_244()) { - jj_scanpos = xsp; - if (jj_3R_245()) return true; + if (jj_3R_236()) return true; } } } @@ -7515,26 +7323,16 @@ LexicalUnitImpl result = null; } private boolean jj_3_1() { - if (jj_3R_179()) return true; + if (jj_3R_176()) return true; return false; } - private boolean jj_3R_185() { - if (jj_3R_203()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_204()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_184() { + private boolean jj_3R_181() { Token xsp; xsp = jj_scanpos; - if (jj_3R_201()) { + if (jj_3R_195()) { jj_scanpos = xsp; - if (jj_3R_202()) return true; + if (jj_3R_196()) return true; } while (true) { xsp = jj_scanpos; @@ -7543,77 +7341,77 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_261() { + private boolean jj_3R_256() { if (jj_scan_token(HASH)) return true; return false; } private boolean jj_3_4() { - if (jj_3R_182()) return true; + if (jj_3R_179()) return true; return false; } - private boolean jj_3R_254() { - if (jj_3R_189()) return true; + private boolean jj_3R_245() { + if (jj_3R_186()) return true; return false; } - private boolean jj_3R_262() { + private boolean jj_3R_257() { if (jj_scan_token(URL)) return true; return false; } - private boolean jj_3R_208() { - if (jj_3R_184()) return true; + private boolean jj_3R_202() { + if (jj_3R_181()) return true; return false; } - private boolean jj_3R_187() { + private boolean jj_3R_260() { + if (jj_scan_token(INTERPOLATION)) return true; + return false; + } + + private boolean jj_3R_184() { Token xsp; xsp = jj_scanpos; - if (jj_3R_208()) { + if (jj_3R_202()) { jj_scanpos = xsp; - if (jj_3R_209()) return true; + if (jj_3R_203()) return true; } return false; } private boolean jj_3_9() { - if (jj_3R_188()) return true; - return false; - } - - private boolean jj_3R_265() { - if (jj_scan_token(INTERPOLATION)) return true; + if (jj_3R_185()) return true; return false; } private boolean jj_3_3() { - if (jj_3R_179()) return true; + if (jj_3R_176()) return true; return false; } - private boolean jj_3R_268() { + private boolean jj_3R_267() { if (jj_scan_token(PLUS)) return true; return false; } - private boolean jj_3R_258() { + private boolean jj_3R_253() { Token xsp; xsp = jj_scanpos; - if (jj_3R_267()) { + if (jj_3R_266()) { jj_scanpos = xsp; - if (jj_3R_268()) return true; + if (jj_3R_267()) return true; } return false; } - private boolean jj_3R_267() { + private boolean jj_3R_266() { if (jj_scan_token(MINUS)) return true; return false; } - private boolean jj_3R_263() { + private boolean jj_3R_258() { if (jj_scan_token(UNICODERANGE)) return true; return false; } @@ -7622,12 +7420,12 @@ LexicalUnitImpl result = null; Token xsp; xsp = jj_scanpos; if (jj_3_9()) jj_scanpos = xsp; - if (jj_3R_187()) return true; + if (jj_3R_184()) return true; return false; } - private boolean jj_3R_192() { - if (jj_scan_token(SEMICOLON)) return true; + private boolean jj_3R_186() { + if (jj_scan_token(VARIABLE)) return true; Token xsp; while (true) { xsp = jj_scanpos; @@ -7636,47 +7434,47 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_190() { - if (jj_3R_187()) return true; + private boolean jj_3R_189() { + if (jj_scan_token(SEMICOLON)) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3_8()) { jj_scanpos = xsp; break; } + if (jj_scan_token(1)) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_189() { - if (jj_scan_token(VARIABLE)) return true; + private boolean jj_3R_187() { + if (jj_3R_184()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_scan_token(1)) { jj_scanpos = xsp; break; } + if (jj_3_8()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_253() { + private boolean jj_3R_244() { Token xsp; xsp = jj_scanpos; - if (jj_3R_264()) { + if (jj_3R_259()) { jj_scanpos = xsp; - if (jj_3R_265()) return true; + if (jj_3R_260()) return true; } return false; } - private boolean jj_3R_264() { + private boolean jj_3R_259() { if (jj_scan_token(IDENT)) return true; return false; } - private boolean jj_3R_205() { + private boolean jj_3R_199() { Token xsp; - if (jj_3R_253()) return true; + if (jj_3R_244()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_253()) { jj_scanpos = xsp; break; } + if (jj_3R_244()) { jj_scanpos = xsp; break; } } while (true) { xsp = jj_scanpos; @@ -7685,7 +7483,7 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_215() { + private boolean jj_3R_209() { if (jj_scan_token(MINUS)) return true; Token xsp; if (jj_scan_token(1)) return true; @@ -7696,12 +7494,12 @@ LexicalUnitImpl result = null; return false; } - private boolean jj_3R_191() { - if (jj_3R_216()) return true; + private boolean jj_3R_188() { + if (jj_3R_210()) return true; return false; } - private boolean jj_3R_214() { + private boolean jj_3R_208() { if (jj_scan_token(PLUS)) return true; Token xsp; if (jj_scan_token(1)) return true; @@ -7722,7 +7520,7 @@ LexicalUnitImpl result = null; private Token jj_scanpos, jj_lastpos; private int jj_la; private int jj_gen; - final private int[] jj_la1 = new int[267]; + final private int[] jj_la1 = new int[261]; static private int[] jj_la1_0; static private int[] jj_la1_1; static private int[] jj_la1_2; @@ -7734,16 +7532,16 @@ LexicalUnitImpl result = null; jj_la1_init_3(); } private static void jj_la1_init_0() { - jj_la1_0 = new int[] {0x0,0x302,0x302,0x0,0x300,0x2,0x2,0x2,0xd4c40000,0x0,0x300,0x2,0x300,0x2,0x0,0x2,0x2,0x2,0x0,0x0,0x2,0x2,0x0,0x0,0x2,0x0,0x2,0x100000,0x2,0x0,0x2,0x2,0xd4c40000,0xd4c40000,0x2,0x2,0x2,0xd4fd1500,0xd4fd1500,0x2,0x2,0x2,0x0,0x0,0x2,0x0,0x200000,0x2,0x0,0x2,0x2,0x2,0x2,0x0,0x200000,0x2,0x0,0x2,0x391500,0xc40000,0xc40002,0xc40000,0x2,0x2,0x80120002,0x80120002,0x2,0x0,0x0,0x2,0x2,0x2,0x2,0xd4c40000,0xd4c40000,0x2,0x100000,0x2,0xd4c40000,0x2,0x84000000,0x84000000,0x84000000,0x84000000,0x84000000,0x84000000,0x84000000,0x84000000,0x84000000,0x84000000,0xd4000000,0x0,0x0,0x0,0x0,0x50000000,0x2,0x2,0x3f000,0x2,0x0,0x2,0x3f000,0x0,0x2,0x0,0x2,0x0,0x2,0x200000,0x0,0xd4c40000,0x0,0x134e0002,0x2,0xd4c40000,0xd4c40000,0x2,0x0,0x2,0x134e0002,0x0,0x2,0xd4c40000,0xd4c40000,0x2,0x134e0002,0x2,0x2,0x2,0x0,0x2,0xd4c40000,0x2,0x2,0x100000,0x2,0x2,0x2,0x2,0x0,0x2,0xd4c40000,0xd4c40000,0x2,0x100000,0x2,0x2,0x2,0x100000,0x0,0x0,0x800c0000,0x2,0x0,0x100000,0x2,0x800c0000,0x2,0x0,0x2,0x2,0x0,0x2,0x200000,0x2,0xd4c40000,0xd4c40000,0x2,0x200400,0x2,0x2,0x0,0x2,0x0,0x2,0x2,0x2,0x100000,0x2,0x2,0x2,0x2,0x2,0x0,0x2,0x2,0x2,0x100000,0x2,0x2,0x2,0x0,0x2,0x2,0x2,0x100000,0x2,0x2,0x0,0x2,0x0,0x2,0x2,0x2,0x100000,0x0,0x2,0x2,0x0,0x2,0x2,0x2,0x200000,0x2,0x2,0x200000,0x2,0x2,0x0,0x200000,0x2,0x0,0x2,0x0,0xd4c40000,0x2,0x0,0x2,0x0,0x200000,0x2,0x0,0x2,0x800c0400,0x2,0x0,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x321c0000,0xc0000,0x800c0000,0xc0000,0x0,0x80000000,0x0,0x80000000,0x800c0000,0x2,0x2,0x800c0000,0x2,0xd4c40000,0x2,0x2,0x2,0x0,0x200000,0x2,0x0,0x2,}; + jj_la1_0 = new int[] {0x0,0x302,0x302,0x0,0x300,0x2,0x2,0x2,0xd4c40000,0x0,0x300,0x2,0x300,0x2,0x0,0x2,0x2,0x2,0x0,0x0,0x2,0x2,0x0,0x0,0x2,0x0,0x2,0x100000,0x2,0x0,0x2,0x2,0xd4c40000,0xd4c40000,0x2,0x2,0x2,0xd4fd1500,0x2,0xd4fd1500,0x2,0x2,0x0,0x0,0x2,0x0,0x200000,0x2,0x0,0x2,0x2,0x2,0x2,0x0,0x200000,0x2,0x0,0x2,0x391500,0xc40000,0xc40002,0xc40000,0x2,0x2,0x80120002,0x80120002,0x2,0x0,0x0,0x2,0x2,0x2,0x2,0xd4c40000,0xd4c40000,0x2,0x100000,0x2,0xd4c40000,0x2,0x84000000,0x84000000,0x84000000,0x84000000,0xd4000000,0x0,0x0,0x0,0x0,0x50000000,0x2,0x2,0x3f000,0x2,0x0,0x2,0x3f000,0x0,0x2,0x0,0x2,0x0,0x2,0x200000,0x0,0xd4c40000,0x0,0x134e0002,0x2,0xd4c40000,0xd4c40000,0x2,0x0,0x2,0x134e0002,0x0,0x2,0xd4c40000,0xd4c40000,0x2,0x134e0002,0x2,0x2,0x2,0x0,0x2,0xd4c40000,0x2,0x2,0x100000,0x2,0x2,0x2,0x2,0x0,0x2,0xd4c40000,0xd4c40000,0x2,0x100000,0x2,0x2,0x2,0x100000,0x0,0x0,0x800c0000,0x2,0x0,0x100000,0x2,0x800c0000,0x2,0x0,0x2,0x2,0x0,0x2,0x200000,0x2,0xd4c40000,0xd4c40000,0x2,0x200400,0x2,0x2,0x0,0x2,0x0,0x2,0x2,0x2,0x100000,0x2,0x2,0x2,0x2,0x2,0x0,0x2,0x2,0x2,0x100000,0x2,0x2,0x2,0x0,0x2,0x2,0x2,0x100000,0x2,0x2,0x0,0x2,0x0,0x2,0x2,0x2,0x100000,0x0,0x2,0x2,0x0,0x2,0x2,0x2,0x200000,0x2,0x2,0x200000,0x2,0x2,0x0,0x200000,0x2,0x0,0x2,0x0,0xd4c40000,0x2,0x0,0x2,0x0,0x200000,0x2,0x0,0x2,0x800c0400,0x2,0x0,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x321c0000,0xc0000,0x800c0000,0xc0000,0x0,0x80000000,0x0,0x80000000,0x800c0000,0x2,0x2,0x800c0000,0x2,0xd4c40000,0x2,0x2,0x2,0x0,0x200000,0x2,0x0,0x2,}; } private static void jj_la1_init_1() { - jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x566000c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x80,0x0,0x0,0x120000,0x120000,0x0,0x120000,0x0,0x0,0x0,0x120000,0x0,0x0,0x564000c0,0x564000c0,0x0,0x0,0x0,0x60001c0,0x60001c0,0x0,0x0,0x0,0x0,0x40,0x0,0x80,0x0,0x0,0x80,0x0,0x0,0x0,0x0,0x80,0x0,0x0,0x80,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0xc2,0xc2,0x0,0x80,0x80,0x0,0x0,0x0,0x0,0x564000c0,0x564000c0,0x0,0x0,0x0,0xc0,0x0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0,0x80,0x80,0x80,0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x50000000,0x64000c0,0x50000000,0x3f,0x0,0x564000c0,0x564000c0,0x0,0x80000000,0x0,0x3f,0x0,0x0,0x564000c0,0x564000c0,0x0,0x3f,0x0,0x0,0x0,0x0,0x0,0x564000c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x564000c0,0x564000c0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x40,0x160040,0x0,0x40,0x0,0x0,0x160040,0x0,0x40,0x0,0x0,0x80,0x0,0x0,0x0,0x61200c0,0x61200c0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x6000000,0x0,0x0,0x60000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x0,0x80,0x0,0x6000000,0xc0,0x0,0x0,0x0,0x80,0x0,0x0,0x80,0x0,0x160000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x160000,0x0,0x0,0x0,0x160000,0x160000,0x160000,0x0,0x0,0x160000,0x0,0x60000c0,0x0,0x0,0x0,0x80,0x0,0x0,0x80,0x0,}; + jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x566000c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x80,0x0,0x0,0x120000,0x120000,0x0,0x120000,0x0,0x0,0x0,0x120000,0x0,0x0,0x564000c0,0x564000c0,0x0,0x0,0x0,0x60001c0,0x0,0x60001c0,0x0,0x0,0x0,0x40,0x0,0x80,0x0,0x0,0x80,0x0,0x0,0x0,0x0,0x80,0x0,0x0,0x80,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0xc2,0xc2,0x0,0x80,0x80,0x0,0x0,0x0,0x0,0x564000c0,0x564000c0,0x0,0x0,0x0,0xc0,0x0,0x40,0x40,0x40,0x40,0xc0,0x80,0x80,0x80,0x80,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x50000000,0x64000c0,0x50000000,0x3f,0x0,0x564000c0,0x564000c0,0x0,0x80000000,0x0,0x3f,0x0,0x0,0x564000c0,0x564000c0,0x0,0x3f,0x0,0x0,0x0,0x0,0x0,0x564000c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x564000c0,0x564000c0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x40,0x160040,0x0,0x40,0x0,0x0,0x160040,0x0,0x40,0x0,0x0,0x80,0x0,0x0,0x0,0x61200c0,0x61200c0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x6000000,0x0,0x0,0x60000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x0,0x80,0x0,0x6000000,0xc0,0x0,0x0,0x0,0x80,0x0,0x0,0x80,0x0,0x160000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x160000,0x0,0x0,0x0,0x160000,0x160000,0x160000,0x0,0x0,0x160000,0x0,0x60000c0,0x0,0x0,0x0,0x80,0x0,0x0,0x80,0x0,}; } private static void jj_la1_init_2() { - jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x1000,0x0,0x0,0x0,0x0,0x880,0x0,0x0,0x0,0x100,0x100,0x0,0x0,0x2008,0x2008,0x0,0x2000,0x0,0x0,0x0,0x2000,0x0,0x0,0x1119,0x1119,0x0,0x0,0x0,0x2b80,0x2b80,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x2a80,0x0,0x0,0x0,0x0,0x0,0x380,0x380,0x0,0x100,0x100,0x0,0x0,0x0,0x0,0x1119,0x1119,0x0,0x0,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x100,0x100,0x100,0x100,0x100,0x0,0x0,0x0,0x0,0x180,0x0,0x0,0x0,0x0,0x100,0x0,0x40,0x0,0x0,0x0,0x109,0x1000,0x1300,0x0,0x1109,0x1109,0x0,0x0,0x0,0x1300,0x20,0x0,0x1109,0x1109,0x0,0x1300,0x0,0x0,0x0,0x1100,0x0,0x1109,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x0,0x1109,0x1109,0x0,0x0,0x0,0x0,0x0,0x0,0x1000,0x1000,0xfffffb80,0x0,0x0,0x0,0x0,0xfffffb80,0x0,0x0,0x0,0x0,0x1100,0x0,0x0,0x0,0x2100,0x2100,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0xfffffb80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfffffb80,0x0,0xffffe200,0x0,0x100,0x980,0xffffeb80,0x0,0x0,0xfffffb80,0x0,0x100,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,}; + jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x1000,0x0,0x0,0x0,0x0,0x880,0x0,0x0,0x0,0x100,0x100,0x0,0x0,0x2008,0x2008,0x0,0x2000,0x0,0x0,0x0,0x2000,0x0,0x0,0x1119,0x1119,0x0,0x0,0x0,0x2b88,0x0,0x2b88,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x2a80,0x0,0x0,0x0,0x0,0x0,0x380,0x380,0x0,0x100,0x100,0x0,0x0,0x0,0x0,0x1119,0x1119,0x0,0x0,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x100,0x100,0x100,0x100,0x100,0x100,0x0,0x0,0x0,0x0,0x180,0x0,0x0,0x0,0x0,0x100,0x0,0x40,0x0,0x0,0x0,0x109,0x1000,0x1300,0x0,0x1109,0x1109,0x0,0x0,0x0,0x1300,0x20,0x0,0x1109,0x1109,0x0,0x1300,0x0,0x0,0x0,0x1100,0x0,0x1109,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x0,0x1109,0x1109,0x0,0x0,0x0,0x0,0x0,0x0,0x1000,0x1000,0xfffffb80,0x0,0x0,0x0,0x0,0xfffffb80,0x0,0x0,0x0,0x0,0x1100,0x0,0x0,0x0,0x2100,0x2100,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,0xfffffb80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfffffb80,0x0,0xffffe200,0x0,0x100,0x980,0xffffeb80,0x0,0x0,0xfffffb80,0x0,0x100,0x0,0x0,0x0,0x100,0x0,0x0,0x100,0x0,}; } private static void jj_la1_init_3() { - jj_la1_3 = new int[] {0x8,0x80,0x80,0x2,0x80,0x0,0x0,0x0,0x75,0x0,0x80,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc5,0xc5,0x0,0x0,0x0,0xc401bf,0xc401bf,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc401be,0x0,0x0,0x0,0x0,0x0,0x400000,0x400000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc7,0xc7,0x0,0x0,0x0,0x1,0x0,0x1,0x1,0x0,0x0,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x400000,0x0,0x0,0x0,0x0,0x0,0x45,0x80,0x200000,0x0,0xe5,0xe5,0x0,0x0,0x0,0x200000,0x0,0x0,0xe5,0xe5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x400000,0x0,0xf5,0xf5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x440001,0x0,0x0,0x0,0x0,0x440001,0x0,0x0,0x0,0x0,0x400000,0x0,0x0,0x0,0x1,0x1,0x0,0x0,0x0,0x0,0x380000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x440001,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x440001,0x0,0x400000,0x0,0x0,0x40001,0x440001,0x0,0x0,0x440001,0x0,0x37,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; + jj_la1_3 = new int[] {0x8,0x80,0x80,0x2,0x80,0x0,0x0,0x0,0x75,0x0,0x80,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc5,0xc5,0x0,0x0,0x0,0xc401bf,0x0,0xc401bf,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc401be,0x0,0x0,0x0,0x0,0x0,0x400000,0x400000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc7,0xc7,0x0,0x0,0x0,0x1,0x0,0x1,0x1,0x1,0x1,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x400000,0x0,0x0,0x0,0x0,0x0,0x45,0x80,0x200000,0x0,0xe5,0xe5,0x0,0x0,0x0,0x200000,0x0,0x0,0xe5,0xe5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x400000,0x0,0xf5,0xf5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x440001,0x0,0x0,0x0,0x0,0x440001,0x0,0x0,0x0,0x0,0x400000,0x0,0x0,0x0,0x1,0x1,0x0,0x0,0x0,0x0,0x380000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x440001,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x440001,0x0,0x400000,0x0,0x0,0x40001,0x440001,0x0,0x0,0x440001,0x0,0x37,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; } final private JJCalls[] jj_2_rtns = new JJCalls[9]; private boolean jj_rescan = false; @@ -7755,7 +7553,7 @@ LexicalUnitImpl result = null; token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 267; i++) jj_la1[i] = -1; + for (int i = 0; i < 261; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -7765,7 +7563,7 @@ LexicalUnitImpl result = null; token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 267; i++) jj_la1[i] = -1; + for (int i = 0; i < 261; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -7775,7 +7573,7 @@ LexicalUnitImpl result = null; token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 267; i++) jj_la1[i] = -1; + for (int i = 0; i < 261; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -7785,7 +7583,7 @@ LexicalUnitImpl result = null; token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 267; i++) jj_la1[i] = -1; + for (int i = 0; i < 261; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -7902,7 +7700,7 @@ LexicalUnitImpl result = null; la1tokens[jj_kind] = true; jj_kind = -1; } - for (int i = 0; i < 267; i++) { + for (int i = 0; i < 261; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { if ((jj_la1_0[i] & (1<<j)) != 0) { diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj index 1c45d815a5..17373532a7 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj +++ b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj @@ -40,6 +40,8 @@ import java.util.ArrayList; import java.util.Locale; import java.util.Map; import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; import org.w3c.css.sac.ConditionFactory; import org.w3c.css.sac.Condition; @@ -912,18 +914,24 @@ void media() : <MEDIA_SYM> ( <S> )* mediaStatement(ml) { start = true; documentHandler.startMedia(ml); } - <LBRACE> ( <S> )* ( debuggingDirective() | styleRule() | skipUnknownRule() )* <RBRACE> ( <S> )* + <LBRACE> ( <S> )* ( mediaDirective() )* <RBRACE> ( <S> )* } catch (ParseException e) { reportError(getLocator(), e); skipStatement(); // reportWarningSkipText(getLocator(), skipStatement()); } finally { if (start) { - documentHandler.endMedia(ml); + documentHandler.endMedia(ml); } } } +void mediaDirective() : +{} +{ + debuggingDirective() | styleRule() | skipUnknownRule() | contentDirective() +} + void mediaStatement(MediaListImpl ml) : { Token t; @@ -1272,18 +1280,12 @@ String simple_selector(String selector, char comb) : pseudoElt = null; } { - ( simple_current=element_name() - ( cond=hash(cond) | cond=_class(cond) - | cond=attrib(cond) | cond=pseudo(cond) )* - | cond=hash(cond) ( cond=_class(cond) - | cond=attrib(cond) | cond=pseudo(cond) )* - | cond=_class(cond) ( cond=hash(cond) | cond=_class(cond) - | cond=attrib(cond) | cond=pseudo(cond) )* - | cond=pseudo(cond) ( cond=hash(cond) | cond=_class(cond) - | cond=attrib(cond) | cond=pseudo(cond) )* - | cond=attrib(cond) ( cond=hash(cond) | cond=_class(cond) - | cond=attrib(cond) | cond=pseudo(cond) )* - ) + ( (simple_current=element_name() + ( cond=hash(cond) | cond=_class(cond) + | cond=attrib(cond) | cond=pseudo(cond) )* ) + | ( cond = hash(cond) | cond=_class(cond) + | cond=attrib(cond) | cond=pseudo(cond) )+ + ) { if (simple_current == null) { simple_current = ""; @@ -1445,7 +1447,7 @@ boolean isPseudoElement = false; } } } - | ( n=<FUNCTION> ( <S> )* d=skipStatementUntilRightParan() <RPARAN> + | ( n=<FUNCTION> ( <S> )* d=skipStatementUntilMatchingRightParan() <RPARAN> { // accept anything between function and a right parenthesis String f = convertIdent(n.image); @@ -1975,7 +1977,7 @@ void debugDirective() : { String content = skipStatementUntilSemiColon(); // TODO should evaluate the content expression, call documentHandler.debugDirective() etc. - System.out.println(content); + Logger.getLogger(Parser.class.getName()).log(Level.INFO, content); } (<S>)* } @@ -1987,7 +1989,7 @@ void warnDirective() : { String content = skipStatementUntilSemiColon(); // TODO should evaluate the content expression, call documentHandler.warnDirective() etc. - System.err.println(content); + Logger.getLogger(Parser.class.getName()).log(Level.SEVERE, content); } (<S>)* } @@ -2784,9 +2786,35 @@ String skipStatementUntilLeftBrace(){ } JAVACODE -String skipStatementUntilRightParan(){ - int[] rParan = {RPARAN}; - return skipStatementUntil(rParan); +String skipStatementUntilMatchingRightParan(){ + int[] leftTokens = {LPARAN, FUNCTION}; // a FUNCTION also contains "(" + int[] rightTokens = {RPARAN}; + StringBuffer s = new StringBuffer(); + int difference = 1; + Token tok; + while(difference != 0){ + tok = getToken(1); + if(tok.kind == EOF) { + return null; + } + for(int sym : leftTokens){ + if(tok.kind == sym){ + difference++; + } + } + for(int sym : rightTokens){ + if(tok.kind == sym){ + difference--; + } + } + if(difference != 0){ + if (tok.image != null) { + s.append(tok.image); + } + getNextToken(); + } + } + return s.toString().trim(); } JAVACODE diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/ParserTokenManager.java b/theme-compiler/src/com/vaadin/sass/internal/parser/ParserTokenManager.java index d54ab4fa7e..0db4e4e2f8 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/parser/ParserTokenManager.java +++ b/theme-compiler/src/com/vaadin/sass/internal/parser/ParserTokenManager.java @@ -21,6 +21,8 @@ import java.util.ArrayList; import java.util.Locale; import java.util.Map; import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; import org.w3c.css.sac.ConditionFactory; import org.w3c.css.sac.Condition; import org.w3c.css.sac.SelectorFactory; diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/Token.java b/theme-compiler/src/com/vaadin/sass/internal/parser/Token.java index 26d1121f96..ba29df7d33 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/parser/Token.java +++ b/theme-compiler/src/com/vaadin/sass/internal/parser/Token.java @@ -143,4 +143,4 @@ public class Token implements java.io.Serializable { } } -/* JavaCC - OriginalChecksum=dad2146dc89e68f66e77382c9e448fb7 (do not edit this line) */ +/* JavaCC - OriginalChecksum=8b653fc6be4ca9bd10137ee3ad4c32c4 (do not edit this line) */ diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/TokenMgrError.java b/theme-compiler/src/com/vaadin/sass/internal/parser/TokenMgrError.java index f093357e96..1757cf6705 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/parser/TokenMgrError.java +++ b/theme-compiler/src/com/vaadin/sass/internal/parser/TokenMgrError.java @@ -159,4 +159,4 @@ public class TokenMgrError extends Error this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); } } -/* JavaCC - OriginalChecksum=c7c96e9cf4a9320d03dd722437439354 (do not edit this line) */ +/* JavaCC - OriginalChecksum=525946b34c715198d7c29f668b049f5d (do not edit this line) */ diff --git a/theme-compiler/src/com/vaadin/sass/internal/resolver/AbstractResolver.java b/theme-compiler/src/com/vaadin/sass/internal/resolver/AbstractResolver.java new file mode 100644 index 0000000000..5de1f95264 --- /dev/null +++ b/theme-compiler/src/com/vaadin/sass/internal/resolver/AbstractResolver.java @@ -0,0 +1,200 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.sass.internal.resolver; + +import java.io.File; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + +import org.w3c.css.sac.InputSource; + +import com.vaadin.sass.internal.ScssStylesheet; + +/** + * Base class for resolvers. Implements functionality for locating paths which + * an import can be relative to and helpers for extracting path information from + * the identifier. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public abstract class AbstractResolver implements ScssStylesheetResolver, + Serializable { + /* + * (non-Javadoc) + * + * @see + * com.vaadin.sass.internal.resolver.ScssStylesheetResolver#resolve(java + * .lang.String) + */ + @Override + public InputSource resolve(ScssStylesheet parentStylesheet, + String identifier) { + // Remove a possible ".scss" suffix + identifier = identifier.replaceFirst(".scss$", ""); + + List<String> potentialParentPaths = getPotentialParentPaths( + parentStylesheet, identifier); + + // remove path from identifier as it has already been added to the + // parent path + if (identifier.contains("/")) { + identifier = identifier.substring(identifier.lastIndexOf("/") + 1); + } + + for (String path : potentialParentPaths) { + InputSource source = normalizeAndResolve(path + "/" + identifier); + + if (source != null) { + return source; + } + + // Try to find partial import (_identifier.scss) + source = normalizeAndResolve(path + "/_" + identifier); + + if (source != null) { + return source; + } + + } + + return normalizeAndResolve(identifier); + } + + /** + * Retrieves the parent paths which should be used while resolving relative + * identifiers. By default uses the parent stylesheet location and a + * possible absolute path in the identifier. + * + * @param parentStylesheet + * The parent stylesheet or null if there is no parent + * @param identifier + * The identifier to be resolved + * @return a list of paths in which to look for the relative import + */ + protected List<String> getPotentialParentPaths( + ScssStylesheet parentStylesheet, String identifier) { + List<String> potentialParents = new ArrayList<String>(); + if (parentStylesheet != null) { + potentialParents.add(extractFullPath( + parentStylesheet.getDirectory(), identifier)); + } + + // Identifier can be a full path so extract the path part also as a + // potential parent + if (identifier.contains("/")) { + potentialParents.add(extractFullPath("", identifier)); + } + + return potentialParents; + + } + + /** + * Extracts the full path from the path combined with the identifier + * + * @param path + * The base path + * @param identifier + * The identifier which may contain a path part, separated by "/" + * from the real identifier + * @return a normalized version of the path where identifier does not + * contain any directory information + */ + protected String extractFullPath(String path, String identifier) { + int lastSlashPosition = identifier.lastIndexOf("/"); + if (lastSlashPosition == -1) { + return path; + } + String identifierPath = identifier.substring(0, lastSlashPosition); + if ("".equals(path)) { + return identifierPath; + } else { + return path + "/" + identifierPath; + } + } + + /** + * Resolves the normalized version of the given identifier + * + * @param identifier + * The identifier to resolve + * @return An input source if the resolver found one or null otherwise + */ + protected InputSource normalizeAndResolve(String identifier) { + String normalized = normalize(identifier); + return resolveNormalized(normalized); + } + + /** + * Resolves the identifier after it has been normalized using + * {@link #normalize(String)}. + * + * @param identifier + * The normalized identifier + * @return an InputSource if the resolver found a source or null otherwise + */ + protected abstract InputSource resolveNormalized(String identifier); + + /** + * Normalizes "." and ".." from the path string where parent path segments + * can be removed. Preserve leading "..". Also ensure / is used instead of \ + * in all places. + * + * @param path + * A relative or absolute file path + * @return The normalized path + */ + protected String normalize(String path) { + + // Ensure only "/" is used, also in Windows + path = path.replace(File.separatorChar, '/'); + + // Split into segments + String[] segments = path.split("/"); + Stack<String> result = new Stack<String>(); + + // Replace '.' and '..' segments + for (int i = 0; i < segments.length; i++) { + if (segments[i].equals(".")) { + // Segments marked '.' are ignored + + } else if (segments[i].equals("..") && !result.isEmpty() + && !result.lastElement().equals("..")) { + // If segment is ".." then remove the previous iff the previous + // element is not a ".." and the result stack is not empty + result.pop(); + } else { + // Other segments are just added to the stack + result.push(segments[i]); + } + } + + // Reconstruct path + StringBuilder pathBuilder = new StringBuilder(); + for (int i = 0; i < result.size(); i++) { + if (i > 0) { + pathBuilder.append("/"); + } + pathBuilder.append(result.get(i)); + } + return pathBuilder.toString(); + } + +} diff --git a/theme-compiler/src/com/vaadin/sass/internal/resolver/ClassloaderResolver.java b/theme-compiler/src/com/vaadin/sass/internal/resolver/ClassloaderResolver.java index 8711a0a3e9..755073bc4c 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/resolver/ClassloaderResolver.java +++ b/theme-compiler/src/com/vaadin/sass/internal/resolver/ClassloaderResolver.java @@ -15,31 +15,19 @@ */ package com.vaadin.sass.internal.resolver; -import java.io.File; import java.io.InputStream; import org.w3c.css.sac.InputSource; -public class ClassloaderResolver implements ScssStylesheetResolver { +public class ClassloaderResolver extends AbstractResolver { @Override - public InputSource resolve(String identifier) { - // identifier should not have .scss, fileName should - String ext = ".scss"; - if (identifier.endsWith(".css")) { - ext = ".css"; - } + public InputSource resolveNormalized(String identifier) { String fileName = identifier; - if (identifier.endsWith(ext)) { - identifier = identifier.substring(0, - identifier.length() - ext.length()); - } else { - fileName = fileName + ext; + if (!fileName.endsWith(".css")) { + fileName += ".scss"; } - // Ensure only "/" is used, also in Windows - fileName = fileName.replace(File.separatorChar, '/'); - // Filename should be a relative path starting with VAADIN/... int vaadinIdx = fileName.lastIndexOf("VAADIN/"); if (vaadinIdx > -1) { diff --git a/theme-compiler/src/com/vaadin/sass/internal/resolver/FilesystemResolver.java b/theme-compiler/src/com/vaadin/sass/internal/resolver/FilesystemResolver.java index 9bb1969ab1..786d0875da 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/resolver/FilesystemResolver.java +++ b/theme-compiler/src/com/vaadin/sass/internal/resolver/FilesystemResolver.java @@ -18,24 +18,46 @@ package com.vaadin.sass.internal.resolver; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; +import java.util.List; import org.w3c.css.sac.InputSource; -public class FilesystemResolver implements ScssStylesheetResolver { +import com.vaadin.sass.internal.ScssStylesheet; +public class FilesystemResolver extends AbstractResolver { + + private String[] customPaths = null; + + public FilesystemResolver(String... customPaths) { + this.customPaths = customPaths; + } + + /* + * (non-Javadoc) + * + * @see + * com.vaadin.sass.internal.resolver.AbstractResolver#getPotentialPaths( + * com.vaadin.sass.internal.ScssStylesheet, java.lang.String) + */ @Override - public InputSource resolve(String identifier) { - // identifier should not have .scss, fileName should - String ext = ".scss"; - if (identifier.endsWith(".css")) { - ext = ".css"; + protected List<String> getPotentialParentPaths( + ScssStylesheet parentStyleSheet, String identifier) { + List<String> potentialPaths = super.getPotentialParentPaths( + parentStyleSheet, identifier); + if (customPaths != null) { + for (String path : customPaths) { + potentialPaths.add(extractFullPath(path, identifier)); + } } + + return potentialPaths; + } + + @Override + public InputSource resolveNormalized(String identifier) { String fileName = identifier; - if (identifier.endsWith(ext)) { - identifier = identifier.substring(0, - identifier.length() - ext.length()); - } else { - fileName = fileName + ext; + if (!fileName.endsWith(".css")) { + fileName += ".scss"; } try { diff --git a/theme-compiler/src/com/vaadin/sass/internal/resolver/ScssStylesheetResolver.java b/theme-compiler/src/com/vaadin/sass/internal/resolver/ScssStylesheetResolver.java index 45f10836a3..64b3d10d88 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/resolver/ScssStylesheetResolver.java +++ b/theme-compiler/src/com/vaadin/sass/internal/resolver/ScssStylesheetResolver.java @@ -17,6 +17,8 @@ package com.vaadin.sass.internal.resolver; import org.w3c.css.sac.InputSource; +import com.vaadin.sass.internal.ScssStylesheet; + public interface ScssStylesheetResolver { /** * Called with the "identifier" of a stylesheet that the resolver should try @@ -26,9 +28,12 @@ public interface ScssStylesheetResolver { * stylesheet was found, e.g "runo.scss" might result in a URI like * "VAADIN/themes/runo/runo.scss". * + * @param parentStylesheet + * The parent style sheet * @param identifier * used fo find stylesheet * @return InputSource for stylesheet (with URI set) or null if not found */ - public InputSource resolve(String identifier); + public InputSource resolve(ScssStylesheet parentStylesheet, + String identifier); }
\ No newline at end of file diff --git a/theme-compiler/src/com/vaadin/sass/internal/resolver/VaadinResolver.java b/theme-compiler/src/com/vaadin/sass/internal/resolver/VaadinResolver.java deleted file mode 100644 index fec16a54c8..0000000000 --- a/theme-compiler/src/com/vaadin/sass/internal/resolver/VaadinResolver.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2000-2013 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.sass.internal.resolver; - -import java.io.File; -import java.util.Stack; - -import org.w3c.css.sac.InputSource; - -public class VaadinResolver implements ScssStylesheetResolver { - - @Override - public InputSource resolve(String identifier) { - - // Remove extra "." and ".." - identifier = normalize(identifier); - - InputSource source = null; - - // Can we find the scss from the file system? - ScssStylesheetResolver resolver = new FilesystemResolver(); - source = resolver.resolve(identifier); - - if (source == null) { - // How about the classpath? - resolver = new ClassloaderResolver(); - source = resolver.resolve(identifier); - } - - return source; - } - - /** - * Normalizes "." and ".." from the path string where parent path segments - * can be removed. Preserve leading "..". - * - * @param path - * A relative or absolute file path - * @return The normalized path - */ - private static String normalize(String path) { - - // Ensure only "/" is used, also in Windows - path = path.replace(File.separatorChar, '/'); - - // Split into segments - String[] segments = path.split("/"); - Stack<String> result = new Stack<String>(); - - // Replace '.' and '..' segments - for (int i = 0; i < segments.length; i++) { - if (segments[i].equals(".")) { - // Segments marked '.' are ignored - - } else if (segments[i].equals("..") && !result.isEmpty() - && !result.lastElement().equals("..")) { - // If segment is ".." then remove the previous iff the previous - // element is not a ".." and the result stack is not empty - result.pop(); - } else { - // Other segments are just added to the stack - result.push(segments[i]); - } - } - - // Reconstruct path - StringBuilder pathBuilder = new StringBuilder(); - for (int i = 0; i < result.size(); i++) { - if (i > 0) { - pathBuilder.append("/"); - } - pathBuilder.append(result.get(i)); - } - return pathBuilder.toString(); - } - -} diff --git a/theme-compiler/src/com/vaadin/sass/internal/selector/SelectorUtil.java b/theme-compiler/src/com/vaadin/sass/internal/selector/SelectorUtil.java index 744b560116..c1f26f968e 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/selector/SelectorUtil.java +++ b/theme-compiler/src/com/vaadin/sass/internal/selector/SelectorUtil.java @@ -16,6 +16,9 @@ package com.vaadin.sass.internal.selector; +import java.util.logging.Level; +import java.util.logging.Logger; + import org.w3c.css.sac.CombinatorCondition; import org.w3c.css.sac.Condition; import org.w3c.css.sac.ConditionFactory; @@ -115,7 +118,7 @@ public class SelectorUtil { } else if (selector.getSelectorType() == CompositeSelector.SCSS_COMPOSITE_SELECTOR) { return toString((CompositeSelector) selector); } else { - System.out.println("SU !Unknown selector type, type: " + log("SU !Unknown selector type, type: " + selector.getSelectorType() + ", " + selector.toString()); } return ""; @@ -162,8 +165,8 @@ public class SelectorUtil { PseudoClassConditionImpl pseudoClassCondition = (PseudoClassConditionImpl) condition; return ":" + pseudoClassCondition.getValue(); } else { - System.out.println("CU !condition type not identified, type: " - + conditionType + ", " + condition.toString()); + log("CU !condition type not identified, type: " + conditionType + + ", " + condition.toString()); return ""; } } @@ -330,4 +333,8 @@ public class SelectorUtil { throw new Exception("Invalid selector type"); } } + + private static void log(String msg) { + Logger.getLogger(SelectorUtil.class.getName()).log(Level.INFO, msg); + } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/tree/BlockNode.java b/theme-compiler/src/com/vaadin/sass/internal/tree/BlockNode.java index 6ce67a3abd..8db522ea1a 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/tree/BlockNode.java +++ b/theme-compiler/src/com/vaadin/sass/internal/tree/BlockNode.java @@ -17,6 +17,8 @@ package com.vaadin.sass.internal.tree; import java.util.ArrayList; +import java.util.logging.Level; +import java.util.logging.Logger; import com.vaadin.sass.internal.ScssStylesheet; import com.vaadin.sass.internal.visitor.BlockNodeHandler; @@ -109,7 +111,8 @@ public class BlockNode extends Node implements IVariableNode { BlockNodeHandler.traverse(this); replaceVariables(ScssStylesheet.getVariables()); } catch (Exception e) { - e.printStackTrace(); + Logger.getLogger(BlockNode.class.getName()).log(Level.SEVERE, null, + e); } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/tree/ExtendNode.java b/theme-compiler/src/com/vaadin/sass/internal/tree/ExtendNode.java index 417849d13b..dcabd2ff01 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/tree/ExtendNode.java +++ b/theme-compiler/src/com/vaadin/sass/internal/tree/ExtendNode.java @@ -17,6 +17,8 @@ package com.vaadin.sass.internal.tree; import java.util.ArrayList; +import java.util.logging.Level; +import java.util.logging.Logger; import com.vaadin.sass.internal.visitor.ExtendNodeHandler; @@ -54,7 +56,8 @@ public class ExtendNode extends Node implements IVariableNode { ExtendNodeHandler.traverse(this); getParentNode().removeChild(this); } catch (Exception e) { - e.printStackTrace(); + Logger.getLogger(ExtendNode.class.getName()).log(Level.SEVERE, + null, e); } } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/tree/MixinNode.java b/theme-compiler/src/com/vaadin/sass/internal/tree/MixinNode.java index e702bc8577..c5ffb6d73d 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/tree/MixinNode.java +++ b/theme-compiler/src/com/vaadin/sass/internal/tree/MixinNode.java @@ -19,6 +19,8 @@ package com.vaadin.sass.internal.tree; import java.util.ArrayList; import java.util.Collection; import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; import com.vaadin.sass.internal.ScssStylesheet; import com.vaadin.sass.internal.parser.LexicalUnitImpl; @@ -119,7 +121,8 @@ public class MixinNode extends Node implements IVariableNode { ScssStylesheet.closeVariableScope(variableScope); } catch (Exception e) { - e.printStackTrace(); + Logger.getLogger(MixinNode.class.getName()).log(Level.SEVERE, null, + e); } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/tree/controldirective/IfElseDefNode.java b/theme-compiler/src/com/vaadin/sass/internal/tree/controldirective/IfElseDefNode.java index 735d83a898..8449a9d891 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/tree/controldirective/IfElseDefNode.java +++ b/theme-compiler/src/com/vaadin/sass/internal/tree/controldirective/IfElseDefNode.java @@ -15,6 +15,9 @@ */ package com.vaadin.sass.internal.tree.controldirective; +import java.util.logging.Level; +import java.util.logging.Logger; + import com.vaadin.sass.internal.tree.Node; import com.vaadin.sass.internal.visitor.IfElseNodeHandler; @@ -40,7 +43,8 @@ public class IfElseDefNode extends Node { IfElseNodeHandler.traverse(this); } catch (Exception e) { - e.printStackTrace(); + Logger.getLogger(IfElseDefNode.class.getName()).log(Level.SEVERE, + null, e); } } diff --git a/theme-compiler/src/com/vaadin/sass/internal/util/DeepCopy.java b/theme-compiler/src/com/vaadin/sass/internal/util/DeepCopy.java index bc30ffdd6c..af66eb9a74 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/util/DeepCopy.java +++ b/theme-compiler/src/com/vaadin/sass/internal/util/DeepCopy.java @@ -22,13 +22,15 @@ import java.io.ObjectOutputStream; import java.util.Collection; import java.util.LinkedList; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Utility for making deep copies (vs. clone()'s shallow copies) of objects. * Objects are first serialized and then deserialized. Error checking is fairly * minimal in this implementation. If an object is encountered that cannot be * serialized (or that references an object that cannot be serialized) an error - * is printed to System.err and null is returned. Depending on your specific + * is printed to the logger and null is returned. Depending on your specific * application, it might make more sense to have copy(...) re-throw the * exception. */ @@ -56,9 +58,9 @@ public class DeepCopy { obj = in.readObject(); in.close(); } catch (IOException e) { - e.printStackTrace(); + log(e); } catch (ClassNotFoundException cnfe) { - cnfe.printStackTrace(); + log(cnfe); } return obj; } else { @@ -80,4 +82,8 @@ public class DeepCopy { } return copies; } + + private static void log(Throwable e) { + Logger.getLogger(DeepCopy.class.getName()).log(Level.SEVERE, null, e); + } }
\ No newline at end of file diff --git a/theme-compiler/src/com/vaadin/sass/internal/visitor/ImportNodeHandler.java b/theme-compiler/src/com/vaadin/sass/internal/visitor/ImportNodeHandler.java index cb9896967a..daf01a3eab 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/visitor/ImportNodeHandler.java +++ b/theme-compiler/src/com/vaadin/sass/internal/visitor/ImportNodeHandler.java @@ -16,10 +16,11 @@ package com.vaadin.sass.internal.visitor; -import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; +import java.util.logging.Level; +import java.util.logging.Logger; import org.w3c.css.sac.CSSException; import org.w3c.css.sac.LexicalUnit; @@ -57,25 +58,14 @@ public class ImportNodeHandler { ImportNode importNode = (ImportNode) n; if (!importNode.isPureCssImport()) { try { - StringBuilder filePathBuilder = new StringBuilder( - styleSheet.getFileName()); - filePathBuilder.append(File.separatorChar).append( - importNode.getUri()); - if (!filePathBuilder.toString().endsWith(".scss")) { - filePathBuilder.append(".scss"); - } - // set parent's charset to imported node. ScssStylesheet imported = ScssStylesheet.get( - filePathBuilder.toString(), - styleSheet.getCharset()); - if (imported == null) { - imported = ScssStylesheet.get(importNode.getUri()); - } + importNode.getUri(), styleSheet); if (imported == null) { - throw new FileNotFoundException(importNode.getUri() - + " (parent: " - + ScssStylesheet.get().getFileName() + ")"); + throw new FileNotFoundException("Import '" + + importNode.getUri() + "' in '" + + styleSheet.getFileName() + + "' could not be found"); } traverse(imported); @@ -90,9 +80,11 @@ public class ImportNodeHandler { importNode); node.removeChild(importNode); } catch (CSSException e) { - e.printStackTrace(); + Logger.getLogger(ImportNodeHandler.class.getName()) + .log(Level.SEVERE, null, e); } catch (IOException e) { - e.printStackTrace(); + Logger.getLogger(ImportNodeHandler.class.getName()) + .log(Level.SEVERE, null, e); } } else { if (styleSheet != node) { diff --git a/theme-compiler/src/logging.properties b/theme-compiler/src/logging.properties new file mode 100644 index 0000000000..b563d4b68e --- /dev/null +++ b/theme-compiler/src/logging.properties @@ -0,0 +1,2 @@ +handlers = com.vaadin.sass.CustomConsoleHandler +.level = ALL
\ No newline at end of file |