diff options
author | Marc Englund <marc@vaadin.com> | 2012-09-21 11:52:52 +0300 |
---|---|---|
committer | Marc Englund <marc@vaadin.com> | 2012-09-21 11:53:22 +0300 |
commit | 8b28ea439cf09b69574009337c2659dd653d3760 (patch) | |
tree | c7e28e1e29b5608115b84f7b0b0cc334fd312455 | |
parent | 9500a714336d6f08b47f7cba980fc82faf318ef3 (diff) | |
download | vaadin-framework-8b28ea439cf09b69574009337c2659dd653d3760.tar.gz vaadin-framework-8b28ea439cf09b69574009337c2659dd653d3760.zip |
Big SassCompiler change, fixes #9411 #9489 partials for #9354 #9545 #9380 (applied patch)
43 files changed, 8612 insertions, 7126 deletions
diff --git a/theme-compiler/src/com/vaadin/sass/ScssStylesheet.java b/theme-compiler/src/com/vaadin/sass/ScssStylesheet.java index ccbb22a2c3..d0b4b732ea 100644 --- a/theme-compiler/src/com/vaadin/sass/ScssStylesheet.java +++ b/theme-compiler/src/com/vaadin/sass/ScssStylesheet.java @@ -38,6 +38,7 @@ import com.vaadin.sass.visitor.EachVisitor; import com.vaadin.sass.visitor.ExtendVisitor; import com.vaadin.sass.visitor.IfElseVisitor; import com.vaadin.sass.visitor.ImportVisitor; +import com.vaadin.sass.visitor.ListModifyVisitor; import com.vaadin.sass.visitor.MixinVisitor; import com.vaadin.sass.visitor.NestPropertiesVisitor; import com.vaadin.sass.visitor.ParentSelectorVisitor; @@ -120,7 +121,6 @@ public class ScssStylesheet extends Node { * @throws Exception */ public void compile() throws Exception { - ScssStylesheet scssStylesheet = this; List<Visitor> visitors = new ArrayList<Visitor>(); visitors.add(new ImportVisitor()); visitors.add(new VariableVisitor()); @@ -131,6 +131,7 @@ public class ScssStylesheet extends Node { visitors.add(new NestPropertiesVisitor()); visitors.add(new ExtendVisitor()); visitors.add(new EachVisitor()); + visitors.add(new ListModifyVisitor()); for (Visitor visitor : visitors) { visitor.traverse(this); } diff --git a/theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandler.java b/theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandler.java index 8696cf7ccf..c23afa7acc 100644 --- a/theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandler.java +++ b/theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandler.java @@ -19,12 +19,12 @@ package com.vaadin.sass.handler; import java.util.ArrayList; import java.util.Collection; +import org.w3c.css.sac.CSSException; import org.w3c.css.sac.DocumentHandler; -import org.w3c.css.sac.LexicalUnit; import org.w3c.css.sac.SACMediaList; -import org.w3c.css.sac.SelectorList; import com.vaadin.sass.ScssStylesheet; +import com.vaadin.sass.parser.LexicalUnitImpl; import com.vaadin.sass.tree.ForNode; import com.vaadin.sass.tree.MixinDefNode; import com.vaadin.sass.tree.VariableNode; @@ -34,7 +34,7 @@ import com.vaadin.sass.tree.controldirective.EachDefNode; public interface SCSSDocumentHandler extends DocumentHandler { ScssStylesheet getStyleSheet(); - void variable(String name, LexicalUnit value, boolean guarded); + void variable(String name, LexicalUnitImpl value, boolean guarded); void startMixinDirective(String name, Collection<VariableNode> args); @@ -49,17 +49,15 @@ public interface SCSSDocumentHandler extends DocumentHandler { WhileNode whileDirective(String condition, String body); - void extendDirective(SelectorList list); - void startNestedProperties(String name); void endNestedProperties(String name); - void includeDirective(String name, Collection<LexicalUnit> args); + void includeDirective(String name, Collection<LexicalUnitImpl> args); void importStyle(String uri, SACMediaList media, boolean isURL); - void property(String name, LexicalUnit value, boolean important, + void property(String name, LexicalUnitImpl value, boolean important, String comment); EachDefNode startEachDirective(String variable, ArrayList<String> list); @@ -74,4 +72,17 @@ public interface SCSSDocumentHandler extends DocumentHandler { void elseDirective(); + void startSelector(ArrayList<String> selectors) throws CSSException; + + void endSelector() throws CSSException; + + void extendDirective(ArrayList<String> list); + + void microsoftDirective(String name, String value); + + EachDefNode startEachDirective(String var, String listVariable); + + void removeDirective(ArrayList<String> list, ArrayList<String> remove, + String separator); + } diff --git a/theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandlerImpl.java b/theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandlerImpl.java index 283546ff35..3378903c4d 100644 --- a/theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandlerImpl.java +++ b/theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandlerImpl.java @@ -27,12 +27,15 @@ import org.w3c.css.sac.SACMediaList; import org.w3c.css.sac.SelectorList; import com.vaadin.sass.ScssStylesheet; +import com.vaadin.sass.parser.LexicalUnitImpl; import com.vaadin.sass.tree.BlockNode; import com.vaadin.sass.tree.CommentNode; import com.vaadin.sass.tree.ExtendNode; import com.vaadin.sass.tree.ForNode; import com.vaadin.sass.tree.ImportNode; +import com.vaadin.sass.tree.ListRemoveNode; import com.vaadin.sass.tree.MediaNode; +import com.vaadin.sass.tree.MicrosoftRuleNode; import com.vaadin.sass.tree.MixinDefNode; import com.vaadin.sass.tree.MixinNode; import com.vaadin.sass.tree.NestPropertiesNode; @@ -67,18 +70,14 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler { @Override public void startDocument(InputSource source) throws CSSException { nodeStack.push(styleSheet); - // System.out.println("startDocument(InputSource source): " - // + source.getURI()); } @Override public void endDocument(InputSource source) throws CSSException { - // System.out.println("endDocument(InputSource source): " - // + source.getURI()); } @Override - public void variable(String name, LexicalUnit value, boolean guarded) { + public void variable(String name, LexicalUnitImpl value, boolean guarded) { VariableNode node = new VariableNode(name, value, guarded); nodeStack.peek().appendChild(node); } @@ -104,6 +103,14 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler { } @Override + public EachDefNode startEachDirective(String var, String listVariable) { + EachDefNode node = new EachDefNode(var, listVariable); + nodeStack.peek().appendChild(node); + nodeStack.push(node); + return node; + } + + @Override public void endEachDirective() { nodeStack.pop(); } @@ -173,31 +180,31 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler { } @Override - public void startSelector(SelectorList selectors) throws CSSException { + public void startSelector(ArrayList<String> selectors) throws CSSException { BlockNode node = new BlockNode(selectors); nodeStack.peek().appendChild(node); nodeStack.push(node); } @Override - public void endSelector(SelectorList selectors) throws CSSException { + public void endSelector() throws CSSException { nodeStack.pop(); } @Override public void property(String name, LexicalUnit value, boolean important) throws CSSException { - property(name, value, important, null); + property(name, (LexicalUnitImpl) value, important, null); } - public void property(String name, LexicalUnit value, boolean important, + public void property(String name, LexicalUnitImpl value, boolean important, String comment) { RuleNode node = new RuleNode(name, value, important, comment); nodeStack.peek().appendChild(node); } @Override - public void extendDirective(SelectorList list) { + public void extendDirective(ArrayList<String> list) { ExtendNode node = new ExtendNode(list); nodeStack.peek().appendChild(node); } @@ -233,7 +240,7 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler { } @Override - public void includeDirective(String name, Collection<LexicalUnit> args) { + public void includeDirective(String name, Collection<LexicalUnitImpl> args) { MixinNode node = new MixinNode(name, args); nodeStack.peek().appendChild(node); } @@ -279,4 +286,29 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler { } nodeStack.pop(); } + + @Override + public void microsoftDirective(String name, String value) { + MicrosoftRuleNode node = new MicrosoftRuleNode(name, value); + nodeStack.peek().appendChild(node); + } + + @Override + public void endSelector(SelectorList arg0) throws CSSException { + // TODO Auto-generated method stub + + } + + @Override + public void startSelector(SelectorList arg0) throws CSSException { + // TODO Auto-generated method stub + + } + + @Override + public void removeDirective(ArrayList<String> list, + ArrayList<String> remove, String separator) { + ListRemoveNode node = new ListRemoveNode(list, remove, separator); + nodeStack.peek().appendChild(node); + } } diff --git a/theme-compiler/src/com/vaadin/sass/parser/LexicalUnitImpl.java b/theme-compiler/src/com/vaadin/sass/parser/LexicalUnitImpl.java index 64a9d4a6b8..661dac6125 100644 --- a/theme-compiler/src/com/vaadin/sass/parser/LexicalUnitImpl.java +++ b/theme-compiler/src/com/vaadin/sass/parser/LexicalUnitImpl.java @@ -17,13 +17,15 @@ import com.vaadin.sass.util.ColorUtil; /** * @version $Revision: 1.3 $ * @author Philippe Le Hegaret + * + * @modified Sebastian Nyholm @ Vaadin Ltd */ public class LexicalUnitImpl implements LexicalUnit, SCSSLexicalUnit, Serializable { private static final long serialVersionUID = -6649833716809789399L; - LexicalUnit prev; - LexicalUnit next; + LexicalUnitImpl prev; + LexicalUnitImpl next; short type; int line; @@ -86,20 +88,32 @@ public class LexicalUnitImpl implements LexicalUnit, SCSSLexicalUnit, return type; } + public void setLexicalUnitType(short type) { + this.type = type; + } + + public void getLexicalUnitType(short type) { + this.type = type; + } + @Override - public LexicalUnit getNextLexicalUnit() { + public LexicalUnitImpl getNextLexicalUnit() { return next; } - public void setNextLexicalUnit(LexicalUnit n) { + public void setNextLexicalUnit(LexicalUnitImpl n) { next = n; } @Override - public LexicalUnit getPreviousLexicalUnit() { + public LexicalUnitImpl getPreviousLexicalUnit() { return prev; } + public void setPrevLexicalUnit(LexicalUnitImpl n) { + prev = n; + } + @Override public int getIntegerValue() { return i; @@ -350,28 +364,24 @@ public class LexicalUnitImpl implements LexicalUnit, SCSSLexicalUnit, return this; } - public void replaceValue(LexicalUnit another) { + public void replaceValue(LexicalUnitImpl another) { type = another.getLexicalUnitType(); i = another.getIntegerValue(); f = another.getFloatValue(); s = another.getStringValue(); fname = another.getFunctionName(); prev = another.getPreviousLexicalUnit(); - if (another instanceof LexicalUnitImpl) { - dimension = ((LexicalUnitImpl) another).getDimension(); - sdimension = ((LexicalUnitImpl) another).getSdimension(); - params = ((LexicalUnitImpl) another).getParameters(); - } + dimension = another.getDimension(); + sdimension = another.getSdimension(); + params = another.getParameters(); - LexicalUnit finalNextInAnother = another; + LexicalUnitImpl finalNextInAnother = another; while (finalNextInAnother.getNextLexicalUnit() != null) { finalNextInAnother = finalNextInAnother.getNextLexicalUnit(); } - if (another instanceof LexicalUnitImpl) { - ((LexicalUnitImpl) finalNextInAnother).setNextLexicalUnit(next); - next = ((LexicalUnitImpl) another).next; - } + finalNextInAnother.setNextLexicalUnit(next); + next = another.next; } public void setParameters(LexicalUnitImpl params) { @@ -423,6 +433,10 @@ public class LexicalUnitImpl implements LexicalUnit, SCSSLexicalUnit, return new LexicalUnitImpl(line, column, previous, SAC_EX, null, v); } + public static LexicalUnitImpl createPixel(float p) { + return new LexicalUnitImpl(0, 0, null, SAC_PIXEL, null, p); + } + static LexicalUnitImpl createPX(int line, int column, LexicalUnitImpl previous, float v) { return new LexicalUnitImpl(line, column, previous, SAC_PIXEL, null, v); @@ -520,6 +534,10 @@ public class LexicalUnitImpl implements LexicalUnit, SCSSLexicalUnit, return new LexicalUnitImpl(line, column, previous, SAC_IDENT, s); } + public static LexicalUnitImpl createString(String s) { + return new LexicalUnitImpl(0, 0, null, SAC_STRING_VALUE, s); + } + static LexicalUnitImpl createString(int line, int column, LexicalUnitImpl previous, String s) { return new LexicalUnitImpl(line, column, previous, SAC_STRING_VALUE, s); @@ -589,4 +607,25 @@ public class LexicalUnitImpl implements LexicalUnit, SCSSLexicalUnit, cloned.replaceValue(this); return cloned; } + + /** + * Tries to return the value for this {@link LexicalUnitImpl} without + * considering any related units. + * + * @return + */ + public Object getValue() { + if (s != null) { + return s; + } else if (i != -1) { + return i; + } else if (f != -1) { + return f; + } else + return null; + } + + public void setFunctionName(String functionName) { + fname = functionName; + } } diff --git a/theme-compiler/src/com/vaadin/sass/parser/Parser.java b/theme-compiler/src/com/vaadin/sass/parser/Parser.java index 41ea251943..e274195484 100644 --- a/theme-compiler/src/com/vaadin/sass/parser/Parser.java +++ b/theme-compiler/src/com/vaadin/sass/parser/Parser.java @@ -1,38 +1,37 @@ /* Generated By:JavaCC: Do not edit this line. Parser.java */ package com.vaadin.sass.parser; -import java.io.*; -import java.net.*; +import java.io.BufferedInputStream; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.net.URL; import java.util.ArrayList; import java.util.Locale; -import java.util.Map; +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.CSSParseException; import org.w3c.css.sac.ConditionFactory; -import org.w3c.css.sac.Condition; -import org.w3c.css.sac.SelectorFactory; -import org.w3c.css.sac.SelectorList; -import org.w3c.css.sac.Selector; -import org.w3c.css.sac.SimpleSelector; import org.w3c.css.sac.DocumentHandler; -import org.w3c.css.sac.InputSource; import org.w3c.css.sac.ErrorHandler; -import org.w3c.css.sac.CSSException; -import org.w3c.css.sac.CSSParseException; -import org.w3c.css.sac.Locator; +import org.w3c.css.sac.InputSource; import org.w3c.css.sac.LexicalUnit; - -import org.w3c.flute.parser.selectors.SelectorFactoryImpl; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.SelectorFactory; +import org.w3c.css.sac.SelectorList; import org.w3c.flute.parser.selectors.ConditionFactoryImpl; - +import org.w3c.flute.parser.selectors.SelectorFactoryImpl; import org.w3c.flute.util.Encoding; -import com.vaadin.sass.handler.*; - -import com.vaadin.sass.tree.*; +import com.vaadin.sass.handler.SCSSDocumentHandlerImpl; +import com.vaadin.sass.tree.Node; +import com.vaadin.sass.tree.VariableNode; /** * A CSS2 parser - * + * * @author Philippe Le H�garet * @version $Revision: 1.15 $ */ @@ -63,7 +62,8 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { /** * @@TODO - * @exception CSSException Not yet implemented + * @exception CSSException + * Not yet implemented */ public void setLocale(Locale locale) throws CSSException { throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); @@ -93,13 +93,16 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { /** * Main parse methods - * - * @param source the source of the style sheet. - * @exception IOException the source can't be parsed. - * @exception CSSException the source is not CSS valid. + * + * @param source + * the source of the style sheet. + * @exception IOException + * the source can't be parsed. + * @exception CSSException + * the source is not CSS valid. */ - public void parseStyleSheet(InputSource source) - throws CSSException, IOException { + public void parseStyleSheet(InputSource source) throws CSSException, + IOException { this.source = source; ReInit(getCharStreamWithLurk(source)); if (selectorFactory == null) { @@ -114,25 +117,31 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { /** * Convenient method for URIs. - * - * @param systemId the fully resolved URI of the style sheet. - * @exception IOException the source can't be parsed. - * @exception CSSException the source is not CSS valid. + * + * @param systemId + * the fully resolved URI of the style sheet. + * @exception IOException + * the source can't be parsed. + * @exception CSSException + * the source is not CSS valid. */ - public void parseStyleSheet(String systemId) - throws CSSException, IOException { + public void parseStyleSheet(String systemId) throws CSSException, + IOException { parseStyleSheet(new InputSource(systemId)); } /** - * This method parses only one rule (style rule or at-rule, except @charset). - * - * @param source the source of the rule. - * @exception IOException the source can't be parsed. - * @exception CSSException the source is not CSS valid. + * This method parses only one rule (style rule or at-rule, except + * @charset). + * + * @param source + * the source of the rule. + * @exception IOException + * the source can't be parsed. + * @exception CSSException + * the source is not CSS valid. */ - public void parseRule(InputSource source) - throws CSSException, IOException { + public void parseRule(InputSource source) throws CSSException, IOException { this.source = source; ReInit(getCharStreamWithLurk(source)); @@ -148,13 +157,16 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { /** * This method parses a style declaration (including the surrounding curly * braces). - * - * @param source the source of the style declaration. - * @exception IOException the source can't be parsed. - * @exception CSSException the source is not CSS valid. + * + * @param source + * the source of the style declaration. + * @exception IOException + * the source can't be parsed. + * @exception CSSException + * the source is not CSS valid. */ - public void parseStyleDeclaration(InputSource source) - throws CSSException, IOException { + public void parseStyleDeclaration(InputSource source) throws CSSException, + IOException { this.source = source; ReInit(getCharStreamWithLurk(source)); @@ -169,6 +181,7 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { /** * This methods returns "http://www.w3.org/TR/REC-CSS2". + * * @return the string "http://www.w3.org/TR/REC-CSS2". */ public String getParserVersion() { @@ -178,8 +191,8 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { /** * Parse methods used by DOM Level 2 implementation. */ - public void parseImportRule(InputSource source) - throws CSSException, IOException { + public void parseImportRule(InputSource source) throws CSSException, + IOException { this.source = source; ReInit(getCharStreamWithLurk(source)); @@ -192,8 +205,8 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { _parseImportRule(); } - public void parseMediaRule(InputSource source) - throws CSSException, IOException { + public void parseMediaRule(InputSource source) throws CSSException, + IOException { this.source = source; ReInit(getCharStreamWithLurk(source)); @@ -206,18 +219,12 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { _parseMediaRule(); } - public SelectorList parseSelectors(InputSource source) - throws CSSException, IOException { + public SelectorList parseSelectors(InputSource source) throws CSSException, + IOException { this.source = source; ReInit(getCharStreamWithLurk(source)); - if (selectorFactory == null) { - selectorFactory = new SelectorFactoryImpl(); - } - if (conditionFactory == null) { - conditionFactory = new ConditionFactoryImpl(); - } - return _parseSelectors(); + return null; } public LexicalUnit parsePropertyValue(InputSource source) @@ -228,8 +235,8 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { return expr(); } - public boolean parsePriority(InputSource source) - throws CSSException, IOException { + public boolean parsePriority(InputSource source) throws CSSException, + IOException { this.source = source; ReInit(getCharStreamWithLurk(source)); @@ -237,7 +244,8 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { } /** - * Convert the source into a Reader. Used only by DOM Level 2 parser methods. + * Convert the source into a Reader. Used only by DOM Level 2 parser + * methods. */ private Reader getReader(InputSource source) throws IOException { if (source.getCharacterStream() != null) { @@ -249,7 +257,7 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { return new InputStreamReader(source.getByteStream(), "ASCII"); } else { return new InputStreamReader(source.getByteStream(), - source.getEncoding()); + source.getEncoding()); } } else { // systemId @@ -259,11 +267,10 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { } /** - * Convert the source into a CharStream with encoding informations. - * The encoding can be found in the InputSource or in the CSS document. - * Since this method marks the reader and make a reset after looking for - * the charset declaration, you'll find the charset declaration into the - * stream. + * Convert the source into a CharStream with encoding informations. The + * encoding can be found in the InputSource or in the CSS document. Since + * this method marks the reader and make a reset after looking for the + * charset declaration, you'll find the charset declaration into the stream. */ private CharStream getCharStreamWithLurk(InputSource source) throws CSSException, IOException { @@ -296,7 +303,7 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { if (c == '@') { // hum, is it a charset ? - int size = 100; + int size = 100; byte[] buf = new byte[size]; input.read(buf, 0, 7); String keyword = new String(buf, 0, 7); @@ -330,12 +337,13 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { if (c != ';') { // no semi colon at the end ? throw new CSSException("invalid charset declaration: " - + "missing semi colon"); + + "missing semi colon"); } encoding = new String(buf, 0, i); if (source.getEncoding() != null) { // compare the two encoding informations. - // For example, I don't accept to have ASCII and after UTF-8. + // For example, I don't accept to have ASCII and after + // UTF-8. // Is it really good ? That is the question. if (!encoding.equals(source.getEncoding())) { throw new CSSException("invalid encoding information."); @@ -347,7 +355,7 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { source.setEncoding(encoding); // set the real reader of this source. source.setCharacterStream(new InputStreamReader(source.getByteStream(), - Encoding.getJavaEncoding(encoding))); + Encoding.getJavaEncoding(encoding))); // reset the stream (leave the charset declaration in the stream). input.reset(); @@ -355,6 +363,7 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { } private LocatorImpl currentLocator; + private Locator getLocator() { if (currentLocator == null) { currentLocator = new LocatorImpl(this); @@ -362,6 +371,7 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { } return currentLocator.reInit(this); } + private LocatorImpl getLocator(Token save) { if (currentLocator == null) { currentLocator = new LocatorImpl(this, save); @@ -378,8 +388,8 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { if (pe.specialConstructor) { StringBuffer errorM = new StringBuffer(); if (pe.currentToken != null) { - errorM.append("encountered \u005c"") - .append(pe.currentToken.next); + errorM.append("encountered \u005c"").append( + pe.currentToken.next); } errorM.append('"'); if (pe.expectedTokenSequences.length != 0) { @@ -395,10 +405,10 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { } } errorHandler.error(new CSSParseException(errorM.toString(), - l, e)); + l, e)); } else { - errorHandler.error(new CSSParseException(e.getMessage(), - l, e)); + errorHandler.error(new CSSParseException(e.getMessage(), l, + e)); } } else if (e == null) { errorHandler.error(new CSSParseException("error", l, null)); @@ -409,3665 +419,4055 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants { } private void reportWarningSkipText(Locator l, String text) { - if (errorHandler != null && text != null) { + if (errorHandler != null && text != null) { errorHandler.warning(new CSSParseException("Skipping: " + text, l)); } } -/* - * The grammar of CSS2 - */ + /* + * The grammar of CSS2 + */ -/** - * The main entry for the parser. - * - * @exception ParseException exception during the parse - */ - final public void parserUnit() throws ParseException { - try { - documentHandler.startDocument(source); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case CHARSET_SYM: - charset(); - break; - default: - jj_la1[0] = jj_gen; - ; - } - label_1: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - case CDO: - case CDC: - case ATKEYWORD: - ; - break; - default: - jj_la1[1] = jj_gen; - break label_1; + /** + * The main entry for the parser. + * + * @exception ParseException + * exception during the parse + */ + final public void parserUnit() throws ParseException { + try { + documentHandler.startDocument(source); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case CHARSET_SYM: + charset(); + break; + default: + jj_la1[0] = jj_gen; + ; + } + label_1: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + case CDO: + case CDC: + case ATKEYWORD: + ; + break; + default: + jj_la1[1] = jj_gen; + break label_1; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + jj_consume_token(S); + comments(); + break; + case CDO: + case CDC: + case ATKEYWORD: + ignoreStatement(); + break; + default: + jj_la1[2] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + label_2: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IMPORT_SYM: + ; + break; + default: + jj_la1[3] = jj_gen; + break label_2; + } + importDeclaration(); + label_3: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case CDO: + case CDC: + case ATKEYWORD: + ; + break; + default: + jj_la1[4] = jj_gen; + break label_3; + } + ignoreStatement(); + label_4: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[5] = jj_gen; + break label_4; + } + jj_consume_token(S); + } + } + } + afterImportDeclaration(); + jj_consume_token(0); + } finally { + documentHandler.endDocument(source); } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - jj_consume_token(S); - comments(); - break; + } + + final public void charset() throws ParseException { + Token n; + try { + jj_consume_token(CHARSET_SYM); + label_5: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[6] = jj_gen; + break label_5; + } + jj_consume_token(S); + } + n = jj_consume_token(STRING); + label_6: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[7] = jj_gen; + break label_6; + } + jj_consume_token(S); + } + jj_consume_token(SEMICOLON); + } catch (ParseException e) { + reportError(getLocator(e.currentToken.next), e); + skipStatement(); + // reportWarningSkipText(getLocator(), skipStatement()); + + } catch (Exception e) { + reportError(getLocator(), e); + skipStatement(); + // reportWarningSkipText(getLocator(), skipStatement()); + + } + } + + final public void afterImportDeclaration() throws ParseException { + String ret; + Locator l; + label_7: while (true) { + ; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case VARIABLE: + variable(); + break; + case REMOVE: + removeDirective(); + break; + case MIXIN_SYM: + mixinDirective(); + break; + case EACH_SYM: + eachDirective(); + break; + case INCLUDE_SYM: + includeDirective(); + break; + case LBRACKET: + case ANY: + case PARENT: + case DOT: + case COLON: + case EACH_VAR: + case IDENT: + case HASH: + styleRule(); + break; + case MEDIA_SYM: + media(); + break; + case PAGE_SYM: + page(); + break; + case FONT_FACE_SYM: + fontFace(); + break; + default: + jj_la1[8] = jj_gen; + l = getLocator(); + ret = skipStatement(); + if ((ret == null) || (ret.length() == 0)) { + { + if (true) + return; + } + } + reportWarningSkipText(l, ret); + if (ret.charAt(0) == '@') { + documentHandler.ignorableAtRule(ret); + } + } + label_8: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case CDO: + case CDC: + case ATKEYWORD: + ; + break; + default: + jj_la1[9] = jj_gen; + break label_8; + } + ignoreStatement(); + label_9: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[10] = jj_gen; + break label_9; + } + jj_consume_token(S); + } + } + } + } + + final public void ignoreStatement() throws ParseException { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case CDO: + jj_consume_token(CDO); + break; case CDC: + jj_consume_token(CDC); + break; case ATKEYWORD: - ignoreStatement(); - break; - default: - jj_la1[2] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - label_2: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IMPORT_SYM: - ; - break; + atRuleDeclaration(); + break; default: - jj_la1[3] = jj_gen; - break label_2; + jj_la1[11] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); } - importDeclaration(); - label_3: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case CDO: - case CDC: - case ATKEYWORD: - ; - break; - default: - jj_la1[4] = jj_gen; - break label_3; - } - ignoreStatement(); - label_4: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + } + + /** + * The import statement + * + * @exception ParseException + * exception during the parse + */ + final public void importDeclaration() throws ParseException { + Token n; + String uri; + MediaListImpl ml = new MediaListImpl(); + boolean isURL = false; + try { + jj_consume_token(IMPORT_SYM); + label_10: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[12] = jj_gen; + break label_10; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case STRING: + n = jj_consume_token(STRING); + uri = convertStringIndex(n.image, 1, n.image.length() - 1); + break; + case URL: + n = jj_consume_token(URL); + isURL = true; + uri = n.image.substring(4, n.image.length() - 1).trim(); + if ((uri.charAt(0) == '"') || (uri.charAt(0) == '\u005c'')) { + uri = uri.substring(1, uri.length() - 1); + } + break; + default: + jj_la1[13] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_11: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[14] = jj_gen; + break label_11; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + mediaStatement(ml); + break; + default: + jj_la1[15] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); + label_12: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[16] = jj_gen; + break label_12; + } + jj_consume_token(S); + } + if (ml.getLength() == 0) { + // see section 6.3 of the CSS2 recommandation. + ml.addItem("all"); + } + documentHandler.importStyle(uri, ml, isURL); + } catch (ParseException e) { + reportError(getLocator(), e); + skipStatement(); + // reportWarningSkipText(getLocator(), skipStatement()); + + } + } + + /** + * @exception ParseException + * exception during the parse + */ + final public void media() throws ParseException { + boolean start = false; + String ret; + MediaListImpl ml = new MediaListImpl(); + try { + jj_consume_token(MEDIA_SYM); + label_13: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[17] = jj_gen; + break label_13; + } + jj_consume_token(S); + } + mediaStatement(ml); + start = true; + documentHandler.startMedia(ml); + jj_consume_token(LBRACE); + label_14: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[18] = jj_gen; + break label_14; + } + jj_consume_token(S); + } + label_15: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case CDO: + case LBRACE: + case DASHMATCH: + case INCLUDES: + case PLUS: + case MINUS: + case COMMA: + case SEMICOLON: + case PRECEDES: + case LBRACKET: + case ANY: + case PARENT: + case DOT: + case COLON: + case EACH_VAR: + case NONASCII: + case STRING: + case IDENT: + case NUMBER: + case URL: + case PERCENTAGE: + case HASH: + 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: + ; + break; + default: + jj_la1[19] = jj_gen; + break label_15; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + case ANY: + case PARENT: + case DOT: + case COLON: + case EACH_VAR: + case IDENT: + case HASH: + styleRule(); + break; + case CDO: + case LBRACE: + case DASHMATCH: + case INCLUDES: + case PLUS: + case MINUS: + case COMMA: + case SEMICOLON: + case PRECEDES: + 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[20] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + jj_consume_token(RBRACE); + label_16: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[21] = jj_gen; + break label_16; + } + jj_consume_token(S); + } + } catch (ParseException e) { + reportError(getLocator(), e); + skipStatement(); + // reportWarningSkipText(getLocator(), skipStatement()); + + } finally { + if (start) { + documentHandler.endMedia(ml); + } + } + } + + final public void mediaStatement(MediaListImpl ml) throws ParseException { + String m; + m = medium(); + label_17: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[22] = jj_gen; + break label_17; + } + jj_consume_token(COMMA); + label_18: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[23] = jj_gen; + break label_18; + } + jj_consume_token(S); + } + ml.addItem(m); + m = medium(); + } + ml.addItem(m); + } + + /** + * @exception ParseException + * exception during the parse + */ + final public String medium() throws ParseException { + Token n; + n = jj_consume_token(IDENT); + label_19: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case S: - ; - break; + ; + break; default: - jj_la1[5] = jj_gen; - break label_4; + jj_la1[24] = jj_gen; + break label_19; } jj_consume_token(S); - } - } - } - afterImportDeclaration(); - jj_consume_token(0); - } finally { - documentHandler.endDocument(source); - } - } - - final public void charset() throws ParseException { - Token n; - try { - jj_consume_token(CHARSET_SYM); - label_5: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[6] = jj_gen; - break label_5; - } - jj_consume_token(S); - } - n = jj_consume_token(STRING); - label_6: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[7] = jj_gen; - break label_6; - } - jj_consume_token(S); - } - jj_consume_token(SEMICOLON); - } catch (ParseException e) { - reportError(getLocator(e.currentToken.next), e); - skipStatement(); - // reportWarningSkipText(getLocator(), skipStatement()); - - } catch (Exception e) { - reportError(getLocator(), e); - skipStatement(); - // reportWarningSkipText(getLocator(), skipStatement()); - - } - } - - final public void afterImportDeclaration() throws ParseException { - String ret; - Locator l; - label_7: - while (true) { - ; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case VARIABLE: - variable(); - break; - case MIXIN_SYM: - mixinDirective(); - break; - case EACH_SYM: - eachDirective(); - break; - case INCLUDE_SYM: - includeDirective(); - break; - case LBRACKET: - case ANY: - case PARENT: - case DOT: - case COLON: - case EACH_VAR: - case IDENT: - case HASH: - styleRule(); - break; - case MEDIA_SYM: - media(); - break; - case PAGE_SYM: - page(); - break; - case FONT_FACE_SYM: - fontFace(); - break; - default: - jj_la1[8] = jj_gen; - l = getLocator(); - ret = skipStatement(); - if ((ret == null) || (ret.length() == 0)) { - {if (true) return;} - } - reportWarningSkipText(l, ret); - if (ret.charAt(0) == '@') { - documentHandler.ignorableAtRule(ret); - } - } - label_8: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case CDO: - case CDC: - case ATKEYWORD: - ; - break; - default: - jj_la1[9] = jj_gen; - break label_8; } - ignoreStatement(); - label_9: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[10] = jj_gen; - break label_9; - } - jj_consume_token(S); - } - } - } - } - - final public void ignoreStatement() throws ParseException { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case CDO: - jj_consume_token(CDO); - break; - case CDC: - jj_consume_token(CDC); - break; - case ATKEYWORD: - atRuleDeclaration(); - break; - default: - jj_la1[11] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } + { + if (true) + return convertIdent(n.image); + } + throw new Error("Missing return statement in function"); + } -/** - * The import statement - * - * @exception ParseException exception during the parse - */ - final public void importDeclaration() throws ParseException { - Token n; - String uri; - MediaListImpl ml = new MediaListImpl(); - boolean isURL = false; - try { - jj_consume_token(IMPORT_SYM); - label_10: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[12] = jj_gen; - break label_10; - } - jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case STRING: - n = jj_consume_token(STRING); - uri = convertStringIndex(n.image, 1, - n.image.length() -1); - break; - case URL: - n = jj_consume_token(URL); - isURL=true; - uri = n.image.substring(4, n.image.length()-1).trim(); - if ((uri.charAt(0) == '"') - || (uri.charAt(0) == '\u005c'')) { - uri = uri.substring(1, uri.length()-1); - } - break; - default: - jj_la1[13] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - label_11: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[14] = jj_gen; - break label_11; - } - jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - mediaStatement(ml); - break; - default: - jj_la1[15] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - label_12: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[16] = jj_gen; - break label_12; + /** + * @exception ParseException + * exception during the parse + */ + final public void page() throws ParseException { + boolean start = false; + Token n = null; + String page = null; + String pseudo = null; + try { + jj_consume_token(PAGE_SYM); + label_20: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[25] = jj_gen; + break label_20; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + n = jj_consume_token(IDENT); + label_21: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[26] = jj_gen; + break label_21; + } + jj_consume_token(S); + } + break; + default: + jj_la1[27] = jj_gen; + ; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COLON: + pseudo = pseudo_page(); + break; + default: + jj_la1[28] = jj_gen; + ; + } + if (n != null) { + page = convertIdent(n.image); + } + jj_consume_token(LBRACE); + label_22: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[29] = jj_gen; + break label_22; + } + jj_consume_token(S); + } + start = true; + documentHandler.startPage(page, pseudo); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + declaration(); + break; + default: + jj_la1[30] = jj_gen; + ; + } + label_23: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case SEMICOLON: + ; + break; + default: + jj_la1[31] = jj_gen; + break label_23; + } + jj_consume_token(SEMICOLON); + label_24: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[32] = jj_gen; + break label_24; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + declaration(); + break; + default: + jj_la1[33] = jj_gen; + ; + } + } + jj_consume_token(RBRACE); + label_25: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[34] = jj_gen; + break label_25; + } + jj_consume_token(S); + } + } catch (ParseException e) { + if (errorHandler != null) { + LocatorImpl li = new LocatorImpl(this, + e.currentToken.next.beginLine, + e.currentToken.next.beginColumn - 1); + reportError(li, e); + skipStatement(); + // reportWarningSkipText(li, skipStatement()); + } else { + skipStatement(); + } + } finally { + if (start) { + documentHandler.endPage(page, pseudo); + } } - jj_consume_token(S); - } - if (ml.getLength() == 0) { - // see section 6.3 of the CSS2 recommandation. - ml.addItem("all"); - } - documentHandler.importStyle(uri, ml, isURL); - } catch (ParseException e) { - reportError(getLocator(), e); - skipStatement(); - // reportWarningSkipText(getLocator(), skipStatement()); + } + final public String pseudo_page() throws ParseException { + Token n; + jj_consume_token(COLON); + n = jj_consume_token(IDENT); + label_26: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[35] = jj_gen; + break label_26; + } + jj_consume_token(S); + } + { + if (true) + return convertIdent(n.image); + } + throw new Error("Missing return statement in function"); } - } -/** - * @exception ParseException exception during the parse - */ - final public void media() throws ParseException { - boolean start = false; - String ret; - MediaListImpl ml = new MediaListImpl(); - try { - jj_consume_token(MEDIA_SYM); - label_13: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[17] = jj_gen; - break label_13; - } - jj_consume_token(S); - } - mediaStatement(ml); - start = true; documentHandler.startMedia(ml); - jj_consume_token(LBRACE); - label_14: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[18] = jj_gen; - break label_14; - } - jj_consume_token(S); - } - label_15: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + final public void fontFace() throws ParseException { + boolean start = false; + try { + jj_consume_token(FONT_FACE_SYM); + label_27: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[36] = jj_gen; + break label_27; + } + jj_consume_token(S); + } + jj_consume_token(LBRACE); + label_28: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[37] = jj_gen; + break label_28; + } + jj_consume_token(S); + } + start = true; + documentHandler.startFontFace(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + declaration(); + break; + default: + jj_la1[38] = jj_gen; + ; + } + label_29: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case SEMICOLON: + ; + break; + default: + jj_la1[39] = jj_gen; + break label_29; + } + jj_consume_token(SEMICOLON); + label_30: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[40] = jj_gen; + break label_30; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + declaration(); + break; + default: + jj_la1[41] = jj_gen; + ; + } + } + jj_consume_token(RBRACE); + label_31: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[42] = jj_gen; + break label_31; + } + jj_consume_token(S); + } + } catch (ParseException e) { + reportError(getLocator(), e); + skipStatement(); + // reportWarningSkipText(getLocator(), skipStatement()); + + } finally { + if (start) { + documentHandler.endFontFace(); + } + } + } + + /** + * @exception ParseException + * exception during the parse + */ + final public void atRuleDeclaration() throws ParseException { + Token n; + String ret; + n = jj_consume_token(ATKEYWORD); + ret = skipStatement(); + reportWarningSkipText(getLocator(), ret); + if ((ret != null) && (ret.charAt(0) == '@')) { + documentHandler.ignorableAtRule(ret); + } + } + + final public void skipUnknownRule() throws ParseException { + Token n; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ATKEYWORD: + n = jj_consume_token(ATKEYWORD); + break; case CDO: - case LBRACE: + n = jj_consume_token(CDO); + break; + case CHARSET_SYM: + n = jj_consume_token(CHARSET_SYM); + break; + case COMMA: + n = jj_consume_token(COMMA); + break; case DASHMATCH: + n = jj_consume_token(DASHMATCH); + break; + case FONT_FACE_SYM: + n = jj_consume_token(FONT_FACE_SYM); + break; + case FUNCTION: + n = jj_consume_token(FUNCTION); + break; + case IMPORTANT_SYM: + n = jj_consume_token(IMPORTANT_SYM); + break; + case IMPORT_SYM: + n = jj_consume_token(IMPORT_SYM); + break; case INCLUDES: - case PLUS: - case MINUS: - case COMMA: - case SEMICOLON: - case PRECEDES: - case LBRACKET: - case ANY: - case PARENT: - case DOT: - case COLON: - case EACH_VAR: + n = jj_consume_token(INCLUDES); + break; + case LBRACE: + n = jj_consume_token(LBRACE); + break; + case MEDIA_SYM: + n = jj_consume_token(MEDIA_SYM); + break; case NONASCII: - case STRING: - case IDENT: + n = jj_consume_token(NONASCII); + break; case NUMBER: - case URL: - case PERCENTAGE: - case HASH: - case IMPORT_SYM: - case MEDIA_SYM: - case CHARSET_SYM: + n = jj_consume_token(NUMBER); + break; case PAGE_SYM: - case FONT_FACE_SYM: - case ATKEYWORD: - case IMPORTANT_SYM: + n = jj_consume_token(PAGE_SYM); + break; + case PERCENTAGE: + n = jj_consume_token(PERCENTAGE); + break; + case STRING: + n = jj_consume_token(STRING); + break; case UNICODERANGE: - case FUNCTION: + n = jj_consume_token(UNICODERANGE); + break; + case URL: + n = jj_consume_token(URL); + break; + case SEMICOLON: + n = jj_consume_token(SEMICOLON); + break; + case PLUS: + n = jj_consume_token(PLUS); + break; + case PRECEDES: + n = jj_consume_token(PRECEDES); + break; + case MINUS: + n = jj_consume_token(MINUS); + break; case UNKNOWN: - ; - break; + n = jj_consume_token(UNKNOWN); + break; default: - jj_la1[19] = jj_gen; - break label_15; + jj_la1[43] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case ANY: - case PARENT: - case DOT: - case COLON: - case EACH_VAR: - case IDENT: - case HASH: - styleRule(); - break; - case CDO: - case LBRACE: - case DASHMATCH: - case INCLUDES: + String ret; + Locator loc = getLocator(); + ret = skipStatement(); + reportWarningSkipText(loc, ret); + if ((ret != null) && (n.image.charAt(0) == '@')) { + documentHandler.ignorableAtRule(ret); + } + } + + /** + * @exception ParseException + * exception during the parse + */ + final public char combinator() throws ParseException { + char connector = ' '; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case PLUS: - case MINUS: - case COMMA: - case SEMICOLON: + jj_consume_token(PLUS); + label_32: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[44] = jj_gen; + break label_32; + } + jj_consume_token(S); + } + { + if (true) + return '+'; + } + break; case PRECEDES: - 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[20] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - jj_consume_token(RBRACE); - label_16: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[21] = jj_gen; - break label_16; - } - jj_consume_token(S); - } - } catch (ParseException e) { - reportError(getLocator(), e); - skipStatement(); - // reportWarningSkipText(getLocator(), skipStatement()); - - } finally { - if (start) { - documentHandler.endMedia(ml); - } - } - } - - final public void mediaStatement(MediaListImpl ml) throws ParseException { - String m; - m = medium(); - label_17: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[22] = jj_gen; - break label_17; - } - jj_consume_token(COMMA); - label_18: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + jj_consume_token(PRECEDES); + label_33: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[45] = jj_gen; + break label_33; + } + jj_consume_token(S); + } + { + if (true) + return '>'; + } + break; case S: - ; - break; + jj_consume_token(S); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case PLUS: + case PRECEDES: + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case PLUS: + jj_consume_token(PLUS); + connector = '+'; + break; + case PRECEDES: + jj_consume_token(PRECEDES); + connector = '>'; + break; + default: + jj_la1[46] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_34: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[47] = jj_gen; + break label_34; + } + jj_consume_token(S); + } + break; + default: + jj_la1[48] = jj_gen; + ; + } + { + if (true) + return connector; + } + break; default: - jj_la1[23] = jj_gen; - break label_18; + jj_la1[49] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); } - jj_consume_token(S); - } - ml.addItem(m); - m = medium(); + throw new Error("Missing return statement in function"); } - ml.addItem(m); - } - -/** - * @exception ParseException exception during the parse - */ - final public String medium() throws ParseException { - Token n; - n = jj_consume_token(IDENT); - label_19: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[24] = jj_gen; - break label_19; - } - jj_consume_token(S); - } - {if (true) return convertIdent(n.image);} - throw new Error("Missing return statement in function"); - } -/** - * @exception ParseException exception during the parse - */ - final public void page() throws ParseException { - boolean start = false; - Token n = null; - String page = null; - String pseudo = null; - try { - jj_consume_token(PAGE_SYM); - label_20: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[25] = jj_gen; - break label_20; + final public void microsoftExtension() throws ParseException { + Token n; + String name = ""; + String value = ""; + n = jj_consume_token(MICROSOFT_RULE); + label_35: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[50] = jj_gen; + break label_35; + } + jj_consume_token(S); } - jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - n = jj_consume_token(IDENT); - label_21: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[26] = jj_gen; - break label_21; - } - jj_consume_token(S); - } - break; - default: - jj_la1[27] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COLON: - pseudo = pseudo_page(); - break; - default: - jj_la1[28] = jj_gen; - ; - } - if (n != null) { - page = convertIdent(n.image); - } - jj_consume_token(LBRACE); - label_22: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[29] = jj_gen; - break label_22; - } - jj_consume_token(S); - } - start = true; - documentHandler.startPage(page, pseudo); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - declaration(); - break; - default: - jj_la1[30] = jj_gen; - ; - } - label_23: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SEMICOLON: - ; - break; - default: - jj_la1[31] = jj_gen; - break label_23; + name = n.image; + jj_consume_token(COLON); + label_36: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + n = jj_consume_token(IDENT); + value += n.image; + break; + case NUMBER: + n = jj_consume_token(NUMBER); + value += n.image; + break; + case EACH_VAR: + n = jj_consume_token(EACH_VAR); + value += n.image; + break; + case COLON: + n = jj_consume_token(COLON); + value += n.image; + break; + case FUNCTION: + n = jj_consume_token(FUNCTION); + value += n.image; + break; + case RPARAN: + n = jj_consume_token(RPARAN); + value += n.image; + break; + case EQ: + n = jj_consume_token(EQ); + value += n.image; + break; + case DOT: + n = jj_consume_token(DOT); + value += n.image; + break; + case S: + n = jj_consume_token(S); + if (value.lastIndexOf(' ') != value.length() - 1) { + value += n.image; + } + break; + default: + jj_la1[51] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + case EQ: + case DOT: + case RPARAN: + case COLON: + case EACH_VAR: + case IDENT: + case NUMBER: + case FUNCTION: + ; + break; + default: + jj_la1[52] = jj_gen; + break label_36; + } } jj_consume_token(SEMICOLON); - label_24: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[32] = jj_gen; - break label_24; - } - jj_consume_token(S); + label_37: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[53] = jj_gen; + break label_37; + } + jj_consume_token(S); } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - declaration(); - break; - default: - jj_la1[33] = jj_gen; - ; - } - } - jj_consume_token(RBRACE); - label_25: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[34] = jj_gen; - break label_25; - } - jj_consume_token(S); - } - } catch (ParseException e) { - if (errorHandler != null) { - LocatorImpl li = new LocatorImpl(this, - e.currentToken.next.beginLine, - e.currentToken.next.beginColumn-1); - reportError(li, e); - skipStatement(); - // reportWarningSkipText(li, skipStatement()); - } else { - skipStatement(); - } - } finally { - if (start) { - documentHandler.endPage(page, pseudo); - } - } - } - - final public String pseudo_page() throws ParseException { - Token n; - jj_consume_token(COLON); - n = jj_consume_token(IDENT); - label_26: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[35] = jj_gen; - break label_26; - } - jj_consume_token(S); - } - {if (true) return convertIdent(n.image);} - throw new Error("Missing return statement in function"); - } - - final public void fontFace() throws ParseException { - boolean start = false; - try { - jj_consume_token(FONT_FACE_SYM); - label_27: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[36] = jj_gen; - break label_27; - } - jj_consume_token(S); - } - jj_consume_token(LBRACE); - label_28: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[37] = jj_gen; - break label_28; - } - jj_consume_token(S); - } - start = true; documentHandler.startFontFace(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - declaration(); - break; - default: - jj_la1[38] = jj_gen; - ; - } - label_29: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SEMICOLON: - ; - break; - default: - jj_la1[39] = jj_gen; - break label_29; + documentHandler.microsoftDirective(name, value); + } + + /** + * @exception ParseException + * exception during the parse + */ + final public String property() throws ParseException { + Token n; + n = jj_consume_token(IDENT); + label_38: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[54] = jj_gen; + break label_38; + } + jj_consume_token(S); } - jj_consume_token(SEMICOLON); - label_30: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[40] = jj_gen; - break label_30; - } - jj_consume_token(S); + { + if (true) + return convertIdent(n.image); } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - declaration(); - break; - default: - jj_la1[41] = jj_gen; - ; - } - } - jj_consume_token(RBRACE); - label_31: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[42] = jj_gen; - break label_31; + throw new Error("Missing return statement in function"); + } + + final public String variableName() throws ParseException { + Token n; + n = jj_consume_token(VARIABLE); + label_39: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[55] = jj_gen; + break label_39; + } + jj_consume_token(S); } - jj_consume_token(S); - } - } catch (ParseException e) { - reportError(getLocator(), e); - skipStatement(); - // reportWarningSkipText(getLocator(), skipStatement()); + { + if (true) + return convertIdent(n.image.substring(1)); + } + throw new Error("Missing return statement in function"); + } - } finally { - if (start) { - documentHandler.endFontFace(); - } + final public String functionName() throws ParseException { + Token n; + n = jj_consume_token(FUNCTION); + label_40: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[56] = jj_gen; + break label_40; + } + jj_consume_token(S); + } + { + if (true) + return convertIdent(n.image.substring(0, n.image.length() - 1)); + } + throw new Error("Missing return statement in function"); } - } -/** - * @exception ParseException exception during the parse - */ - final public void atRuleDeclaration() throws ParseException { - Token n; - String ret; - n = jj_consume_token(ATKEYWORD); - ret=skipStatement(); - reportWarningSkipText(getLocator(), ret); - if ((ret != null) && (ret.charAt(0) == '@')) { - documentHandler.ignorableAtRule(ret); + /** + * @exception ParseException + * exception during the parse + */ + final public void styleRule() throws ParseException { + boolean start = false; + ArrayList<String> l = null; + Token save; + Locator loc; + try { + l = selectorList(); + save = token; + jj_consume_token(LBRACE); + label_41: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[57] = jj_gen; + break label_41; + } + jj_consume_token(S); + } + start = true; + documentHandler.startSelector(l); + label_42: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + case ANY: + case PARENT: + case DOT: + case COLON: + case EACH_VAR: + case INCLUDE_SYM: + case EACH_SYM: + case IF_SYM: + case EXTEND_SYM: + case MICROSOFT_RULE: + case IDENT: + case VARIABLE: + case HASH: + case MEDIA_SYM: + case REMOVE: + ; + break; + default: + jj_la1[58] = jj_gen; + break label_42; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IF_SYM: + ifDirective(); + break; + case REMOVE: + removeDirective(); + break; + case INCLUDE_SYM: + includeDirective(); + break; + case MEDIA_SYM: + media(); + break; + case EXTEND_SYM: + extendDirective(); + break; + case EACH_SYM: + eachDirective(); + break; + case VARIABLE: + variable(); + break; + default: + jj_la1[60] = jj_gen; + if (jj_2_1(3)) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case MICROSOFT_RULE: + microsoftExtension(); + break; + case IDENT: + declarationOrNestedProperties(); + break; + default: + jj_la1[59] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + case ANY: + case PARENT: + case DOT: + case COLON: + case EACH_VAR: + case IDENT: + case HASH: + styleRule(); + break; + default: + jj_la1[61] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } + } + jj_consume_token(RBRACE); + label_43: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[62] = jj_gen; + break label_43; + } + jj_consume_token(S); + } + } catch (ThrowedParseException e) { + if (errorHandler != null) { + LocatorImpl li = new LocatorImpl(this, + e.e.currentToken.next.beginLine, + e.e.currentToken.next.beginColumn - 1); + reportError(li, e.e); + } + } catch (ParseException e) { + reportError(getLocator(), e); + skipStatement(); + // reportWarningSkipText(getLocator(), skipStatement()); + + } catch (TokenMgrError e) { + reportWarningSkipText(getLocator(), skipStatement()); + } finally { + if (start) { + documentHandler.endSelector(); + } } - } - - final public void skipUnknownRule() throws ParseException { - Token n; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ATKEYWORD: - n = jj_consume_token(ATKEYWORD); - break; - case CDO: - n = jj_consume_token(CDO); - break; - case CHARSET_SYM: - n = jj_consume_token(CHARSET_SYM); - break; - case COMMA: - n = jj_consume_token(COMMA); - break; - case DASHMATCH: - n = jj_consume_token(DASHMATCH); - break; - case FONT_FACE_SYM: - n = jj_consume_token(FONT_FACE_SYM); - break; - case FUNCTION: - n = jj_consume_token(FUNCTION); - break; - case IMPORTANT_SYM: - n = jj_consume_token(IMPORTANT_SYM); - break; - case IMPORT_SYM: - n = jj_consume_token(IMPORT_SYM); - break; - case INCLUDES: - n = jj_consume_token(INCLUDES); - break; - case LBRACE: - n = jj_consume_token(LBRACE); - break; - case MEDIA_SYM: - n = jj_consume_token(MEDIA_SYM); - break; - case NONASCII: - n = jj_consume_token(NONASCII); - break; - case NUMBER: - n = jj_consume_token(NUMBER); - break; - case PAGE_SYM: - n = jj_consume_token(PAGE_SYM); - break; - case PERCENTAGE: - n = jj_consume_token(PERCENTAGE); - break; - case STRING: - n = jj_consume_token(STRING); - break; - case UNICODERANGE: - n = jj_consume_token(UNICODERANGE); - break; - case URL: - n = jj_consume_token(URL); - break; - case SEMICOLON: - n = jj_consume_token(SEMICOLON); - break; - case PLUS: - n = jj_consume_token(PLUS); - break; - case PRECEDES: - n = jj_consume_token(PRECEDES); - break; - case MINUS: - n = jj_consume_token(MINUS); - break; - case UNKNOWN: - n = jj_consume_token(UNKNOWN); - break; - default: - jj_la1[43] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - String ret; - Locator loc = getLocator(); - ret=skipStatement(); - reportWarningSkipText(loc, ret); - if ((ret != null) && (n.image.charAt(0) == '@')) { - documentHandler.ignorableAtRule(ret); - } - } + } -/** - * @exception ParseException exception during the parse - */ - final public char combinator() throws ParseException { -char connector = ' '; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - jj_consume_token(PLUS); - label_32: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[44] = jj_gen; - break label_32; - } - jj_consume_token(S); - } - {if (true) return '+';} - break; - case PRECEDES: - jj_consume_token(PRECEDES); - label_33: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[45] = jj_gen; - break label_33; - } - jj_consume_token(S); - } - {if (true) return '>';} - break; - case S: - jj_consume_token(S); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - case PRECEDES: - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - jj_consume_token(PLUS); - connector = '+'; - break; - case PRECEDES: - jj_consume_token(PRECEDES); - connector = '>'; - break; - default: - jj_la1[46] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); + final public ArrayList<String> selectorList() throws ParseException { + ArrayList<String> selectors = new ArrayList<String>(); + String selector; + selector = selector(); + label_44: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[63] = jj_gen; + break label_44; + } + jj_consume_token(COMMA); + label_45: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[64] = jj_gen; + break label_45; + } + jj_consume_token(S); + } + selectors.add(selector); + selector = selector(); } - label_34: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[47] = jj_gen; - break label_34; - } - jj_consume_token(S); - } - break; - default: - jj_la1[48] = jj_gen; - ; - } - {if (true) return connector;} - break; - default: - jj_la1[49] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - throw new Error("Missing return statement in function"); - } + selectors.add(selector); + { + if (true) + return selectors; + } + throw new Error("Missing return statement in function"); + } -/** - * @exception ParseException exception during the parse - */ - final public String property() throws ParseException { - Token n; - n = jj_consume_token(IDENT); - label_35: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[50] = jj_gen; - break label_35; - } - jj_consume_token(S); - } - {if (true) return convertIdent(n.image);} - throw new Error("Missing return statement in function"); - } - - final public String variableName() throws ParseException { - Token n; - n = jj_consume_token(VARIABLE); - label_36: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[51] = jj_gen; - break label_36; - } - jj_consume_token(S); - } - {if (true) return convertIdent(n.image.substring(1));} - throw new Error("Missing return statement in function"); - } - - final public String functionName() throws ParseException { - Token n; - n = jj_consume_token(FUNCTION); - label_37: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[52] = jj_gen; - break label_37; - } - jj_consume_token(S); - } - {if (true) return convertIdent(n.image.substring(0, n.image.length()-1));} - throw new Error("Missing return statement in function"); - } + /** + * @exception ParseException + * exception during the parse + */ + final public String selector() throws ParseException { + String selector; + char comb; + try { + selector = simple_selector(null, ' '); + label_46: while (true) { + if (jj_2_2(2)) { + ; + } else { + break label_46; + } + comb = combinator(); + selector = simple_selector(selector, comb); + } + label_47: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[65] = jj_gen; + break label_47; + } + jj_consume_token(S); + } + { + if (true) + return selector; + } + } catch (ParseException e) { + /* + * Token t = getToken(1); StringBuffer s = new StringBuffer(); + * s.append(getToken(0).image); while ((t.kind != COMMA) && (t.kind + * != SEMICOLON) && (t.kind != LBRACE) && (t.kind != EOF)) { + * s.append(t.image); getNextToken(); t = getToken(1); } + * reportWarningSkipText(getLocator(), s.toString()); + */ + Token t = getToken(1); + while ((t.kind != COMMA) && (t.kind != SEMICOLON) + && (t.kind != LBRACE) && (t.kind != EOF)) { + getNextToken(); + t = getToken(1); + } -/** - * @exception ParseException exception during the parse - */ - final public void styleRule() throws ParseException { - boolean start = false; - SelectorList l = null; - Token save; - Locator loc; - try { - l = selectorList(); - save = token; - jj_consume_token(LBRACE); - label_38: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[53] = jj_gen; - break label_38; - } - jj_consume_token(S); - } - start = true; - documentHandler.startSelector(l); - label_39: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: + { + if (true) + throw new ThrowedParseException(e); + } + } + throw new Error("Missing return statement in function"); + } + + /** + * @exception ParseException + * exception during the parse + */ + final public String simple_selector(String selector, char comb) + throws ParseException { + String simple_current = null; + String cond = null; + + pseudoElt = null; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case ANY: case PARENT: - case DOT: - case COLON: case EACH_VAR: - case INCLUDE_SYM: - case EACH_SYM: - case IF_SYM: - case EXTEND_SYM: case IDENT: - case VARIABLE: + simple_current = element_name(); + label_48: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + case DOT: + case COLON: + case HASH: + ; + break; + default: + jj_la1[66] = jj_gen; + break label_48; + } + 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[67] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; case HASH: - case MEDIA_SYM: - ; - break; - default: - jj_la1[54] = jj_gen; - break label_39; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IF_SYM: - ifDirective(); - break; - case INCLUDE_SYM: - includeDirective(); - break; - case MEDIA_SYM: - media(); - break; - case EXTEND_SYM: - extendDirective(); - break; - case EACH_SYM: - eachDirective(); - break; - case VARIABLE: - variable(); - break; + cond = hash(cond); + label_49: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + case DOT: + case COLON: + ; + break; + default: + jj_la1[68] = jj_gen; + break label_49; + } + 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[69] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + case DOT: + cond = _class(cond); + label_50: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + case DOT: + case COLON: + case HASH: + ; + break; + default: + jj_la1[70] = jj_gen; + break label_50; + } + 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[71] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + case COLON: + cond = pseudo(cond); + label_51: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + case DOT: + case COLON: + case HASH: + ; + break; + default: + jj_la1[72] = jj_gen; + break label_51; + } + 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[73] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + case LBRACKET: + cond = attrib(cond); + label_52: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + case DOT: + case COLON: + case HASH: + ; + break; + default: + jj_la1[74] = jj_gen; + break label_52; + } + 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[75] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; default: - jj_la1[55] = jj_gen; - if (jj_2_1(3)) { - declarationOrNestedProperties(); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case ANY: - case PARENT: - case DOT: - case COLON: + jj_la1[76] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + if (simple_current == null) { + simple_current = ""; + } + if (cond != null) { + simple_current = simple_current + cond; + } + if (selector != null) { + switch (comb) { + case ' ': + selector = selector + comb + simple_current; + break; + case '+': + selector = selector + " " + comb + " " + simple_current; + break; + case '>': + selector = selector + " " + comb + " " + simple_current; + break; + default: { + if (true) + throw new ParseException("invalid state. send a bug report"); + } + } + } else { + selector = simple_current; + } + if (pseudoElt != null) { + selector = selector + pseudoElt; + } + { + if (true) + return selector; + } + throw new Error("Missing return statement in function"); + } + + /** + * @exception ParseException + * exception during the parse + */ + final public String _class(String pred) throws ParseException { + Token t; + String s = "."; + jj_consume_token(DOT); + label_53: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + t = jj_consume_token(IDENT); + s += t.image; + break; + case EACH_VAR: + t = jj_consume_token(EACH_VAR); + s += t.image; + break; + default: + jj_la1[77] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case EACH_VAR: case IDENT: - case HASH: - styleRule(); - break; + ; + break; default: - jj_la1[56] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); + jj_la1[78] = jj_gen; + break label_53; } - } } - } - jj_consume_token(RBRACE); - label_40: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[57] = jj_gen; - break label_40; - } - jj_consume_token(S); - } - } catch (ThrowedParseException e) { - if (errorHandler != null) { - LocatorImpl li = new LocatorImpl(this, - e.e.currentToken.next.beginLine, - e.e.currentToken.next.beginColumn-1); - reportError(li, e.e); - } - } catch (ParseException e) { - reportError(getLocator(), e); - skipStatement(); - // reportWarningSkipText(getLocator(), skipStatement()); - - } catch (TokenMgrError e) { - reportWarningSkipText(getLocator(), skipStatement()); - } finally { - if (start) { - documentHandler.endSelector(l); - } - } - } - - final public SelectorList selectorList() throws ParseException { - SelectorListImpl selectors = new SelectorListImpl(); - Selector selector; - selector = selector(); - label_41: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[58] = jj_gen; - break label_41; - } - jj_consume_token(COMMA); - label_42: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[59] = jj_gen; - break label_42; + if (pred == null) { + { + if (true) + return s; + } + } else { + { + if (true) + return pred + s; + } } - jj_consume_token(S); - } - selectors.addSelector(selector); - selector = selector(); + throw new Error("Missing return statement in function"); } - selectors.addSelector(selector); - {if (true) return selectors;} - throw new Error("Missing return statement in function"); - } -/** - * @exception ParseException exception during the parse - */ - final public Selector selector() throws ParseException { - Selector selector; - char comb; - try { - selector = simple_selector(null, ' '); - label_43: - while (true) { - if (jj_2_2(2)) { - ; - } else { - break label_43; - } - comb = combinator(); - selector = simple_selector(selector, comb); - } - label_44: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[60] = jj_gen; - break label_44; - } - jj_consume_token(S); - } - {if (true) return selector;} - } catch (ParseException e) { - /* - Token t = getToken(1); - StringBuffer s = new StringBuffer(); - s.append(getToken(0).image); - while ((t.kind != COMMA) && (t.kind != SEMICOLON) - && (t.kind != LBRACE) && (t.kind != EOF)) { - s.append(t.image); - getNextToken(); - t = getToken(1); - } - reportWarningSkipText(getLocator(), s.toString()); + /** + * @exception ParseException + * exception during the parse */ - Token t = getToken(1); - while ((t.kind != COMMA) && (t.kind != SEMICOLON) - && (t.kind != LBRACE) && (t.kind != EOF)) { - getNextToken(); - t = getToken(1); - } - - {if (true) throw new ThrowedParseException(e);} - } - throw new Error("Missing return statement in function"); - } - -/** - * @exception ParseException exception during the parse - */ - final public Selector simple_selector(Selector selector, char comb) throws ParseException { - SimpleSelector simple_current = null; - Condition cond = null; - - pseudoElt = null; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ANY: - case PARENT: - case EACH_VAR: - case IDENT: - simple_current = element_name(); - label_45: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case DOT: - case COLON: - case HASH: - ; - break; - default: - jj_la1[61] = jj_gen; - break label_45; - } - 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[62] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - case HASH: - cond = hash(cond); - label_46: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case DOT: - case COLON: - ; - break; - default: - jj_la1[63] = jj_gen; - break label_46; - } - 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[64] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - case DOT: - cond = _class(cond); - label_47: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case DOT: - case COLON: - case HASH: - ; - break; + final public String element_name() throws ParseException { + Token t; + String s = ""; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case EACH_VAR: + case IDENT: + label_54: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + t = jj_consume_token(IDENT); + s += t.image; + break; + case EACH_VAR: + t = jj_consume_token(EACH_VAR); + s += t.image; + break; + default: + jj_la1[79] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case EACH_VAR: + case IDENT: + ; + break; + default: + jj_la1[80] = jj_gen; + break label_54; + } + } + { + if (true) + return s; + } + break; + case ANY: + jj_consume_token(ANY); + { + if (true) + return "*"; + } + break; + case PARENT: + jj_consume_token(PARENT); + { + if (true) + return "&"; + } + break; default: - jj_la1[65] = jj_gen; - break label_47; + jj_la1[81] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); } - 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[66] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - case COLON: - cond = pseudo(cond); - label_48: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case DOT: - case COLON: - case HASH: - ; - break; - default: - jj_la1[67] = jj_gen; - break label_48; + throw new Error("Missing return statement in function"); + } + + /** + * @exception ParseException + * exception during the parse + */ + final public String attrib(String pred) throws ParseException { + int cases = 0; + Token att = null; + Token val = null; + String attValue = null; + jj_consume_token(LBRACKET); + label_55: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[82] = jj_gen; + break label_55; + } + jj_consume_token(S); } - 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[68] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - case LBRACKET: - cond = attrib(cond); - label_49: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case DOT: - case COLON: - case HASH: - ; - break; - default: - jj_la1[69] = jj_gen; - break label_49; + att = jj_consume_token(IDENT); + label_56: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[83] = jj_gen; + break label_56; + } + jj_consume_token(S); } - 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[70] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - default: - jj_la1[71] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - if (simple_current == null) { - simple_current = selectorFactory.createElementSelector(null, null); - } - if (cond != null) { - simple_current = selectorFactory.createConditionalSelector(simple_current, - cond); - } - if (selector != null) { - switch (comb) { - case ' ': - selector = selectorFactory.createDescendantSelector(selector, - simple_current); - break; - case '+': - selector = - selectorFactory.createDirectAdjacentSelector((short) 1, - selector, - simple_current); - break; - case '>': - selector = selectorFactory.createChildSelector(selector, - simple_current); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case DASHMATCH: + case INCLUDES: + case EQ: + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case EQ: + jj_consume_token(EQ); + cases = 1; + break; + case INCLUDES: + jj_consume_token(INCLUDES); + cases = 2; + break; + case DASHMATCH: + jj_consume_token(DASHMATCH); + cases = 3; + break; + default: + jj_la1[84] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_57: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; break; default: - {if (true) throw new ParseException("invalid state. send a bug report");} + jj_la1[85] = jj_gen; + break label_57; } - } else { - selector= simple_current; + jj_consume_token(S); } - if (pseudoElt != null) { - selector = selectorFactory.createChildSelector(selector, - selectorFactory.createPseudoElementSelector(null, pseudoElt)); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + val = jj_consume_token(IDENT); + attValue = val.image; + break; + case STRING: + val = jj_consume_token(STRING); + attValue = val.image; + break; + default: + jj_la1[86] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); } - {if (true) return selector;} - throw new Error("Missing return statement in function"); - } - -/** - * @exception ParseException exception during the parse - */ - final public Condition _class(Condition pred) throws ParseException { - Token t; -String s = ""; -Condition c; - jj_consume_token(DOT); - label_50: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - t = jj_consume_token(IDENT); - s += t.image; - break; - case EACH_VAR: - t = jj_consume_token(EACH_VAR); - s += t.image; - break; - default: - jj_la1[72] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case EACH_VAR: - case IDENT: - ; - break; - default: - jj_la1[73] = jj_gen; - break label_50; - } - } - c = conditionFactory.createClassCondition(null, s); - if (pred == null) { - {if (true) return c;} - } else { - {if (true) return conditionFactory.createAndCondition(pred, c);} - } - throw new Error("Missing return statement in function"); - } - -/** - * @exception ParseException exception during the parse - */ - final public SimpleSelector element_name() throws ParseException { - Token t; String s = ""; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case EACH_VAR: - case IDENT: - label_51: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - t = jj_consume_token(IDENT); - s += t.image; - break; - case EACH_VAR: - t = jj_consume_token(EACH_VAR); - s += t.image; - break; + label_58: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[87] = jj_gen; + break label_58; + } + jj_consume_token(S); + } + break; default: - jj_la1[74] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); + jj_la1[88] = jj_gen; + ; } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case EACH_VAR: - case IDENT: - ; - break; + jj_consume_token(RBRACKET); + String name = convertIdent(att.image); + String c; + switch (cases) { + case 0: + c = name; + break; + case 1: + c = name + "=" + attValue; + break; + case 2: + c = name + "~=" + attValue; + break; + case 3: + c = name + "|=" + attValue; + break; default: - jj_la1[75] = jj_gen; - break label_51; - } - } - {if (true) return selectorFactory.createElementSelector(null, s);} - break; - case ANY: - jj_consume_token(ANY); - {if (true) return selectorFactory.createElementSelector(null, "*");} - break; - case PARENT: - jj_consume_token(PARENT); - {if (true) return selectorFactory.createElementSelector(null, "&");} - break; - default: - jj_la1[76] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - throw new Error("Missing return statement in function"); - } + // never reached. + c = null; + } + c = "[" + c + "]"; + if (pred == null) { + { + if (true) + return c; + } + } else { + { + if (true) + return pred + c; + } + } + throw new Error("Missing return statement in function"); + } -/** - * @exception ParseException exception during the parse - */ - final public Condition attrib(Condition pred) throws ParseException { - int cases = 0; - Token att = null; - Token val = null; - String attValue = null; - jj_consume_token(LBRACKET); - label_52: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[77] = jj_gen; - break label_52; - } - jj_consume_token(S); - } - att = jj_consume_token(IDENT); - label_53: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[78] = jj_gen; - break label_53; - } - jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case DASHMATCH: - case INCLUDES: - case EQ: - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case EQ: - jj_consume_token(EQ); - cases = 1; - break; - case INCLUDES: - jj_consume_token(INCLUDES); - cases = 2; - break; - case DASHMATCH: - jj_consume_token(DASHMATCH); - cases = 3; - break; - default: - jj_la1[79] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - label_54: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[80] = jj_gen; - break label_54; - } - jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - val = jj_consume_token(IDENT); - attValue = val.image; - break; - case STRING: - val = jj_consume_token(STRING); - attValue = convertStringIndex(val.image, 1, - val.image.length() -1); - break; - default: - jj_la1[81] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - label_55: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; + /** + * @exception ParseException + * exception during the parse + */ + final public String pseudo(String pred) throws ParseException { + Token n; + Token language; + boolean isPseudoElement = false; + jj_consume_token(COLON); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COLON: + jj_consume_token(COLON); + isPseudoElement = true; + break; default: - jj_la1[82] = jj_gen; - break label_55; - } - jj_consume_token(S); - } - break; - default: - jj_la1[83] = jj_gen; - ; - } - jj_consume_token(RBRACKET); - String name = convertIdent(att.image); - Condition c; - switch (cases) { - case 0: - c = conditionFactory.createAttributeCondition(name, null, false, null); - break; - case 1: - c = conditionFactory.createAttributeCondition(name, null, false, - attValue); - break; - case 2: - c = conditionFactory.createOneOfAttributeCondition(name, null, false, - attValue); - break; - case 3: - c = conditionFactory.createBeginHyphenAttributeCondition(name, null, - false, - attValue); - break; - default: - // never reached. - c = null; - } - if (pred == null) { - {if (true) return c;} - } else { - {if (true) return conditionFactory.createAndCondition(pred, c);} - } - throw new Error("Missing return statement in function"); - } - -/** - * @exception ParseException exception during the parse - */ - final public Condition pseudo(Condition pred) throws ParseException { - Token n; -Token language; -boolean isPseudoElement = false; - jj_consume_token(COLON); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COLON: - jj_consume_token(COLON); - isPseudoElement=true; - break; - default: - jj_la1[84] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - n = jj_consume_token(IDENT); - String s = convertIdent(n.image); + jj_la1[89] = jj_gen; + ; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + n = jj_consume_token(IDENT); + String s = ":" + convertIdent(n.image); if (isPseudoElement) { if (pseudoElt != null) { - {if (true) throw new CSSParseException("duplicate pseudo element definition " - + s, getLocator());} + { + if (true) + throw new CSSParseException( + "duplicate pseudo element definition " + s, + getLocator()); + } } else { - pseudoElt = s; - {if (true) return pred;} + pseudoElt = ":" + s; + { + if (true) + return pred; + } } } else { - Condition c = - conditionFactory.createPseudoClassCondition(null, s); + String c = s; if (pred == null) { - {if (true) return c;} + { + if (true) + return c; + } } else { - {if (true) return conditionFactory.createAndCondition(pred, c);} + { + if (true) + return pred + c; + } } } - break; - case FUNCTION: - n = jj_consume_token(FUNCTION); - label_56: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[85] = jj_gen; - break label_56; - } - jj_consume_token(S); - } - language = jj_consume_token(IDENT); - label_57: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; + break; + case FUNCTION: + n = jj_consume_token(FUNCTION); + label_59: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[90] = jj_gen; + break label_59; + } + jj_consume_token(S); + } + language = jj_consume_token(IDENT); + label_60: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[91] = jj_gen; + break label_60; + } + jj_consume_token(S); + } + jj_consume_token(RPARAN); + String f = convertIdent(n.image); + if (f.equals("lang(")) { + String d = convertIdent(language.image); + if (pred == null) { + { + if (true) + return d; + } + } else { + { + if (true) + return pred + d; + } + } + } else { + { + if (true) + throw new CSSParseException( + "invalid pseudo function name " + f, + getLocator()); + } + } + break; default: - jj_la1[86] = jj_gen; - break label_57; - } - jj_consume_token(S); - } - jj_consume_token(RPARAN); - String f = convertIdent(n.image); - if (f.equals("lang(")) { - Condition d = - conditionFactory.createLangCondition(convertIdent(language.image)); - if (pred == null) { - {if (true) return d;} - } else { - {if (true) return conditionFactory.createAndCondition(pred, d);} - } - } else { - {if (true) throw new CSSParseException("invalid pseudo function name " - + f, getLocator());} - } - break; - default: - jj_la1[87] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - throw new Error("Missing return statement in function"); - } + jj_la1[92] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + throw new Error("Missing return statement in function"); + } -/** - * @exception ParseException exception during the parse - */ - final public Condition hash(Condition pred) throws ParseException { - Token n; - n = jj_consume_token(HASH); - Condition d = - conditionFactory.createIdCondition(n.image.substring(1)); - if (pred == null) { - {if (true) return d;} - } else { - {if (true) return conditionFactory.createAndCondition(pred, d);} - } - throw new Error("Missing return statement in function"); - } - - final public void variable() throws ParseException { + /** + * @exception ParseException + * exception during the parse + */ + final public String hash(String pred) throws ParseException { + Token n; + n = jj_consume_token(HASH); + String d = n.image; + if (pred == null) { + { + if (true) + return d; + } + } else { + { + if (true) + return pred + d; + } + } + throw new Error("Missing return statement in function"); + } + + final public void variable() throws ParseException { String name; - LexicalUnit exp = null; + LexicalUnitImpl exp = null; boolean guarded = false; String raw; - try { - name = variableName(); - jj_consume_token(COLON); - label_58: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[88] = jj_gen; - break label_58; - } - jj_consume_token(S); - } - exp = expr(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case GUARDED_SYM: - guarded = guarded(); - break; - default: - jj_la1[89] = jj_gen; - ; - } - label_59: - while (true) { - jj_consume_token(SEMICOLON); - label_60: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[90] = jj_gen; - break label_60; - } - jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SEMICOLON: - ; - break; - default: - jj_la1[91] = jj_gen; - break label_59; - } - } - documentHandler.variable(name, exp, guarded); - } catch (JumpException e) { + try { + name = variableName(); + jj_consume_token(COLON); + label_61: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[93] = jj_gen; + break label_61; + } + jj_consume_token(S); + } + exp = expr(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case GUARDED_SYM: + guarded = guarded(); + break; + default: + jj_la1[94] = jj_gen; + ; + } + label_62: while (true) { + jj_consume_token(SEMICOLON); + label_63: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[95] = jj_gen; + break label_63; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case SEMICOLON: + ; + break; + default: + jj_la1[96] = jj_gen; + break label_62; + } + } + documentHandler.variable(name, exp, guarded); + } catch (JumpException e) { skipAfterExpression(); - } catch (NumberFormatException e) { + } catch (NumberFormatException e) { if (errorHandler != null) { errorHandler.error(new CSSParseException("Invalid number " - + e.getMessage(), - getLocator(), - e)); + + e.getMessage(), getLocator(), e)); } reportWarningSkipText(getLocator(), skipAfterExpression()); - } catch (ParseException e) { + } catch (ParseException e) { if (errorHandler != null) { if (e.currentToken != null) { - LocatorImpl li = new LocatorImpl(this, - e.currentToken.next.beginLine, - e.currentToken.next.beginColumn-1); - reportError(li, e); + LocatorImpl li = new LocatorImpl(this, + e.currentToken.next.beginLine, + e.currentToken.next.beginColumn - 1); + reportError(li, e); } else { - reportError(getLocator(), e); - } + reportError(getLocator(), e); + } skipAfterExpression(); } else { skipAfterExpression(); } + } } - } - - final public void ifDirective() throws ParseException { - Token n = null; - String evaluator = ""; - jj_consume_token(IF_SYM); - label_61: - while (true) { - n = booleanExpressionToken(); - evaluator += n.image; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - case EQ: - case PLUS: - case MINUS: - case PRECEDES: - case SUCCEEDS: - case DIV: - case ANY: - case LPARAN: - case RPARAN: - case COMPARE: - case OR: - case AND: - case NOT_EQ: - case IDENT: - case NUMBER: - case VARIABLE: - ; - break; - default: - jj_la1[92] = jj_gen; - break label_61; - } - } - jj_consume_token(LBRACE); - label_62: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[93] = jj_gen; - break label_62; - } - jj_consume_token(S); - } - documentHandler.startIfElseDirective(); - documentHandler.ifDirective(evaluator); - label_63: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case ANY: - case PARENT: - case DOT: - case COLON: - case EACH_VAR: - case INCLUDE_SYM: - case EXTEND_SYM: - case IDENT: - case VARIABLE: - case HASH: - case MEDIA_SYM: - ; - break; - default: - jj_la1[94] = jj_gen; - break label_63; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INCLUDE_SYM: - includeDirective(); - break; - case MEDIA_SYM: - media(); - break; - case EXTEND_SYM: - extendDirective(); - break; - case VARIABLE: - variable(); - break; - default: - jj_la1[95] = jj_gen; - if (jj_2_3(3)) { - declarationOrNestedProperties(); + + final public void ifDirective() throws ParseException { + Token n = null; + String evaluator = ""; + jj_consume_token(IF_SYM); + label_64: while (true) { + n = booleanExpressionToken(); + evaluator += n.image; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + case EQ: + case PLUS: + case MINUS: + case PRECEDES: + case SUCCEEDS: + case DIV: + case ANY: + case LPARAN: + case RPARAN: + case COMPARE: + case OR: + case AND: + case NOT_EQ: + case IDENT: + case NUMBER: + case VARIABLE: + ; + break; + default: + jj_la1[97] = jj_gen; + break label_64; + } + } + jj_consume_token(LBRACE); + label_65: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[98] = jj_gen; + break label_65; + } + jj_consume_token(S); + } + documentHandler.startIfElseDirective(); + documentHandler.ifDirective(evaluator); + label_66: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + case ANY: + case PARENT: + case DOT: + case COLON: + case EACH_VAR: + case INCLUDE_SYM: + case EXTEND_SYM: + case IDENT: + case VARIABLE: + case HASH: + case MEDIA_SYM: + ; + break; + default: + jj_la1[99] = jj_gen; + break label_66; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case INCLUDE_SYM: + includeDirective(); + break; + case MEDIA_SYM: + media(); + break; + case EXTEND_SYM: + extendDirective(); + break; + case VARIABLE: + variable(); + break; + default: + jj_la1[100] = jj_gen; + if (jj_2_3(3)) { + declarationOrNestedProperties(); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + case ANY: + case PARENT: + case DOT: + case COLON: + case EACH_VAR: + case IDENT: + case HASH: + styleRule(); + break; + default: + jj_la1[101] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } + } + jj_consume_token(RBRACE); + label_67: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[102] = jj_gen; + break label_67; + } + jj_consume_token(S); + } + label_68: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ELSE_SYM: + ; + break; + default: + jj_la1[103] = jj_gen; + break label_68; + } + elseDirective(); + } + documentHandler.endIfElseDirective(); + } + + final public void elseDirective() throws ParseException { + String evaluator = ""; + Token n = null; + jj_consume_token(ELSE_SYM); + label_69: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[104] = jj_gen; + break label_69; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IF: + jj_consume_token(IF); + label_70: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + case EQ: + case PLUS: + case MINUS: + case PRECEDES: + case SUCCEEDS: + case DIV: + case ANY: + case LPARAN: + case RPARAN: + case COMPARE: + case OR: + case AND: + case NOT_EQ: + case IDENT: + case NUMBER: + case VARIABLE: + ; + break; + default: + jj_la1[105] = jj_gen; + break label_70; + } + n = booleanExpressionToken(); + if (n != null) + evaluator += n.image; + } + break; + default: + jj_la1[106] = jj_gen; + ; + } + jj_consume_token(LBRACE); + label_71: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[107] = jj_gen; + break label_71; + } + jj_consume_token(S); + } + if (!evaluator.trim().equals("")) { + documentHandler.ifDirective(evaluator); } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case ANY: - case PARENT: - case DOT: - case COLON: - case EACH_VAR: - case IDENT: - case HASH: - styleRule(); + documentHandler.elseDirective(); + } + label_72: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + case ANY: + case PARENT: + case DOT: + case COLON: + case EACH_VAR: + case INCLUDE_SYM: + case EXTEND_SYM: + case IDENT: + case VARIABLE: + case HASH: + case MEDIA_SYM: + ; + break; + default: + jj_la1[108] = jj_gen; + break label_72; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case INCLUDE_SYM: + includeDirective(); + break; + case MEDIA_SYM: + media(); + break; + case EXTEND_SYM: + extendDirective(); + break; + case VARIABLE: + variable(); + break; + default: + jj_la1[109] = jj_gen; + if (jj_2_4(3)) { + declarationOrNestedProperties(); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + case ANY: + case PARENT: + case DOT: + case COLON: + case EACH_VAR: + case IDENT: + case HASH: + styleRule(); + break; + default: + jj_la1[110] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } + } + jj_consume_token(RBRACE); + label_73: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[111] = jj_gen; + break label_73; + } + jj_consume_token(S); + } + } + + final public Token booleanExpressionToken() throws ParseException { + Token n = null; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case VARIABLE: + n = jj_consume_token(VARIABLE); + break; + case IDENT: + n = jj_consume_token(IDENT); + break; + case NUMBER: + n = jj_consume_token(NUMBER); + break; + case LPARAN: + n = jj_consume_token(LPARAN); + break; + case RPARAN: + n = jj_consume_token(RPARAN); break; - default: - jj_la1[96] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - } - jj_consume_token(RBRACE); - label_64: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[97] = jj_gen; - break label_64; - } - jj_consume_token(S); - } - label_65: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ELSE_SYM: - ; - break; - default: - jj_la1[98] = jj_gen; - break label_65; - } - elseDirective(); - } - documentHandler.endIfElseDirective(); - } - - final public void elseDirective() throws ParseException { - String evaluator = ""; - Token n = null; - jj_consume_token(ELSE_SYM); - label_66: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[99] = jj_gen; - break label_66; - } - jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IF: - jj_consume_token(IF); - label_67: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - case EQ: case PLUS: + n = jj_consume_token(PLUS); + break; case MINUS: - case PRECEDES: - case SUCCEEDS: + n = jj_consume_token(MINUS); + break; case DIV: + n = jj_consume_token(DIV); + break; case ANY: - case LPARAN: - case RPARAN: + n = jj_consume_token(ANY); + break; case COMPARE: + n = jj_consume_token(COMPARE); + break; + case EQ: + n = jj_consume_token(EQ); + break; + case PRECEDES: + n = jj_consume_token(PRECEDES); + break; + case SUCCEEDS: + n = jj_consume_token(SUCCEEDS); + break; case OR: + n = jj_consume_token(OR); + break; case AND: + n = jj_consume_token(AND); + break; + case S: + n = jj_consume_token(S); + break; case NOT_EQ: - case IDENT: - case NUMBER: - case VARIABLE: - ; - break; - default: - jj_la1[100] = jj_gen; - break label_67; - } - n = booleanExpressionToken(); - if(n != null) evaluator += n.image; - } - break; - default: - jj_la1[101] = jj_gen; - ; - } - jj_consume_token(LBRACE); - label_68: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[102] = jj_gen; - break label_68; - } - jj_consume_token(S); - } - if(!evaluator.trim().equals("")){ documentHandler.ifDirective(evaluator); } - else{ documentHandler.elseDirective(); } - label_69: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case ANY: - case PARENT: - case DOT: - case COLON: - case EACH_VAR: - case INCLUDE_SYM: - case EXTEND_SYM: - case IDENT: - case VARIABLE: - case HASH: - case MEDIA_SYM: - ; - break; - default: - jj_la1[103] = jj_gen; - break label_69; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INCLUDE_SYM: - includeDirective(); - break; - case MEDIA_SYM: - media(); - break; - case EXTEND_SYM: - extendDirective(); - break; - case VARIABLE: - variable(); - break; - default: - jj_la1[104] = jj_gen; - if (jj_2_4(3)) { - declarationOrNestedProperties(); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case ANY: - case PARENT: - case DOT: - case COLON: - case EACH_VAR: - case IDENT: - case HASH: - styleRule(); + n = jj_consume_token(NOT_EQ); break; - default: - jj_la1[105] = jj_gen; + default: + jj_la1[112] = jj_gen; jj_consume_token(-1); throw new ParseException(); - } - } - } - } - jj_consume_token(RBRACE); - label_70: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[106] = jj_gen; - break label_70; - } - jj_consume_token(S); - } - } - - final public Token booleanExpressionToken() throws ParseException { - Token n = null; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case VARIABLE: - n = jj_consume_token(VARIABLE); - break; - case IDENT: - n = jj_consume_token(IDENT); - break; - case NUMBER: - n = jj_consume_token(NUMBER); - break; - case LPARAN: - n = jj_consume_token(LPARAN); - break; - case RPARAN: - n = jj_consume_token(RPARAN); - break; - case PLUS: - n = jj_consume_token(PLUS); - break; - case MINUS: - n = jj_consume_token(MINUS); - break; - case DIV: - n = jj_consume_token(DIV); - break; - case ANY: - n = jj_consume_token(ANY); - break; - case COMPARE: - n = jj_consume_token(COMPARE); - break; - case EQ: - n = jj_consume_token(EQ); - break; - case PRECEDES: - n = jj_consume_token(PRECEDES); - break; - case SUCCEEDS: - n = jj_consume_token(SUCCEEDS); - break; - case OR: - n = jj_consume_token(OR); - break; - case AND: - n = jj_consume_token(AND); - break; - case S: - n = jj_consume_token(S); - break; - case NOT_EQ: - n = jj_consume_token(NOT_EQ); - break; - default: - jj_la1[107] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return n;} - throw new Error("Missing return statement in function"); - } - - final public void eachDirective() throws ParseException { - Token var; - ArrayList<String> list; - jj_consume_token(EACH_SYM); - label_71: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[108] = jj_gen; - break label_71; - } - jj_consume_token(S); - } - var = jj_consume_token(VARIABLE); - label_72: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[109] = jj_gen; - break label_72; - } - jj_consume_token(S); - } - jj_consume_token(EACH_IN); - label_73: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[110] = jj_gen; - break label_73; - } - jj_consume_token(S); - } - list = stringList(); - jj_consume_token(LBRACE); - label_74: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[111] = jj_gen; - break label_74; - } - jj_consume_token(S); - } - documentHandler.startEachDirective(var.image, list); - label_75: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case ANY: - case PARENT: - case DOT: - case COLON: - case EACH_VAR: - case INCLUDE_SYM: - case EXTEND_SYM: - case IDENT: - case VARIABLE: - case HASH: - case MEDIA_SYM: - ; - break; - default: - jj_la1[112] = jj_gen; - break label_75; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INCLUDE_SYM: - includeDirective(); - break; - case MEDIA_SYM: - media(); - break; - case EXTEND_SYM: - extendDirective(); - break; - case VARIABLE: - variable(); - break; - default: - jj_la1[113] = jj_gen; - if (jj_2_5(3)) { - declarationOrNestedProperties(); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case ANY: - case PARENT: - case DOT: - case COLON: - case EACH_VAR: - case IDENT: - case HASH: - styleRule(); + } + { + if (true) + return n; + } + throw new Error("Missing return statement in function"); + } + + final public void eachDirective() throws ParseException { + Token var; + ArrayList<String> list = null; + String listVariable = null; + jj_consume_token(EACH_SYM); + label_74: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[113] = jj_gen; + break label_74; + } + jj_consume_token(S); + } + var = jj_consume_token(VARIABLE); + label_75: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[114] = jj_gen; + break label_75; + } + jj_consume_token(S); + } + jj_consume_token(EACH_IN); + label_76: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[115] = jj_gen; + break label_76; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + list = stringList(); + documentHandler.startEachDirective(var.image, list); + break; + case REMOVE: + documentHandler.startEachDirective(var.image, list); + removeDirective(); + break; + case VARIABLE: + listVariable = variableName(); + documentHandler.startEachDirective(var.image, listVariable); break; - default: - jj_la1[114] = jj_gen; + default: + jj_la1[116] = jj_gen; jj_consume_token(-1); throw new ParseException(); - } - } - } - } - jj_consume_token(RBRACE); - label_76: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[115] = jj_gen; - break label_76; - } - jj_consume_token(S); - } - documentHandler.endEachDirective(); - } - - final public ArrayList<String > stringList() throws ParseException { - ArrayList<String > strings = new ArrayList<String >(); + } + jj_consume_token(LBRACE); + label_77: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[117] = jj_gen; + break label_77; + } + jj_consume_token(S); + } + label_78: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + case ANY: + case PARENT: + case DOT: + case COLON: + case EACH_VAR: + case INCLUDE_SYM: + case EXTEND_SYM: + case IDENT: + case VARIABLE: + case HASH: + case MEDIA_SYM: + case REMOVE: + ; + break; + default: + jj_la1[118] = jj_gen; + break label_78; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case INCLUDE_SYM: + includeDirective(); + break; + case REMOVE: + removeDirective(); + break; + case MEDIA_SYM: + media(); + break; + case EXTEND_SYM: + extendDirective(); + break; + case VARIABLE: + variable(); + break; + default: + jj_la1[119] = jj_gen; + if (jj_2_5(3)) { + declarationOrNestedProperties(); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + case ANY: + case PARENT: + case DOT: + case COLON: + case EACH_VAR: + case IDENT: + case HASH: + styleRule(); + break; + default: + jj_la1[120] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } + } + jj_consume_token(RBRACE); + label_79: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[121] = jj_gen; + break label_79; + } + jj_consume_token(S); + } + documentHandler.endEachDirective(); + } + + final public ArrayList<String> stringList() throws ParseException { + ArrayList<String> strings = new ArrayList<String>(); Token input; - input = jj_consume_token(IDENT); - label_77: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[116] = jj_gen; - break label_77; - } - jj_consume_token(S); - } - strings.add(input.image); - label_78: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[117] = jj_gen; - break label_78; - } - jj_consume_token(COMMA); - label_79: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[118] = jj_gen; - break label_79; - } - jj_consume_token(S); - } - input = jj_consume_token(IDENT); - strings.add(input.image); - label_80: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[119] = jj_gen; - break label_80; - } - jj_consume_token(S); - } - } - {if (true) return strings;} - throw new Error("Missing return statement in function"); - } - - final public void mixinDirective() throws ParseException { - String name; - ArrayList<VariableNode> args = null; - String body; - jj_consume_token(MIXIN_SYM); - label_81: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[120] = jj_gen; - break label_81; - } - jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - name = property(); - break; - case FUNCTION: - name = functionName(); - args = arglist(); - jj_consume_token(RPARAN); - label_82: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[121] = jj_gen; - break label_82; - } - jj_consume_token(S); - } - break; - default: - jj_la1[122] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(LBRACE); - label_83: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[123] = jj_gen; - break label_83; - } - jj_consume_token(S); - } - documentHandler.startMixinDirective(name, args); - label_84: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case ANY: - case PARENT: - case DOT: - case COLON: - case EACH_VAR: - case INCLUDE_SYM: - case EXTEND_SYM: - case IDENT: - case VARIABLE: - case HASH: - case MEDIA_SYM: - ; - break; - default: - jj_la1[124] = jj_gen; - break label_84; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INCLUDE_SYM: - includeDirective(); - break; - case MEDIA_SYM: - media(); - break; - case EXTEND_SYM: - extendDirective(); - break; - case VARIABLE: - variable(); - break; - default: - jj_la1[125] = jj_gen; - if (jj_2_6(3)) { - declarationOrNestedProperties(); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACKET: - case ANY: - case PARENT: - case DOT: - case COLON: - case EACH_VAR: - case IDENT: - case HASH: - styleRule(); + input = jj_consume_token(IDENT); + label_80: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[122] = jj_gen; + break label_80; + } + jj_consume_token(S); + } + strings.add(input.image); + label_81: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[123] = jj_gen; + break label_81; + } + jj_consume_token(COMMA); + label_82: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[124] = jj_gen; + break label_82; + } + jj_consume_token(S); + } + input = jj_consume_token(IDENT); + strings.add(input.image); + label_83: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[125] = jj_gen; + break label_83; + } + jj_consume_token(S); + } + } + { + if (true) + return strings; + } + throw new Error("Missing return statement in function"); + } + + final public void mixinDirective() throws ParseException { + String name; + ArrayList<VariableNode> args = null; + String body; + jj_consume_token(MIXIN_SYM); + label_84: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[126] = jj_gen; + break label_84; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + name = property(); + break; + case FUNCTION: + name = functionName(); + args = arglist(); + jj_consume_token(RPARAN); + label_85: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[127] = jj_gen; + break label_85; + } + jj_consume_token(S); + } break; - default: - jj_la1[126] = jj_gen; + default: + jj_la1[128] = jj_gen; jj_consume_token(-1); throw new ParseException(); - } - } - } - } - jj_consume_token(RBRACE); - label_85: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[127] = jj_gen; - break label_85; - } - jj_consume_token(S); - } - documentHandler.endMixinDirective(name, args); - } - - final public ArrayList<VariableNode> arglist() throws ParseException { - ArrayList<VariableNode> args = new ArrayList<VariableNode>(); - VariableNode arg; - arg = mixinArg(); - label_86: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[128] = jj_gen; - break label_86; - } - jj_consume_token(COMMA); - label_87: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[129] = jj_gen; - break label_87; - } - jj_consume_token(S); - } - args.add(arg); - arg = mixinArg(); - } - args.add(arg); - {if (true) return args;} - throw new Error("Missing return statement in function"); - } - - final public VariableNode mixinArg() throws ParseException { - String name; - LexicalUnit value = null; - name = variableName(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COLON: - jj_consume_token(COLON); - label_88: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[130] = jj_gen; - break label_88; - } - jj_consume_token(S); - } - value = term(null); - break; - default: - jj_la1[131] = jj_gen; - ; - } - VariableNode arg = new VariableNode(name, value, false); - {if (true) return arg;} - throw new Error("Missing return statement in function"); - } - - final public ArrayList<LexicalUnit> argValuelist() throws ParseException { - ArrayList<LexicalUnit> args = new ArrayList<LexicalUnit>(); - LexicalUnit argValue; - argValue = term(null); - args.add(argValue); - label_89: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[132] = jj_gen; - break label_89; - } - jj_consume_token(COMMA); - label_90: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[133] = jj_gen; - break label_90; - } - jj_consume_token(S); - } - argValue = term(null); - args.add(argValue); - } - {if (true) return args;} - throw new Error("Missing return statement in function"); - } - - final public void includeDirective() throws ParseException { - String name; - ArrayList<LexicalUnit> args=null; - jj_consume_token(INCLUDE_SYM); - label_91: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[134] = jj_gen; - break label_91; - } - jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - name = property(); - break; - case FUNCTION: - name = functionName(); - args = argValuelist(); - jj_consume_token(RPARAN); - break; - default: - jj_la1[135] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - label_92: - while (true) { - jj_consume_token(SEMICOLON); - label_93: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[136] = jj_gen; - break label_93; - } - jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SEMICOLON: - ; - break; - default: - jj_la1[137] = jj_gen; - break label_92; - } - } - documentHandler.includeDirective(name, args); - } - - final public Node functionDirective() throws ParseException { - String name; - String args = null; - String body; - int[] stops = {RPARAN}; - name = functionName(); - args = skipStatementUntilRightParan(); - jj_consume_token(RPARAN); - label_94: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[138] = jj_gen; - break label_94; - } - jj_consume_token(S); - } - body = skipStatement(); - {if (true) return null;} - throw new Error("Missing return statement in function"); - } - - final public Node returnDirective() throws ParseException { - String raw; - raw = skipStatement(); - {if (true) return null;} - throw new Error("Missing return statement in function"); - } - - void debugDirective() throws ParseException { - } - - void warnDirective() throws ParseException { - } - - final public Node forDirective() throws ParseException { - String var; - String from; - String to; - boolean exclusive; - String body; - Token tok; - var = variableName(); - int[] toThrough = {TO, THROUGH}; - from = skipStatementUntil(toThrough); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case TO: - tok = jj_consume_token(TO); - exclusive = true; - break; - case THROUGH: - tok = jj_consume_token(THROUGH); - exclusive = false; - break; - default: - jj_la1[139] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - to = skipStatementUntilLeftBrace(); - label_95: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[140] = jj_gen; - break label_95; - } - jj_consume_token(S); - } - body = skipStatement(); - {if (true) return documentHandler.forDirective(var, from, to, exclusive, body);} - throw new Error("Missing return statement in function"); - } - - final public Node whileDirective() throws ParseException { - String condition; - String body; - condition = skipStatementUntilLeftBrace(); - body = skipStatement(); - {if (true) return documentHandler.whileDirective(condition, body);} - throw new Error("Missing return statement in function"); - } - - final public void extendDirective() throws ParseException { - SelectorList list; - jj_consume_token(EXTEND_SYM); - label_96: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[141] = jj_gen; - break label_96; - } - jj_consume_token(S); - } - list = selectorList(); - label_97: - while (true) { - jj_consume_token(SEMICOLON); - label_98: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[142] = jj_gen; - break label_98; - } - jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SEMICOLON: - ; - break; - default: - jj_la1[143] = jj_gen; - break label_97; - } - } - documentHandler.extendDirective(list); - } - - Node importDirective() throws ParseException { - return null; - } - - Node charsetDirective() throws ParseException { - return null; - } - - Node mozDocumentDirective() throws ParseException { - return null; - } - - Node supportsDirective() throws ParseException { - return null; - } - - final public void nestedProperties() throws ParseException { - String name; -LexicalUnit exp; - name = property(); - jj_consume_token(COLON); - label_99: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[144] = jj_gen; - break label_99; - } - jj_consume_token(S); - } - jj_consume_token(LBRACE); - label_100: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[145] = jj_gen; - break label_100; - } - jj_consume_token(S); - } - documentHandler.startNestedProperties(name); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - declaration(); - break; - default: - jj_la1[146] = jj_gen; - ; - } - label_101: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SEMICOLON: - ; - break; - default: - jj_la1[147] = jj_gen; - break label_101; - } - jj_consume_token(SEMICOLON); - label_102: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[148] = jj_gen; - break label_102; - } - jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - declaration(); - break; - default: - jj_la1[149] = jj_gen; - ; - } - } - jj_consume_token(RBRACE); - documentHandler.endNestedProperties(name); - label_103: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[150] = jj_gen; - break label_103; - } - jj_consume_token(S); - } - } + } + jj_consume_token(LBRACE); + label_86: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[129] = jj_gen; + break label_86; + } + jj_consume_token(S); + } + documentHandler.startMixinDirective(name, args); + label_87: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + case ANY: + case PARENT: + case DOT: + case COLON: + case EACH_VAR: + case INCLUDE_SYM: + case EACH_SYM: + case EXTEND_SYM: + case IDENT: + case VARIABLE: + case HASH: + case MEDIA_SYM: + ; + break; + default: + jj_la1[130] = jj_gen; + break label_87; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case INCLUDE_SYM: + includeDirective(); + break; + case MEDIA_SYM: + media(); + break; + case EACH_SYM: + eachDirective(); + break; + case EXTEND_SYM: + extendDirective(); + break; + case VARIABLE: + variable(); + break; + default: + jj_la1[131] = jj_gen; + if (jj_2_6(3)) { + declarationOrNestedProperties(); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + case ANY: + case PARENT: + case DOT: + case COLON: + case EACH_VAR: + case IDENT: + case HASH: + styleRule(); + break; + default: + jj_la1[132] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } + } + jj_consume_token(RBRACE); + label_88: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[133] = jj_gen; + break label_88; + } + jj_consume_token(S); + } + documentHandler.endMixinDirective(name, args); + } -/** - * @exception ParseException exception during the parse - */ - final public void declarationOrNestedProperties() throws ParseException { - boolean important = false; - String name; - LexicalUnit exp; - Token save; - String comment = null; - try { - name = property(); - save = token; - jj_consume_token(COLON); - label_104: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[151] = jj_gen; - break label_104; - } - jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - case MINUS: - case STRING: - case IDENT: - case NUMBER: - case URL: - case VARIABLE: - case PERCENTAGE: - case PT: - case MM: - case CM: - case PC: - case IN: - case PX: - case EMS: - case EXS: - case DEG: - case RAD: - case GRAD: - case MS: - case SECOND: - case HZ: - case KHZ: - case DIMEN: - case HASH: - case UNICODERANGE: - case FUNCTION: - exp = expr(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IMPORTANT_SYM: - important = prio(); - break; + final public ArrayList<VariableNode> arglist() throws ParseException { + ArrayList<VariableNode> args = new ArrayList<VariableNode>(); + VariableNode arg; + arg = mixinArg(); + label_89: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[134] = jj_gen; + break label_89; + } + jj_consume_token(COMMA); + label_90: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[135] = jj_gen; + break label_90; + } + jj_consume_token(S); + } + args.add(arg); + arg = mixinArg(); + } + args.add(arg); + { + if (true) + return args; + } + throw new Error("Missing return statement in function"); + } + + final public VariableNode mixinArg() throws ParseException { + String name; + LexicalUnitImpl first = null; + LexicalUnitImpl next = null; + LexicalUnitImpl prev = null; + name = variableName(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COLON: + jj_consume_token(COLON); + label_91: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[136] = jj_gen; + break label_91; + } + jj_consume_token(S); + } + first = term(null); + prev = first; + label_92: while (true) { + if (jj_2_7(2)) { + ; + } else { + break label_92; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + jj_consume_token(COMMA); + label_93: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[137] = jj_gen; + break label_93; + } + jj_consume_token(S); + } + break; + default: + jj_la1[138] = jj_gen; + ; + } + next = term(prev); + prev.setNextLexicalUnit(next); + prev = next; + } + break; default: - jj_la1[152] = jj_gen; - ; - } - Token next = getToken(1); - if(next.kind == SEMICOLON || next.kind == RBRACE){ - while(next.kind == SEMICOLON){ - skipStatement(); - next = getToken(1); - } - if(token.specialToken!=null){ - documentHandler.property(name, exp, important, token.specialToken.image); - }else{ - documentHandler.property(name, exp, important, null); - } - } - break; - case LBRACE: - jj_consume_token(LBRACE); - label_105: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: + jj_la1[139] = jj_gen; ; - break; - default: - jj_la1[153] = jj_gen; - break label_105; - } - jj_consume_token(S); - } - documentHandler.startNestedProperties(name); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + } + VariableNode arg = new VariableNode(name, first, false); + { + if (true) + return arg; + } + throw new Error("Missing return statement in function"); + } + + final public ArrayList<LexicalUnitImpl> argValuelist() + throws ParseException { + ArrayList<LexicalUnitImpl> args = new ArrayList<LexicalUnitImpl>(); + LexicalUnitImpl first = null; + LexicalUnitImpl next = null; + LexicalUnitImpl prev = null; + first = term(null); + args.add(first); + prev = first; + label_94: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case PLUS: + case MINUS: + case STRING: + case IDENT: + case NUMBER: + case URL: + case VARIABLE: + case PERCENTAGE: + case PT: + case MM: + case CM: + case PC: + case IN: + case PX: + case EMS: + case EXS: + case DEG: + case RAD: + case GRAD: + case MS: + case SECOND: + case HZ: + case KHZ: + case DIMEN: + case HASH: + case UNICODERANGE: + case FUNCTION: + ; + break; + default: + jj_la1[140] = jj_gen; + break label_94; + } + next = term(prev); + prev.setNextLexicalUnit(next); + prev = next; + } + label_95: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[141] = jj_gen; + break label_95; + } + jj_consume_token(COMMA); + label_96: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[142] = jj_gen; + break label_96; + } + jj_consume_token(S); + } + first = term(null); + args.add(first); + prev = first; + label_97: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case PLUS: + case MINUS: + case STRING: + case IDENT: + case NUMBER: + case URL: + case VARIABLE: + case PERCENTAGE: + case PT: + case MM: + case CM: + case PC: + case IN: + case PX: + case EMS: + case EXS: + case DEG: + case RAD: + case GRAD: + case MS: + case SECOND: + case HZ: + case KHZ: + case DIMEN: + case HASH: + case UNICODERANGE: + case FUNCTION: + ; + break; + default: + jj_la1[143] = jj_gen; + break label_97; + } + next = term(prev); + prev.setNextLexicalUnit(next); + prev = next; + } + } + { + if (true) + return args; + } + throw new Error("Missing return statement in function"); + } + + final public void includeDirective() throws ParseException { + String name; + ArrayList<LexicalUnitImpl> args = null; + jj_consume_token(INCLUDE_SYM); + label_98: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[144] = jj_gen; + break label_98; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case IDENT: - declaration(); - break; + name = property(); + break; + case FUNCTION: + name = functionName(); + args = argValuelist(); + jj_consume_token(RPARAN); + break; default: - jj_la1[154] = jj_gen; - ; + jj_la1[145] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); } - label_106: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SEMICOLON: + label_99: while (true) { + jj_consume_token(SEMICOLON); + label_100: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[146] = jj_gen; + break label_100; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case SEMICOLON: + ; + break; + default: + jj_la1[147] = jj_gen; + break label_99; + } + } + documentHandler.includeDirective(name, args); + } + + /** + * @exception ParseException + * exception during the parse + */ + final public void removeDirective() throws ParseException { + ArrayList<String> list = null; + ArrayList<String> remove = null; + String separator = null; + Token n = null; + jj_consume_token(REMOVE); + label_101: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[148] = jj_gen; + break label_101; + } + jj_consume_token(S); + } + list = removeDirectiveArgs(0); + jj_consume_token(COMMA); + label_102: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[149] = jj_gen; + break label_102; + } + jj_consume_token(S); + } + remove = removeDirectiveArgs(1); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + jj_consume_token(COMMA); + label_103: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[150] = jj_gen; + break label_103; + } + jj_consume_token(S); + } + n = jj_consume_token(IDENT); + separator = n.image; + label_104: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[151] = jj_gen; + break label_104; + } + jj_consume_token(S); + } + break; + default: + jj_la1[152] = jj_gen; ; + } + jj_consume_token(RPARAN); + label_105: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[153] = jj_gen; + break label_105; + } + jj_consume_token(S); + } + jj_consume_token(SEMICOLON); + label_106: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[154] = jj_gen; + break label_106; + } + jj_consume_token(S); + } + documentHandler.removeDirective(list, remove, separator); + } + + ArrayList<String> removeDirectiveArgs(int nest) throws ParseException { + ArrayList<String> list = new ArrayList<String>(); + // Start at one due to "remove(" containing one. + int nesting = nest; + Token t = null; + + while (true) { + t = getToken(1); + if (t.kind == VARIABLE) { + list.add(t.image); + } else if (t.kind == STRING) { + list.add(t.image.substring(1, t.image.length()).substring(0, + t.image.length() - 2)); + + } else if (t.kind == LPARAN) { + nesting++; + if (nesting > nest + 1) { + throw new CSSParseException( + "Only one ( ) pair per parameter allowed", + getLocator()); + } + } else if (t.kind == RPARAN) { + nesting--; + if (nesting == 0) { + getNextToken(); + return list; + } + } else if (t.kind == COMMA) { + if (nesting == nest) { + return list; + } + } + + getNextToken(); + } + } + + final public Node returnDirective() throws ParseException { + String raw; + raw = skipStatement(); + { + if (true) + return null; + } + throw new Error("Missing return statement in function"); + } + + void debugDirective() throws ParseException { + } + + void warnDirective() throws ParseException { + } + + final public Node forDirective() throws ParseException { + String var; + String from; + String to; + boolean exclusive; + String body; + Token tok; + var = variableName(); + int[] toThrough = { TO, THROUGH }; + from = skipStatementUntil(toThrough); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case TO: + tok = jj_consume_token(TO); + exclusive = true; + break; + case THROUGH: + tok = jj_consume_token(THROUGH); + exclusive = false; break; - default: + default: jj_la1[155] = jj_gen; - break label_106; - } - jj_consume_token(SEMICOLON); - label_107: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + jj_consume_token(-1); + throw new ParseException(); + } + to = skipStatementUntilLeftBrace(); + label_107: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[156] = jj_gen; + break label_107; + } + jj_consume_token(S); + } + body = skipStatement(); + { + if (true) + return documentHandler.forDirective(var, from, to, exclusive, + body); + } + throw new Error("Missing return statement in function"); + } + + final public Node whileDirective() throws ParseException { + String condition; + String body; + condition = skipStatementUntilLeftBrace(); + body = skipStatement(); + { + if (true) + return documentHandler.whileDirective(condition, body); + } + throw new Error("Missing return statement in function"); + } + + final public void extendDirective() throws ParseException { + ArrayList<String> list; + jj_consume_token(EXTEND_SYM); + label_108: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[157] = jj_gen; + break label_108; + } + jj_consume_token(S); + } + list = selectorList(); + label_109: while (true) { + jj_consume_token(SEMICOLON); + label_110: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[158] = jj_gen; + break label_110; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case SEMICOLON: + ; + break; + default: + jj_la1[159] = jj_gen; + break label_109; + } + } + documentHandler.extendDirective(list); + } + + Node importDirective() throws ParseException { + return null; + } + + Node charsetDirective() throws ParseException { + return null; + } + + Node mozDocumentDirective() throws ParseException { + return null; + } + + Node supportsDirective() throws ParseException { + return null; + } + + final public void nestedProperties() throws ParseException { + String name; + LexicalUnit exp; + name = property(); + jj_consume_token(COLON); + label_111: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[160] = jj_gen; + break label_111; + } + jj_consume_token(S); + } + jj_consume_token(LBRACE); + label_112: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case S: - ; - break; + ; + break; default: - jj_la1[156] = jj_gen; - break label_107; + jj_la1[161] = jj_gen; + break label_112; } jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: + } + documentHandler.startNestedProperties(name); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: declaration(); break; - default: - jj_la1[157] = jj_gen; + default: + jj_la1[162] = jj_gen; ; - } + } + label_113: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case SEMICOLON: + ; + break; + default: + jj_la1[163] = jj_gen; + break label_113; + } + jj_consume_token(SEMICOLON); + label_114: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[164] = jj_gen; + break label_114; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + declaration(); + break; + default: + jj_la1[165] = jj_gen; + ; + } } jj_consume_token(RBRACE); - label_108: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[158] = jj_gen; - break label_108; - } - jj_consume_token(S); - } - documentHandler.endNestedProperties(name); - break; - default: - jj_la1[159] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch (JumpException e) { - skipAfterExpression(); - // reportWarningSkipText(getLocator(), skipAfterExpression()); - - } catch (NumberFormatException e) { - if (errorHandler != null) { - errorHandler.error(new CSSParseException("Invalid number " - + e.getMessage(), - getLocator(), - e)); - } - reportWarningSkipText(getLocator(), skipAfterExpression()); - } catch (ParseException e) { - if (errorHandler != null) { - if (e.currentToken != null) { - LocatorImpl li = new LocatorImpl(this, - e.currentToken.next.beginLine, - e.currentToken.next.beginColumn-1); - reportError(li, e); - } else { - reportError(getLocator(), e); - } - skipAfterExpression(); - /* - LocatorImpl loc = (LocatorImpl) getLocator(); - loc.column--; - reportWarningSkipText(loc, skipAfterExpression()); - */ - } else { - skipAfterExpression(); - } - } - } + documentHandler.endNestedProperties(name); + label_115: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[166] = jj_gen; + break label_115; + } + jj_consume_token(S); + } + } -/** - * @exception ParseException exception during the parse - */ - final public void declaration() throws ParseException { - boolean important = false; - String name; - LexicalUnit exp; - Token save; - try { - name = property(); - save = token; - jj_consume_token(COLON); - label_109: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[160] = jj_gen; - break label_109; - } - jj_consume_token(S); - } - exp = expr(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IMPORTANT_SYM: - important = prio(); - break; - default: - jj_la1[161] = jj_gen; - ; - } - documentHandler.property(name, exp, important); - } catch (JumpException e) { - skipAfterExpression(); - // reportWarningSkipText(getLocator(), skipAfterExpression()); - - } catch (NumberFormatException e) { - if (errorHandler != null) { - errorHandler.error(new CSSParseException("Invalid number " - + e.getMessage(), - getLocator(), - e)); - } - reportWarningSkipText(getLocator(), skipAfterExpression()); - } catch (ParseException e) { - if (errorHandler != null) { - if (e.currentToken != null) { - LocatorImpl li = new LocatorImpl(this, - e.currentToken.next.beginLine, - e.currentToken.next.beginColumn-1); - reportError(li, e); - } else { - reportError(getLocator(), e); - } - skipAfterExpression(); - /* - LocatorImpl loc = (LocatorImpl) getLocator(); - loc.column--; - reportWarningSkipText(loc, skipAfterExpression()); - */ - } else { - skipAfterExpression(); - } - } - } + /** + * @exception ParseException + * exception during the parse + */ + final public void declarationOrNestedProperties() throws ParseException { + boolean important = false; + String name; + LexicalUnitImpl exp; + Token save; + String comment = null; + try { + name = property(); + save = token; + jj_consume_token(COLON); + label_116: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[167] = jj_gen; + break label_116; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case PLUS: + case MINUS: + case STRING: + case IDENT: + case NUMBER: + case URL: + case VARIABLE: + case PERCENTAGE: + case PT: + case MM: + case CM: + case PC: + case IN: + case PX: + case EMS: + case EXS: + case DEG: + case RAD: + case GRAD: + case MS: + case SECOND: + case HZ: + case KHZ: + case DIMEN: + case HASH: + case UNICODERANGE: + case FUNCTION: + exp = expr(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IMPORTANT_SYM: + important = prio(); + break; + default: + jj_la1[168] = jj_gen; + ; + } + Token next = getToken(1); + if (next.kind == SEMICOLON || next.kind == RBRACE) { + while (next.kind == SEMICOLON) { + skipStatement(); + next = getToken(1); + } + if (token.specialToken != null) { + documentHandler.property(name, exp, important, + token.specialToken.image); + } else { + documentHandler.property(name, exp, important, null); + } + } + break; + case LBRACE: + jj_consume_token(LBRACE); + label_117: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[169] = jj_gen; + break label_117; + } + jj_consume_token(S); + } + documentHandler.startNestedProperties(name); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + declaration(); + break; + default: + jj_la1[170] = jj_gen; + ; + } + label_118: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case SEMICOLON: + ; + break; + default: + jj_la1[171] = jj_gen; + break label_118; + } + jj_consume_token(SEMICOLON); + label_119: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[172] = jj_gen; + break label_119; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + declaration(); + break; + default: + jj_la1[173] = jj_gen; + ; + } + } + jj_consume_token(RBRACE); + label_120: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[174] = jj_gen; + break label_120; + } + jj_consume_token(S); + } + documentHandler.endNestedProperties(name); + break; + default: + jj_la1[175] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (JumpException e) { + skipAfterExpression(); + // reportWarningSkipText(getLocator(), skipAfterExpression()); -/** - * @exception ParseException exception during the parse - */ - final public boolean prio() throws ParseException { - jj_consume_token(IMPORTANT_SYM); - label_110: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[162] = jj_gen; - break label_110; - } - jj_consume_token(S); - } - {if (true) return true;} - throw new Error("Missing return statement in function"); - } - - final public boolean guarded() throws ParseException { - jj_consume_token(GUARDED_SYM); - label_111: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[163] = jj_gen; - break label_111; - } - jj_consume_token(S); - } - {if (true) return true;} - throw new Error("Missing return statement in function"); - } + } catch (NumberFormatException e) { + if (errorHandler != null) { + errorHandler.error(new CSSParseException("Invalid number " + + e.getMessage(), getLocator(), e)); + } + reportWarningSkipText(getLocator(), skipAfterExpression()); + } catch (ParseException e) { + if (errorHandler != null) { + if (e.currentToken != null) { + LocatorImpl li = new LocatorImpl(this, + e.currentToken.next.beginLine, + e.currentToken.next.beginColumn - 1); + reportError(li, e); + } else { + reportError(getLocator(), e); + } + skipAfterExpression(); + /* + * LocatorImpl loc = (LocatorImpl) getLocator(); loc.column--; + * reportWarningSkipText(loc, skipAfterExpression()); + */ + } else { + skipAfterExpression(); + } + } + } -/** - * @exception ParseException exception during the parse - */ - final public LexicalUnitImpl operator(LexicalUnitImpl prev) throws ParseException { - Token n; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case DIV: - n = jj_consume_token(DIV); - label_112: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[164] = jj_gen; - break label_112; - } - jj_consume_token(S); - } - {if (true) return LexicalUnitImpl.createSlash(n.beginLine, - n.beginColumn, - prev);} - break; - case COMMA: - n = jj_consume_token(COMMA); - label_113: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[165] = jj_gen; - break label_113; - } - jj_consume_token(S); - } - {if (true) return LexicalUnitImpl.createComma(n.beginLine, - n.beginColumn, - prev);} - break; - default: - jj_la1[166] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - throw new Error("Missing return statement in function"); - } + /** + * @exception ParseException + * exception during the parse + */ + final public void declaration() throws ParseException { + boolean important = false; + String name; + LexicalUnit exp; + Token save; + try { + name = property(); + save = token; + jj_consume_token(COLON); + label_121: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[176] = jj_gen; + break label_121; + } + jj_consume_token(S); + } + exp = expr(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IMPORTANT_SYM: + important = prio(); + break; + default: + jj_la1[177] = jj_gen; + ; + } + documentHandler.property(name, exp, important); + } catch (JumpException e) { + skipAfterExpression(); + // reportWarningSkipText(getLocator(), skipAfterExpression()); -/** - * @exception ParseException exception during the parse - */ - final public LexicalUnit expr() throws ParseException { - LexicalUnitImpl first, res; - char op; - first = term(null); - res = first; - label_114: - while (true) { - if (jj_2_7(2)) { - ; - } else { - break label_114; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - case DIV: - res = operator(res); - break; - default: - jj_la1[167] = jj_gen; - ; - } - res = term(res); - } - {if (true) return first;} - throw new Error("Missing return statement in function"); - } + } catch (NumberFormatException e) { + if (errorHandler != null) { + errorHandler.error(new CSSParseException("Invalid number " + + e.getMessage(), getLocator(), e)); + } + reportWarningSkipText(getLocator(), skipAfterExpression()); + } catch (ParseException e) { + if (errorHandler != null) { + if (e.currentToken != null) { + LocatorImpl li = new LocatorImpl(this, + e.currentToken.next.beginLine, + e.currentToken.next.beginColumn - 1); + reportError(li, e); + } else { + reportError(getLocator(), e); + } + skipAfterExpression(); + /* + * LocatorImpl loc = (LocatorImpl) getLocator(); loc.column--; + * reportWarningSkipText(loc, skipAfterExpression()); + */ + } else { + skipAfterExpression(); + } + } + } -/** - * @exception ParseException exception during the parse - */ - final public char unaryOperator() throws ParseException { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case MINUS: - jj_consume_token(MINUS); - {if (true) return '-';} - break; - case PLUS: - jj_consume_token(PLUS); - {if (true) return '+';} - break; - default: - jj_la1[168] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - throw new Error("Missing return statement in function"); - } + /** + * @exception ParseException + * exception during the parse + */ + final public boolean prio() throws ParseException { + jj_consume_token(IMPORTANT_SYM); + label_122: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[178] = jj_gen; + break label_122; + } + jj_consume_token(S); + } + { + if (true) + return true; + } + throw new Error("Missing return statement in function"); + } -/** - * @exception ParseException exception during the parse - */ - final public LexicalUnitImpl term(LexicalUnitImpl prev) throws ParseException { - LexicalUnitImpl result = null; - Token n = null; - char op = ' '; - String varName; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - case MINUS: - case STRING: - case IDENT: - case NUMBER: - case URL: - case PERCENTAGE: - case PT: - case MM: - case CM: - case PC: - case IN: - case PX: - case EMS: - case EXS: - case DEG: - case RAD: - case GRAD: - case MS: - case SECOND: - case HZ: - case KHZ: - case DIMEN: - case HASH: - case UNICODERANGE: - case FUNCTION: - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - case MINUS: - case NUMBER: - case PERCENTAGE: - case PT: - case MM: - case CM: - case PC: - case IN: - case PX: - case EMS: - case EXS: - case DEG: - case RAD: - case GRAD: - case MS: - case SECOND: - case HZ: - case KHZ: - case DIMEN: - case FUNCTION: - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: + final public boolean guarded() throws ParseException { + jj_consume_token(GUARDED_SYM); + label_123: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[179] = jj_gen; + break label_123; + } + jj_consume_token(S); + } + { + if (true) + return true; + } + throw new Error("Missing return statement in function"); + } + + /** + * @exception ParseException + * exception during the parse + */ + final public LexicalUnitImpl operator(LexicalUnitImpl prev) + throws ParseException { + Token n; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case DIV: + n = jj_consume_token(DIV); + label_124: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[180] = jj_gen; + break label_124; + } + jj_consume_token(S); + } + { + if (true) + return LexicalUnitImpl.createSlash(n.beginLine, + n.beginColumn, prev); + } + break; + case COMMA: + n = jj_consume_token(COMMA); + label_125: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[181] = jj_gen; + break label_125; + } + jj_consume_token(S); + } + { + if (true) + return LexicalUnitImpl.createComma(n.beginLine, + n.beginColumn, prev); + } + break; + default: + jj_la1[182] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + throw new Error("Missing return statement in function"); + } + + /** + * @exception ParseException + * exception during the parse + */ + final public LexicalUnitImpl expr() throws ParseException { + LexicalUnitImpl first, res; + char op; + first = term(null); + res = first; + label_126: while (true) { + if (jj_2_8(2)) { + ; + } else { + break label_126; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + case DIV: + res = operator(res); + break; + default: + jj_la1[183] = jj_gen; + ; + } + res = term(res); + } + { + if (true) + return first; + } + throw new Error("Missing return statement in function"); + } + + /** + * @exception ParseException + * exception during the parse + */ + final public char unaryOperator() throws ParseException { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case MINUS: - op = unaryOperator(); - break; + jj_consume_token(MINUS); + { + if (true) + return '-'; + } + break; + case PLUS: + jj_consume_token(PLUS); + { + if (true) + return '+'; + } + break; default: - jj_la1[169] = jj_gen; - ; + jj_la1[184] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + throw new Error("Missing return statement in function"); + } + + /** + * @exception ParseException + * exception during the parse + */ + final public LexicalUnitImpl term(LexicalUnitImpl prev) + throws ParseException { + LexicalUnitImpl result = null; + Token n = null; + char op = ' '; + String varName; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case PLUS: + case MINUS: + case STRING: + case IDENT: case NUMBER: - n = jj_consume_token(NUMBER); - result = LexicalUnitImpl.createNumber(n.beginLine, n.beginColumn, - prev, number(op, n, 0)); - break; + case URL: case PERCENTAGE: - n = jj_consume_token(PERCENTAGE); - result = LexicalUnitImpl.createPercentage(n.beginLine, n.beginColumn, - prev, number(op, n, 1)); - break; case PT: - n = jj_consume_token(PT); - result = LexicalUnitImpl.createPT(n.beginLine, n.beginColumn, - prev, number(op, n, 2)); - break; - case CM: - n = jj_consume_token(CM); - result = LexicalUnitImpl.createCM(n.beginLine, n.beginColumn, - prev, number(op, n, 2)); - break; case MM: - n = jj_consume_token(MM); - result = LexicalUnitImpl.createMM(n.beginLine, n.beginColumn, - prev, number(op, n, 2)); - break; + case CM: case PC: - n = jj_consume_token(PC); - result = LexicalUnitImpl.createPC(n.beginLine, n.beginColumn, - prev, number(op, n, 2)); - break; case IN: - n = jj_consume_token(IN); - result = LexicalUnitImpl.createIN(n.beginLine, n.beginColumn, - prev, number(op, n, 2)); - break; case PX: - n = jj_consume_token(PX); - result = LexicalUnitImpl.createPX(n.beginLine, n.beginColumn, - prev, number(op, n, 2)); - break; case EMS: - n = jj_consume_token(EMS); - result = LexicalUnitImpl.createEMS(n.beginLine, n.beginColumn, - prev, number(op, n, 2)); - break; case EXS: - n = jj_consume_token(EXS); - result = LexicalUnitImpl.createEXS(n.beginLine, n.beginColumn, - prev, number(op, n, 2)); - break; case DEG: - n = jj_consume_token(DEG); - result = LexicalUnitImpl.createDEG(n.beginLine, n.beginColumn, - prev, number(op, n, 3)); - break; case RAD: - n = jj_consume_token(RAD); - result = LexicalUnitImpl.createRAD(n.beginLine, n.beginColumn, - prev, number(op, n, 3)); - break; case GRAD: - n = jj_consume_token(GRAD); - result = LexicalUnitImpl.createGRAD(n.beginLine, n.beginColumn, - prev, number(op, n, 3)); - break; - case SECOND: - n = jj_consume_token(SECOND); - result = LexicalUnitImpl.createS(n.beginLine, n.beginColumn, - prev, number(op, n, 1)); - break; case MS: - n = jj_consume_token(MS); - result = LexicalUnitImpl.createMS(n.beginLine, n.beginColumn, - prev, number(op, n, 2)); - break; + case SECOND: case HZ: - n = jj_consume_token(HZ); - result = LexicalUnitImpl.createHZ(n.beginLine, n.beginColumn, - prev, number(op, n, 2)); - break; case KHZ: - n = jj_consume_token(KHZ); - result = LexicalUnitImpl.createKHZ(n.beginLine, n.beginColumn, - prev, number(op, n, 3)); - break; case DIMEN: - n = jj_consume_token(DIMEN); - String s = n.image; - int i = 0; - while (i < s.length() - && (Character.isDigit(s.charAt(i)) || (s.charAt(i) == '.'))) { - i++; - } - result = LexicalUnitImpl.createDimen(n.beginLine, n.beginColumn, prev, - Float.valueOf(s.substring(0, i)).floatValue(), - s.substring(i)); - break; + case HASH: + case UNICODERANGE: case FUNCTION: - result = function(op, prev); - break; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case PLUS: + case MINUS: + case NUMBER: + case PERCENTAGE: + case PT: + case MM: + case CM: + case PC: + case IN: + case PX: + case EMS: + case EXS: + case DEG: + case RAD: + case GRAD: + case MS: + case SECOND: + case HZ: + case KHZ: + case DIMEN: + case FUNCTION: + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case PLUS: + case MINUS: + op = unaryOperator(); + break; + default: + jj_la1[185] = jj_gen; + ; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case NUMBER: + n = jj_consume_token(NUMBER); + result = LexicalUnitImpl.createNumber(n.beginLine, + n.beginColumn, prev, number(op, n, 0)); + break; + case PERCENTAGE: + n = jj_consume_token(PERCENTAGE); + result = LexicalUnitImpl.createPercentage(n.beginLine, + n.beginColumn, prev, number(op, n, 1)); + break; + case PT: + n = jj_consume_token(PT); + result = LexicalUnitImpl.createPT(n.beginLine, + n.beginColumn, prev, number(op, n, 2)); + break; + case CM: + n = jj_consume_token(CM); + result = LexicalUnitImpl.createCM(n.beginLine, + n.beginColumn, prev, number(op, n, 2)); + break; + case MM: + n = jj_consume_token(MM); + result = LexicalUnitImpl.createMM(n.beginLine, + n.beginColumn, prev, number(op, n, 2)); + break; + case PC: + n = jj_consume_token(PC); + result = LexicalUnitImpl.createPC(n.beginLine, + n.beginColumn, prev, number(op, n, 2)); + break; + case IN: + n = jj_consume_token(IN); + result = LexicalUnitImpl.createIN(n.beginLine, + n.beginColumn, prev, number(op, n, 2)); + break; + case PX: + n = jj_consume_token(PX); + result = LexicalUnitImpl.createPX(n.beginLine, + n.beginColumn, prev, number(op, n, 2)); + break; + case EMS: + n = jj_consume_token(EMS); + result = LexicalUnitImpl.createEMS(n.beginLine, + n.beginColumn, prev, number(op, n, 2)); + break; + case EXS: + n = jj_consume_token(EXS); + result = LexicalUnitImpl.createEXS(n.beginLine, + n.beginColumn, prev, number(op, n, 2)); + break; + case DEG: + n = jj_consume_token(DEG); + result = LexicalUnitImpl.createDEG(n.beginLine, + n.beginColumn, prev, number(op, n, 3)); + break; + case RAD: + n = jj_consume_token(RAD); + result = LexicalUnitImpl.createRAD(n.beginLine, + n.beginColumn, prev, number(op, n, 3)); + break; + case GRAD: + n = jj_consume_token(GRAD); + result = LexicalUnitImpl.createGRAD(n.beginLine, + n.beginColumn, prev, number(op, n, 3)); + break; + case SECOND: + n = jj_consume_token(SECOND); + result = LexicalUnitImpl.createS(n.beginLine, + n.beginColumn, prev, number(op, n, 1)); + break; + case MS: + n = jj_consume_token(MS); + result = LexicalUnitImpl.createMS(n.beginLine, + n.beginColumn, prev, number(op, n, 2)); + break; + case HZ: + n = jj_consume_token(HZ); + result = LexicalUnitImpl.createHZ(n.beginLine, + n.beginColumn, prev, number(op, n, 2)); + break; + case KHZ: + n = jj_consume_token(KHZ); + result = LexicalUnitImpl.createKHZ(n.beginLine, + n.beginColumn, prev, number(op, n, 3)); + break; + case DIMEN: + n = jj_consume_token(DIMEN); + String s = n.image; + int i = 0; + while (i < s.length() + && (Character.isDigit(s.charAt(i)) || (s.charAt(i) == '.'))) { + i++; + } + result = LexicalUnitImpl.createDimen(n.beginLine, + n.beginColumn, prev, + Float.valueOf(s.substring(0, i)).floatValue(), + s.substring(i)); + break; + case FUNCTION: + result = function(op, prev); + break; + default: + jj_la1[186] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + case STRING: + case IDENT: + case URL: + case HASH: + case UNICODERANGE: + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case STRING: + n = jj_consume_token(STRING); + result = LexicalUnitImpl + .createString( + n.beginLine, + n.beginColumn, + prev, + convertStringIndex(n.image, 1, + n.image.length() - 1)); + break; + case IDENT: + n = jj_consume_token(IDENT); + String s = convertIdent(n.image); + if ("inherit".equals(s)) { + result = LexicalUnitImpl.createInherit(n.beginLine, + n.beginColumn, prev); + } else { + result = LexicalUnitImpl.createIdent(n.beginLine, + n.beginColumn, prev, convertIdent(n.image)); + } + + /* + * / Auto correction code used in the CSS Validator but must + * not be used by a conformant CSS2 parser. Common error : + * H1 { color : black background : white } + * + * Token t = getToken(1); Token semicolon = new Token(); + * semicolon.kind = SEMICOLON; semicolon.image = ";"; if + * (t.kind == COLON) { // @@SEEME. (generate a warning?) // + * @@SEEME if expression is a single ident, generate an + * error ? rejectToken(semicolon); + * + * result = prev; } / + */ + + break; + case HASH: + result = hexcolor(prev); + break; + case URL: + result = url(prev); + break; + case UNICODERANGE: + result = unicode(prev); + break; + default: + jj_la1[187] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + default: + jj_la1[188] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_127: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[189] = jj_gen; + break label_127; + } + jj_consume_token(S); + } + break; + case VARIABLE: + varName = variableName(); + result = LexicalUnitImpl.createVariable(token.beginLine, + token.beginColumn, prev, varName); + break; default: - jj_la1[170] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - case STRING: - case IDENT: - case URL: - case HASH: - case UNICODERANGE: - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + jj_la1[190] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) + return result; + } + throw new Error("Missing return statement in function"); + } + + /** + * Handle all CSS2 functions. + * + * @exception ParseException + * exception during the parse + */ + final public LexicalUnitImpl function(char operator, LexicalUnitImpl prev) + throws ParseException { + Token n; + LexicalUnit params = null; + n = jj_consume_token(FUNCTION); + label_128: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[191] = jj_gen; + break label_128; + } + jj_consume_token(S); + } + String fname = convertIdent(n.image); + if ("alpha(".equals(fname)) { + String body = skipStatementUntilSemiColon(); + { + if (true) + return LexicalUnitImpl.createIdent(n.beginLine, + n.beginColumn, null, "alpha(" + body); + } + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case PLUS: + case MINUS: case STRING: - n = jj_consume_token(STRING); - result = - LexicalUnitImpl.createString(n.beginLine, n.beginColumn, prev, - convertStringIndex(n.image, 1, - n.image.length() -1)); - break; case IDENT: - n = jj_consume_token(IDENT); - String s = convertIdent(n.image); - if ("inherit".equals(s)) { - result = LexicalUnitImpl.createInherit(n.beginLine, n.beginColumn, - prev); - } else { - result = LexicalUnitImpl.createIdent(n.beginLine, n.beginColumn, - prev, convertIdent(n.image)); - } - - /* / - Auto correction code used in the CSS Validator but must not - be used by a conformant CSS2 parser. - * Common error : - * H1 { - * color : black - * background : white - * } - * - Token t = getToken(1); - Token semicolon = new Token(); - semicolon.kind = SEMICOLON; - semicolon.image = ";"; - if (t.kind == COLON) { - // @@SEEME. (generate a warning?) - // @@SEEME if expression is a single ident, - generate an error ? - rejectToken(semicolon); - - result = prev; - } - / */ - - break; - case HASH: - result = hexcolor(prev); - break; + case NUMBER: case URL: - result = url(prev); - break; + case VARIABLE: + case PERCENTAGE: + case PT: + case MM: + case CM: + case PC: + case IN: + case PX: + case EMS: + case EXS: + case DEG: + case RAD: + case GRAD: + case MS: + case SECOND: + case HZ: + case KHZ: + case DIMEN: + case HASH: case UNICODERANGE: - result = unicode(prev); - break; - default: - jj_la1[171] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - default: - jj_la1[172] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - label_115: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; + case FUNCTION: + params = expr(); + break; default: - jj_la1[173] = jj_gen; - break label_115; - } - jj_consume_token(S); - } - break; - case VARIABLE: - varName = variableName(); - result = LexicalUnitImpl.createVariable(token.beginLine, token.beginColumn, - prev, varName); - break; - default: - jj_la1[174] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return result;} - throw new Error("Missing return statement in function"); - } - -/** - * Handle all CSS2 functions. - * @exception ParseException exception during the parse - */ - final public LexicalUnitImpl function(char operator, LexicalUnitImpl prev) throws ParseException { - Token n; - LexicalUnit params = null; - n = jj_consume_token(FUNCTION); - label_116: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[175] = jj_gen; - break label_116; - } - jj_consume_token(S); - } - String fname = convertIdent(n.image); - if("alpha(".equals(fname)){ - String body = skipStatementUntilSemiColon(); - {if (true) return LexicalUnitImpl.createIdent(n.beginLine, n.beginColumn, - null, "alpha("+body);} - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - case MINUS: - case STRING: - case IDENT: - case NUMBER: - case URL: - case VARIABLE: - case PERCENTAGE: - case PT: - case MM: - case CM: - case PC: - case IN: - case PX: - case EMS: - case EXS: - case DEG: - case RAD: - case GRAD: - case MS: - case SECOND: - case HZ: - case KHZ: - case DIMEN: - case HASH: - case UNICODERANGE: - case FUNCTION: - params = expr(); - break; - default: - jj_la1[176] = jj_gen; - ; - } - jj_consume_token(RPARAN); + jj_la1[192] = jj_gen; + ; + } + jj_consume_token(RPARAN); if (operator != ' ') { - {if (true) throw new CSSParseException("invalid operator before a function.", - getLocator());} + { + if (true) + throw new CSSParseException( + "invalid operator before a function.", getLocator()); + } } String f = convertIdent(n.image); LexicalUnitImpl l = (LexicalUnitImpl) params; @@ -4077,32 +4477,36 @@ LexicalUnit exp; int i = 0; while (loop && l != null && i < 5) { switch (i) { - case 0: - case 2: - case 4: - if ((l.getLexicalUnitType() != LexicalUnit.SAC_INTEGER) + case 0: + case 2: + case 4: + if ((l.getLexicalUnitType() != LexicalUnit.SAC_INTEGER) && (l.getLexicalUnitType() != LexicalUnit.SAC_PERCENTAGE)) { - loop = false; - } - break; - case 1: - case 3: - if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) { - loop = false; - } - break; - default: - {if (true) throw new ParseException("implementation error");} + loop = false; + } + break; + case 1: + case 3: + if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) { + loop = false; + } + break; + default: { + if (true) + throw new ParseException("implementation error"); + } } if (loop) { l = (LexicalUnitImpl) l.getNextLexicalUnit(); - i ++; + i++; } } if ((i == 5) && loop && (l == null)) { - {if (true) return LexicalUnitImpl.createRGBColor(n.beginLine, - n.beginColumn, - prev, params);} + { + if (true) + return LexicalUnitImpl.createRGBColor(n.beginLine, + n.beginColumn, prev, params); + } } else { if (errorHandler != null) { String errorText; @@ -4110,54 +4514,60 @@ LexicalUnit exp; if (i < 5) { if (params == null) { loc = new LocatorImpl(this, n.beginLine, - n.beginColumn-1); + n.beginColumn - 1); errorText = "not enough parameters."; } else if (l == null) { loc = new LocatorImpl(this, n.beginLine, - n.beginColumn-1); + n.beginColumn - 1); errorText = "not enough parameters: " - + params.toString(); + + params.toString(); } else { loc = new LocatorImpl(this, l.getLineNumber(), - l.getColumnNumber()); - errorText = "invalid parameter: " - + l.toString(); + l.getColumnNumber()); + errorText = "invalid parameter: " + l.toString(); } } else { loc = new LocatorImpl(this, l.getLineNumber(), - l.getColumnNumber()); - errorText = "too many parameters: " - + l.toString(); + l.getColumnNumber()); + errorText = "too many parameters: " + l.toString(); } errorHandler.error(new CSSParseException(errorText, loc)); } - {if (true) throw new JumpException();} + { + if (true) + throw new JumpException(); + } } } else if ("counter".equals(f)) { int i = 0; while (loop && l != null && i < 3) { switch (i) { - case 0: - case 2: - if (l.getLexicalUnitType() != LexicalUnit.SAC_IDENT) { - loop = false; - } - break; - case 1: - if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) { - loop = false; - } - break; - default: - {if (true) throw new ParseException("implementation error");} + case 0: + case 2: + if (l.getLexicalUnitType() != LexicalUnit.SAC_IDENT) { + loop = false; + } + break; + case 1: + if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) { + loop = false; + } + break; + default: { + if (true) + throw new ParseException("implementation error"); + } } l = (LexicalUnitImpl) l.getNextLexicalUnit(); - i ++; + i++; } if (((i == 1) || (i == 3)) && loop && (l == null)) { - {if (true) return LexicalUnitImpl.createCounter(n.beginLine, n.beginColumn, - prev, params);} + { + if (true) + return LexicalUnitImpl.createCounter(n.beginLine, + n.beginColumn, prev, params); + } } } else if ("counters(".equals(f)) { @@ -4165,1450 +4575,1955 @@ LexicalUnit exp; int i = 0; while (loop && l != null && i < 5) { switch (i) { - case 0: - case 4: - if (l.getLexicalUnitType() != LexicalUnit.SAC_IDENT) { - loop = false; - } - break; - case 2: - if (l.getLexicalUnitType() != LexicalUnit.SAC_STRING_VALUE) { - loop = false; - } - break; - case 1: - case 3: - if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) { - loop = false; - } - break; - default: - {if (true) throw new ParseException("implementation error");} + case 0: + case 4: + if (l.getLexicalUnitType() != LexicalUnit.SAC_IDENT) { + loop = false; + } + break; + case 2: + if (l.getLexicalUnitType() != LexicalUnit.SAC_STRING_VALUE) { + loop = false; + } + break; + case 1: + case 3: + if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) { + loop = false; + } + break; + default: { + if (true) + throw new ParseException("implementation error"); + } } l = (LexicalUnitImpl) l.getNextLexicalUnit(); - i ++; + i++; } if (((i == 3) || (i == 5)) && loop && (l == null)) { - {if (true) return LexicalUnitImpl.createCounters(n.beginLine, n.beginColumn, - prev, params);} + { + if (true) + return LexicalUnitImpl.createCounters(n.beginLine, + n.beginColumn, prev, params); + } } } else if ("attr(".equals(f)) { - if ((l != null) - && (l.getNextLexicalUnit() == null) - && (l.getLexicalUnitType() == LexicalUnit.SAC_IDENT)) { - {if (true) return LexicalUnitImpl.createAttr(l.getLineNumber(), - l.getColumnNumber(), - prev, l.getStringValue());} + if ((l != null) && (l.getNextLexicalUnit() == null) + && (l.getLexicalUnitType() == LexicalUnit.SAC_IDENT)) { + { + if (true) + return LexicalUnitImpl.createAttr(l.getLineNumber(), + l.getColumnNumber(), prev, l.getStringValue()); + } } } else if ("rect(".equals(f)) { int i = 0; while (loop && l != null && i < 7) { switch (i) { - case 0: - case 2: - case 4: - case 6: - switch (l.getLexicalUnitType()) { - case LexicalUnit.SAC_INTEGER: - if (l.getIntegerValue() != 0) { - loop = false; - } - break; - case LexicalUnit.SAC_IDENT: - if (!l.getStringValue().equals("auto")) { - loop = false; - } - break; - case LexicalUnit.SAC_EM: - case LexicalUnit.SAC_EX: - case LexicalUnit.SAC_PIXEL: - case LexicalUnit.SAC_CENTIMETER: - case LexicalUnit.SAC_MILLIMETER: - case LexicalUnit.SAC_INCH: - case LexicalUnit.SAC_POINT: - case LexicalUnit.SAC_PICA: - // nothing - break; - default: + case 0: + case 2: + case 4: + case 6: + switch (l.getLexicalUnitType()) { + case LexicalUnit.SAC_INTEGER: + if (l.getIntegerValue() != 0) { loop = false; } break; - case 1: - case 3: - case 5: - if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) { + case LexicalUnit.SAC_IDENT: + if (!l.getStringValue().equals("auto")) { loop = false; } break; + case LexicalUnit.SAC_EM: + case LexicalUnit.SAC_EX: + case LexicalUnit.SAC_PIXEL: + case LexicalUnit.SAC_CENTIMETER: + case LexicalUnit.SAC_MILLIMETER: + case LexicalUnit.SAC_INCH: + case LexicalUnit.SAC_POINT: + case LexicalUnit.SAC_PICA: + // nothing + break; default: - {if (true) throw new ParseException("implementation error");} + loop = false; + } + break; + case 1: + case 3: + case 5: + if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) { + loop = false; + } + break; + default: { + if (true) + throw new ParseException("implementation error"); + } } l = (LexicalUnitImpl) l.getNextLexicalUnit(); - i ++; + i++; } if ((i == 7) && loop && (l == null)) { - {if (true) return LexicalUnitImpl.createRect(n.beginLine, n.beginColumn, - prev, params);} - } - } - {if (true) return LexicalUnitImpl.createFunction(n.beginLine, n.beginColumn, prev, - f.substring(0, - f.length() -1), - params);} - throw new Error("Missing return statement in function"); - } - - final public LexicalUnitImpl unicode(LexicalUnitImpl prev) throws ParseException { - Token n; - n = jj_consume_token(UNICODERANGE); - LexicalUnitImpl params = null; - String s = n.image.substring(2); - int index = s.indexOf('-'); - if (index == -1) { - params = LexicalUnitImpl.createInteger(n.beginLine, n.beginColumn, - params, Integer.parseInt(s, 16)); - } else { - String s1 = s.substring(0, index); - String s2 = s.substring(index); - - params = LexicalUnitImpl.createInteger(n.beginLine, n.beginColumn, - params, Integer.parseInt(s1, 16)); - params = LexicalUnitImpl.createInteger(n.beginLine, n.beginColumn, - params, Integer.parseInt(s2, 16)); - } - - {if (true) return LexicalUnitImpl.createUnicodeRange(n.beginLine, n.beginColumn, - prev, params);} - throw new Error("Missing return statement in function"); - } - - final public LexicalUnitImpl url(LexicalUnitImpl prev) throws ParseException { - Token n; - n = jj_consume_token(URL); - String urlname = n.image.substring(4, n.image.length()-1).trim(); - if (urlname.charAt(0) == '"' - || urlname.charAt(0) == '\u005c'') { - urlname = urlname.substring(1, urlname.length()-1); - } - {if (true) return LexicalUnitImpl.createURL(n.beginLine, n.beginColumn, prev, urlname);} - throw new Error("Missing return statement in function"); - } + { + if (true) + return LexicalUnitImpl.createRect(n.beginLine, + n.beginColumn, prev, params); + } + } + } + { + if (true) + return LexicalUnitImpl.createFunction(n.beginLine, + n.beginColumn, prev, f.substring(0, f.length() - 1), + params); + } + throw new Error("Missing return statement in function"); + } + + final public LexicalUnitImpl unicode(LexicalUnitImpl prev) + throws ParseException { + Token n; + n = jj_consume_token(UNICODERANGE); + LexicalUnitImpl params = null; + String s = n.image.substring(2); + int index = s.indexOf('-'); + if (index == -1) { + params = LexicalUnitImpl.createInteger(n.beginLine, n.beginColumn, + params, Integer.parseInt(s, 16)); + } else { + String s1 = s.substring(0, index); + String s2 = s.substring(index); -/** - * @exception ParseException exception during the parse - */ - final public LexicalUnitImpl hexcolor(LexicalUnitImpl prev) throws ParseException { - Token n; - n = jj_consume_token(HASH); - int r; - LexicalUnitImpl first, params = null; - String s = n.image.substring(1); - - if(s.length()!=3 && s.length()!=6) { - first = null; - {if (true) throw new CSSParseException("invalid hexadecimal notation for RGB: " + s, - getLocator());} - } - {if (true) return LexicalUnitImpl.createIdent(n.beginLine, n.beginColumn, - prev, n.image);} - throw new Error("Missing return statement in function"); - } - - float number(char operator, Token n, int lengthUnit) throws ParseException { - String image = n.image; - float f = 0; - - if (lengthUnit != 0) { - image = image.substring(0, image.length() - lengthUnit); - } - f = Float.valueOf(image).floatValue(); - return (operator == '-')? -f: f; - } - - String skipStatementUntilSemiColon() throws ParseException { - int[] semicolon = {SEMICOLON}; - return skipStatementUntil(semicolon); - } - - String skipStatementUntilLeftBrace() throws ParseException { - int[] lBrace = {LBRACE}; - return skipStatementUntil(lBrace); - } - - String skipStatementUntilRightParan() throws ParseException { - int[] rParan = {RPARAN}; - return skipStatementUntil(rParan); - } - - String skipStatementUntil(int[] symbols) throws ParseException { - StringBuffer s = new StringBuffer(); - boolean stop = false; - Token tok; - while(!stop){ - tok = getToken(1); - if(tok.kind == EOF) { - return null; - } - for(int sym : symbols){ - if(tok.kind == sym){ - stop = true; - break; - } - } - if(!stop){ - if (tok.image != null) { - s.append(tok.image); + params = LexicalUnitImpl.createInteger(n.beginLine, n.beginColumn, + params, Integer.parseInt(s1, 16)); + params = LexicalUnitImpl.createInteger(n.beginLine, n.beginColumn, + params, Integer.parseInt(s2, 16)); + } + + { + if (true) + return LexicalUnitImpl.createUnicodeRange(n.beginLine, + n.beginColumn, prev, params); + } + throw new Error("Missing return statement in function"); + } + + final public LexicalUnitImpl url(LexicalUnitImpl prev) + throws ParseException { + Token n; + n = jj_consume_token(URL); + String urlname = n.image.substring(4, n.image.length() - 1).trim(); + { + if (true) + return LexicalUnitImpl.createURL(n.beginLine, n.beginColumn, + prev, urlname); + } + throw new Error("Missing return statement in function"); + } + + /** + * @exception ParseException + * exception during the parse + */ + final public LexicalUnitImpl hexcolor(LexicalUnitImpl prev) + throws ParseException { + Token n; + n = jj_consume_token(HASH); + int r; + LexicalUnitImpl first, params = null; + String s = n.image.substring(1); + + if (s.length() != 3 && s.length() != 6) { + first = null; + { + if (true) + throw new CSSParseException( + "invalid hexadecimal notation for RGB: " + s, + getLocator()); } - getNextToken(); } + { + if (true) + return LexicalUnitImpl.createIdent(n.beginLine, n.beginColumn, + prev, n.image); + } + throw new Error("Missing return statement in function"); } - return s.toString().trim(); - } - String skipStatement() throws ParseException { - StringBuffer s = new StringBuffer(); - Token tok = getToken(0); - if (tok.image != null) { - s.append(tok.image); + float number(char operator, Token n, int lengthUnit) throws ParseException { + String image = n.image; + float f = 0; + + if (lengthUnit != 0) { + image = image.substring(0, image.length() - lengthUnit); + } + f = Float.valueOf(image).floatValue(); + return (operator == '-') ? -f : f; } - while (true) { - tok = getToken(1); - if (tok.kind == EOF) { - return null; + + String skipStatementUntilSemiColon() throws ParseException { + int[] semicolon = { SEMICOLON }; + return skipStatementUntil(semicolon); + } + + String skipStatementUntilLeftBrace() throws ParseException { + int[] lBrace = { LBRACE }; + return skipStatementUntil(lBrace); + } + + String skipStatementUntilRightParan() throws ParseException { + int[] rParan = { RPARAN }; + return skipStatementUntil(rParan); + } + + String skipStatementUntil(int[] symbols) throws ParseException { + StringBuffer s = new StringBuffer(); + boolean stop = false; + Token tok; + while (!stop) { + tok = getToken(1); + if (tok.kind == EOF) { + return null; + } + for (int sym : symbols) { + if (tok.kind == sym) { + stop = true; + break; + } + } + if (!stop) { + if (tok.image != null) { + s.append(tok.image); + } + getNextToken(); + } } - s.append(tok.image); - if (tok.kind == LBRACE) { - getNextToken(); - s.append(skip_to_matching_brace()); - getNextToken(); + return s.toString().trim(); + } + + String skipStatement() throws ParseException { + StringBuffer s = new StringBuffer(); + Token tok = getToken(0); + if (tok.image != null) { + s.append(tok.image); + } + while (true) { tok = getToken(1); - break; - } else if (tok.kind == RBRACE) { + if (tok.kind == EOF) { + return null; + } + s.append(tok.image); + if (tok.kind == LBRACE) { + getNextToken(); + s.append(skip_to_matching_brace()); + getNextToken(); + tok = getToken(1); + break; + } else if (tok.kind == RBRACE) { + getNextToken(); + tok = getToken(1); + break; + } else if (tok.kind == SEMICOLON) { + getNextToken(); + tok = getToken(1); + break; + } getNextToken(); + } + + // skip white space + while (true) { + if (tok.kind != S) { + break; + } + tok = getNextToken(); tok = getToken(1); - break; - } else if (tok.kind == SEMICOLON) { - getNextToken(); + } + + return s.toString().trim(); + } + + String skip_to_matching_brace() throws ParseException { + StringBuffer s = new StringBuffer(); + Token tok; + int nesting = 1; + while (true) { tok = getToken(1); - break; + if (tok.kind == EOF) { + break; + } + s.append(tok.image); + if (tok.kind == LBRACE) { + nesting++; + } else if (tok.kind == RBRACE) { + nesting--; + if (nesting == 0) { + break; + } + } + getNextToken(); + } + return s.toString(); + } + + String convertStringIndex(String s, int start, int len) + throws ParseException { + StringBuffer buf = new StringBuffer(len); + int index = start; + + while (index < len) { + char c = s.charAt(index); + if (c == '\u005c\u005c') { + if (++index < len) { + c = s.charAt(index); + switch (c) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + int numValue = Character.digit(c, 16); + int count = 0; + int p = 16; + + while (index + 1 < len && count < 6) { + c = s.charAt(index + 1); + + if (Character.digit(c, 16) != -1) { + numValue = (numValue * 16) + + Character.digit(c, 16); + p *= 16; + index++; + } else { + if (c == ' ') { + // skip the latest white space + index++; + } + break; + } + } + buf.append((char) numValue); + break; + case '\u005cn': + case '\u005cf': + break; + case '\u005cr': + if (index + 1 < len) { + if (s.charAt(index + 1) == '\u005cn') { + index++; + } + } + break; + default: + buf.append(c); + } + } else { + throw new CSSParseException("invalid string " + s, + getLocator()); + } + } else { + buf.append(c); + } + index++; + } + + return buf.toString(); + } + + String convertIdent(String s) throws ParseException { + return convertStringIndex(s, 0, s.length()); + } + + String convertString(String s) throws ParseException { + return convertStringIndex(s, 0, s.length()); + } + + void comments() throws ParseException { + if (token.specialToken != null) { + Token tmp_t = token.specialToken; + while (tmp_t.specialToken != null) + tmp_t = tmp_t.specialToken; + while (tmp_t != null) { + documentHandler.comment(tmp_t.image); + tmp_t = tmp_t.next; + } } - getNextToken(); } - // skip white space - while (true) { - if (tok.kind != S) { + void rejectToken(Token t) throws ParseException { + Token fakeToken = new Token(); + t.next = token; + fakeToken.next = t; + token = fakeToken; + } + + String skipAfterExpression() throws ParseException { + Token t = getToken(1); + StringBuffer s = new StringBuffer(); + s.append(getToken(0).image); + + while ((t.kind != RBRACE) && (t.kind != SEMICOLON) && (t.kind != EOF)) { + s.append(t.image); + getNextToken(); + t = getToken(1); + } + + return s.toString(); + } + + /** + * The following functions are useful for a DOM CSS implementation only and + * are not part of the general CSS2 parser. + */ + final public void _parseRule() throws ParseException { + String ret = null; + label_129: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[193] = jj_gen; + break label_129; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IMPORT_SYM: + importDeclaration(); break; + case LBRACKET: + case ANY: + case PARENT: + case DOT: + case COLON: + case EACH_VAR: + case IDENT: + case HASH: + styleRule(); + break; + case MEDIA_SYM: + media(); + break; + case PAGE_SYM: + page(); + break; + case FONT_FACE_SYM: + fontFace(); + break; + default: + jj_la1[194] = jj_gen; + ret = skipStatement(); + if ((ret == null) || (ret.length() == 0)) { + { + if (true) + return; + } + } + if (ret.charAt(0) == '@') { + documentHandler.ignorableAtRule(ret); + } else { + { + if (true) + throw new CSSParseException("unrecognize rule: " + ret, + getLocator()); + } + } + } + } + + final public void _parseImportRule() throws ParseException { + label_130: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[195] = jj_gen; + break label_130; + } + jj_consume_token(S); } - tok = getNextToken(); - tok = getToken(1); + importDeclaration(); } - return s.toString().trim(); - } + final public void _parseMediaRule() throws ParseException { + label_131: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[196] = jj_gen; + break label_131; + } + jj_consume_token(S); + } + media(); + } - String skip_to_matching_brace() throws ParseException { - StringBuffer s = new StringBuffer(); - Token tok; - int nesting = 1; - while (true) { - tok = getToken(1); - if (tok.kind == EOF) { + final public void _parseDeclarationBlock() throws ParseException { + label_132: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[197] = jj_gen; + break label_132; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + declaration(); break; + default: + jj_la1[198] = jj_gen; + ; } - s.append(tok.image); - if (tok.kind == LBRACE) { - nesting++; - } else if (tok.kind == RBRACE) { - nesting--; - if (nesting == 0) { - break; - } - } - getNextToken(); - } - return s.toString(); - } - - String convertStringIndex(String s, int start, int len) throws ParseException { - StringBuffer buf = new StringBuffer(len); - int index = start; - - while (index < len) { - char c = s.charAt(index); - if (c == '\u005c\u005c') { - if (++index < len) { - c = s.charAt(index); - switch (c) { - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - int numValue = Character.digit(c, 16); - int count = 0; - int p = 16; - - while (index + 1 < len && count < 6) { - c = s.charAt(index+1); - - if (Character.digit(c, 16) != -1) { - numValue = (numValue * 16) + Character.digit(c, 16); - p *= 16; - index++; - } else { - if (c == ' ') { - // skip the latest white space - index++; + label_133: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case SEMICOLON: + ; + break; + default: + jj_la1[199] = jj_gen; + break label_133; + } + jj_consume_token(SEMICOLON); + label_134: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[200] = jj_gen; + break label_134; + } + jj_consume_token(S); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENT: + declaration(); + break; + default: + jj_la1[201] = jj_gen; + ; + } + } + } + + final public ArrayList<String> _parseSelectors() throws ParseException { + ArrayList<String> p = null; + try { + label_135: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case S: + ; + break; + default: + jj_la1[202] = jj_gen; + break label_135; + } + jj_consume_token(S); + } + p = selectorList(); + { + if (true) + return p; + } + } catch (ThrowedParseException e) { + { + if (true) + throw (ParseException) e.e.fillInStackTrace(); + } + } + throw new Error("Missing return statement in function"); + } + + private boolean jj_2_1(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_1(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(0, xla); + } + } + + private boolean jj_2_2(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_2(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(1, xla); + } + } + + private boolean jj_2_3(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_3(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(2, xla); + } + } + + private boolean jj_2_4(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_4(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(3, xla); + } + } + + private boolean jj_2_5(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_5(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(4, xla); + } + } + + private boolean jj_2_6(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_6(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(5, xla); + } + } + + private boolean jj_2_7(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_7(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(6, xla); + } + } + + private boolean jj_2_8(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_8(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(7, xla); + } + } + + private boolean jj_3R_139() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_148()) { + jj_scanpos = xsp; + if (jj_3R_149()) { + jj_scanpos = xsp; + if (jj_3R_150()) { + jj_scanpos = xsp; + if (jj_3R_151()) { + jj_scanpos = xsp; + if (jj_3R_152()) + return true; + } + } + } + } + return false; + } + + private boolean jj_3R_167() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_186()) + jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_187()) { + jj_scanpos = xsp; + if (jj_3R_188()) { + jj_scanpos = xsp; + if (jj_3R_189()) { + jj_scanpos = xsp; + if (jj_3R_190()) { + jj_scanpos = xsp; + if (jj_3R_191()) { + jj_scanpos = xsp; + if (jj_3R_192()) { + jj_scanpos = xsp; + if (jj_3R_193()) { + jj_scanpos = xsp; + if (jj_3R_194()) { + jj_scanpos = xsp; + 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()) { + jj_scanpos = xsp; + if (jj_3R_200()) { + jj_scanpos = xsp; + if (jj_3R_201()) { + jj_scanpos = xsp; + if (jj_3R_202()) { + jj_scanpos = xsp; + if (jj_3R_203()) { + jj_scanpos = xsp; + if (jj_3R_204()) { + jj_scanpos = xsp; + if (jj_3R_205()) + return true; + } + } + } + } + } + } + } + } + } + } + } + } } - break; } } - buf.append((char) numValue); - break; - case '\u005cn': - case '\u005cf': - break; - case '\u005cr': - if (index + 1 < len) { - if (s.charAt(index + 1) == '\u005cn') { - index ++; + } + } + } + return false; + } + + private boolean jj_3R_156() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_167()) { + jj_scanpos = xsp; + if (jj_3R_168()) + return true; + } + while (true) { + xsp = jj_scanpos; + if (jj_scan_token(1)) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_142() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_156()) { + jj_scanpos = xsp; + if (jj_3R_157()) + return true; + } + return false; + } + + private boolean jj_3R_143() { + if (jj_3R_158()) + return true; + return false; + } + + private boolean jj_3R_162() { + if (jj_scan_token(HASH)) + return true; + return false; + } + + private boolean jj_3R_214() { + if (jj_scan_token(HASH)) + return true; + return false; + } + + private boolean jj_3R_220() { + if (jj_scan_token(PLUS)) + return true; + return false; + } + + private boolean jj_3R_219() { + if (jj_scan_token(MINUS)) + return true; + return false; + } + + private boolean jj_3R_212() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_219()) { + jj_scanpos = xsp; + if (jj_3R_220()) + return true; + } + return false; + } + + private boolean jj_3_8() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_143()) + jj_scanpos = xsp; + if (jj_3R_142()) + return true; + return false; + } + + private boolean jj_3R_215() { + if (jj_scan_token(URL)) + return true; + return false; + } + + private boolean jj_3R_166() { + if (jj_3R_142()) + return true; + return false; + } + + private boolean jj_3_2() { + if (jj_3R_138()) + return true; + if (jj_3R_139()) + return true; + return false; + } + + private boolean jj_3R_171() { + if (jj_scan_token(COMMA)) + return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_scan_token(1)) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_158() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_170()) { + jj_scanpos = xsp; + if (jj_3R_171()) + return true; + } + return false; + } + + private boolean jj_3R_170() { + if (jj_scan_token(DIV)) + return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_scan_token(1)) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_216() { + if (jj_scan_token(UNICODERANGE)) + return true; + return false; + } + + private boolean jj_3R_164() { + if (jj_scan_token(COLON)) + return true; + return false; + } + + private boolean jj_3_4() { + if (jj_3R_140()) + return true; + return false; + } + + private boolean jj_3R_221() { + if (jj_3R_166()) + return true; + return false; + } + + private boolean jj_3R_213() { + if (jj_scan_token(FUNCTION)) + return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_scan_token(1)) { + jj_scanpos = xsp; + break; + } + } + xsp = jj_scanpos; + if (jj_3R_221()) + jj_scanpos = xsp; + if (jj_scan_token(RPARAN)) + return true; + return false; + } + + private boolean jj_3_3() { + if (jj_3R_140()) + return true; + return false; + } + + private boolean jj_3R_157() { + if (jj_3R_169()) + return true; + return false; + } + + private boolean jj_3R_210() { + if (jj_3R_216()) + return true; + return false; + } + + private boolean jj_3R_209() { + if (jj_3R_215()) + return true; + return false; + } + + private boolean jj_3R_208() { + if (jj_3R_214()) + return true; + return false; + } + + private boolean jj_3R_218() { + if (jj_scan_token(EACH_VAR)) + return true; + return false; + } + + private boolean jj_3R_165() { + if (jj_scan_token(LBRACKET)) + return true; + return false; + } + + private boolean jj_3R_153() { + if (jj_scan_token(IDENT)) + return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_scan_token(1)) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_169() { + if (jj_scan_token(VARIABLE)) + return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_scan_token(1)) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_185() { + if (jj_scan_token(PARENT)) + return true; + return false; + } + + private boolean jj_3R_184() { + if (jj_scan_token(ANY)) + return true; + return false; + } + + private boolean jj_3R_207() { + if (jj_scan_token(IDENT)) + return true; + return false; + } + + private boolean jj_3R_141() { + if (jj_scan_token(COMMA)) + return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_scan_token(1)) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_217() { + if (jj_scan_token(IDENT)) + return true; + return false; + } + + private boolean jj_3R_211() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_217()) { + jj_scanpos = xsp; + if (jj_3R_218()) + return true; + } + return false; + } + + private boolean jj_3R_137() { + if (jj_3R_140()) + return true; + return false; + } + + private boolean jj_3R_161() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_183()) { + jj_scanpos = xsp; + if (jj_3R_184()) { + jj_scanpos = xsp; + if (jj_3R_185()) + return true; + } + } + return false; + } + + private boolean jj_3R_183() { + Token xsp; + if (jj_3R_211()) + return true; + while (true) { + xsp = jj_scanpos; + if (jj_3R_211()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_206() { + if (jj_scan_token(STRING)) + return true; + return false; + } + + private boolean jj_3R_205() { + if (jj_3R_213()) + return true; + return false; + } + + private boolean jj_3R_180() { + if (jj_scan_token(S)) + return true; + return false; + } + + private boolean jj_3R_179() { + if (jj_scan_token(DOT)) + return true; + return false; + } + + private boolean jj_3R_168() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_206()) { + jj_scanpos = xsp; + if (jj_3R_207()) { + jj_scanpos = xsp; + if (jj_3R_208()) { + jj_scanpos = xsp; + if (jj_3R_209()) { + jj_scanpos = xsp; + if (jj_3R_210()) + return true; + } + } + } + } + return false; + } + + private boolean jj_3R_178() { + if (jj_scan_token(EQ)) + return true; + return false; + } + + private boolean jj_3R_177() { + if (jj_scan_token(RPARAN)) + return true; + return false; + } + + private boolean jj_3R_176() { + if (jj_scan_token(FUNCTION)) + return true; + return false; + } + + private boolean jj_3R_175() { + if (jj_scan_token(COLON)) + return true; + return false; + } + + private boolean jj_3R_174() { + if (jj_scan_token(EACH_VAR)) + return true; + return false; + } + + private boolean jj_3R_173() { + if (jj_scan_token(NUMBER)) + return true; + return false; + } + + private boolean jj_3_7() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_141()) + jj_scanpos = xsp; + if (jj_3R_142()) + return true; + return false; + } + + private boolean jj_3R_159() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_172()) { + jj_scanpos = xsp; + if (jj_3R_173()) { + jj_scanpos = xsp; + if (jj_3R_174()) { + jj_scanpos = xsp; + if (jj_3R_175()) { + jj_scanpos = xsp; + if (jj_3R_176()) { + jj_scanpos = xsp; + if (jj_3R_177()) { + jj_scanpos = xsp; + if (jj_3R_178()) { + jj_scanpos = xsp; + if (jj_3R_179()) { + jj_scanpos = xsp; + if (jj_3R_180()) + return true; + } + } + } } } - break; - default: - buf.append(c); } - } else { - throw new CSSParseException("invalid string " + s, getLocator()); } - } else { - buf.append(c); } - index++; + return false; + } + + private boolean jj_3R_172() { + if (jj_scan_token(IDENT)) + return true; + return false; + } + + private boolean jj_3R_204() { + if (jj_scan_token(DIMEN)) + return true; + return false; + } + + private boolean jj_3R_203() { + if (jj_scan_token(KHZ)) + return true; + return false; } - return buf.toString(); - } + private boolean jj_3R_163() { + if (jj_scan_token(DOT)) + return true; + return false; + } - String convertIdent(String s) throws ParseException { - return convertStringIndex(s, 0, s.length()); - } + private boolean jj_3R_136() { + if (jj_3R_144()) + return true; + return false; + } - String convertString(String s) throws ParseException { - return convertStringIndex(s, 0, s.length()); - } + private boolean jj_3R_202() { + if (jj_scan_token(HZ)) + return true; + return false; + } - void comments() throws ParseException { - if (token.specialToken != null){ - Token tmp_t = token.specialToken; - while (tmp_t.specialToken != null) tmp_t = tmp_t.specialToken; - while (tmp_t != null) { - documentHandler.comment(tmp_t.image); - tmp_t = tmp_t.next; + private boolean jj_3R_144() { + if (jj_scan_token(MICROSOFT_RULE)) + return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_scan_token(1)) { + jj_scanpos = xsp; + break; + } + } + if (jj_scan_token(COLON)) + return true; + if (jj_3R_159()) + return true; + while (true) { + xsp = jj_scanpos; + if (jj_3R_159()) { + jj_scanpos = xsp; + break; + } } + return false; } - } - void rejectToken(Token t) throws ParseException { - Token fakeToken = new Token(); - t.next = token; - fakeToken.next = t; - token = fakeToken; - } + private boolean jj_3R_182() { + if (jj_scan_token(PRECEDES)) + return true; + return false; + } - String skipAfterExpression() throws ParseException { - Token t = getToken(1); - StringBuffer s = new StringBuffer(); - s.append(getToken(0).image); + private boolean jj_3_6() { + if (jj_3R_140()) + return true; + return false; + } - while ((t.kind != RBRACE) && (t.kind != SEMICOLON) && (t.kind != EOF)) { - s.append(t.image); - getNextToken(); - t = getToken(1); + private boolean jj_3R_201() { + if (jj_scan_token(MS)) + return true; + return false; } - return s.toString(); - } + private boolean jj_3R_181() { + if (jj_scan_token(PLUS)) + return true; + return false; + } -/** - * The following functions are useful for a DOM CSS implementation only and are - * not part of the general CSS2 parser. - */ - final public void _parseRule() throws ParseException { - String ret = null; - label_117: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[177] = jj_gen; - break label_117; - } - jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IMPORT_SYM: - importDeclaration(); - break; - case LBRACKET: - case ANY: - case PARENT: - case DOT: - case COLON: - case EACH_VAR: - case IDENT: - case HASH: - styleRule(); - break; - case MEDIA_SYM: - media(); - break; - case PAGE_SYM: - page(); - break; - case FONT_FACE_SYM: - fontFace(); - break; - default: - jj_la1[178] = jj_gen; - ret = skipStatement(); - if ((ret == null) || (ret.length() == 0)) { - {if (true) return;} + private boolean jj_3R_200() { + if (jj_scan_token(SECOND)) + return true; + return false; + } + + private boolean jj_3R_160() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_181()) { + jj_scanpos = xsp; + if (jj_3R_182()) + return true; + } + return false; + } + + private boolean jj_3R_199() { + if (jj_scan_token(GRAD)) + return true; + return false; + } + + private boolean jj_3R_146() { + if (jj_scan_token(PRECEDES)) + return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_scan_token(1)) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_198() { + if (jj_scan_token(RAD)) + return true; + return false; + } + + private boolean jj_3R_147() { + if (jj_scan_token(S)) + return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_160()) + jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_145() { + if (jj_scan_token(PLUS)) + return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_scan_token(1)) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_138() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_145()) { + jj_scanpos = xsp; + if (jj_3R_146()) { + jj_scanpos = xsp; + if (jj_3R_147()) + return true; + } + } + return false; + } + + private boolean jj_3_1() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_136()) { + jj_scanpos = xsp; + if (jj_3R_137()) + return true; + } + return false; + } + + private boolean jj_3R_155() { + if (jj_scan_token(LBRACE)) + return true; + return false; + } + + private boolean jj_3R_197() { + if (jj_scan_token(DEG)) + return true; + return false; + } + + private boolean jj_3R_196() { + if (jj_scan_token(EXS)) + return true; + return false; + } + + private boolean jj_3R_195() { + if (jj_scan_token(EMS)) + return true; + return false; + } + + private boolean jj_3R_194() { + if (jj_scan_token(PX)) + return true; + return false; + } + + private boolean jj_3R_193() { + if (jj_scan_token(IN)) + return true; + return false; + } + + private boolean jj_3R_154() { + if (jj_3R_166()) + return true; + return false; + } + + private boolean jj_3R_192() { + if (jj_scan_token(PC)) + return true; + return false; + } + + private boolean jj_3_5() { + if (jj_3R_140()) + return true; + return false; + } + + private boolean jj_3R_191() { + if (jj_scan_token(MM)) + return true; + return false; + } + + private boolean jj_3R_152() { + if (jj_3R_165()) + return true; + return false; + } + + private boolean jj_3R_151() { + if (jj_3R_164()) + return true; + return false; + } + + private boolean jj_3R_190() { + if (jj_scan_token(CM)) + return true; + return false; + } + + private boolean jj_3R_140() { + if (jj_3R_153()) + 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; + } + } + xsp = jj_scanpos; + if (jj_3R_154()) { + jj_scanpos = xsp; + if (jj_3R_155()) + return true; + } + return false; + } + + private boolean jj_3R_150() { + if (jj_3R_163()) + return true; + return false; + } + + private boolean jj_3R_189() { + if (jj_scan_token(PT)) + return true; + return false; + } + + private boolean jj_3R_149() { + if (jj_3R_162()) + return true; + return false; + } + + private boolean jj_3R_188() { + if (jj_scan_token(PERCENTAGE)) + return true; + return false; + } + + private boolean jj_3R_186() { + if (jj_3R_212()) + return true; + return false; + } + + private boolean jj_3R_148() { + if (jj_3R_161()) + return true; + return false; + } + + private boolean jj_3R_187() { + if (jj_scan_token(NUMBER)) + return true; + return false; + } + + /** Generated Token Manager. */ + public ParserTokenManager token_source; + /** Current token. */ + public Token token; + /** Next token. */ + public Token jj_nt; + private int jj_ntk; + private Token jj_scanpos, jj_lastpos; + private int jj_la; + private int jj_gen; + final private int[] jj_la1 = new int[203]; + static private int[] jj_la1_0; + static private int[] jj_la1_1; + static private int[] jj_la1_2; + static private int[] jj_la1_3; + static { + jj_la1_init_0(); + jj_la1_init_1(); + jj_la1_init_2(); + jj_la1_init_3(); + } + + private static void jj_la1_init_0() { + jj_la1_0 = new int[] { 0x0, 0xc02, 0xc02, 0x0, 0xc00, 0x2, 0x2, 0x2, + 0x1d000000, 0xc00, 0x2, 0xc00, 0x2, 0x0, 0x2, 0x0, 0x2, 0x2, + 0x2, 0x1d3ed400, 0x1d3ed400, 0x2, 0x80000, 0x2, 0x2, 0x2, 0x2, + 0x0, 0x0, 0x2, 0x0, 0x100000, 0x2, 0x0, 0x2, 0x2, 0x2, 0x2, + 0x0, 0x100000, 0x2, 0x0, 0x2, 0x3ed400, 0x2, 0x2, 0x220000, + 0x2, 0x220000, 0x220002, 0x2, 0x50010002, 0x50010002, 0x2, 0x2, + 0x2, 0x2, 0x2, 0x1d000000, 0x0, 0x0, 0x1d000000, 0x2, 0x80000, + 0x2, 0x2, 0x11000000, 0x11000000, 0x11000000, 0x11000000, + 0x11000000, 0x11000000, 0x11000000, 0x11000000, 0x11000000, + 0x11000000, 0x1d000000, 0x0, 0x0, 0x0, 0x0, 0xc000000, 0x2, + 0x2, 0x1c000, 0x2, 0x0, 0x2, 0x1c000, 0x0, 0x2, 0x2, 0x0, 0x2, + 0x0, 0x2, 0x100000, 0xe4e70002, 0x2, 0x1d000000, 0x0, + 0x1d000000, 0x2, 0x0, 0x2, 0xe4e70002, 0x0, 0x2, 0x1d000000, + 0x0, 0x1d000000, 0x2, 0xe4e70002, 0x2, 0x2, 0x2, 0x0, 0x2, + 0x1d000000, 0x0, 0x1d000000, 0x2, 0x2, 0x80000, 0x2, 0x2, 0x2, + 0x2, 0x0, 0x2, 0x1d000000, 0x0, 0x1d000000, 0x2, 0x80000, 0x2, + 0x2, 0x2, 0x80000, 0x0, 0x60000, 0x80000, 0x2, 0x60000, 0x2, + 0x0, 0x2, 0x100000, 0x2, 0x2, 0x2, 0x2, 0x80000, 0x2, 0x2, 0x0, + 0x2, 0x2, 0x2, 0x100000, 0x2, 0x2, 0x0, 0x100000, 0x2, 0x0, + 0x2, 0x2, 0x0, 0x2, 0x0, 0x100000, 0x2, 0x0, 0x2, 0x61000, 0x2, + 0x0, 0x2, 0x2, 0x2, 0x2, 0x880000, 0x880000, 0x60000, 0x60000, + 0x0, 0x0, 0x60000, 0x2, 0x60000, 0x2, 0x60000, 0x2, 0x1d000000, + 0x2, 0x2, 0x2, 0x0, 0x100000, 0x2, 0x0, 0x2, }; + } + + private static void jj_la1_init_1() { + jj_la1_1 = new int[] { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x1060018, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x38, 0x38, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18, 0x18, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x95040018, 0x80000000, 0x15040000, 0x18, 0x0, + 0x0, 0x0, 0x0, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, + 0x8, 0x18, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, + 0x0, 0x10040018, 0x10040000, 0x18, 0x0, 0x8000000, 0x0, 0x7, + 0x0, 0x0, 0x10040018, 0x10040000, 0x18, 0x0, 0x7, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x10040018, 0x10040000, 0x18, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11040018, 0x11040000, 0x18, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc000, 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, 0x18, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }; + } + + private static void jj_la1_init_2() { + jj_la1_2 = new int[] { 0x10000000, 0x80000000, 0x80000000, 0x4000000, + 0x80000000, 0x0, 0x0, 0x0, 0x6a000088, 0x80000000, 0x0, + 0x80000000, 0x0, 0x44, 0x0, 0x8, 0x0, 0x0, 0x0, 0xfe00015c, + 0xfe00015c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x8, + 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x8, 0x0, + 0xfc000154, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18, 0x18, 0x0, + 0x0, 0x0, 0x0, 0x0, 0xa000088, 0x8, 0x8000080, 0x2000008, 0x0, + 0x0, 0x0, 0x0, 0x2000000, 0x2000000, 0x0, 0x0, 0x2000000, + 0x2000000, 0x2000000, 0x2000000, 0x2000000, 0x2000000, + 0x2000008, 0x8, 0x8, 0x8, 0x8, 0x8, 0x0, 0x0, 0x0, 0x0, 0xc, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x2, 0x0, 0x0, 0x98, 0x0, + 0xa000088, 0x8000080, 0x2000008, 0x0, 0x0, 0x0, 0x98, 0x1, 0x0, + 0xa000088, 0x8000080, 0x2000008, 0x0, 0x98, 0x0, 0x0, 0x0, + 0x88, 0x0, 0xa000088, 0x8000080, 0x2000008, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x8, 0x0, 0xa000088, 0x8000080, 0x2000008, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3ffffdc, 0x0, 0x0, 0x3ffffdc, + 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x8, 0x0, 0x0, + 0x0, 0x0, 0x8, 0x0, 0x0, 0x8, 0x0, 0x3ffffdc, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1ffff10, 0x200004c, + 0x3ffff5c, 0x0, 0x3ffffdc, 0x0, 0x3ffffdc, 0x0, 0x6e000008, + 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x8, 0x0, }; + } + + private static void jj_la1_init_3() { + jj_la1_3 = new int[] { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x800, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3401, + 0x3401, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3401, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1000, 0x1000, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x800, 0x0, 0x800, 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, 0x0, 0x0, 0x0, + 0x0, 0x800, 0x0, 0x800, 0x800, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x1000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x1400, 0x0, 0x0, 0x1400, 0x0, 0x1000, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x1400, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x1000, 0x400, 0x1400, 0x0, 0x1400, 0x0, 0x1400, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }; + } + + final private JJCalls[] jj_2_rtns = new JJCalls[8]; + private boolean jj_rescan = false; + private int jj_gc = 0; + + /** Constructor with user supplied CharStream. */ + public Parser(CharStream stream) { + token_source = new ParserTokenManager(stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 203; i++) + jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) + jj_2_rtns[i] = new JJCalls(); + } + + /** Reinitialise. */ + public void ReInit(CharStream stream) { + token_source.ReInit(stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 203; i++) + jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) + jj_2_rtns[i] = new JJCalls(); + } + + /** Constructor with generated Token Manager. */ + public Parser(ParserTokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 203; i++) + jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) + jj_2_rtns[i] = new JJCalls(); + } + + /** Reinitialise. */ + public void ReInit(ParserTokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 203; i++) + jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) + jj_2_rtns[i] = new JJCalls(); + } + + private Token jj_consume_token(int kind) throws ParseException { + Token oldToken; + if ((oldToken = token).next != null) + token = token.next; + else + token = token.next = token_source.getNextToken(); + jj_ntk = -1; + if (token.kind == kind) { + jj_gen++; + if (++jj_gc > 100) { + jj_gc = 0; + for (int i = 0; i < jj_2_rtns.length; i++) { + JJCalls c = jj_2_rtns[i]; + while (c != null) { + if (c.gen < jj_gen) + c.first = null; + c = c.next; } - if (ret.charAt(0) == '@') { - documentHandler.ignorableAtRule(ret); - } else { - {if (true) throw new CSSParseException("unrecognize rule: " + ret, - getLocator());} + } + } + return token; + } + token = oldToken; + jj_kind = kind; + throw generateParseException(); + } + + static private final class LookaheadSuccess extends java.lang.Error { + } + + final private LookaheadSuccess jj_ls = new LookaheadSuccess(); + + private boolean jj_scan_token(int kind) { + if (jj_scanpos == jj_lastpos) { + jj_la--; + if (jj_scanpos.next == null) { + jj_lastpos = jj_scanpos = jj_scanpos.next = token_source + .getNextToken(); + } else { + jj_lastpos = jj_scanpos = jj_scanpos.next; + } + } else { + jj_scanpos = jj_scanpos.next; + } + if (jj_rescan) { + int i = 0; + Token tok = token; + while (tok != null && tok != jj_scanpos) { + i++; + tok = tok.next; + } + if (tok != null) + jj_add_error_token(kind, i); + } + if (jj_scanpos.kind != kind) + return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) + throw jj_ls; + return false; + } + + /** Get the next Token. */ + final public Token getNextToken() { + if (token.next != null) + token = token.next; + else + token = token.next = token_source.getNextToken(); + jj_ntk = -1; + jj_gen++; + return token; + } + + /** Get the specific Token. */ + final public Token getToken(int index) { + Token t = token; + for (int i = 0; i < index; i++) { + if (t.next != null) + t = t.next; + else + t = t.next = token_source.getNextToken(); + } + return t; + } + + private int jj_ntk() { + if ((jj_nt = token.next) == null) + return (jj_ntk = (token.next = token_source.getNextToken()).kind); + else + return (jj_ntk = jj_nt.kind); + } + + private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>(); + private int[] jj_expentry; + private int jj_kind = -1; + private int[] jj_lasttokens = new int[100]; + private int jj_endpos; + + private void jj_add_error_token(int kind, int pos) { + if (pos >= 100) + return; + if (pos == jj_endpos + 1) { + jj_lasttokens[jj_endpos++] = kind; + } else if (jj_endpos != 0) { + jj_expentry = new int[jj_endpos]; + for (int i = 0; i < jj_endpos; i++) { + jj_expentry[i] = jj_lasttokens[i]; + } + jj_entries_loop: for (java.util.Iterator<?> it = jj_expentries + .iterator(); it.hasNext();) { + int[] oldentry = (int[]) (it.next()); + if (oldentry.length == jj_expentry.length) { + for (int i = 0; i < jj_expentry.length; i++) { + if (oldentry[i] != jj_expentry[i]) { + continue jj_entries_loop; + } } + jj_expentries.add(jj_expentry); + break jj_entries_loop; + } + } + if (pos != 0) + jj_lasttokens[(jj_endpos = pos) - 1] = kind; + } + } + + /** Generate ParseException. */ + public ParseException generateParseException() { + jj_expentries.clear(); + boolean[] la1tokens = new boolean[110]; + if (jj_kind >= 0) { + la1tokens[jj_kind] = true; + jj_kind = -1; + } + for (int i = 0; i < 203; i++) { + if (jj_la1[i] == jj_gen) { + for (int j = 0; j < 32; j++) { + if ((jj_la1_0[i] & (1 << j)) != 0) { + la1tokens[j] = true; + } + if ((jj_la1_1[i] & (1 << j)) != 0) { + la1tokens[32 + j] = true; + } + if ((jj_la1_2[i] & (1 << j)) != 0) { + la1tokens[64 + j] = true; + } + if ((jj_la1_3[i] & (1 << j)) != 0) { + la1tokens[96 + j] = true; + } + } + } + } + for (int i = 0; i < 110; i++) { + if (la1tokens[i]) { + jj_expentry = new int[1]; + jj_expentry[0] = i; + jj_expentries.add(jj_expentry); + } + } + jj_endpos = 0; + jj_rescan_token(); + jj_add_error_token(0, 0); + int[][] exptokseq = new int[jj_expentries.size()][]; + for (int i = 0; i < jj_expentries.size(); i++) { + exptokseq[i] = jj_expentries.get(i); + } + return new ParseException(token, exptokseq, tokenImage); } - } - - final public void _parseImportRule() throws ParseException { - label_118: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[179] = jj_gen; - break label_118; - } - jj_consume_token(S); - } - importDeclaration(); - } - - final public void _parseMediaRule() throws ParseException { - label_119: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[180] = jj_gen; - break label_119; - } - jj_consume_token(S); - } - media(); - } - - final public void _parseDeclarationBlock() throws ParseException { - label_120: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[181] = jj_gen; - break label_120; - } - jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - declaration(); - break; - default: - jj_la1[182] = jj_gen; - ; - } - label_121: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SEMICOLON: - ; - break; - default: - jj_la1[183] = jj_gen; - break label_121; - } - jj_consume_token(SEMICOLON); - label_122: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[184] = jj_gen; - break label_122; - } - jj_consume_token(S); - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - declaration(); - break; - default: - jj_la1[185] = jj_gen; - ; - } - } - } - - final public SelectorList _parseSelectors() throws ParseException { - SelectorList p = null; - try { - label_123: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case S: - ; - break; - default: - jj_la1[186] = jj_gen; - break label_123; - } - jj_consume_token(S); - } - p = selectorList(); - {if (true) return p;} - } catch (ThrowedParseException e) { - {if (true) throw (ParseException) e.e.fillInStackTrace();} - } - throw new Error("Missing return statement in function"); - } - - private boolean jj_2_1(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_1(); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(0, xla); } - } - - private boolean jj_2_2(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_2(); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(1, xla); } - } - - private boolean jj_2_3(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_3(); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(2, xla); } - } - - private boolean jj_2_4(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_4(); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(3, xla); } - } - - private boolean jj_2_5(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_5(); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(4, xla); } - } - - private boolean jj_2_6(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_6(); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(5, xla); } - } - - private boolean jj_2_7(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_7(); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(6, xla); } - } - - private boolean jj_3R_181() { - if (jj_scan_token(IDENT)) return true; - return false; - } - - private boolean jj_3R_180() { - if (jj_scan_token(STRING)) return true; - return false; - } - - private boolean jj_3R_179() { - if (jj_3R_187()) return true; - return false; - } - - private boolean jj_3R_153() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_180()) { - jj_scanpos = xsp; - if (jj_3R_181()) { - jj_scanpos = xsp; - if (jj_3R_182()) { - jj_scanpos = xsp; - if (jj_3R_183()) { - jj_scanpos = xsp; - if (jj_3R_184()) return true; - } - } - } - } - return false; - } - - private boolean jj_3_1() { - if (jj_3R_124()) return true; - return false; - } - - private boolean jj_3R_139() { - if (jj_3R_149()) return true; - return false; - } - - private boolean jj_3R_138() { - if (jj_3R_148()) return true; - return false; - } - - private boolean jj_3R_137() { - if (jj_3R_147()) return true; - return false; - } - - private boolean jj_3R_136() { - if (jj_3R_146()) return true; - return false; - } - - private boolean jj_3R_178() { - if (jj_scan_token(DIMEN)) return true; - return false; - } - - private boolean jj_3_5() { - if (jj_3R_124()) return true; - return false; - } - - private boolean jj_3R_177() { - if (jj_scan_token(KHZ)) return true; - return false; - } - - private boolean jj_3R_135() { - if (jj_3R_145()) return true; - return false; - } - - private boolean jj_3R_146() { - if (jj_scan_token(HASH)) return true; - return false; - } - - private boolean jj_3R_176() { - if (jj_scan_token(HZ)) return true; - return false; - } - - private boolean jj_3R_126() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_135()) { - jj_scanpos = xsp; - if (jj_3R_136()) { - jj_scanpos = xsp; - if (jj_3R_137()) { - jj_scanpos = xsp; - if (jj_3R_138()) { - jj_scanpos = xsp; - if (jj_3R_139()) return true; - } - } - } - } - return false; - } - - private boolean jj_3R_175() { - if (jj_scan_token(MS)) return true; - return false; - } - - private boolean jj_3R_174() { - if (jj_scan_token(SECOND)) return true; - return false; - } - - private boolean jj_3R_173() { - if (jj_scan_token(GRAD)) return true; - return false; - } - - private boolean jj_3R_172() { - if (jj_scan_token(RAD)) return true; - return false; - } - - private boolean jj_3R_131() { - if (jj_scan_token(LBRACE)) return true; - return false; - } - - private boolean jj_3R_171() { - if (jj_scan_token(DEG)) return true; - return false; - } - - private boolean jj_3R_170() { - if (jj_scan_token(EXS)) return true; - return false; - } - - private boolean jj_3R_169() { - if (jj_scan_token(EMS)) return true; - return false; - } - - private boolean jj_3R_168() { - if (jj_scan_token(PX)) return true; - return false; - } - - private boolean jj_3R_167() { - if (jj_scan_token(IN)) return true; - return false; - } - - private boolean jj_3R_130() { - if (jj_3R_143()) return true; - return false; - } - - private boolean jj_3R_166() { - if (jj_scan_token(PC)) return true; - return false; - } - - private boolean jj_3R_165() { - if (jj_scan_token(MM)) return true; - return false; - } - - private boolean jj_3_2() { - if (jj_3R_125()) return true; - if (jj_3R_126()) return true; - return false; - } - - private boolean jj_3R_164() { - if (jj_scan_token(CM)) return true; - return false; - } - - private boolean jj_3R_124() { - if (jj_3R_129()) 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; } - } - xsp = jj_scanpos; - if (jj_3R_130()) { - jj_scanpos = xsp; - if (jj_3R_131()) return true; - } - return false; - } - - private boolean jj_3R_163() { - if (jj_scan_token(PT)) return true; - return false; - } - - private boolean jj_3_4() { - if (jj_3R_124()) return true; - return false; - } - - private boolean jj_3R_162() { - if (jj_scan_token(PERCENTAGE)) return true; - return false; - } - - private boolean jj_3R_148() { - if (jj_scan_token(COLON)) return true; - return false; - } - - private boolean jj_3R_160() { - if (jj_3R_186()) return true; - return false; - } - - private boolean jj_3R_161() { - if (jj_scan_token(NUMBER)) return true; - return false; - } - - private boolean jj_3R_152() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_160()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_161()) { - jj_scanpos = xsp; - if (jj_3R_162()) { - jj_scanpos = xsp; - if (jj_3R_163()) { - jj_scanpos = xsp; - if (jj_3R_164()) { - jj_scanpos = xsp; - if (jj_3R_165()) { - jj_scanpos = xsp; - if (jj_3R_166()) { - jj_scanpos = xsp; - if (jj_3R_167()) { - jj_scanpos = xsp; - if (jj_3R_168()) { - jj_scanpos = xsp; - if (jj_3R_169()) { - jj_scanpos = xsp; - if (jj_3R_170()) { - jj_scanpos = xsp; - if (jj_3R_171()) { - jj_scanpos = xsp; - if (jj_3R_172()) { - jj_scanpos = xsp; - if (jj_3R_173()) { - jj_scanpos = xsp; - if (jj_3R_174()) { - jj_scanpos = xsp; - if (jj_3R_175()) { - jj_scanpos = xsp; - if (jj_3R_176()) { - jj_scanpos = xsp; - if (jj_3R_177()) { - jj_scanpos = xsp; - if (jj_3R_178()) { - jj_scanpos = xsp; - if (jj_3R_179()) return true; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_141() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_152()) { - jj_scanpos = xsp; - if (jj_3R_153()) return true; - } - while (true) { - xsp = jj_scanpos; - if (jj_scan_token(1)) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_128() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_141()) { - jj_scanpos = xsp; - if (jj_3R_142()) return true; - } - return false; - } - - private boolean jj_3R_188() { - if (jj_scan_token(HASH)) return true; - return false; - } - - private boolean jj_3R_127() { - if (jj_3R_140()) return true; - return false; - } - - private boolean jj_3_3() { - if (jj_3R_124()) return true; - return false; - } - - private boolean jj_3R_194() { - if (jj_scan_token(PLUS)) return true; - return false; - } - - private boolean jj_3R_193() { - if (jj_scan_token(MINUS)) return true; - return false; - } - - private boolean jj_3R_186() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_193()) { - jj_scanpos = xsp; - if (jj_3R_194()) return true; - } - return false; - } - private boolean jj_3_7() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_127()) jj_scanpos = xsp; - if (jj_3R_128()) return true; - return false; - } + /** Enable tracing. */ + final public void enable_tracing() { + } - private boolean jj_3R_189() { - if (jj_scan_token(URL)) return true; - return false; - } + /** Disable tracing. */ + final public void disable_tracing() { + } - private boolean jj_3R_143() { - if (jj_3R_128()) return true; - return false; - } + private void jj_rescan_token() { + jj_rescan = true; + for (int i = 0; i < 8; i++) { + try { + JJCalls p = jj_2_rtns[i]; + do { + if (p.gen > jj_gen) { + jj_la = p.arg; + jj_lastpos = jj_scanpos = p.first; + switch (i) { + case 0: + jj_3_1(); + break; + case 1: + jj_3_2(); + break; + case 2: + jj_3_3(); + break; + case 3: + jj_3_4(); + break; + case 4: + jj_3_5(); + break; + case 5: + jj_3_6(); + break; + case 6: + jj_3_7(); + break; + case 7: + jj_3_8(); + break; + } + } + p = p.next; + } while (p != null); + } catch (LookaheadSuccess ls) { + } + } + jj_rescan = false; + } - private boolean jj_3R_192() { - if (jj_scan_token(EACH_VAR)) return true; - return false; - } + private void jj_save(int index, int xla) { + JJCalls p = jj_2_rtns[index]; + while (p.gen > jj_gen) { + if (p.next == null) { + p = p.next = new JJCalls(); + break; + } + p = p.next; + } + p.gen = jj_gen + xla - jj_la; + p.first = token; + p.arg = xla; + } - private boolean jj_3R_151() { - if (jj_scan_token(COMMA)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_scan_token(1)) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_150() { - if (jj_scan_token(DIV)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_scan_token(1)) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_140() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_150()) { - jj_scanpos = xsp; - if (jj_3R_151()) return true; - } - return false; - } - - private boolean jj_3R_149() { - if (jj_scan_token(LBRACKET)) return true; - return false; - } - - private boolean jj_3R_190() { - if (jj_scan_token(UNICODERANGE)) return true; - return false; - } - - private boolean jj_3R_195() { - if (jj_3R_143()) return true; - return false; - } - - private boolean jj_3R_159() { - if (jj_scan_token(PARENT)) return true; - return false; - } - - private boolean jj_3R_158() { - if (jj_scan_token(ANY)) return true; - return false; - } - - private boolean jj_3R_129() { - if (jj_scan_token(IDENT)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_scan_token(1)) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_154() { - if (jj_scan_token(VARIABLE)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_scan_token(1)) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_191() { - if (jj_scan_token(IDENT)) return true; - return false; - } - - private boolean jj_3R_185() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_191()) { - jj_scanpos = xsp; - if (jj_3R_192()) return true; - } - return false; - } - - private boolean jj_3R_187() { - if (jj_scan_token(FUNCTION)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_scan_token(1)) { jj_scanpos = xsp; break; } - } - xsp = jj_scanpos; - if (jj_3R_195()) jj_scanpos = xsp; - if (jj_scan_token(RPARAN)) return true; - return false; - } - - private boolean jj_3R_145() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_157()) { - jj_scanpos = xsp; - if (jj_3R_158()) { - jj_scanpos = xsp; - if (jj_3R_159()) return true; - } - } - return false; - } - - private boolean jj_3R_157() { - Token xsp; - if (jj_3R_185()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_185()) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_156() { - if (jj_scan_token(PRECEDES)) return true; - return false; - } - - private boolean jj_3R_155() { - if (jj_scan_token(PLUS)) return true; - return false; - } - - private boolean jj_3R_144() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_155()) { - jj_scanpos = xsp; - if (jj_3R_156()) return true; - } - return false; - } - - private boolean jj_3R_142() { - if (jj_3R_154()) return true; - return false; - } - - private boolean jj_3R_184() { - if (jj_3R_190()) return true; - return false; - } - - private boolean jj_3R_133() { - if (jj_scan_token(PRECEDES)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_scan_token(1)) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_183() { - if (jj_3R_189()) return true; - return false; - } - - private boolean jj_3R_182() { - if (jj_3R_188()) return true; - return false; - } - - private boolean jj_3R_134() { - if (jj_scan_token(S)) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_144()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_125() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_132()) { - jj_scanpos = xsp; - if (jj_3R_133()) { - jj_scanpos = xsp; - if (jj_3R_134()) return true; - } - } - return false; - } - - private boolean jj_3R_132() { - if (jj_scan_token(PLUS)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_scan_token(1)) { jj_scanpos = xsp; break; } - } - return false; - } - - private boolean jj_3R_147() { - if (jj_scan_token(DOT)) return true; - return false; - } - - private boolean jj_3_6() { - if (jj_3R_124()) return true; - return false; - } - - /** Generated Token Manager. */ - public ParserTokenManager token_source; - /** Current token. */ - public Token token; - /** Next token. */ - public Token jj_nt; - private int jj_ntk; - private Token jj_scanpos, jj_lastpos; - private int jj_la; - private int jj_gen; - final private int[] jj_la1 = new int[187]; - static private int[] jj_la1_0; - static private int[] jj_la1_1; - static private int[] jj_la1_2; - static private int[] jj_la1_3; - static { - jj_la1_init_0(); - jj_la1_init_1(); - jj_la1_init_2(); - jj_la1_init_3(); - } - private static void jj_la1_init_0() { - jj_la1_0 = new int[] {0x0,0xc02,0xc02,0x0,0xc00,0x2,0x2,0x2,0x1d000000,0xc00,0x2,0xc00,0x2,0x0,0x2,0x0,0x2,0x2,0x2,0x1d3ed400,0x1d3ed400,0x2,0x80000,0x2,0x2,0x2,0x2,0x0,0x0,0x2,0x0,0x100000,0x2,0x0,0x2,0x2,0x2,0x2,0x0,0x100000,0x2,0x0,0x2,0x3ed400,0x2,0x2,0x220000,0x2,0x220000,0x220002,0x2,0x2,0x2,0x2,0x1d000000,0x0,0x1d000000,0x2,0x80000,0x2,0x2,0x11000000,0x11000000,0x11000000,0x11000000,0x11000000,0x11000000,0x11000000,0x11000000,0x11000000,0x11000000,0x1d000000,0x0,0x0,0x0,0x0,0xc000000,0x2,0x2,0x1c000,0x2,0x0,0x2,0x1c000,0x0,0x2,0x2,0x0,0x2,0x0,0x2,0x100000,0xe4e70002,0x2,0x1d000000,0x0,0x1d000000,0x2,0x0,0x2,0xe4e70002,0x0,0x2,0x1d000000,0x0,0x1d000000,0x2,0xe4e70002,0x2,0x2,0x2,0x2,0x1d000000,0x0,0x1d000000,0x2,0x2,0x80000,0x2,0x2,0x2,0x2,0x0,0x2,0x1d000000,0x0,0x1d000000,0x2,0x80000,0x2,0x2,0x0,0x80000,0x2,0x2,0x0,0x2,0x100000,0x2,0x0,0x2,0x2,0x2,0x100000,0x2,0x2,0x0,0x100000,0x2,0x0,0x2,0x2,0x0,0x2,0x0,0x100000,0x2,0x0,0x2,0x61000,0x2,0x0,0x2,0x2,0x2,0x2,0x880000,0x880000,0x60000,0x60000,0x0,0x0,0x60000,0x2,0x60000,0x2,0x60000,0x2,0x1d000000,0x2,0x2,0x2,0x0,0x100000,0x2,0x0,0x2,}; - } - private static void jj_la1_init_1() { - jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1060018,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x38,0x38,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x15040018,0x15040000,0x18,0x0,0x0,0x0,0x0,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x18,0x10,0x10,0x10,0x10,0x10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7,0x0,0x10040018,0x10040000,0x18,0x0,0x8000000,0x0,0x7,0x80000000,0x0,0x10040018,0x10040000,0x18,0x0,0x7,0x0,0x0,0x0,0x0,0x10040018,0x10040000,0x18,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10040018,0x10040000,0x18,0x0,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc000,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,0x18,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; - } - private static void jj_la1_init_2() { - jj_la1_2 = new int[] {0x8000000,0x40000000,0x40000000,0x2000000,0x40000000,0x0,0x0,0x0,0x35000044,0x40000000,0x0,0x40000000,0x0,0x22,0x0,0x4,0x0,0x0,0x0,0xff0000ae,0xff0000ae,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x0,0x0,0x4,0x0,0x0,0x4,0x0,0x0,0x0,0x0,0x4,0x0,0x0,0x4,0x0,0xfe0000aa,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x5000044,0x4000040,0x1000004,0x0,0x0,0x0,0x0,0x1000000,0x1000000,0x0,0x0,0x1000000,0x1000000,0x1000000,0x1000000,0x1000000,0x1000000,0x1000004,0x4,0x4,0x4,0x4,0x4,0x0,0x0,0x0,0x0,0x6,0x0,0x0,0x0,0x0,0x0,0x4,0x0,0x1,0x0,0x0,0x4c,0x0,0x5000044,0x4000040,0x1000004,0x0,0x0,0x0,0x4c,0x0,0x0,0x5000044,0x4000040,0x1000004,0x0,0x4c,0x0,0x0,0x0,0x0,0x5000044,0x4000040,0x1000004,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x0,0x5000044,0x4000040,0x1000004,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x0,0x0,0x4,0x0,0x0,0x80000000,0x0,0x4,0x0,0x0,0x4,0x0,0x1ffffee,0x0,0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xffff88,0x1000026,0x1ffffae,0x0,0x1ffffee,0x0,0x1ffffee,0x0,0x37000004,0x0,0x0,0x0,0x4,0x0,0x0,0x4,0x0,}; - } - private static void jj_la1_init_3() { - jj_la1_3 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xe00,0xe00,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xe00,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,0x400,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,0x400,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x400,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x600,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x400,0x200,0x600,0x0,0x600,0x0,0x600,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; - } - final private JJCalls[] jj_2_rtns = new JJCalls[7]; - private boolean jj_rescan = false; - private int jj_gc = 0; - - /** Constructor with user supplied CharStream. */ - public Parser(CharStream stream) { - token_source = new ParserTokenManager(stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 187; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - public void ReInit(CharStream stream) { - token_source.ReInit(stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 187; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Constructor with generated Token Manager. */ - public Parser(ParserTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 187; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - public void ReInit(ParserTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 187; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - private Token jj_consume_token(int kind) throws ParseException { - Token oldToken; - if ((oldToken = token).next != null) token = token.next; - else token = token.next = token_source.getNextToken(); - jj_ntk = -1; - if (token.kind == kind) { - jj_gen++; - if (++jj_gc > 100) { - jj_gc = 0; - for (int i = 0; i < jj_2_rtns.length; i++) { - JJCalls c = jj_2_rtns[i]; - while (c != null) { - if (c.gen < jj_gen) c.first = null; - c = c.next; - } - } - } - return token; - } - token = oldToken; - jj_kind = kind; - throw generateParseException(); - } - - static private final class LookaheadSuccess extends java.lang.Error { } - final private LookaheadSuccess jj_ls = new LookaheadSuccess(); - private boolean jj_scan_token(int kind) { - if (jj_scanpos == jj_lastpos) { - jj_la--; - if (jj_scanpos.next == null) { - jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); - } else { - jj_lastpos = jj_scanpos = jj_scanpos.next; - } - } else { - jj_scanpos = jj_scanpos.next; - } - if (jj_rescan) { - int i = 0; Token tok = token; - while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } - if (tok != null) jj_add_error_token(kind, i); - } - if (jj_scanpos.kind != kind) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; - return false; - } - - -/** Get the next Token. */ - final public Token getNextToken() { - if (token.next != null) token = token.next; - else token = token.next = token_source.getNextToken(); - jj_ntk = -1; - jj_gen++; - return token; - } - -/** Get the specific Token. */ - final public Token getToken(int index) { - Token t = token; - for (int i = 0; i < index; i++) { - if (t.next != null) t = t.next; - else t = t.next = token_source.getNextToken(); - } - return t; - } - - private int jj_ntk() { - if ((jj_nt=token.next) == null) - return (jj_ntk = (token.next=token_source.getNextToken()).kind); - else - return (jj_ntk = jj_nt.kind); - } - - private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>(); - private int[] jj_expentry; - private int jj_kind = -1; - private int[] jj_lasttokens = new int[100]; - private int jj_endpos; - - private void jj_add_error_token(int kind, int pos) { - if (pos >= 100) return; - if (pos == jj_endpos + 1) { - jj_lasttokens[jj_endpos++] = kind; - } else if (jj_endpos != 0) { - jj_expentry = new int[jj_endpos]; - for (int i = 0; i < jj_endpos; i++) { - jj_expentry[i] = jj_lasttokens[i]; - } - jj_entries_loop: for (java.util.Iterator<?> it = jj_expentries.iterator(); it.hasNext();) { - int[] oldentry = (int[])(it.next()); - if (oldentry.length == jj_expentry.length) { - for (int i = 0; i < jj_expentry.length; i++) { - if (oldentry[i] != jj_expentry[i]) { - continue jj_entries_loop; - } - } - jj_expentries.add(jj_expentry); - break jj_entries_loop; - } - } - if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; - } - } - - /** Generate ParseException. */ - public ParseException generateParseException() { - jj_expentries.clear(); - boolean[] la1tokens = new boolean[108]; - if (jj_kind >= 0) { - la1tokens[jj_kind] = true; - jj_kind = -1; - } - for (int i = 0; i < 187; i++) { - if (jj_la1[i] == jj_gen) { - for (int j = 0; j < 32; j++) { - if ((jj_la1_0[i] & (1<<j)) != 0) { - la1tokens[j] = true; - } - if ((jj_la1_1[i] & (1<<j)) != 0) { - la1tokens[32+j] = true; - } - if ((jj_la1_2[i] & (1<<j)) != 0) { - la1tokens[64+j] = true; - } - if ((jj_la1_3[i] & (1<<j)) != 0) { - la1tokens[96+j] = true; - } - } - } - } - for (int i = 0; i < 108; i++) { - if (la1tokens[i]) { - jj_expentry = new int[1]; - jj_expentry[0] = i; - jj_expentries.add(jj_expentry); - } - } - jj_endpos = 0; - jj_rescan_token(); - jj_add_error_token(0, 0); - int[][] exptokseq = new int[jj_expentries.size()][]; - for (int i = 0; i < jj_expentries.size(); i++) { - exptokseq[i] = jj_expentries.get(i); - } - return new ParseException(token, exptokseq, tokenImage); - } - - /** Enable tracing. */ - final public void enable_tracing() { - } - - /** Disable tracing. */ - final public void disable_tracing() { - } - - private void jj_rescan_token() { - jj_rescan = true; - for (int i = 0; i < 7; i++) { - try { - JJCalls p = jj_2_rtns[i]; - do { - if (p.gen > jj_gen) { - jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; - switch (i) { - case 0: jj_3_1(); break; - case 1: jj_3_2(); break; - case 2: jj_3_3(); break; - case 3: jj_3_4(); break; - case 4: jj_3_5(); break; - case 5: jj_3_6(); break; - case 6: jj_3_7(); break; - } - } - p = p.next; - } while (p != null); - } catch(LookaheadSuccess ls) { } - } - jj_rescan = false; - } - - private void jj_save(int index, int xla) { - JJCalls p = jj_2_rtns[index]; - while (p.gen > jj_gen) { - if (p.next == null) { p = p.next = new JJCalls(); break; } - p = p.next; - } - p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; - } - - static final class JJCalls { - int gen; - Token first; - int arg; - JJCalls next; - } + static final class JJCalls { + int gen; + Token first; + int arg; + JJCalls next; + } } diff --git a/theme-compiler/src/com/vaadin/sass/parser/Parser.jj b/theme-compiler/src/com/vaadin/sass/parser/Parser.jj index f126f8e343..52f9535213 100644 --- a/theme-compiler/src/com/vaadin/sass/parser/Parser.jj +++ b/theme-compiler/src/com/vaadin/sass/parser/Parser.jj @@ -229,13 +229,7 @@ public class Parser implements org.w3c.css.sac.Parser { this.source = source; ReInit(getCharStreamWithLurk(source)); - if (selectorFactory == null) { - selectorFactory = new SelectorFactoryImpl(); - } - if (conditionFactory == null) { - conditionFactory = new ConditionFactoryImpl(); - } - return _parseSelectors(); + return null; } public LexicalUnit parsePropertyValue(InputSource source) @@ -548,6 +542,7 @@ TOKEN : /* basic tokens */ | <NONASCII> | <ESCAPE> > | < #D : ["0"-"9"] > | < #NAME : ( <NMCHAR> )+ > + } <DEFAULT> @@ -581,7 +576,14 @@ TOKEN : < DEFAULT > TOKEN: { - < IF : "if" >
} + < MICROSOFT_RULE : "filter"|"-ms-filter" > +} + +< DEFAULT > +TOKEN: +{ + < IF : "if" > +} <DEFAULT> TOKEN: @@ -670,6 +672,12 @@ TOKEN : | "U+" <UNI> "-" <UNI> > } +< DEFAULT > +TOKEN : +{ + < REMOVE : "remove" (< S >)? "(" > +} + <DEFAULT> TOKEN : { @@ -729,7 +737,7 @@ void afterImportDeclaration() : } { ( - ( variable() | mixinDirective()|eachDirective() | includeDirective() | styleRule() | media()| page() | fontFace() + ( variable() | removeDirective() | mixinDirective()|eachDirective() | includeDirective() | styleRule() | media()| page() | fontFace() | { l = getLocator(); } ret=skipStatement() { if ((ret == null) || (ret.length() == 0)) { @@ -979,6 +987,32 @@ char connector = ' '; ( <S> )* )? { return connector; } } +void microsoftExtension() : +{ + Token n; + String name = ""; + String value = ""; +} + +{ + n = < MICROSOFT_RULE > (< S >)* { name = n.image; } + < COLON > + ((n = < IDENT > { value += n.image; }) + | (n = < NUMBER > { value += n.image; }) + | (n = < EACH_VAR > { value += n.image; }) + | (n = < COLON > { value += n.image; }) + | (n = < FUNCTION > { value += n.image; }) + | (n = < RPARAN > { value += n.image; }) + | (n = < EQ > { value += n.image; }) + | (n = < DOT > { value += n.image; }) + | (n = < S > { if(value.lastIndexOf(' ') != value.length()-1) + { value += n.image; } } + ) )+ + < SEMICOLON > + (< S >)* + { documentHandler.microsoftDirective(name, value); } +} + /** * @exception ParseException exception during the parse */ @@ -1006,7 +1040,7 @@ String functionName() : void styleRule() : { boolean start = false; - SelectorList l = null; + ArrayList<String> l = null; Token save; Locator loc; } @@ -1017,7 +1051,7 @@ void styleRule() : start = true; documentHandler.startSelector(l); } - ( ifDirective() | includeDirective() | media() | extendDirective()| eachDirective() | variable() | LOOKAHEAD(3) declarationOrNestedProperties() | styleRule())* + ( ifDirective() | removeDirective() | includeDirective() | media() | extendDirective()| eachDirective() | variable() | LOOKAHEAD(3) (microsoftExtension()|declarationOrNestedProperties()) | styleRule())* <RBRACE> (<S>)* } catch (ThrowedParseException e) { if (errorHandler != null) { @@ -1034,20 +1068,20 @@ void styleRule() : reportWarningSkipText(getLocator(), skipStatement()); } finally { if (start) { - documentHandler.endSelector(l); + documentHandler.endSelector(); } } } -SelectorList selectorList() : + ArrayList<String> selectorList() : { - SelectorListImpl selectors = new SelectorListImpl(); - Selector selector; + ArrayList<String> selectors = new ArrayList<String>(); + String selector; } { - selector=selector() ( <COMMA> (<S>)* { selectors.addSelector(selector); } + selector=selector() ( <COMMA> (<S>)* { selectors.add(selector); } selector=selector() )* - { selectors.addSelector(selector); + { selectors.add(selector); return selectors; } } @@ -1055,9 +1089,9 @@ SelectorList selectorList() : /** * @exception ParseException exception during the parse */ -Selector selector() : +String selector() : { - Selector selector; + String selector; char comb; } { @@ -1095,10 +1129,10 @@ Selector selector() : /** * @exception ParseException exception during the parse */ -Selector simple_selector(Selector selector, char comb) : +String simple_selector(String selector, char comb) : { - SimpleSelector simple_current = null; - Condition cond = null; + String simple_current = null; + String cond = null; pseudoElt = null; } @@ -1117,27 +1151,21 @@ Selector simple_selector(Selector selector, char comb) : ) { if (simple_current == null) { - simple_current = selectorFactory.createElementSelector(null, null); + simple_current = ""; } if (cond != null) { - simple_current = selectorFactory.createConditionalSelector(simple_current, - cond); + simple_current = simple_current + cond; } if (selector != null) { switch (comb) { case ' ': - selector = selectorFactory.createDescendantSelector(selector, - simple_current); + selector = selector + comb + simple_current; break; case '+': - selector = - selectorFactory.createDirectAdjacentSelector((short) 1, - selector, - simple_current); + selector = selector + " " + comb + " " + simple_current; break; case '>': - selector = selectorFactory.createChildSelector(selector, - simple_current); + selector = selector + " " + comb + " " + simple_current; break; default: throw new ParseException("invalid state. send a bug report"); @@ -1146,8 +1174,7 @@ Selector simple_selector(Selector selector, char comb) : selector= simple_current; } if (pseudoElt != null) { - selector = selectorFactory.createChildSelector(selector, - selectorFactory.createPseudoElementSelector(null, pseudoElt)); + selector = selector + pseudoElt; } return selector; } @@ -1156,19 +1183,18 @@ Selector simple_selector(Selector selector, char comb) : /** * @exception ParseException exception during the parse */ -Condition _class(Condition pred) : +String _class(String pred) : {Token t; -String s = ""; -Condition c; +String s = "."; } { "." (t = <IDENT>{s += t.image; }|t = < EACH_VAR >{ s += t.image; })+ { - c = conditionFactory.createClassCondition(null, s); + if (pred == null) { - return c; + return s; } else { - return conditionFactory.createAndCondition(pred, c); + return pred + s; } } } @@ -1176,23 +1202,23 @@ Condition c; /** * @exception ParseException exception during the parse */ -SimpleSelector element_name() : +String element_name() : {Token t; String s = "";} { (t = <IDENT>{s += t.image; }|t = < EACH_VAR >{ s += t.image; })+ { - return selectorFactory.createElementSelector(null, s); + return s; } | "*" - { return selectorFactory.createElementSelector(null, "*"); } + { return "*"; } | "&" - { return selectorFactory.createElementSelector(null, "&"); } + { return "&"; } } /** * @exception ParseException exception during the parse */ -Condition attrib(Condition pred) : +String attrib(String pred) : { int cases = 0; Token att = null; @@ -1205,39 +1231,35 @@ Condition attrib(Condition pred) : | <INCLUDES> { cases = 2; } | <DASHMATCH> { cases = 3; } ) ( <S> )* ( val=<IDENT> { attValue = val.image; } - | val=<STRING> { attValue = convertStringIndex(val.image, 1, - val.image.length() -1);} + | val=<STRING> { attValue = val.image; } ) ( <S> )* )? "]" { String name = convertIdent(att.image); - Condition c; + String c; switch (cases) { case 0: - c = conditionFactory.createAttributeCondition(name, null, false, null); + c = name; break; case 1: - c = conditionFactory.createAttributeCondition(name, null, false, - attValue); + c = name + "=" + attValue; break; case 2: - c = conditionFactory.createOneOfAttributeCondition(name, null, false, - attValue); + c = name + "~=" + attValue; break; case 3: - c = conditionFactory.createBeginHyphenAttributeCondition(name, null, - false, - attValue); + c = name + "|=" +attValue; break; default: // never reached. c = null; } + c = "[" + c + "]"; if (pred == null) { return c; } else { - return conditionFactory.createAndCondition(pred, c); + return pred + c; } } } @@ -1245,7 +1267,7 @@ Condition attrib(Condition pred) : /** * @exception ParseException exception during the parse */ -Condition pseudo(Condition pred) : +String pseudo(String pred) : {Token n; Token language; boolean isPseudoElement = false; @@ -1253,22 +1275,21 @@ boolean isPseudoElement = false; { ":" (":"{isPseudoElement=true;})?( n=<IDENT> { - String s = convertIdent(n.image); + String s = ":" + convertIdent(n.image); if (isPseudoElement) { if (pseudoElt != null) { throw new CSSParseException("duplicate pseudo element definition " + s, getLocator()); } else { - pseudoElt = s; + pseudoElt = ":"+s; return pred; } } else { - Condition c = - conditionFactory.createPseudoClassCondition(null, s); + String c = s; if (pred == null) { return c; } else { - return conditionFactory.createAndCondition(pred, c); + return pred + c; } } } @@ -1276,12 +1297,11 @@ boolean isPseudoElement = false; { String f = convertIdent(n.image); if (f.equals("lang(")) { - Condition d = - conditionFactory.createLangCondition(convertIdent(language.image)); + String d = convertIdent(language.image); if (pred == null) { return d; } else { - return conditionFactory.createAndCondition(pred, d); + return pred + d; } } else { throw new CSSParseException("invalid pseudo function name " @@ -1295,17 +1315,16 @@ boolean isPseudoElement = false; /** * @exception ParseException exception during the parse */ -Condition hash(Condition pred) : +String hash(String pred) : {Token n; } { n=<HASH> { - Condition d = - conditionFactory.createIdCondition(n.image.substring(1)); + String d = n.image; if (pred == null) { return d; } else { - return conditionFactory.createAndCondition(pred, d); + return pred + d; } } } @@ -1313,7 +1332,7 @@ Condition hash(Condition pred) : void variable() : { String name; - LexicalUnit exp = null; + LexicalUnitImpl exp = null; boolean guarded = false; String raw; } @@ -1359,7 +1378,9 @@ void ifDirective() : } { < IF_SYM > - ( n = booleanExpressionToken() { evaluator += n.image; } )+
< LBRACE >(< S >)*
{ documentHandler.startIfElseDirective(); + ( n = booleanExpressionToken() { evaluator += n.image; } )+ + < LBRACE >(< S >)* + { documentHandler.startIfElseDirective(); documentHandler.ifDirective(evaluator); } ( includeDirective() | media() | extendDirective()| variable() | LOOKAHEAD(3) declarationOrNestedProperties() | styleRule())* @@ -1368,20 +1389,29 @@ void ifDirective() : { documentHandler.endIfElseDirective(); } } -void elseDirective() :
{ +void elseDirective() : +{ String evaluator = ""; - Token n = null;
} + Token n = null; +} { < ELSE_SYM >(< S >)* ( < IF > (n = booleanExpressionToken() { if(n != null) evaluator += n.image; })*)? < LBRACE >(< S >)* { if(!evaluator.trim().equals("")){ documentHandler.ifDirective(evaluator); } - else{ documentHandler.elseDirective(); }
}
( includeDirective() | media() | extendDirective()| variable() | LOOKAHEAD(3) declarationOrNestedProperties() | styleRule())*
< RBRACE >(< S >)* + else{ documentHandler.elseDirective(); } + } + ( includeDirective() | media() | extendDirective()| variable() | LOOKAHEAD(3) declarationOrNestedProperties() | styleRule())* + < RBRACE >(< S >)* } -Token booleanExpressionToken() :
{ - Token n = null;
} -{
(
n = < VARIABLE > +Token booleanExpressionToken() : +{ + Token n = null; +} +{ + ( + n = < VARIABLE > |n = < IDENT > |n = < NUMBER > |n = < LPARAN > @@ -1399,22 +1429,28 @@ Token booleanExpressionToken() :
{ |n = < S > |n = < NOT_EQ > ){ - return n;
} + return n; + } } void eachDirective() : { Token var; - ArrayList<String> list; + ArrayList<String> list = null; + String listVariable = null; } { < EACH_SYM > (< S >)* var = < VARIABLE > (< S >)* < EACH_IN > (< S >)* - list = stringList() + (list = stringList() + {documentHandler.startEachDirective(var.image, list);} + |{documentHandler.startEachDirective(var.image, list);}removeDirective() + |listVariable = variableName() + {documentHandler.startEachDirective(var.image, listVariable);} + ) < LBRACE >(< S >)* - { documentHandler.startEachDirective(var.image, list);} - ( includeDirective() | media() | extendDirective()| variable() | LOOKAHEAD(3) declarationOrNestedProperties() | styleRule())* + ( includeDirective() | removeDirective() | media() | extendDirective()| variable() | LOOKAHEAD(3) declarationOrNestedProperties() | styleRule())* < RBRACE >(< S >)* { documentHandler.endEachDirective();} } @@ -1446,7 +1482,7 @@ void mixinDirective() : |(name = functionName() args = arglist()) <RPARAN> (<S>)*) <LBRACE> (<S>)* {documentHandler.startMixinDirective(name, args);} - ( includeDirective() | media()| extendDirective()| variable() | LOOKAHEAD(3) declarationOrNestedProperties() | styleRule())* + ( includeDirective() | media() | eachDirective() | extendDirective()| variable() | LOOKAHEAD(3) declarationOrNestedProperties() | styleRule())* //(includeDirective() | media() | LOOKAHEAD(declaration()) declaration()";"(<S>)* | styleRule())* <RBRACE>(<S>)* {documentHandler.endMixinDirective(name, args);} @@ -1468,25 +1504,29 @@ ArrayList<VariableNode> arglist() : VariableNode mixinArg() : { String name; - LexicalUnit value = null; + LexicalUnitImpl first = null; + LexicalUnitImpl next = null; + LexicalUnitImpl prev = null; } { - name=variableName() (":" (<S>)* value=term(null) )? + name=variableName() (":" (<S>)* first=term(null){ prev = first; } (LOOKAHEAD(2)(< COMMA >(< S >)*)?next=term(prev){prev.setNextLexicalUnit(next); prev = next;})* )? { - VariableNode arg = new VariableNode(name, value, false); + VariableNode arg = new VariableNode(name, first, false); return arg; } } -ArrayList<LexicalUnit> argValuelist() : +ArrayList<LexicalUnitImpl> argValuelist() : { - ArrayList<LexicalUnit> args = new ArrayList<LexicalUnit>(); - LexicalUnit argValue; + ArrayList<LexicalUnitImpl> args = new ArrayList<LexicalUnitImpl>(); + LexicalUnitImpl first = null; + LexicalUnitImpl next = null; + LexicalUnitImpl prev = null; } { - argValue= term(null) { args.add(argValue); } - ( <COMMA> (<S>)* argValue = term(null) - {args.add(argValue);} + first = term(null) { args.add(first); prev = first;}(next=term(prev){prev.setNextLexicalUnit(next); prev = next;})* + ( <COMMA> (<S>)* + first = term(null) { args.add(first); prev = first;}(next=term(prev){prev.setNextLexicalUnit(next); prev = next;})* )* {return args;} } @@ -1494,7 +1534,7 @@ ArrayList<LexicalUnit> argValuelist() : void includeDirective() : { String name; - ArrayList<LexicalUnit> args=null; + ArrayList<LexicalUnitImpl> args=null; } { <INCLUDE_SYM> @@ -1505,20 +1545,50 @@ void includeDirective() : {documentHandler.includeDirective(name, args);} } -Node functionDirective() : -{ - String name; - String args = null; - String body; - int[] stops = {RPARAN}; +/** + * @exception ParseException exception during the parse + */ +void removeDirective() :
{
ArrayList<String> list = null; + ArrayList<String> remove = null; + String separator = null; + Token n = null; } { - (name=functionName() args = skipStatementUntilRightParan() <RPARAN>) - (<S>)* - body = skipStatement() - { - return null; - } + < REMOVE >(< S >)* + (list = removeDirectiveArgs(0)) + < COMMA >(< S >)*
(remove = removeDirectiveArgs(1)) + ( < COMMA >(< S >)* n = < IDENT >{ separator = n.image; } (< S >)*)? + < RPARAN >(< S >)* < SEMICOLON >(< S >)* + + { documentHandler.removeDirective(list,remove,separator); }
} + +JAVACODE +ArrayList<String > removeDirectiveArgs(int nest)
{ + ArrayList<String> list = new ArrayList<String>(); + // Start at one due to "remove(" containing one. + int nesting = nest; + Token t = null; + + while(true)
{
t = getToken(1); + if(t.kind == VARIABLE)
{ + list.add(t.image); + }else if(t.kind == STRING)
{ + list.add(t.image.substring(1,t.image.length()).substring(0,t.image.length()-2)); + + }else if(t.kind == LPARAN)
{
nesting++; + if(nesting > nest+1)
{
throw new CSSParseException("Only one ( ) pair per parameter allowed", getLocator()); + } + }else if(t.kind == RPARAN)
{
nesting--; + if(nesting == 0)
{ + getNextToken();
return list; + } + } else if(t.kind == COMMA)
{ + if(nesting == nest)
{ + return list;
} + } else if(t.kind == LBRACE)
{ + throw new CSSParseException("Invalid token,'{' found", getLocator());
} +
getNextToken(); + } } Node returnDirective() : @@ -1573,7 +1643,7 @@ Node whileDirective() : } void extendDirective() : -{SelectorList list;} +{ArrayList<String> list;} { <EXTEND_SYM> (<S>)* @@ -1626,7 +1696,7 @@ LexicalUnit exp;} void declarationOrNestedProperties() : { boolean important = false; String name; - LexicalUnit exp; + LexicalUnitImpl exp; Token save; String comment = null; } @@ -1776,7 +1846,7 @@ n="/" ( <S> )* { return LexicalUnitImpl.createSlash(n.beginLine, /** * @exception ParseException exception during the parse */ -LexicalUnit expr() : +LexicalUnitImpl expr() : { LexicalUnitImpl first, res; char op; @@ -2170,10 +2240,6 @@ LexicalUnitImpl url(LexicalUnitImpl prev) : n=<URL> { String urlname = n.image.substring(4, n.image.length()-1).trim(); - if (urlname.charAt(0) == '"' - || urlname.charAt(0) == '\'') { - urlname = urlname.substring(1, urlname.length()-1); - } return LexicalUnitImpl.createURL(n.beginLine, n.beginColumn, prev, urlname); } } @@ -2493,8 +2559,8 @@ void _parseDeclarationBlock() : ( declaration() )? ( ";" ( <S> )* ( declaration() )? )* } -SelectorList _parseSelectors() : -{ SelectorList p = null; +ArrayList<String> _parseSelectors() : +{ ArrayList<String> p = null; } { try { diff --git a/theme-compiler/src/com/vaadin/sass/parser/ParserConstants.java b/theme-compiler/src/com/vaadin/sass/parser/ParserConstants.java index 6e6c0ae204..c7d6042d03 100644 --- a/theme-compiler/src/com/vaadin/sass/parser/ParserConstants.java +++ b/theme-compiler/src/com/vaadin/sass/parser/ParserConstants.java @@ -123,95 +123,99 @@ public interface ParserConstants { /** RegularExpression Id. */ int SUPPORTS_SYM = 62; /** RegularExpression Id. */ - int IF = 63; + int MICROSOFT_RULE = 63; /** RegularExpression Id. */ - int GUARDED_SYM = 64; + int IF = 64; /** RegularExpression Id. */ - int STRING = 65; + int GUARDED_SYM = 65; /** RegularExpression Id. */ - int IDENT = 66; + int STRING = 66; /** RegularExpression Id. */ - int NUMBER = 67; + int IDENT = 67; /** RegularExpression Id. */ - int _URL = 68; + int NUMBER = 68; /** RegularExpression Id. */ - int URL = 69; + int _URL = 69; /** RegularExpression Id. */ - int VARIABLE = 70; + int URL = 70; /** RegularExpression Id. */ - int PERCENTAGE = 71; + int VARIABLE = 71; /** RegularExpression Id. */ - int PT = 72; + int PERCENTAGE = 72; /** RegularExpression Id. */ - int MM = 73; + int PT = 73; /** RegularExpression Id. */ - int CM = 74; + int MM = 74; /** RegularExpression Id. */ - int PC = 75; + int CM = 75; /** RegularExpression Id. */ - int IN = 76; + int PC = 76; /** RegularExpression Id. */ - int PX = 77; + int IN = 77; /** RegularExpression Id. */ - int EMS = 78; + int PX = 78; /** RegularExpression Id. */ - int EXS = 79; + int EMS = 79; /** RegularExpression Id. */ - int DEG = 80; + int EXS = 80; /** RegularExpression Id. */ - int RAD = 81; + int DEG = 81; /** RegularExpression Id. */ - int GRAD = 82; + int RAD = 82; /** RegularExpression Id. */ - int MS = 83; + int GRAD = 83; /** RegularExpression Id. */ - int SECOND = 84; + int MS = 84; /** RegularExpression Id. */ - int HZ = 85; + int SECOND = 85; /** RegularExpression Id. */ - int KHZ = 86; + int HZ = 86; /** RegularExpression Id. */ - int DIMEN = 87; + int KHZ = 87; /** RegularExpression Id. */ - int HASH = 88; + int DIMEN = 88; /** RegularExpression Id. */ - int IMPORT_SYM = 89; + int HASH = 89; /** RegularExpression Id. */ - int MEDIA_SYM = 90; + int IMPORT_SYM = 90; /** RegularExpression Id. */ - int CHARSET_SYM = 91; + int MEDIA_SYM = 91; /** RegularExpression Id. */ - int PAGE_SYM = 92; + int CHARSET_SYM = 92; /** RegularExpression Id. */ - int FONT_FACE_SYM = 93; + int PAGE_SYM = 93; /** RegularExpression Id. */ - int ATKEYWORD = 94; + int FONT_FACE_SYM = 94; /** RegularExpression Id. */ - int IMPORTANT_SYM = 95; + int ATKEYWORD = 95; /** RegularExpression Id. */ - int RANGE0 = 96; + int IMPORTANT_SYM = 96; /** RegularExpression Id. */ - int RANGE1 = 97; + int RANGE0 = 97; /** RegularExpression Id. */ - int RANGE2 = 98; + int RANGE1 = 98; /** RegularExpression Id. */ - int RANGE3 = 99; + int RANGE2 = 99; /** RegularExpression Id. */ - int RANGE4 = 100; + int RANGE3 = 100; /** RegularExpression Id. */ - int RANGE5 = 101; + int RANGE4 = 101; /** RegularExpression Id. */ - int RANGE6 = 102; + int RANGE5 = 102; /** RegularExpression Id. */ - int RANGE = 103; + int RANGE6 = 103; /** RegularExpression Id. */ - int UNI = 104; + int RANGE = 104; /** RegularExpression Id. */ - int UNICODERANGE = 105; + int UNI = 105; /** RegularExpression Id. */ - int FUNCTION = 106; + int UNICODERANGE = 106; /** RegularExpression Id. */ - int UNKNOWN = 107; + int REMOVE = 107; + /** RegularExpression Id. */ + int FUNCTION = 108; + /** RegularExpression Id. */ + int UNKNOWN = 109; /** Lexical state. */ int DEFAULT = 0; @@ -287,6 +291,7 @@ public interface ParserConstants { "\"@extend\"", "\"@-moz-document\"", "\"@supports\"", + "<MICROSOFT_RULE>", "\"if\"", "<GUARDED_SYM>", "<STRING>", @@ -330,6 +335,7 @@ public interface ParserConstants { "<RANGE>", "<UNI>", "<UNICODERANGE>", + "<REMOVE>", "<FUNCTION>", "<UNKNOWN>", }; diff --git a/theme-compiler/src/com/vaadin/sass/parser/ParserTokenManager.java b/theme-compiler/src/com/vaadin/sass/parser/ParserTokenManager.java index a878acadec..025bcaae8f 100644 --- a/theme-compiler/src/com/vaadin/sass/parser/ParserTokenManager.java +++ b/theme-compiler/src/com/vaadin/sass/parser/ParserTokenManager.java @@ -37,170 +37,170 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) switch (pos) { case 0: - if ((active0 & 0x10000000L) != 0L) - return 400; + if ((active0 & 0x7ffe000000000000L) != 0L || (active1 & 0x7c000000L) != 0L) + return 111; + if ((active0 & 0x400000000L) != 0L) + return 423; if ((active0 & 0x40800L) != 0L) - return 159; - if ((active0 & 0x7ffe000000000000L) != 0L || (active1 & 0x3e000000L) != 0L) - return 96; - if ((active0 & 0x8001c00000000000L) != 0L) + return 42; + if ((active0 & 0x10000000L) != 0L) + return 424; + if ((active0 & 0x1c00000000000L) != 0L || (active1 & 0x1L) != 0L) { - jjmatchedKind = 66; - return 401; + jjmatchedKind = 67; + return 425; } - if ((active0 & 0x400000000L) != 0L) - return 402; if ((active0 & 0x800044L) != 0L) return 3; return -1; case 1: + if ((active0 & 0x2000000000000000L) != 0L) + return 112; if ((active0 & 0x800000000000L) != 0L) { - jjmatchedKind = 66; + jjmatchedKind = 67; jjmatchedPos = 1; - return 401; + return 425; } - if ((active0 & 0x2000000000000000L) != 0L) - return 97; - if ((active0 & 0x5ffe000000000000L) != 0L || (active1 & 0x3e000000L) != 0L) + if ((active0 & 0x1400000000000L) != 0L || (active1 & 0x1L) != 0L) + return 425; + if ((active0 & 0x40L) != 0L) + return 1; + if ((active0 & 0x5ffe000000000000L) != 0L || (active1 & 0x7c000000L) != 0L) { - jjmatchedKind = 94; + jjmatchedKind = 95; jjmatchedPos = 1; - return 403; + return 426; } - if ((active0 & 0x8001400000000000L) != 0L) - return 401; - if ((active0 & 0x40L) != 0L) - return 1; return -1; case 2: if ((active0 & 0x400000000000000L) != 0L) - return 403; - if ((active0 & 0x7bfe000000000000L) != 0L || (active1 & 0x3e000000L) != 0L) + return 426; + if ((active0 & 0x7bfe000000000000L) != 0L || (active1 & 0x7c000000L) != 0L) { - jjmatchedKind = 94; + jjmatchedKind = 95; jjmatchedPos = 2; - return 403; + return 426; } if ((active0 & 0x800000000000L) != 0L) { - jjmatchedKind = 66; + jjmatchedKind = 67; jjmatchedPos = 2; - return 401; + return 425; } return -1; case 3: - if ((active0 & 0x80000000000000L) != 0L) - return 403; if ((active0 & 0x800000000000L) != 0L) { - jjmatchedKind = 66; + jjmatchedKind = 67; jjmatchedPos = 3; - return 401; + return 425; } - if ((active0 & 0x7b7e000000000000L) != 0L || (active1 & 0x3e000000L) != 0L) + if ((active0 & 0x7b7e000000000000L) != 0L || (active1 & 0x7c000000L) != 0L) { - jjmatchedKind = 94; + jjmatchedKind = 95; jjmatchedPos = 3; - return 403; + return 426; } + if ((active0 & 0x80000000000000L) != 0L) + return 426; return -1; case 4: - if ((active0 & 0x940000000000000L) != 0L || (active1 & 0x10000000L) != 0L) - return 403; - if ((active0 & 0x723e000000000000L) != 0L || (active1 & 0x2e000000L) != 0L) + if ((active0 & 0x723e000000000000L) != 0L || (active1 & 0x5c000000L) != 0L) { - jjmatchedKind = 94; + jjmatchedKind = 95; jjmatchedPos = 4; - return 403; + return 426; } + if ((active0 & 0x940000000000000L) != 0L || (active1 & 0x20000000L) != 0L) + return 426; if ((active0 & 0x800000000000L) != 0L) { - jjmatchedKind = 66; + jjmatchedKind = 67; jjmatchedPos = 4; - return 401; + return 425; } return -1; case 5: - if ((active0 & 0x222000000000000L) != 0L || (active1 & 0x4000000L) != 0L) - return 403; - if ((active0 & 0x800000000000L) != 0L) + if ((active0 & 0x701c000000000000L) != 0L || (active1 & 0x54000000L) != 0L) { - jjmatchedKind = 66; + jjmatchedKind = 95; jjmatchedPos = 5; - return 401; + return 426; } - if ((active0 & 0x701c000000000000L) != 0L || (active1 & 0x2a000000L) != 0L) + if ((active0 & 0x800000000000L) != 0L) { - jjmatchedKind = 94; + jjmatchedKind = 67; jjmatchedPos = 5; - return 403; + return 425; } + if ((active0 & 0x222000000000000L) != 0L || (active1 & 0x8000000L) != 0L) + return 426; return -1; case 6: - if ((active0 & 0x1010000000000000L) != 0L || (active1 & 0x2000000L) != 0L) - return 403; if ((active0 & 0x800000000000L) != 0L) - return 401; - if ((active0 & 0x600c000000000000L) != 0L || (active1 & 0x28000000L) != 0L) + return 425; + if ((active0 & 0x1010000000000000L) != 0L || (active1 & 0x4000000L) != 0L) + return 426; + if ((active0 & 0x600c000000000000L) != 0L || (active1 & 0x50000000L) != 0L) { - jjmatchedKind = 94; + jjmatchedKind = 95; jjmatchedPos = 6; - return 403; + return 426; } return -1; case 7: - if ((active0 & 0x4000000000000L) != 0L || (active1 & 0x8000000L) != 0L) - return 403; - if ((active0 & 0x6008000000000000L) != 0L || (active1 & 0x20000000L) != 0L) + if ((active0 & 0x4000000000000L) != 0L || (active1 & 0x10000000L) != 0L) + return 426; + if ((active0 & 0x6008000000000000L) != 0L || (active1 & 0x40000000L) != 0L) { - jjmatchedKind = 94; + jjmatchedKind = 95; jjmatchedPos = 7; - return 403; + return 426; } return -1; case 8: if ((active0 & 0x4008000000000000L) != 0L) - return 403; - if ((active0 & 0x2000000000000000L) != 0L || (active1 & 0x20000000L) != 0L) + return 426; + if ((active0 & 0x2000000000000000L) != 0L || (active1 & 0x40000000L) != 0L) { - jjmatchedKind = 94; + jjmatchedKind = 95; jjmatchedPos = 8; - return 403; + return 426; } return -1; case 9: - if ((active1 & 0x20000000L) != 0L) - return 403; + if ((active1 & 0x40000000L) != 0L) + return 426; if ((active0 & 0x2000000000000000L) != 0L) { - jjmatchedKind = 94; + jjmatchedKind = 95; jjmatchedPos = 9; - return 403; + return 426; } return -1; case 10: if ((active0 & 0x2000000000000000L) != 0L) { - jjmatchedKind = 94; + jjmatchedKind = 95; jjmatchedPos = 10; - return 403; + return 426; } return -1; case 11: if ((active0 & 0x2000000000000000L) != 0L) { - jjmatchedKind = 94; + jjmatchedKind = 95; jjmatchedPos = 11; - return 403; + return 426; } return -1; case 12: if ((active0 & 0x2000000000000000L) != 0L) { - jjmatchedKind = 94; + jjmatchedKind = 95; jjmatchedPos = 12; - return 403; + return 426; } return -1; default : @@ -240,7 +240,7 @@ private int jjMoveStringLiteralDfa0_0() jjmatchedKind = 18; return jjMoveStringLiteralDfa1_0(0x800L, 0x0L); case 46: - return jjStartNfaWithStates_0(0, 28, 400); + return jjStartNfaWithStates_0(0, 28, 424); case 47: jjmatchedKind = 23; return jjMoveStringLiteralDfa1_0(0x44L, 0x0L); @@ -257,14 +257,14 @@ private int jjMoveStringLiteralDfa0_0() case 62: return jjStopAtPos(0, 21); case 64: - return jjMoveStringLiteralDfa1_0(0x7ffe000000000000L, 0x3e000000L); + return jjMoveStringLiteralDfa1_0(0x7ffe000000000000L, 0x7c000000L); case 91: return jjStopAtPos(0, 24); case 93: return jjStopAtPos(0, 25); case 73: case 105: - return jjMoveStringLiteralDfa1_0(0x8001000000000000L, 0x0L); + return jjMoveStringLiteralDfa1_0(0x1000000000000L, 0x1L); case 84: case 116: return jjMoveStringLiteralDfa1_0(0xc00000000000L, 0x0L); @@ -317,7 +317,7 @@ private int jjMoveStringLiteralDfa1_0(long active0, long active1) break; case 67: case 99: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x8000000L); + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x10000000L); case 68: case 100: return jjMoveStringLiteralDfa2_0(active0, 0x20000000000000L, active1, 0L); @@ -326,31 +326,31 @@ private int jjMoveStringLiteralDfa1_0(long active0, long active1) return jjMoveStringLiteralDfa2_0(active0, 0x1900000000000000L, active1, 0L); case 70: case 102: - if ((active0 & 0x8000000000000000L) != 0L) - return jjStartNfaWithStates_0(1, 63, 401); - return jjMoveStringLiteralDfa2_0(active0, 0x88000000000000L, active1, 0x20000000L); + if ((active1 & 0x1L) != 0L) + return jjStartNfaWithStates_0(1, 64, 425); + return jjMoveStringLiteralDfa2_0(active0, 0x88000000000000L, active1, 0x40000000L); case 72: case 104: return jjMoveStringLiteralDfa2_0(active0, 0x800000000000L, active1, 0L); case 73: case 105: - return jjMoveStringLiteralDfa2_0(active0, 0x404000000000000L, active1, 0x2000000L); + return jjMoveStringLiteralDfa2_0(active0, 0x404000000000000L, active1, 0x4000000L); case 77: case 109: - return jjMoveStringLiteralDfa2_0(active0, 0x2000000000000L, active1, 0x4000000L); + return jjMoveStringLiteralDfa2_0(active0, 0x2000000000000L, active1, 0x8000000L); case 78: case 110: if ((active0 & 0x1000000000000L) != 0L) - return jjStartNfaWithStates_0(1, 48, 401); + return jjStartNfaWithStates_0(1, 48, 425); break; case 79: case 111: if ((active0 & 0x400000000000L) != 0L) - return jjStartNfaWithStates_0(1, 46, 401); + return jjStartNfaWithStates_0(1, 46, 425); break; case 80: case 112: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x10000000L); + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x20000000L); case 82: case 114: return jjMoveStringLiteralDfa2_0(active0, 0x10000000000000L, active1, 0L); @@ -388,18 +388,18 @@ private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long a break; case 65: case 97: - return jjMoveStringLiteralDfa3_0(active0, 0x140000000000000L, active1, 0x10000000L); + return jjMoveStringLiteralDfa3_0(active0, 0x140000000000000L, active1, 0x20000000L); case 69: case 101: - return jjMoveStringLiteralDfa3_0(active0, 0x30000000000000L, active1, 0x4000000L); + return jjMoveStringLiteralDfa3_0(active0, 0x30000000000000L, active1, 0x8000000L); case 70: case 102: if ((active0 & 0x400000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 58, 403); + return jjStartNfaWithStates_0(2, 58, 426); break; case 72: case 104: - return jjMoveStringLiteralDfa3_0(active0, 0x200000000000000L, active1, 0x8000000L); + return jjMoveStringLiteralDfa3_0(active0, 0x200000000000000L, active1, 0x10000000L); case 73: case 105: return jjMoveStringLiteralDfa3_0(active0, 0x2000000000000L, active1, 0L); @@ -408,13 +408,13 @@ private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long a return jjMoveStringLiteralDfa3_0(active0, 0x800000000000000L, active1, 0L); case 77: case 109: - return jjMoveStringLiteralDfa3_0(active0, 0x2000000000000000L, active1, 0x2000000L); + return jjMoveStringLiteralDfa3_0(active0, 0x2000000000000000L, active1, 0x4000000L); case 78: case 110: return jjMoveStringLiteralDfa3_0(active0, 0x4000000000000L, active1, 0L); case 79: case 111: - return jjMoveStringLiteralDfa3_0(active0, 0x80000000000000L, active1, 0x20000000L); + return jjMoveStringLiteralDfa3_0(active0, 0x80000000000000L, active1, 0x40000000L); case 82: case 114: return jjMoveStringLiteralDfa3_0(active0, 0x800000000000L, active1, 0L); @@ -446,7 +446,7 @@ private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long a break; case 65: case 97: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x8000000L); + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x10000000L); case 66: case 98: return jjMoveStringLiteralDfa4_0(active0, 0x20000000000000L, active1, 0L); @@ -455,26 +455,26 @@ private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long a return jjMoveStringLiteralDfa4_0(active0, 0x104000000000000L, active1, 0L); case 68: case 100: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x4000000L); + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x8000000L); case 71: case 103: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x10000000L); + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x20000000L); case 73: case 105: return jjMoveStringLiteralDfa4_0(active0, 0x200000000000000L, active1, 0L); case 78: case 110: - return jjMoveStringLiteralDfa4_0(active0, 0x8000000000000L, active1, 0x20000000L); + return jjMoveStringLiteralDfa4_0(active0, 0x8000000000000L, active1, 0x40000000L); case 79: case 111: return jjMoveStringLiteralDfa4_0(active0, 0x2000800000000000L, active1, 0L); case 80: case 112: - return jjMoveStringLiteralDfa4_0(active0, 0x4000000000000000L, active1, 0x2000000L); + return jjMoveStringLiteralDfa4_0(active0, 0x4000000000000000L, active1, 0x4000000L); case 82: case 114: if ((active0 & 0x80000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 55, 403); + return jjStartNfaWithStates_0(3, 55, 426); return jjMoveStringLiteralDfa4_0(active0, 0x40000000000000L, active1, 0L); case 83: case 115: @@ -507,38 +507,38 @@ private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long a case 69: case 101: if ((active0 & 0x800000000000000L) != 0L) - return jjStartNfaWithStates_0(4, 59, 403); - else if ((active1 & 0x10000000L) != 0L) - return jjStartNfaWithStates_0(4, 92, 403); + return jjStartNfaWithStates_0(4, 59, 426); + else if ((active1 & 0x20000000L) != 0L) + return jjStartNfaWithStates_0(4, 93, 426); return jjMoveStringLiteralDfa5_0(active0, 0x1000000000000000L, active1, 0L); case 72: case 104: if ((active0 & 0x100000000000000L) != 0L) - return jjStartNfaWithStates_0(4, 56, 403); + return jjStartNfaWithStates_0(4, 56, 426); break; case 73: case 105: - return jjMoveStringLiteralDfa5_0(active0, 0x2000000000000L, active1, 0x4000000L); + return jjMoveStringLiteralDfa5_0(active0, 0x2000000000000L, active1, 0x8000000L); case 76: case 108: return jjMoveStringLiteralDfa5_0(active0, 0x204000000000000L, active1, 0L); case 78: case 110: if ((active0 & 0x40000000000000L) != 0L) - return jjStartNfaWithStates_0(4, 54, 403); + return jjStartNfaWithStates_0(4, 54, 426); break; case 79: case 111: - return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x2000000L); + return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x4000000L); case 80: case 112: return jjMoveStringLiteralDfa5_0(active0, 0x4000000000000000L, active1, 0L); case 82: case 114: - return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x8000000L); + return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x10000000L); case 84: case 116: - return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x20000000L); + return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x40000000L); case 85: case 117: return jjMoveStringLiteralDfa5_0(active0, 0x30800000000000L, active1, 0L); @@ -562,36 +562,36 @@ private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long a switch(curChar) { case 45: - return jjMoveStringLiteralDfa6_0(active0, 0x2000000000000000L, active1, 0x20000000L); + return jjMoveStringLiteralDfa6_0(active0, 0x2000000000000000L, active1, 0x40000000L); case 65: case 97: - if ((active1 & 0x4000000L) != 0L) - return jjStartNfaWithStates_0(5, 90, 403); + if ((active1 & 0x8000000L) != 0L) + return jjStartNfaWithStates_0(5, 91, 426); break; case 69: case 101: if ((active0 & 0x200000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 57, 403); + return jjStartNfaWithStates_0(5, 57, 426); break; case 71: case 103: if ((active0 & 0x20000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 53, 403); + return jjStartNfaWithStates_0(5, 53, 426); return jjMoveStringLiteralDfa6_0(active0, 0x800000000000L, active1, 0L); case 78: case 110: if ((active0 & 0x2000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 49, 403); + return jjStartNfaWithStates_0(5, 49, 426); return jjMoveStringLiteralDfa6_0(active0, 0x1000000000000000L, active1, 0L); case 79: case 111: return jjMoveStringLiteralDfa6_0(active0, 0x4000000000000000L, active1, 0L); case 82: case 114: - return jjMoveStringLiteralDfa6_0(active0, 0x10000000000000L, active1, 0x2000000L); + return jjMoveStringLiteralDfa6_0(active0, 0x10000000000000L, active1, 0x4000000L); case 83: case 115: - return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x8000000L); + return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x10000000L); case 84: case 116: return jjMoveStringLiteralDfa6_0(active0, 0x8000000000000L, active1, 0L); @@ -617,18 +617,18 @@ private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long a case 68: case 100: if ((active0 & 0x1000000000000000L) != 0L) - return jjStartNfaWithStates_0(6, 60, 403); + return jjStartNfaWithStates_0(6, 60, 426); return jjMoveStringLiteralDfa7_0(active0, 0x2004000000000000L, active1, 0L); case 69: case 101: - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x8000000L); + return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x10000000L); case 70: case 102: - return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x20000000L); + return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x40000000L); case 72: case 104: if ((active0 & 0x800000000000L) != 0L) - return jjStartNfaWithStates_0(6, 47, 401); + return jjStartNfaWithStates_0(6, 47, 425); break; case 73: case 105: @@ -636,15 +636,15 @@ private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long a case 78: case 110: if ((active0 & 0x10000000000000L) != 0L) - return jjStartNfaWithStates_0(6, 52, 403); + return jjStartNfaWithStates_0(6, 52, 426); break; case 82: case 114: return jjMoveStringLiteralDfa7_0(active0, 0x4000000000000000L, active1, 0L); case 84: case 116: - if ((active1 & 0x2000000L) != 0L) - return jjStartNfaWithStates_0(6, 89, 403); + if ((active1 & 0x4000000L) != 0L) + return jjStartNfaWithStates_0(6, 90, 426); break; default : break; @@ -664,19 +664,19 @@ private int jjMoveStringLiteralDfa7_0(long old0, long active0, long old1, long a { case 65: case 97: - return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x20000000L); + return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0x40000000L); case 69: case 101: if ((active0 & 0x4000000000000L) != 0L) - return jjStartNfaWithStates_0(7, 50, 403); + return jjStartNfaWithStates_0(7, 50, 426); break; case 79: case 111: return jjMoveStringLiteralDfa8_0(active0, 0x2008000000000000L, active1, 0L); case 84: case 116: - if ((active1 & 0x8000000L) != 0L) - return jjStartNfaWithStates_0(7, 91, 403); + if ((active1 & 0x10000000L) != 0L) + return jjStartNfaWithStates_0(7, 92, 426); return jjMoveStringLiteralDfa8_0(active0, 0x4000000000000000L, active1, 0L); default : break; @@ -696,16 +696,16 @@ private int jjMoveStringLiteralDfa8_0(long old0, long active0, long old1, long a { case 67: case 99: - return jjMoveStringLiteralDfa9_0(active0, 0x2000000000000000L, active1, 0x20000000L); + return jjMoveStringLiteralDfa9_0(active0, 0x2000000000000000L, active1, 0x40000000L); case 78: case 110: if ((active0 & 0x8000000000000L) != 0L) - return jjStartNfaWithStates_0(8, 51, 403); + return jjStartNfaWithStates_0(8, 51, 426); break; case 83: case 115: if ((active0 & 0x4000000000000000L) != 0L) - return jjStartNfaWithStates_0(8, 62, 403); + return jjStartNfaWithStates_0(8, 62, 426); break; default : break; @@ -725,8 +725,8 @@ private int jjMoveStringLiteralDfa9_0(long old0, long active0, long old1, long a { case 69: case 101: - if ((active1 & 0x20000000L) != 0L) - return jjStartNfaWithStates_0(9, 93, 403); + if ((active1 & 0x40000000L) != 0L) + return jjStartNfaWithStates_0(9, 94, 426); break; case 85: case 117: @@ -807,7 +807,7 @@ private int jjMoveStringLiteralDfa13_0(long old0, long active0) case 84: case 116: if ((active0 & 0x2000000000000000L) != 0L) - return jjStartNfaWithStates_0(13, 61, 403); + return jjStartNfaWithStates_0(13, 61, 426); break; default : break; @@ -828,7 +828,7 @@ static final long[] jjbitVec0 = { private int jjMoveNfa_0(int startState, int curPos) { int startsAt = 0; - jjnewStateCnt = 400; + jjnewStateCnt = 423; int i = 1; jjstateSet[0] = startState; int kind = 0x7fffffff; @@ -843,114 +843,116 @@ private int jjMoveNfa_0(int startState, int curPos) { switch(jjstateSet[--i]) { - case 400: + case 4: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(0, 4); + { + if (kind > 68) + kind = 68; + jjCheckNAddStates(0, 73); + } + else if ((0x100003600L & l) != 0L) + { + if (kind > 1) + kind = 1; + jjCheckNAdd(0); + } + else if (curChar == 46) + jjCheckNAddStates(74, 91); + else if (curChar == 45) + jjAddStates(92, 93); + else if (curChar == 33) + jjCheckNAddStates(94, 97); + else if (curChar == 35) + jjCheckNAddTwoStates(100, 101); + else if (curChar == 36) + jjCheckNAddStates(98, 101); + else if (curChar == 39) + jjCheckNAddStates(102, 105); + else if (curChar == 34) + jjCheckNAddStates(106, 109); + else if (curChar == 47) + jjstateSet[jjnewStateCnt++] = 3; + if (curChar == 45) + jjstateSet[jjnewStateCnt++] = 42; + else if (curChar == 35) + jjstateSet[jjnewStateCnt++] = 5; + break; + case 424: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddStates(110, 114); if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(211, 214); + jjCheckNAddTwoStates(234, 237); if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(208, 210); + jjCheckNAddTwoStates(231, 233); if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(206, 207); + jjCheckNAddTwoStates(229, 230); if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(203, 205); + jjCheckNAddTwoStates(226, 228); if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(198, 202); + jjCheckNAddTwoStates(221, 225); if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(194, 197); + jjCheckNAddTwoStates(217, 220); if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(190, 193); + jjCheckNAddTwoStates(213, 216); if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(187, 189); + jjCheckNAddTwoStates(210, 212); if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(184, 186); + jjCheckNAddTwoStates(207, 209); if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(181, 183); + jjCheckNAddTwoStates(204, 206); if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(178, 180); + jjCheckNAddTwoStates(201, 203); if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(175, 177); + jjCheckNAddTwoStates(198, 200); if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(172, 174); + jjCheckNAddTwoStates(195, 197); if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(169, 171); + jjCheckNAddTwoStates(192, 194); if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(166, 168); + jjCheckNAddTwoStates(189, 191); if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(164, 165); + jjCheckNAddTwoStates(187, 188); if ((0x3ff000000000000L & l) != 0L) { - if (kind > 67) - kind = 67; - jjCheckNAdd(163); + if (kind > 68) + kind = 68; + jjCheckNAdd(186); } break; - case 96: - if (curChar == 45) - jjstateSet[jjnewStateCnt++] = 97; - break; - case 402: - if ((0x100003600L & l) != 0L) - jjCheckNAddTwoStates(148, 157); - if ((0x100003600L & l) != 0L) - jjCheckNAddTwoStates(140, 147); - break; - case 403: - case 98: + case 426: + case 113: if ((0x3ff200000000000L & l) == 0L) break; - if (kind > 94) - kind = 94; - jjCheckNAddTwoStates(98, 99); + if (kind > 95) + kind = 95; + jjCheckNAddTwoStates(113, 114); break; - case 401: + case 425: if ((0x3ff200000000000L & l) != 0L) - jjCheckNAddStates(5, 8); + jjCheckNAddStates(115, 118); else if ((0x100003600L & l) != 0L) - jjCheckNAddTwoStates(128, 129); + jjCheckNAddTwoStates(151, 152); else if (curChar == 40) { - if (kind > 106) - kind = 106; + if (kind > 108) + kind = 108; } if ((0x3ff200000000000L & l) != 0L) { - if (kind > 66) - kind = 66; - jjCheckNAddTwoStates(117, 118); - } - break; - case 4: - if ((0x3ff000000000000L & l) != 0L) - { if (kind > 67) kind = 67; - jjCheckNAddStates(9, 82); + jjCheckNAddTwoStates(140, 141); } - else if ((0x100003600L & l) != 0L) - { - if (kind > 1) - kind = 1; - jjCheckNAdd(0); - } - else if (curChar == 46) - jjCheckNAddStates(83, 100); - else if (curChar == 45) - jjAddStates(101, 102); - else if (curChar == 33) - jjCheckNAddStates(103, 106); - else if (curChar == 35) - jjCheckNAddTwoStates(85, 86); - else if (curChar == 36) - jjCheckNAddStates(107, 110); - else if (curChar == 39) - jjCheckNAddStates(111, 114); - else if (curChar == 34) - jjCheckNAddStates(115, 118); - else if (curChar == 47) - jjstateSet[jjnewStateCnt++] = 3; - if (curChar == 35) - jjstateSet[jjnewStateCnt++] = 5; + break; + case 423: + if ((0x100003600L & l) != 0L) + jjCheckNAddTwoStates(171, 180); + if ((0x100003600L & l) != 0L) + jjCheckNAddTwoStates(163, 170); + break; + case 111: + if (curChar == 45) + jjstateSet[jjnewStateCnt++] = 112; break; case 0: if ((0x100003600L & l) == 0L) @@ -1043,1410 +1045,1426 @@ private int jjMoveNfa_0(int startState, int curPos) if (curChar == 35) jjstateSet[jjnewStateCnt++] = 5; break; - case 29: + case 40: + if (curChar == 45) + jjstateSet[jjnewStateCnt++] = 39; + break; + case 43: + if (curChar == 45) + jjstateSet[jjnewStateCnt++] = 42; + break; + case 44: if (curChar == 34) - jjCheckNAddStates(115, 118); + jjCheckNAddStates(106, 109); break; - case 30: + case 45: if ((0xfffffffb00000200L & l) != 0L) - jjCheckNAddStates(115, 118); + jjCheckNAddStates(106, 109); break; - case 31: - if (curChar == 34 && kind > 65) - kind = 65; + case 46: + if (curChar == 34 && kind > 66) + kind = 66; break; - case 33: + case 48: if (curChar == 12) - jjCheckNAddStates(115, 118); + jjCheckNAddStates(106, 109); break; - case 35: + case 50: if ((0xffffffff00000000L & l) != 0L) - jjCheckNAddStates(115, 118); + jjCheckNAddStates(106, 109); break; - case 36: + case 51: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(196, 201); break; - case 37: + case 52: if ((0x100003600L & l) != 0L) - jjCheckNAddStates(115, 118); + jjCheckNAddStates(106, 109); break; - case 38: + case 53: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(202, 210); break; - case 39: + case 54: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(211, 215); break; - case 40: + case 55: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(216, 221); break; - case 41: + case 56: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(222, 228); break; - case 42: + case 57: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(229, 236); break; - case 43: + case 58: if (curChar == 13) - jjCheckNAddStates(115, 118); + jjCheckNAddStates(106, 109); break; - case 44: + case 59: if (curChar == 10) - jjCheckNAddStates(115, 118); + jjCheckNAddStates(106, 109); break; - case 45: + case 60: if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 44; + jjstateSet[jjnewStateCnt++] = 59; break; - case 46: + case 61: if (curChar == 39) - jjCheckNAddStates(111, 114); + jjCheckNAddStates(102, 105); break; - case 47: + case 62: if ((0xffffff7f00000200L & l) != 0L) - jjCheckNAddStates(111, 114); + jjCheckNAddStates(102, 105); break; - case 48: - if (curChar == 39 && kind > 65) - kind = 65; + case 63: + if (curChar == 39 && kind > 66) + kind = 66; break; - case 50: + case 65: if (curChar == 12) - jjCheckNAddStates(111, 114); + jjCheckNAddStates(102, 105); break; - case 52: + case 67: if ((0xffffffff00000000L & l) != 0L) - jjCheckNAddStates(111, 114); + jjCheckNAddStates(102, 105); break; - case 53: + case 68: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(237, 242); break; - case 54: + case 69: if ((0x100003600L & l) != 0L) - jjCheckNAddStates(111, 114); + jjCheckNAddStates(102, 105); break; - case 55: + case 70: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(243, 251); break; - case 56: + case 71: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(252, 256); break; - case 57: + case 72: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(257, 262); break; - case 58: + case 73: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(263, 269); break; - case 59: + case 74: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(270, 277); break; - case 60: + case 75: if (curChar == 13) - jjCheckNAddStates(111, 114); + jjCheckNAddStates(102, 105); break; - case 61: + case 76: if (curChar == 10) - jjCheckNAddStates(111, 114); + jjCheckNAddStates(102, 105); break; - case 62: + case 77: if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 61; + jjstateSet[jjnewStateCnt++] = 76; break; - case 63: + case 78: if (curChar == 36) - jjCheckNAddStates(107, 110); + jjCheckNAddStates(98, 101); break; - case 64: + case 79: if (curChar == 45) - jjCheckNAdd(65); + jjCheckNAdd(80); break; - case 66: + case 81: if ((0x3ff200000000000L & l) == 0L) break; - if (kind > 70) - kind = 70; - jjCheckNAddTwoStates(66, 67); + if (kind > 71) + kind = 71; + jjCheckNAddTwoStates(81, 82); break; - case 68: + case 83: if ((0xffffffff00000000L & l) == 0L) break; - if (kind > 70) - kind = 70; - jjCheckNAddTwoStates(66, 67); + if (kind > 71) + kind = 71; + jjCheckNAddTwoStates(81, 82); break; - case 69: + case 84: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(278, 281); break; - case 70: + case 85: if ((0x100003600L & l) == 0L) break; - if (kind > 70) - kind = 70; - jjCheckNAddTwoStates(66, 67); + if (kind > 71) + kind = 71; + jjCheckNAddTwoStates(81, 82); break; - case 71: + case 86: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(282, 288); break; - case 72: + case 87: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(289, 291); break; - case 73: + case 88: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(292, 295); break; - case 74: + case 89: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(296, 300); break; - case 75: + case 90: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(301, 306); break; - case 78: + case 93: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(307, 310); break; - case 79: + case 94: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(311, 317); break; - case 80: + case 95: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(318, 320); break; - case 81: + case 96: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(321, 324); break; - case 82: + case 97: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(325, 329); break; - case 83: + case 98: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(330, 335); break; - case 84: + case 99: if (curChar == 35) - jjCheckNAddTwoStates(85, 86); + jjCheckNAddTwoStates(100, 101); break; - case 85: + case 100: if ((0x3ff200000000000L & l) == 0L) break; - if (kind > 88) - kind = 88; - jjCheckNAddTwoStates(85, 86); + if (kind > 89) + kind = 89; + jjCheckNAddTwoStates(100, 101); break; - case 87: + case 102: if ((0xffffffff00000000L & l) == 0L) break; - if (kind > 88) - kind = 88; - jjCheckNAddTwoStates(85, 86); + if (kind > 89) + kind = 89; + jjCheckNAddTwoStates(100, 101); break; - case 88: + case 103: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 88) - kind = 88; + if (kind > 89) + kind = 89; jjCheckNAddStates(336, 339); break; - case 89: + case 104: if ((0x100003600L & l) == 0L) break; - if (kind > 88) - kind = 88; - jjCheckNAddTwoStates(85, 86); + if (kind > 89) + kind = 89; + jjCheckNAddTwoStates(100, 101); break; - case 90: + case 105: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 88) - kind = 88; + if (kind > 89) + kind = 89; jjCheckNAddStates(340, 346); break; - case 91: + case 106: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 88) - kind = 88; + if (kind > 89) + kind = 89; jjCheckNAddStates(347, 349); break; - case 92: + case 107: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 88) - kind = 88; + if (kind > 89) + kind = 89; jjCheckNAddStates(350, 353); break; - case 93: + case 108: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 88) - kind = 88; + if (kind > 89) + kind = 89; jjCheckNAddStates(354, 358); break; - case 94: + case 109: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 88) - kind = 88; + if (kind > 89) + kind = 89; jjCheckNAddStates(359, 364); break; - case 100: + case 115: if ((0xffffffff00000000L & l) == 0L) break; - if (kind > 94) - kind = 94; - jjCheckNAddTwoStates(98, 99); + if (kind > 95) + kind = 95; + jjCheckNAddTwoStates(113, 114); break; - case 101: + case 116: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(365, 368); break; - case 102: + case 117: if ((0x100003600L & l) == 0L) break; - if (kind > 94) - kind = 94; - jjCheckNAddTwoStates(98, 99); + if (kind > 95) + kind = 95; + jjCheckNAddTwoStates(113, 114); break; - case 103: + case 118: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(369, 375); break; - case 104: + case 119: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(376, 378); break; - case 105: + case 120: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(379, 382); break; - case 106: + case 121: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(383, 387); break; - case 107: + case 122: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(388, 393); break; - case 110: + case 125: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(394, 397); break; - case 111: + case 126: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(398, 404); break; - case 112: + case 127: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(405, 407); break; - case 113: + case 128: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(408, 411); break; - case 114: + case 129: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(412, 416); break; - case 115: + case 130: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(417, 422); break; - case 117: + case 132: + if ((0x100003600L & l) != 0L) + jjAddStates(423, 424); + break; + case 133: + if (curChar == 40 && kind > 107) + kind = 107; + break; + case 140: if ((0x3ff200000000000L & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddTwoStates(117, 118); + if (kind > 67) + kind = 67; + jjCheckNAddTwoStates(140, 141); break; - case 119: + case 142: if ((0xffffffff00000000L & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddTwoStates(117, 118); + if (kind > 67) + kind = 67; + jjCheckNAddTwoStates(140, 141); break; - case 120: + case 143: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(423, 426); + if (kind > 67) + kind = 67; + jjCheckNAddStates(425, 428); break; - case 121: + case 144: if ((0x100003600L & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddTwoStates(117, 118); + if (kind > 67) + kind = 67; + jjCheckNAddTwoStates(140, 141); break; - case 122: + case 145: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(427, 433); + if (kind > 67) + kind = 67; + jjCheckNAddStates(429, 435); break; - case 123: + case 146: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(434, 436); + if (kind > 67) + kind = 67; + jjCheckNAddStates(436, 438); break; - case 124: + case 147: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(437, 440); + if (kind > 67) + kind = 67; + jjCheckNAddStates(439, 442); break; - case 125: + case 148: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(441, 445); + if (kind > 67) + kind = 67; + jjCheckNAddStates(443, 447); break; - case 126: + case 149: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(446, 451); + if (kind > 67) + kind = 67; + jjCheckNAddStates(448, 453); break; - case 127: + case 150: if ((0x3ff200000000000L & l) != 0L) - jjCheckNAddStates(5, 8); + jjCheckNAddStates(115, 118); break; - case 128: + case 151: if ((0x100003600L & l) != 0L) - jjCheckNAddTwoStates(128, 129); + jjCheckNAddTwoStates(151, 152); break; - case 129: - if (curChar == 40 && kind > 106) - kind = 106; + case 152: + if (curChar == 40 && kind > 108) + kind = 108; break; - case 131: + case 154: if ((0xffffffff00000000L & l) != 0L) - jjCheckNAddStates(5, 8); + jjCheckNAddStates(115, 118); break; - case 132: + case 155: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(452, 456); + jjCheckNAddStates(454, 458); break; - case 133: + case 156: if ((0x100003600L & l) != 0L) - jjCheckNAddStates(5, 8); + jjCheckNAddStates(115, 118); break; - case 134: + case 157: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(457, 464); + jjCheckNAddStates(459, 466); break; - case 135: - case 341: + case 158: + case 364: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(465, 468); + jjCheckNAddStates(467, 470); break; - case 136: + case 159: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(469, 473); + jjCheckNAddStates(471, 475); break; - case 137: + case 160: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(474, 479); + jjCheckNAddStates(476, 481); break; - case 138: + case 161: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(480, 486); + jjCheckNAddStates(482, 488); break; - case 139: + case 162: if (curChar == 33) - jjCheckNAddStates(103, 106); + jjCheckNAddStates(94, 97); break; - case 140: + case 163: if ((0x100003600L & l) != 0L) - jjCheckNAddTwoStates(140, 147); + jjCheckNAddTwoStates(163, 170); break; - case 148: + case 171: if ((0x100003600L & l) != 0L) - jjCheckNAddTwoStates(148, 157); + jjCheckNAddTwoStates(171, 180); break; - case 158: + case 181: if (curChar == 45) - jjAddStates(101, 102); + jjAddStates(92, 93); break; - case 162: + case 185: if (curChar == 46) - jjCheckNAddStates(83, 100); + jjCheckNAddStates(74, 91); break; - case 163: + case 186: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 67) - kind = 67; - jjCheckNAdd(163); + if (kind > 68) + kind = 68; + jjCheckNAdd(186); break; - case 164: + case 187: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(164, 165); + jjCheckNAddTwoStates(187, 188); break; - case 165: - if (curChar == 37 && kind > 71) - kind = 71; + case 188: + if (curChar == 37 && kind > 72) + kind = 72; break; - case 166: + case 189: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(166, 168); + jjCheckNAddTwoStates(189, 191); break; - case 169: + case 192: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(169, 171); + jjCheckNAddTwoStates(192, 194); break; - case 172: + case 195: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(172, 174); + jjCheckNAddTwoStates(195, 197); break; - case 175: + case 198: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(175, 177); + jjCheckNAddTwoStates(198, 200); break; - case 178: + case 201: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(178, 180); + jjCheckNAddTwoStates(201, 203); break; - case 181: + case 204: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(181, 183); + jjCheckNAddTwoStates(204, 206); break; - case 184: + case 207: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(184, 186); + jjCheckNAddTwoStates(207, 209); break; - case 187: + case 210: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(187, 189); + jjCheckNAddTwoStates(210, 212); break; - case 190: + case 213: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(190, 193); + jjCheckNAddTwoStates(213, 216); break; - case 194: + case 217: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(194, 197); + jjCheckNAddTwoStates(217, 220); break; - case 198: + case 221: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(198, 202); + jjCheckNAddTwoStates(221, 225); break; - case 203: + case 226: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(203, 205); + jjCheckNAddTwoStates(226, 228); break; - case 206: + case 229: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(206, 207); + jjCheckNAddTwoStates(229, 230); break; - case 208: + case 231: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(208, 210); + jjCheckNAddTwoStates(231, 233); break; - case 211: + case 234: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(211, 214); + jjCheckNAddTwoStates(234, 237); break; - case 215: + case 238: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(0, 4); + jjCheckNAddStates(110, 114); break; - case 216: + case 239: if (curChar == 45) - jjCheckNAdd(217); + jjCheckNAdd(240); break; - case 218: + case 241: if ((0x3ff200000000000L & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddTwoStates(218, 219); + if (kind > 88) + kind = 88; + jjCheckNAddTwoStates(241, 242); break; - case 220: + case 243: if ((0xffffffff00000000L & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddTwoStates(218, 219); + if (kind > 88) + kind = 88; + jjCheckNAddTwoStates(241, 242); break; - case 221: + case 244: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(487, 490); + if (kind > 88) + kind = 88; + jjCheckNAddStates(489, 492); break; - case 222: + case 245: if ((0x100003600L & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddTwoStates(218, 219); + if (kind > 88) + kind = 88; + jjCheckNAddTwoStates(241, 242); break; - case 223: + case 246: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(491, 497); + if (kind > 88) + kind = 88; + jjCheckNAddStates(493, 499); break; - case 224: + case 247: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(498, 500); + if (kind > 88) + kind = 88; + jjCheckNAddStates(500, 502); break; - case 225: + case 248: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(501, 504); + if (kind > 88) + kind = 88; + jjCheckNAddStates(503, 506); break; - case 226: + case 249: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(505, 509); + if (kind > 88) + kind = 88; + jjCheckNAddStates(507, 511); break; - case 227: + case 250: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(510, 515); + if (kind > 88) + kind = 88; + jjCheckNAddStates(512, 517); break; - case 230: + case 253: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(516, 519); + if (kind > 88) + kind = 88; + jjCheckNAddStates(518, 521); break; - case 231: + case 254: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(520, 526); + if (kind > 88) + kind = 88; + jjCheckNAddStates(522, 528); break; - case 232: + case 255: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(527, 529); + if (kind > 88) + kind = 88; + jjCheckNAddStates(529, 531); break; - case 233: + case 256: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(530, 533); + if (kind > 88) + kind = 88; + jjCheckNAddStates(532, 535); break; - case 234: + case 257: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(534, 538); + if (kind > 88) + kind = 88; + jjCheckNAddStates(536, 540); break; - case 235: + case 258: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(539, 544); + if (kind > 88) + kind = 88; + jjCheckNAddStates(541, 546); break; - case 237: + case 260: if (curChar == 40) - jjCheckNAddStates(545, 550); + jjCheckNAddStates(547, 552); break; - case 238: + case 261: if ((0xfffffc7a00000000L & l) != 0L) - jjCheckNAddStates(551, 554); + jjCheckNAddStates(553, 556); break; - case 239: + case 262: if ((0x100003600L & l) != 0L) - jjCheckNAddTwoStates(239, 240); + jjCheckNAddTwoStates(262, 263); break; - case 240: - if (curChar == 41 && kind > 69) - kind = 69; + case 263: + if (curChar == 41 && kind > 70) + kind = 70; break; - case 242: + case 265: if ((0xffffffff00000000L & l) != 0L) - jjCheckNAddStates(551, 554); + jjCheckNAddStates(553, 556); break; - case 243: + case 266: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(555, 559); + jjCheckNAddStates(557, 561); break; - case 244: + case 267: if ((0x100003600L & l) != 0L) - jjCheckNAddStates(551, 554); + jjCheckNAddStates(553, 556); break; - case 245: + case 268: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(560, 567); + jjCheckNAddStates(562, 569); break; - case 246: + case 269: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(568, 571); + jjCheckNAddStates(570, 573); break; - case 247: + case 270: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(572, 576); + jjCheckNAddStates(574, 578); break; - case 248: + case 271: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(577, 582); + jjCheckNAddStates(579, 584); break; - case 249: + case 272: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(583, 589); + jjCheckNAddStates(585, 591); break; - case 250: + case 273: if (curChar == 39) - jjCheckNAddStates(590, 593); + jjCheckNAddStates(592, 595); break; - case 251: + case 274: if ((0xffffff7f00000200L & l) != 0L) - jjCheckNAddStates(590, 593); + jjCheckNAddStates(592, 595); break; - case 252: + case 275: if (curChar == 39) - jjCheckNAddTwoStates(239, 240); + jjCheckNAddTwoStates(262, 263); break; - case 254: + case 277: if (curChar == 12) - jjCheckNAddStates(590, 593); + jjCheckNAddStates(592, 595); break; - case 256: + case 279: if ((0xffffffff00000000L & l) != 0L) - jjCheckNAddStates(590, 593); + jjCheckNAddStates(592, 595); break; - case 257: + case 280: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(594, 599); + jjCheckNAddStates(596, 601); break; - case 258: + case 281: if ((0x100003600L & l) != 0L) - jjCheckNAddStates(590, 593); + jjCheckNAddStates(592, 595); break; - case 259: + case 282: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(600, 608); + jjCheckNAddStates(602, 610); break; - case 260: + case 283: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(609, 613); + jjCheckNAddStates(611, 615); break; - case 261: + case 284: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(614, 619); + jjCheckNAddStates(616, 621); break; - case 262: + case 285: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(620, 626); + jjCheckNAddStates(622, 628); break; - case 263: + case 286: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(627, 634); + jjCheckNAddStates(629, 636); break; - case 264: + case 287: if (curChar == 13) - jjCheckNAddStates(590, 593); + jjCheckNAddStates(592, 595); break; - case 265: + case 288: if (curChar == 10) - jjCheckNAddStates(590, 593); + jjCheckNAddStates(592, 595); break; - case 266: + case 289: if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 265; + jjstateSet[jjnewStateCnt++] = 288; break; - case 267: + case 290: if (curChar == 34) - jjCheckNAddStates(635, 638); + jjCheckNAddStates(637, 640); break; - case 268: + case 291: if ((0xfffffffb00000200L & l) != 0L) - jjCheckNAddStates(635, 638); + jjCheckNAddStates(637, 640); break; - case 269: + case 292: if (curChar == 34) - jjCheckNAddTwoStates(239, 240); + jjCheckNAddTwoStates(262, 263); break; - case 271: + case 294: if (curChar == 12) - jjCheckNAddStates(635, 638); + jjCheckNAddStates(637, 640); break; - case 273: + case 296: if ((0xffffffff00000000L & l) != 0L) - jjCheckNAddStates(635, 638); + jjCheckNAddStates(637, 640); break; - case 274: + case 297: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(639, 644); + jjCheckNAddStates(641, 646); break; - case 275: + case 298: if ((0x100003600L & l) != 0L) - jjCheckNAddStates(635, 638); + jjCheckNAddStates(637, 640); break; - case 276: + case 299: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(645, 653); + jjCheckNAddStates(647, 655); break; - case 277: + case 300: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(654, 658); + jjCheckNAddStates(656, 660); break; - case 278: + case 301: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(659, 664); + jjCheckNAddStates(661, 666); break; - case 279: + case 302: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(665, 671); + jjCheckNAddStates(667, 673); break; - case 280: + case 303: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(672, 679); + jjCheckNAddStates(674, 681); break; - case 281: + case 304: if (curChar == 13) - jjCheckNAddStates(635, 638); + jjCheckNAddStates(637, 640); break; - case 282: + case 305: if (curChar == 10) - jjCheckNAddStates(635, 638); + jjCheckNAddStates(637, 640); break; - case 283: + case 306: if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 282; + jjstateSet[jjnewStateCnt++] = 305; break; - case 284: + case 307: if ((0x100003600L & l) != 0L) - jjCheckNAddStates(680, 686); + jjCheckNAddStates(682, 688); break; - case 287: + case 310: if (curChar == 43) - jjAddStates(687, 688); + jjAddStates(689, 690); break; - case 288: + case 311: if (curChar != 63) break; - if (kind > 105) - kind = 105; - jjstateSet[jjnewStateCnt++] = 289; + if (kind > 106) + kind = 106; + jjstateSet[jjnewStateCnt++] = 312; break; - case 289: + case 312: if (curChar != 63) break; - if (kind > 105) - kind = 105; - jjCheckNAddStates(689, 692); - break; - case 290: - if (curChar == 63 && kind > 105) - kind = 105; + if (kind > 106) + kind = 106; + jjCheckNAddStates(691, 694); break; - case 291: - case 306: - case 310: case 313: - case 316: + if (curChar == 63 && kind > 106) + kind = 106; + break; + case 314: + case 329: + case 333: + case 336: + case 339: if (curChar != 63) break; - if (kind > 105) - kind = 105; - jjCheckNAdd(290); + if (kind > 106) + kind = 106; + jjCheckNAdd(313); break; - case 292: + case 315: if (curChar != 63) break; - if (kind > 105) - kind = 105; - jjCheckNAddTwoStates(290, 291); + if (kind > 106) + kind = 106; + jjCheckNAddTwoStates(313, 314); break; - case 293: + case 316: if (curChar != 63) break; - if (kind > 105) - kind = 105; - jjCheckNAddStates(693, 695); + if (kind > 106) + kind = 106; + jjCheckNAddStates(695, 697); break; - case 294: + case 317: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 105) - kind = 105; - jjAddStates(696, 701); + if (kind > 106) + kind = 106; + jjAddStates(698, 703); break; - case 295: + case 318: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 296; + jjstateSet[jjnewStateCnt++] = 319; break; - case 296: + case 319: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 297; + jjstateSet[jjnewStateCnt++] = 320; break; - case 297: + case 320: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAdd(298); + jjCheckNAdd(321); break; - case 298: - if ((0x3ff000000000000L & l) != 0L && kind > 105) - kind = 105; + case 321: + if ((0x3ff000000000000L & l) != 0L && kind > 106) + kind = 106; break; - case 299: + case 322: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 300; + jjstateSet[jjnewStateCnt++] = 323; break; - case 300: + case 323: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 301; + jjstateSet[jjnewStateCnt++] = 324; break; - case 301: + case 324: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 302; + jjstateSet[jjnewStateCnt++] = 325; break; - case 302: + case 325: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 105) - kind = 105; - jjCheckNAdd(290); + if (kind > 106) + kind = 106; + jjCheckNAdd(313); break; - case 303: + case 326: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 304; + jjstateSet[jjnewStateCnt++] = 327; break; - case 304: + case 327: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 305; + jjstateSet[jjnewStateCnt++] = 328; break; - case 305: + case 328: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 105) - kind = 105; - jjstateSet[jjnewStateCnt++] = 306; + if (kind > 106) + kind = 106; + jjstateSet[jjnewStateCnt++] = 329; break; - case 307: + case 330: if ((0x3ff000000000000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 308; + jjstateSet[jjnewStateCnt++] = 331; break; - case 308: + case 331: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 105) - kind = 105; - jjstateSet[jjnewStateCnt++] = 309; + if (kind > 106) + kind = 106; + jjstateSet[jjnewStateCnt++] = 332; break; - case 309: + case 332: if (curChar != 63) break; - if (kind > 105) - kind = 105; - jjCheckNAddTwoStates(290, 310); + if (kind > 106) + kind = 106; + jjCheckNAddTwoStates(313, 333); break; - case 311: + case 334: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 105) - kind = 105; - jjstateSet[jjnewStateCnt++] = 312; + if (kind > 106) + kind = 106; + jjstateSet[jjnewStateCnt++] = 335; break; - case 312: + case 335: if (curChar != 63) break; - if (kind > 105) - kind = 105; - jjCheckNAddStates(702, 704); + if (kind > 106) + kind = 106; + jjCheckNAddStates(704, 706); break; - case 314: + case 337: if (curChar != 63) break; - if (kind > 105) - kind = 105; - jjCheckNAddTwoStates(290, 313); + if (kind > 106) + kind = 106; + jjCheckNAddTwoStates(313, 336); break; - case 315: + case 338: if (curChar != 63) break; - if (kind > 105) - kind = 105; - jjCheckNAddStates(705, 708); + if (kind > 106) + kind = 106; + jjCheckNAddStates(707, 710); break; - case 317: + case 340: if (curChar != 63) break; - if (kind > 105) - kind = 105; - jjCheckNAddTwoStates(290, 316); + if (kind > 106) + kind = 106; + jjCheckNAddTwoStates(313, 339); break; - case 318: + case 341: if (curChar != 63) break; - if (kind > 105) - kind = 105; - jjCheckNAddStates(709, 711); + if (kind > 106) + kind = 106; + jjCheckNAddStates(711, 713); break; - case 319: + case 342: if (curChar == 43) - jjstateSet[jjnewStateCnt++] = 320; + jjstateSet[jjnewStateCnt++] = 343; break; - case 320: + case 343: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(321, 327); + jjCheckNAddTwoStates(344, 350); break; - case 321: + case 344: if (curChar == 45) - jjstateSet[jjnewStateCnt++] = 322; + jjstateSet[jjnewStateCnt++] = 345; break; - case 322: + case 345: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 105) - kind = 105; - jjstateSet[jjnewStateCnt++] = 323; + if (kind > 106) + kind = 106; + jjstateSet[jjnewStateCnt++] = 346; break; - case 323: + case 346: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 105) - kind = 105; - jjCheckNAddStates(712, 715); + if (kind > 106) + kind = 106; + jjCheckNAddStates(714, 717); break; - case 324: + case 347: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 105) - kind = 105; - jjCheckNAdd(298); + if (kind > 106) + kind = 106; + jjCheckNAdd(321); break; - case 325: + case 348: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 105) - kind = 105; - jjCheckNAddTwoStates(298, 324); + if (kind > 106) + kind = 106; + jjCheckNAddTwoStates(321, 347); break; - case 326: + case 349: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 105) - kind = 105; - jjCheckNAddStates(716, 718); + if (kind > 106) + kind = 106; + jjCheckNAddStates(718, 720); break; - case 327: + case 350: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(719, 723); + jjCheckNAddStates(721, 725); break; - case 328: + case 351: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAdd(321); + jjCheckNAdd(344); break; - case 329: + case 352: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(328, 321); + jjCheckNAddTwoStates(351, 344); break; - case 330: + case 353: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(724, 726); + jjCheckNAddStates(726, 728); break; - case 331: + case 354: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(727, 730); + jjCheckNAddStates(729, 732); break; - case 333: + case 356: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(731, 734); + if (kind > 67) + kind = 67; + jjCheckNAddStates(733, 736); break; - case 334: + case 357: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(735, 741); + if (kind > 67) + kind = 67; + jjCheckNAddStates(737, 743); break; - case 335: + case 358: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(742, 744); + if (kind > 67) + kind = 67; + jjCheckNAddStates(744, 746); break; - case 336: + case 359: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(745, 748); + if (kind > 67) + kind = 67; + jjCheckNAddStates(747, 750); break; - case 337: + case 360: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(749, 753); + if (kind > 67) + kind = 67; + jjCheckNAddStates(751, 755); break; - case 338: + case 361: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(754, 759); + if (kind > 67) + kind = 67; + jjCheckNAddStates(756, 761); break; - case 339: + case 362: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(760, 764); + jjCheckNAddStates(762, 766); break; - case 340: + case 363: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(765, 772); + jjCheckNAddStates(767, 774); break; - case 342: + case 365: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(773, 777); + jjCheckNAddStates(775, 779); break; - case 343: + case 366: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(778, 783); + jjCheckNAddStates(780, 785); break; - case 344: + case 367: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(784, 790); + jjCheckNAddStates(786, 792); break; - case 345: + case 368: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 67) - kind = 67; - jjCheckNAddStates(9, 82); + if (kind > 68) + kind = 68; + jjCheckNAddStates(0, 73); break; - case 346: + case 369: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 67) - kind = 67; - jjCheckNAdd(346); + if (kind > 68) + kind = 68; + jjCheckNAdd(369); break; - case 347: + case 370: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(347, 348); + jjCheckNAddTwoStates(370, 371); break; - case 348: + case 371: if (curChar == 46) - jjCheckNAdd(163); + jjCheckNAdd(186); break; - case 349: + case 372: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(349, 165); + jjCheckNAddTwoStates(372, 188); break; - case 350: + case 373: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(350, 351); + jjCheckNAddTwoStates(373, 374); break; - case 351: + case 374: if (curChar == 46) - jjCheckNAdd(164); + jjCheckNAdd(187); break; - case 352: + case 375: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(352, 168); + jjCheckNAddTwoStates(375, 191); break; - case 353: + case 376: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(353, 354); + jjCheckNAddTwoStates(376, 377); break; - case 354: + case 377: if (curChar == 46) - jjCheckNAdd(166); + jjCheckNAdd(189); break; - case 355: + case 378: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(355, 171); + jjCheckNAddTwoStates(378, 194); break; - case 356: + case 379: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(356, 357); + jjCheckNAddTwoStates(379, 380); break; - case 357: + case 380: if (curChar == 46) - jjCheckNAdd(169); + jjCheckNAdd(192); break; - case 358: + case 381: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(358, 174); + jjCheckNAddTwoStates(381, 197); break; - case 359: + case 382: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(359, 360); + jjCheckNAddTwoStates(382, 383); break; - case 360: + case 383: if (curChar == 46) - jjCheckNAdd(172); + jjCheckNAdd(195); break; - case 361: + case 384: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(361, 177); + jjCheckNAddTwoStates(384, 200); break; - case 362: + case 385: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(362, 363); + jjCheckNAddTwoStates(385, 386); break; - case 363: + case 386: if (curChar == 46) - jjCheckNAdd(175); + jjCheckNAdd(198); break; - case 364: + case 387: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(364, 180); + jjCheckNAddTwoStates(387, 203); break; - case 365: + case 388: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(365, 366); + jjCheckNAddTwoStates(388, 389); break; - case 366: + case 389: if (curChar == 46) - jjCheckNAdd(178); + jjCheckNAdd(201); break; - case 367: + case 390: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(367, 183); + jjCheckNAddTwoStates(390, 206); break; - case 368: + case 391: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(368, 369); + jjCheckNAddTwoStates(391, 392); break; - case 369: + case 392: if (curChar == 46) - jjCheckNAdd(181); + jjCheckNAdd(204); break; - case 370: + case 393: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(370, 186); + jjCheckNAddTwoStates(393, 209); break; - case 371: + case 394: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(371, 372); + jjCheckNAddTwoStates(394, 395); break; - case 372: + case 395: if (curChar == 46) - jjCheckNAdd(184); + jjCheckNAdd(207); break; - case 373: + case 396: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(373, 189); + jjCheckNAddTwoStates(396, 212); break; - case 374: + case 397: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(374, 375); + jjCheckNAddTwoStates(397, 398); break; - case 375: + case 398: if (curChar == 46) - jjCheckNAdd(187); + jjCheckNAdd(210); break; - case 376: + case 399: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(376, 193); + jjCheckNAddTwoStates(399, 216); break; - case 377: + case 400: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(377, 378); + jjCheckNAddTwoStates(400, 401); break; - case 378: + case 401: if (curChar == 46) - jjCheckNAdd(190); + jjCheckNAdd(213); break; - case 379: + case 402: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(379, 197); + jjCheckNAddTwoStates(402, 220); break; - case 380: + case 403: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(380, 381); + jjCheckNAddTwoStates(403, 404); break; - case 381: + case 404: if (curChar == 46) - jjCheckNAdd(194); + jjCheckNAdd(217); break; - case 382: + case 405: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(382, 202); + jjCheckNAddTwoStates(405, 225); break; - case 383: + case 406: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(383, 384); + jjCheckNAddTwoStates(406, 407); break; - case 384: + case 407: if (curChar == 46) - jjCheckNAdd(198); + jjCheckNAdd(221); break; - case 385: + case 408: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(385, 205); + jjCheckNAddTwoStates(408, 228); break; - case 386: + case 409: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(386, 387); + jjCheckNAddTwoStates(409, 410); break; - case 387: + case 410: if (curChar == 46) - jjCheckNAdd(203); + jjCheckNAdd(226); break; - case 388: + case 411: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(388, 207); + jjCheckNAddTwoStates(411, 230); break; - case 389: + case 412: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(389, 390); + jjCheckNAddTwoStates(412, 413); break; - case 390: + case 413: if (curChar == 46) - jjCheckNAdd(206); + jjCheckNAdd(229); break; - case 391: + case 414: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(391, 210); + jjCheckNAddTwoStates(414, 233); break; - case 392: + case 415: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(392, 393); + jjCheckNAddTwoStates(415, 416); break; - case 393: + case 416: if (curChar == 46) - jjCheckNAdd(208); + jjCheckNAdd(231); break; - case 394: + case 417: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(394, 214); + jjCheckNAddTwoStates(417, 237); break; - case 395: + case 418: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(395, 396); + jjCheckNAddTwoStates(418, 419); break; - case 396: + case 419: if (curChar == 46) - jjCheckNAdd(211); + jjCheckNAdd(234); break; - case 397: + case 420: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(791, 795); + jjCheckNAddStates(793, 797); break; - case 398: + case 421: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(398, 399); + jjCheckNAddTwoStates(421, 422); break; - case 399: + case 422: if (curChar == 46) - jjCheckNAdd(215); + jjCheckNAdd(238); break; default : break; } @@ -2459,69 +2477,75 @@ private int jjMoveNfa_0(int startState, int curPos) { switch(jjstateSet[--i]) { - case 96: + case 4: if ((0x7fffffe07fffffeL & l) != 0L) { - if (kind > 94) - kind = 94; - jjCheckNAddTwoStates(98, 99); + if (kind > 67) + kind = 67; + jjCheckNAddStates(798, 803); } else if (curChar == 92) - jjCheckNAddTwoStates(100, 110); - break; - case 402: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 156; - else if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 146; + jjCheckNAddStates(804, 807); + else if (curChar == 64) + jjAddStates(808, 811); + if ((0x20000000200000L & l) != 0L) + jjAddStates(812, 814); + else if ((0x4000000040000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 137; + else if ((0x4000000040L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 33; break; - case 159: + case 42: if ((0x7fffffe07fffffeL & l) != 0L) - jjCheckNAddStates(5, 8); + jjCheckNAddStates(115, 118); if ((0x7fffffe07fffffeL & l) != 0L) { - if (kind > 66) - kind = 66; - jjCheckNAddTwoStates(117, 118); + if (kind > 67) + kind = 67; + jjCheckNAddTwoStates(140, 141); } + if ((0x200000002000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 41; break; - case 403: + case 426: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 94) - kind = 94; - jjCheckNAddTwoStates(98, 99); + if (kind > 95) + kind = 95; + jjCheckNAddTwoStates(113, 114); } else if (curChar == 92) - jjCheckNAddTwoStates(100, 101); + jjCheckNAddTwoStates(115, 116); break; - case 401: + case 425: if ((0x7fffffe87fffffeL & l) != 0L) - jjCheckNAddStates(5, 8); + jjCheckNAddStates(115, 118); else if (curChar == 92) - jjCheckNAddTwoStates(119, 120); + jjCheckNAddTwoStates(142, 143); if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 66) - kind = 66; - jjCheckNAddTwoStates(117, 118); + if (kind > 67) + kind = 67; + jjCheckNAddTwoStates(140, 141); } else if (curChar == 92) - jjCheckNAddTwoStates(131, 132); + jjCheckNAddTwoStates(154, 155); break; - case 4: + case 423: + if ((0x20000000200L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 179; + else if ((0x1000000010L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 169; + break; + case 111: if ((0x7fffffe07fffffeL & l) != 0L) { - if (kind > 66) - kind = 66; - jjCheckNAddStates(796, 801); + if (kind > 95) + kind = 95; + jjCheckNAddTwoStates(113, 114); } else if (curChar == 92) - jjCheckNAddStates(802, 805); - else if (curChar == 64) - jjAddStates(806, 809); - if ((0x20000000200000L & l) != 0L) - jjAddStates(810, 812); + jjCheckNAddTwoStates(115, 125); break; case 2: if (kind > 5) @@ -2603,1109 +2627,1185 @@ private int jjMoveNfa_0(int startState, int curPos) if ((0x7e0000007eL & l) != 0L) jjCheckNAddStates(189, 195); break; + case 29: + if ((0x4000000040000L & l) != 0L && kind > 63) + kind = 63; + break; case 30: case 35: - if ((0x7fffffffffffffffL & l) != 0L) - jjCheckNAddStates(115, 118); + if ((0x2000000020L & l) != 0L) + jjCheckNAdd(29); + break; + case 31: + if ((0x10000000100000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 30; break; case 32: - if (curChar == 92) - jjAddStates(813, 816); + if ((0x100000001000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 31; + break; + case 33: + if ((0x20000000200L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 32; break; case 34: - if (curChar == 92) - jjAddStates(817, 818); + if ((0x4000000040L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 33; break; case 36: + if ((0x10000000100000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 35; + break; + case 37: + if ((0x100000001000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 36; + break; + case 38: + if ((0x20000000200L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 37; + break; + case 39: + if ((0x4000000040L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 38; + break; + case 41: + if ((0x8000000080000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 40; + break; + case 45: + case 50: + if ((0x7fffffffffffffffL & l) != 0L) + jjCheckNAddStates(106, 109); + break; + case 47: + if (curChar == 92) + jjAddStates(815, 818); + break; + case 49: + if (curChar == 92) + jjAddStates(819, 820); + break; + case 51: if ((0x7e0000007eL & l) != 0L) jjCheckNAddStates(196, 201); break; - case 38: + case 53: if ((0x7e0000007eL & l) != 0L) jjCheckNAddStates(202, 210); break; - case 39: + case 54: if ((0x7e0000007eL & l) != 0L) jjCheckNAddStates(211, 215); break; - case 40: + case 55: if ((0x7e0000007eL & l) != 0L) jjCheckNAddStates(216, 221); break; - case 41: + case 56: if ((0x7e0000007eL & l) != 0L) jjCheckNAddStates(222, 228); break; - case 42: + case 57: if ((0x7e0000007eL & l) != 0L) jjCheckNAddStates(229, 236); break; - case 47: - case 52: + case 62: + case 67: if ((0x7fffffffffffffffL & l) != 0L) - jjCheckNAddStates(111, 114); + jjCheckNAddStates(102, 105); break; - case 49: + case 64: if (curChar == 92) - jjAddStates(819, 822); + jjAddStates(821, 824); break; - case 51: + case 66: if (curChar == 92) - jjAddStates(823, 824); + jjAddStates(825, 826); break; - case 53: + case 68: if ((0x7e0000007eL & l) != 0L) jjCheckNAddStates(237, 242); break; - case 55: + case 70: if ((0x7e0000007eL & l) != 0L) jjCheckNAddStates(243, 251); break; - case 56: + case 71: if ((0x7e0000007eL & l) != 0L) jjCheckNAddStates(252, 256); break; - case 57: + case 72: if ((0x7e0000007eL & l) != 0L) jjCheckNAddStates(257, 262); break; - case 58: + case 73: if ((0x7e0000007eL & l) != 0L) jjCheckNAddStates(263, 269); break; - case 59: + case 74: if ((0x7e0000007eL & l) != 0L) jjCheckNAddStates(270, 277); break; - case 65: + case 80: if ((0x7fffffe07fffffeL & l) == 0L) break; - if (kind > 70) - kind = 70; - jjCheckNAddTwoStates(66, 67); + if (kind > 71) + kind = 71; + jjCheckNAddTwoStates(81, 82); break; - case 66: + case 81: if ((0x7fffffe87fffffeL & l) == 0L) break; - if (kind > 70) - kind = 70; - jjCheckNAddTwoStates(66, 67); + if (kind > 71) + kind = 71; + jjCheckNAddTwoStates(81, 82); break; - case 67: + case 82: if (curChar == 92) - jjCheckNAddTwoStates(68, 69); + jjCheckNAddTwoStates(83, 84); break; - case 68: + case 83: if ((0x7fffffffffffffffL & l) == 0L) break; - if (kind > 70) - kind = 70; - jjCheckNAddTwoStates(66, 67); + if (kind > 71) + kind = 71; + jjCheckNAddTwoStates(81, 82); break; - case 69: + case 84: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(278, 281); break; - case 71: + case 86: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(282, 288); break; - case 72: + case 87: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(289, 291); break; - case 73: + case 88: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(292, 295); break; - case 74: + case 89: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(296, 300); break; - case 75: + case 90: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(301, 306); break; - case 77: + case 92: if (curChar == 92) - jjCheckNAddTwoStates(68, 78); + jjCheckNAddTwoStates(83, 93); break; - case 78: + case 93: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(307, 310); break; - case 79: + case 94: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(311, 317); break; - case 80: + case 95: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(318, 320); break; - case 81: + case 96: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(321, 324); break; - case 82: + case 97: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(325, 329); break; - case 83: + case 98: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 70) - kind = 70; + if (kind > 71) + kind = 71; jjCheckNAddStates(330, 335); break; - case 85: + case 100: if ((0x7fffffe87fffffeL & l) == 0L) break; - if (kind > 88) - kind = 88; - jjCheckNAddTwoStates(85, 86); + if (kind > 89) + kind = 89; + jjCheckNAddTwoStates(100, 101); break; - case 86: + case 101: if (curChar == 92) - jjAddStates(825, 826); + jjAddStates(827, 828); break; - case 87: + case 102: if ((0x7fffffffffffffffL & l) == 0L) break; - if (kind > 88) - kind = 88; - jjCheckNAddTwoStates(85, 86); + if (kind > 89) + kind = 89; + jjCheckNAddTwoStates(100, 101); break; - case 88: + case 103: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 88) - kind = 88; + if (kind > 89) + kind = 89; jjCheckNAddStates(336, 339); break; - case 90: + case 105: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 88) - kind = 88; + if (kind > 89) + kind = 89; jjCheckNAddStates(340, 346); break; - case 91: + case 106: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 88) - kind = 88; + if (kind > 89) + kind = 89; jjCheckNAddStates(347, 349); break; - case 92: + case 107: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 88) - kind = 88; + if (kind > 89) + kind = 89; jjCheckNAddStates(350, 353); break; - case 93: + case 108: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 88) - kind = 88; + if (kind > 89) + kind = 89; jjCheckNAddStates(354, 358); break; - case 94: + case 109: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 88) - kind = 88; + if (kind > 89) + kind = 89; jjCheckNAddStates(359, 364); break; - case 95: + case 110: if (curChar == 64) - jjAddStates(806, 809); + jjAddStates(808, 811); break; - case 97: + case 112: if ((0x7fffffe07fffffeL & l) == 0L) break; - if (kind > 94) - kind = 94; - jjCheckNAddTwoStates(98, 99); + if (kind > 95) + kind = 95; + jjCheckNAddTwoStates(113, 114); break; - case 98: + case 113: if ((0x7fffffe87fffffeL & l) == 0L) break; - if (kind > 94) - kind = 94; - jjCheckNAddTwoStates(98, 99); + if (kind > 95) + kind = 95; + jjCheckNAddTwoStates(113, 114); break; - case 99: + case 114: if (curChar == 92) - jjCheckNAddTwoStates(100, 101); + jjCheckNAddTwoStates(115, 116); break; - case 100: + case 115: if ((0x7fffffffffffffffL & l) == 0L) break; - if (kind > 94) - kind = 94; - jjCheckNAddTwoStates(98, 99); + if (kind > 95) + kind = 95; + jjCheckNAddTwoStates(113, 114); break; - case 101: + case 116: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(365, 368); break; - case 103: + case 118: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(369, 375); break; - case 104: + case 119: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(376, 378); break; - case 105: + case 120: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(379, 382); break; - case 106: + case 121: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(383, 387); break; - case 107: + case 122: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(388, 393); break; - case 109: + case 124: if (curChar == 92) - jjCheckNAddTwoStates(100, 110); + jjCheckNAddTwoStates(115, 125); break; - case 110: + case 125: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(394, 397); break; - case 111: + case 126: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(398, 404); break; - case 112: + case 127: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(405, 407); break; - case 113: + case 128: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(408, 411); break; - case 114: + case 129: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(412, 416); break; - case 115: + case 130: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 94) - kind = 94; + if (kind > 95) + kind = 95; jjCheckNAddStates(417, 422); break; - case 117: + case 131: + if ((0x2000000020L & l) != 0L) + jjAddStates(423, 424); + break; + case 134: + if ((0x40000000400000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 131; + break; + case 135: + if ((0x800000008000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 134; + break; + case 136: + if ((0x200000002000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 135; + break; + case 137: + if ((0x2000000020L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 136; + break; + case 138: + if ((0x4000000040000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 137; + break; + case 140: if ((0x7fffffe87fffffeL & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddTwoStates(117, 118); + if (kind > 67) + kind = 67; + jjCheckNAddTwoStates(140, 141); break; - case 118: + case 141: if (curChar == 92) - jjCheckNAddTwoStates(119, 120); + jjCheckNAddTwoStates(142, 143); break; - case 119: + case 142: if ((0x7fffffffffffffffL & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddTwoStates(117, 118); + if (kind > 67) + kind = 67; + jjCheckNAddTwoStates(140, 141); break; - case 120: + case 143: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(423, 426); + if (kind > 67) + kind = 67; + jjCheckNAddStates(425, 428); break; - case 122: + case 145: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(427, 433); + if (kind > 67) + kind = 67; + jjCheckNAddStates(429, 435); break; - case 123: + case 146: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(434, 436); + if (kind > 67) + kind = 67; + jjCheckNAddStates(436, 438); break; - case 124: + case 147: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(437, 440); + if (kind > 67) + kind = 67; + jjCheckNAddStates(439, 442); break; - case 125: + case 148: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(441, 445); + if (kind > 67) + kind = 67; + jjCheckNAddStates(443, 447); break; - case 126: + case 149: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(446, 451); + if (kind > 67) + kind = 67; + jjCheckNAddStates(448, 453); break; - case 127: + case 150: if ((0x7fffffe87fffffeL & l) != 0L) - jjCheckNAddStates(5, 8); + jjCheckNAddStates(115, 118); break; - case 130: + case 153: if (curChar == 92) - jjCheckNAddTwoStates(131, 132); + jjCheckNAddTwoStates(154, 155); break; - case 131: + case 154: if ((0x7fffffffffffffffL & l) != 0L) - jjCheckNAddStates(5, 8); + jjCheckNAddStates(115, 118); break; - case 132: + case 155: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(452, 456); + jjCheckNAddStates(454, 458); break; - case 134: + case 157: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(457, 464); + jjCheckNAddStates(459, 466); break; - case 135: - case 341: + case 158: + case 364: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(465, 468); + jjCheckNAddStates(467, 470); break; - case 136: + case 159: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(469, 473); + jjCheckNAddStates(471, 475); break; - case 137: + case 160: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(474, 479); + jjCheckNAddStates(476, 481); break; - case 138: + case 161: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(480, 486); + jjCheckNAddStates(482, 488); break; - case 141: - if ((0x10000000100000L & l) != 0L && kind > 64) - kind = 64; + case 164: + if ((0x10000000100000L & l) != 0L && kind > 65) + kind = 65; break; - case 142: + case 165: if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 141; + jjstateSet[jjnewStateCnt++] = 164; break; - case 143: + case 166: if ((0x20000000200000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 142; + jjstateSet[jjnewStateCnt++] = 165; break; - case 144: + case 167: if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 143; + jjstateSet[jjnewStateCnt++] = 166; break; - case 145: + case 168: if ((0x4000000040L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 144; + jjstateSet[jjnewStateCnt++] = 167; break; - case 146: + case 169: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 145; + jjstateSet[jjnewStateCnt++] = 168; break; - case 147: + case 170: if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 146; + jjstateSet[jjnewStateCnt++] = 169; break; - case 149: - if ((0x10000000100000L & l) != 0L && kind > 95) - kind = 95; + case 172: + if ((0x10000000100000L & l) != 0L && kind > 96) + kind = 96; break; - case 150: + case 173: if ((0x400000004000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 149; + jjstateSet[jjnewStateCnt++] = 172; break; - case 151: + case 174: if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 150; + jjstateSet[jjnewStateCnt++] = 173; break; - case 152: + case 175: if ((0x10000000100000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 151; + jjstateSet[jjnewStateCnt++] = 174; break; - case 153: + case 176: if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 152; + jjstateSet[jjnewStateCnt++] = 175; break; - case 154: + case 177: if ((0x800000008000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 153; + jjstateSet[jjnewStateCnt++] = 176; break; - case 155: + case 178: if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 154; + jjstateSet[jjnewStateCnt++] = 177; break; - case 156: + case 179: if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 155; + jjstateSet[jjnewStateCnt++] = 178; break; - case 157: + case 180: if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 156; - break; - case 160: - if ((0x7fffffe07fffffeL & l) != 0L) - jjCheckNAddStates(5, 8); + jjstateSet[jjnewStateCnt++] = 179; break; - case 161: + case 182: if ((0x7fffffe07fffffeL & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(796, 801); + if (kind > 67) + kind = 67; + jjCheckNAddTwoStates(140, 141); break; - case 167: - if ((0x10000000100000L & l) != 0L && kind > 72) - kind = 72; + case 183: + if ((0x7fffffe07fffffeL & l) != 0L) + jjCheckNAddStates(115, 118); break; - case 168: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 167; + case 184: + if ((0x7fffffe07fffffeL & l) == 0L) + break; + if (kind > 67) + kind = 67; + jjCheckNAddStates(798, 803); break; - case 170: - if ((0x200000002000L & l) != 0L && kind > 73) + case 190: + if ((0x10000000100000L & l) != 0L && kind > 73) kind = 73; break; - case 171: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 170; + case 191: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 190; break; - case 173: + case 193: if ((0x200000002000L & l) != 0L && kind > 74) kind = 74; break; - case 174: - if ((0x800000008L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 173; + case 194: + if ((0x200000002000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 193; break; - case 176: - if ((0x800000008L & l) != 0L && kind > 75) + case 196: + if ((0x200000002000L & l) != 0L && kind > 75) kind = 75; break; - case 177: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 176; + case 197: + if ((0x800000008L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 196; break; - case 179: - if ((0x400000004000L & l) != 0L && kind > 76) + case 199: + if ((0x800000008L & l) != 0L && kind > 76) kind = 76; break; - case 180: - if ((0x20000000200L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 179; + case 200: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 199; break; - case 182: - if ((0x100000001000000L & l) != 0L && kind > 77) + case 202: + if ((0x400000004000L & l) != 0L && kind > 77) kind = 77; break; - case 183: - if ((0x1000000010000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 182; + case 203: + if ((0x20000000200L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 202; break; - case 185: - if ((0x200000002000L & l) != 0L && kind > 78) + case 205: + if ((0x100000001000000L & l) != 0L && kind > 78) kind = 78; break; - case 186: - if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 185; + case 206: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 205; break; - case 188: - if ((0x100000001000000L & l) != 0L && kind > 79) + case 208: + if ((0x200000002000L & l) != 0L && kind > 79) kind = 79; break; - case 189: + case 209: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 188; + jjstateSet[jjnewStateCnt++] = 208; break; - case 191: - if ((0x8000000080L & l) != 0L && kind > 80) + case 211: + if ((0x100000001000000L & l) != 0L && kind > 80) kind = 80; break; - case 192: + case 212: if ((0x2000000020L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 191; + jjstateSet[jjnewStateCnt++] = 211; break; - case 193: - if ((0x1000000010L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 192; - break; - case 195: - if ((0x1000000010L & l) != 0L && kind > 81) + case 214: + if ((0x8000000080L & l) != 0L && kind > 81) kind = 81; break; - case 196: - if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 195; + case 215: + if ((0x2000000020L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 214; break; - case 197: - if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 196; + case 216: + if ((0x1000000010L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 215; break; - case 199: + case 218: if ((0x1000000010L & l) != 0L && kind > 82) kind = 82; break; - case 200: + case 219: if ((0x200000002L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 199; + jjstateSet[jjnewStateCnt++] = 218; break; - case 201: + case 220: if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 200; + jjstateSet[jjnewStateCnt++] = 219; break; - case 202: - if ((0x8000000080L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 201; - break; - case 204: - if ((0x8000000080000L & l) != 0L && kind > 83) + case 222: + if ((0x1000000010L & l) != 0L && kind > 83) kind = 83; break; - case 205: - if ((0x200000002000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 204; + case 223: + if ((0x200000002L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 222; break; - case 207: + case 224: + if ((0x4000000040000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 223; + break; + case 225: + if ((0x8000000080L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 224; + break; + case 227: if ((0x8000000080000L & l) != 0L && kind > 84) kind = 84; break; - case 209: - if ((0x400000004000000L & l) != 0L && kind > 85) - kind = 85; + case 228: + if ((0x200000002000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 227; break; - case 210: - if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 209; + case 230: + if ((0x8000000080000L & l) != 0L && kind > 85) + kind = 85; break; - case 212: + case 232: if ((0x400000004000000L & l) != 0L && kind > 86) kind = 86; break; - case 213: + case 233: if ((0x10000000100L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 212; + jjstateSet[jjnewStateCnt++] = 232; break; - case 214: + case 235: + if ((0x400000004000000L & l) != 0L && kind > 87) + kind = 87; + break; + case 236: + if ((0x10000000100L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 235; + break; + case 237: if ((0x80000000800L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 213; + jjstateSet[jjnewStateCnt++] = 236; break; - case 217: + case 240: if ((0x7fffffe07fffffeL & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddTwoStates(218, 219); + if (kind > 88) + kind = 88; + jjCheckNAddTwoStates(241, 242); break; - case 218: + case 241: if ((0x7fffffe87fffffeL & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddTwoStates(218, 219); + if (kind > 88) + kind = 88; + jjCheckNAddTwoStates(241, 242); break; - case 219: + case 242: if (curChar == 92) - jjCheckNAddTwoStates(220, 221); + jjCheckNAddTwoStates(243, 244); break; - case 220: + case 243: if ((0x7fffffffffffffffL & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddTwoStates(218, 219); + if (kind > 88) + kind = 88; + jjCheckNAddTwoStates(241, 242); break; - case 221: + case 244: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(487, 490); + if (kind > 88) + kind = 88; + jjCheckNAddStates(489, 492); break; - case 223: + case 246: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(491, 497); + if (kind > 88) + kind = 88; + jjCheckNAddStates(493, 499); break; - case 224: + case 247: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(498, 500); + if (kind > 88) + kind = 88; + jjCheckNAddStates(500, 502); break; - case 225: + case 248: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(501, 504); + if (kind > 88) + kind = 88; + jjCheckNAddStates(503, 506); break; - case 226: + case 249: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(505, 509); + if (kind > 88) + kind = 88; + jjCheckNAddStates(507, 511); break; - case 227: + case 250: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(510, 515); + if (kind > 88) + kind = 88; + jjCheckNAddStates(512, 517); break; - case 229: + case 252: if (curChar == 92) - jjCheckNAddTwoStates(220, 230); + jjCheckNAddTwoStates(243, 253); break; - case 230: + case 253: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(516, 519); + if (kind > 88) + kind = 88; + jjCheckNAddStates(518, 521); break; - case 231: + case 254: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(520, 526); + if (kind > 88) + kind = 88; + jjCheckNAddStates(522, 528); break; - case 232: + case 255: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(527, 529); + if (kind > 88) + kind = 88; + jjCheckNAddStates(529, 531); break; - case 233: + case 256: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(530, 533); + if (kind > 88) + kind = 88; + jjCheckNAddStates(532, 535); break; - case 234: + case 257: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(534, 538); + if (kind > 88) + kind = 88; + jjCheckNAddStates(536, 540); break; - case 235: + case 258: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddStates(539, 544); + if (kind > 88) + kind = 88; + jjCheckNAddStates(541, 546); break; - case 236: + case 259: if ((0x20000000200000L & l) != 0L) - jjAddStates(810, 812); + jjAddStates(812, 814); break; - case 238: - case 242: + case 261: + case 265: if ((0x7fffffffffffffffL & l) != 0L) - jjCheckNAddStates(551, 554); + jjCheckNAddStates(553, 556); break; - case 241: + case 264: if (curChar == 92) - jjAddStates(827, 828); + jjAddStates(829, 830); break; - case 243: + case 266: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(555, 559); + jjCheckNAddStates(557, 561); break; - case 245: + case 268: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(560, 567); + jjCheckNAddStates(562, 569); break; - case 246: + case 269: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(568, 571); + jjCheckNAddStates(570, 573); break; - case 247: + case 270: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(572, 576); + jjCheckNAddStates(574, 578); break; - case 248: + case 271: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(577, 582); + jjCheckNAddStates(579, 584); break; - case 249: + case 272: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(583, 589); + jjCheckNAddStates(585, 591); break; - case 251: - case 256: + case 274: + case 279: if ((0x7fffffffffffffffL & l) != 0L) - jjCheckNAddStates(590, 593); + jjCheckNAddStates(592, 595); break; - case 253: + case 276: if (curChar == 92) - jjAddStates(829, 832); + jjAddStates(831, 834); break; - case 255: + case 278: if (curChar == 92) - jjAddStates(833, 834); + jjAddStates(835, 836); break; - case 257: + case 280: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(594, 599); + jjCheckNAddStates(596, 601); break; - case 259: + case 282: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(600, 608); + jjCheckNAddStates(602, 610); break; - case 260: + case 283: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(609, 613); + jjCheckNAddStates(611, 615); break; - case 261: + case 284: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(614, 619); + jjCheckNAddStates(616, 621); break; - case 262: + case 285: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(620, 626); + jjCheckNAddStates(622, 628); break; - case 263: + case 286: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(627, 634); + jjCheckNAddStates(629, 636); break; - case 268: - case 273: + case 291: + case 296: if ((0x7fffffffffffffffL & l) != 0L) - jjCheckNAddStates(635, 638); + jjCheckNAddStates(637, 640); break; - case 270: + case 293: if (curChar == 92) - jjAddStates(835, 838); + jjAddStates(837, 840); break; - case 272: + case 295: if (curChar == 92) - jjAddStates(839, 840); + jjAddStates(841, 842); break; - case 274: + case 297: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(639, 644); + jjCheckNAddStates(641, 646); break; - case 276: + case 299: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(645, 653); + jjCheckNAddStates(647, 655); break; - case 277: + case 300: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(654, 658); + jjCheckNAddStates(656, 660); break; - case 278: + case 301: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(659, 664); + jjCheckNAddStates(661, 666); break; - case 279: + case 302: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(665, 671); + jjCheckNAddStates(667, 673); break; - case 280: + case 303: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(672, 679); + jjCheckNAddStates(674, 681); break; - case 285: + case 308: if ((0x100000001000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 237; + jjstateSet[jjnewStateCnt++] = 260; break; - case 286: + case 309: if ((0x4000000040000L & l) != 0L) - jjstateSet[jjnewStateCnt++] = 285; + jjstateSet[jjnewStateCnt++] = 308; break; - case 294: + case 317: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 105) - kind = 105; - jjAddStates(696, 701); + if (kind > 106) + kind = 106; + jjAddStates(698, 703); break; - case 295: + case 318: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 296; + jjstateSet[jjnewStateCnt++] = 319; break; - case 296: + case 319: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 297; + jjstateSet[jjnewStateCnt++] = 320; break; - case 297: + case 320: if ((0x7e0000007eL & l) != 0L) - jjCheckNAdd(298); + jjCheckNAdd(321); break; - case 298: - if ((0x7e0000007eL & l) != 0L && kind > 105) - kind = 105; + case 321: + if ((0x7e0000007eL & l) != 0L && kind > 106) + kind = 106; break; - case 299: + case 322: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 300; + jjstateSet[jjnewStateCnt++] = 323; break; - case 300: + case 323: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 301; + jjstateSet[jjnewStateCnt++] = 324; break; - case 301: + case 324: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 302; + jjstateSet[jjnewStateCnt++] = 325; break; - case 302: + case 325: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 105) - kind = 105; - jjstateSet[jjnewStateCnt++] = 290; + if (kind > 106) + kind = 106; + jjstateSet[jjnewStateCnt++] = 313; break; - case 303: + case 326: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 304; + jjstateSet[jjnewStateCnt++] = 327; break; - case 304: + case 327: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 305; + jjstateSet[jjnewStateCnt++] = 328; break; - case 305: + case 328: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 105) - kind = 105; - jjstateSet[jjnewStateCnt++] = 306; + if (kind > 106) + kind = 106; + jjstateSet[jjnewStateCnt++] = 329; break; - case 307: + case 330: if ((0x7e0000007eL & l) != 0L) - jjstateSet[jjnewStateCnt++] = 308; + jjstateSet[jjnewStateCnt++] = 331; break; - case 308: + case 331: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 105) - kind = 105; - jjstateSet[jjnewStateCnt++] = 309; + if (kind > 106) + kind = 106; + jjstateSet[jjnewStateCnt++] = 332; break; - case 311: + case 334: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 105) - kind = 105; - jjstateSet[jjnewStateCnt++] = 312; + if (kind > 106) + kind = 106; + jjstateSet[jjnewStateCnt++] = 335; break; - case 320: + case 343: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddTwoStates(321, 327); + jjCheckNAddTwoStates(344, 350); break; - case 322: + case 345: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 105) - kind = 105; - jjstateSet[jjnewStateCnt++] = 323; + if (kind > 106) + kind = 106; + jjstateSet[jjnewStateCnt++] = 346; break; - case 323: + case 346: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 105) - kind = 105; - jjCheckNAddStates(712, 715); + if (kind > 106) + kind = 106; + jjCheckNAddStates(714, 717); break; - case 324: + case 347: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 105) - kind = 105; - jjCheckNAdd(298); + if (kind > 106) + kind = 106; + jjCheckNAdd(321); break; - case 325: + case 348: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 105) - kind = 105; - jjCheckNAddTwoStates(298, 324); + if (kind > 106) + kind = 106; + jjCheckNAddTwoStates(321, 347); break; - case 326: + case 349: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 105) - kind = 105; - jjCheckNAddStates(716, 718); + if (kind > 106) + kind = 106; + jjCheckNAddStates(718, 720); break; - case 327: + case 350: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(719, 723); + jjCheckNAddStates(721, 725); break; - case 328: + case 351: if ((0x7e0000007eL & l) != 0L) - jjCheckNAdd(321); + jjCheckNAdd(344); break; - case 329: + case 352: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddTwoStates(328, 321); + jjCheckNAddTwoStates(351, 344); break; - case 330: + case 353: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(724, 726); + jjCheckNAddStates(726, 728); break; - case 331: + case 354: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(727, 730); + jjCheckNAddStates(729, 732); break; - case 332: + case 355: if (curChar == 92) - jjCheckNAddStates(802, 805); + jjCheckNAddStates(804, 807); break; - case 333: + case 356: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(731, 734); + if (kind > 67) + kind = 67; + jjCheckNAddStates(733, 736); break; - case 334: + case 357: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(735, 741); + if (kind > 67) + kind = 67; + jjCheckNAddStates(737, 743); break; - case 335: + case 358: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(742, 744); + if (kind > 67) + kind = 67; + jjCheckNAddStates(744, 746); break; - case 336: + case 359: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(745, 748); + if (kind > 67) + kind = 67; + jjCheckNAddStates(747, 750); break; - case 337: + case 360: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(749, 753); + if (kind > 67) + kind = 67; + jjCheckNAddStates(751, 755); break; - case 338: + case 361: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddStates(754, 759); + if (kind > 67) + kind = 67; + jjCheckNAddStates(756, 761); break; - case 339: + case 362: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(760, 764); + jjCheckNAddStates(762, 766); break; - case 340: + case 363: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(765, 772); + jjCheckNAddStates(767, 774); break; - case 342: + case 365: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(773, 777); + jjCheckNAddStates(775, 779); break; - case 343: + case 366: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(778, 783); + jjCheckNAddStates(780, 785); break; - case 344: + case 367: if ((0x7e0000007eL & l) != 0L) - jjCheckNAddStates(784, 790); + jjCheckNAddStates(786, 792); break; default : break; } @@ -3719,38 +3819,38 @@ private int jjMoveNfa_0(int startState, int curPos) { switch(jjstateSet[--i]) { - case 96: - case 100: + case 4: if ((jjbitVec0[i2] & l2) == 0L) break; - if (kind > 94) - kind = 94; - jjCheckNAddTwoStates(98, 99); + if (kind > 37) + kind = 37; + jjCheckNAddStates(798, 803); break; - case 403: - case 98: + case 426: + case 113: + case 115: if ((jjbitVec0[i2] & l2) == 0L) break; - if (kind > 94) - kind = 94; - jjCheckNAddTwoStates(98, 99); + if (kind > 95) + kind = 95; + jjCheckNAddTwoStates(113, 114); break; - case 401: + case 425: if ((jjbitVec0[i2] & l2) != 0L) { - if (kind > 66) - kind = 66; - jjCheckNAddTwoStates(117, 118); + if (kind > 67) + kind = 67; + jjCheckNAddTwoStates(140, 141); } if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddStates(5, 8); + jjCheckNAddStates(115, 118); break; - case 4: + case 111: if ((jjbitVec0[i2] & l2) == 0L) break; - if (kind > 37) - kind = 37; - jjCheckNAddStates(796, 801); + if (kind > 95) + kind = 95; + jjCheckNAddTwoStates(113, 114); break; case 2: if ((jjbitVec0[i2] & l2) != 0L && kind > 5) @@ -3762,69 +3862,69 @@ private int jjMoveNfa_0(int startState, int curPos) if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(123, 125); break; - case 30: - case 35: + case 45: + case 50: if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddStates(115, 118); + jjCheckNAddStates(106, 109); break; - case 47: - case 52: + case 62: + case 67: if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddStates(111, 114); + jjCheckNAddStates(102, 105); break; - case 66: - case 68: - case 76: + case 81: + case 83: + case 91: if ((jjbitVec0[i2] & l2) == 0L) break; - if (kind > 70) - kind = 70; - jjCheckNAddTwoStates(66, 67); + if (kind > 71) + kind = 71; + jjCheckNAddTwoStates(81, 82); break; - case 85: - case 87: + case 100: + case 102: if ((jjbitVec0[i2] & l2) == 0L) break; - if (kind > 88) - kind = 88; - jjCheckNAddTwoStates(85, 86); + if (kind > 89) + kind = 89; + jjCheckNAddTwoStates(100, 101); break; - case 117: - case 119: + case 140: + case 142: if ((jjbitVec0[i2] & l2) == 0L) break; - if (kind > 66) - kind = 66; - jjCheckNAddTwoStates(117, 118); + if (kind > 67) + kind = 67; + jjCheckNAddTwoStates(140, 141); break; - case 127: - case 131: + case 150: + case 154: if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddStates(5, 8); + jjCheckNAddStates(115, 118); break; - case 218: - case 220: - case 228: + case 241: + case 243: + case 251: if ((jjbitVec0[i2] & l2) == 0L) break; - if (kind > 87) - kind = 87; - jjCheckNAddTwoStates(218, 219); + if (kind > 88) + kind = 88; + jjCheckNAddTwoStates(241, 242); break; - case 238: - case 242: + case 261: + case 265: if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddStates(551, 554); + jjCheckNAddStates(553, 556); break; - case 251: - case 256: + case 274: + case 279: if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddStates(590, 593); + jjCheckNAddStates(592, 595); break; - case 268: - case 273: + case 291: + case 296: if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddStates(635, 638); + jjCheckNAddStates(637, 640); break; default : break; } @@ -3837,7 +3937,7 @@ private int jjMoveNfa_0(int startState, int curPos) kind = 0x7fffffff; } ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 400 - (jjnewStateCnt = startsAt))) + if ((i = jjnewStateCnt) == (startsAt = 423 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } @@ -3993,59 +4093,59 @@ private int jjMoveStringLiteralDfa1_2(long active0) return 2; } static final int[] jjnextStates = { - 215, 216, 217, 228, 229, 127, 128, 129, 130, 346, 347, 348, 349, 350, 351, 165, - 352, 353, 354, 168, 355, 356, 357, 171, 358, 359, 360, 174, 361, 362, 363, 177, - 364, 365, 366, 180, 367, 368, 369, 183, 370, 371, 372, 186, 373, 374, 375, 189, - 376, 377, 378, 193, 379, 380, 381, 197, 382, 383, 384, 202, 385, 386, 387, 205, - 388, 389, 390, 207, 391, 392, 393, 210, 394, 395, 396, 214, 397, 398, 399, 216, - 217, 228, 229, 163, 164, 166, 169, 172, 175, 178, 181, 184, 187, 190, 194, 198, - 203, 206, 208, 211, 215, 159, 160, 140, 147, 148, 157, 64, 65, 76, 77, 47, - 48, 49, 51, 30, 31, 32, 34, 7, 8, 20, 21, 9, 10, 11, 9, 14, + 369, 370, 371, 372, 373, 374, 188, 375, 376, 377, 191, 378, 379, 380, 194, 381, + 382, 383, 197, 384, 385, 386, 200, 387, 388, 389, 203, 390, 391, 392, 206, 393, + 394, 395, 209, 396, 397, 398, 212, 399, 400, 401, 216, 402, 403, 404, 220, 405, + 406, 407, 225, 408, 409, 410, 228, 411, 412, 413, 230, 414, 415, 416, 233, 417, + 418, 419, 237, 420, 421, 422, 239, 240, 251, 252, 186, 187, 189, 192, 195, 198, + 201, 204, 207, 210, 213, 217, 221, 226, 229, 231, 234, 238, 182, 183, 163, 170, + 171, 180, 79, 80, 91, 92, 62, 63, 64, 66, 45, 46, 47, 49, 238, 239, + 240, 251, 252, 150, 151, 152, 153, 7, 8, 20, 21, 9, 10, 11, 9, 14, 10, 11, 15, 9, 16, 14, 10, 11, 17, 18, 19, 9, 14, 10, 11, 9, 16, 14, 10, 11, 9, 16, 14, 10, 11, 17, 9, 16, 14, 10, 11, 17, 18, 14, 9, 10, 11, 23, 24, 14, 9, 10, 11, 25, 26, 27, 14, 9, 10, 11, 24, 14, 9, 10, 11, 24, 14, 9, 10, 11, 25, 24, 14, 9, - 10, 11, 25, 26, 30, 37, 31, 32, 34, 38, 30, 39, 37, 31, 32, 34, - 40, 41, 42, 30, 37, 31, 32, 34, 30, 39, 37, 31, 32, 34, 30, 39, - 37, 31, 32, 34, 40, 30, 39, 37, 31, 32, 34, 40, 41, 47, 54, 48, - 49, 51, 55, 47, 56, 54, 48, 49, 51, 57, 58, 59, 47, 54, 48, 49, - 51, 47, 56, 54, 48, 49, 51, 47, 56, 54, 48, 49, 51, 57, 47, 56, - 54, 48, 49, 51, 57, 58, 66, 70, 67, 71, 66, 72, 70, 67, 73, 74, - 75, 66, 70, 67, 66, 72, 70, 67, 66, 72, 70, 67, 73, 66, 72, 70, - 67, 73, 74, 70, 66, 67, 79, 80, 70, 66, 67, 81, 82, 83, 70, 66, - 67, 80, 70, 66, 67, 80, 70, 66, 67, 81, 80, 70, 66, 67, 81, 82, - 85, 89, 86, 90, 85, 91, 89, 86, 92, 93, 94, 85, 89, 86, 85, 91, - 89, 86, 85, 91, 89, 86, 92, 85, 91, 89, 86, 92, 93, 98, 102, 99, - 103, 98, 104, 102, 99, 105, 106, 107, 98, 102, 99, 98, 104, 102, 99, 98, - 104, 102, 99, 105, 98, 104, 102, 99, 105, 106, 102, 98, 99, 111, 112, 102, - 98, 99, 113, 114, 115, 102, 98, 99, 112, 102, 98, 99, 112, 102, 98, 99, - 113, 112, 102, 98, 99, 113, 114, 117, 121, 118, 122, 117, 123, 121, 118, 124, - 125, 126, 117, 121, 118, 117, 123, 121, 118, 117, 123, 121, 118, 124, 117, 123, - 121, 118, 124, 125, 127, 129, 130, 133, 134, 127, 135, 129, 130, 133, 136, 137, - 138, 127, 129, 130, 133, 127, 135, 129, 130, 133, 127, 135, 129, 130, 133, 136, - 127, 135, 129, 130, 133, 136, 137, 218, 222, 219, 223, 218, 224, 222, 219, 225, - 226, 227, 218, 222, 219, 218, 224, 222, 219, 218, 224, 222, 219, 225, 218, 224, - 222, 219, 225, 226, 222, 218, 219, 231, 232, 222, 218, 219, 233, 234, 235, 222, - 218, 219, 232, 222, 218, 219, 232, 222, 218, 219, 233, 232, 222, 218, 219, 233, - 234, 238, 250, 267, 240, 241, 284, 238, 239, 240, 241, 238, 240, 241, 244, 245, - 238, 246, 240, 241, 244, 247, 248, 249, 238, 240, 241, 244, 238, 246, 240, 241, - 244, 238, 246, 240, 241, 244, 247, 238, 246, 240, 241, 244, 247, 248, 251, 252, - 253, 255, 251, 258, 252, 253, 255, 259, 251, 260, 258, 252, 253, 255, 261, 262, - 263, 251, 258, 252, 253, 255, 251, 260, 258, 252, 253, 255, 251, 260, 258, 252, - 253, 255, 261, 251, 260, 258, 252, 253, 255, 261, 262, 268, 269, 270, 272, 268, - 275, 269, 270, 272, 276, 268, 277, 275, 269, 270, 272, 278, 279, 280, 268, 275, - 269, 270, 272, 268, 277, 275, 269, 270, 272, 268, 277, 275, 269, 270, 272, 278, - 268, 277, 275, 269, 270, 272, 278, 279, 238, 250, 267, 239, 240, 241, 284, 288, - 294, 290, 291, 292, 293, 290, 291, 292, 295, 299, 303, 307, 311, 315, 290, 313, - 314, 290, 316, 317, 318, 290, 316, 317, 298, 324, 325, 326, 298, 324, 325, 328, - 321, 329, 330, 331, 328, 321, 329, 328, 321, 329, 330, 121, 117, 118, 334, 335, - 121, 117, 118, 336, 337, 338, 121, 117, 118, 335, 121, 117, 118, 335, 121, 117, - 118, 336, 335, 121, 117, 118, 336, 337, 127, 129, 130, 133, 340, 341, 127, 129, - 130, 133, 342, 343, 344, 341, 127, 129, 130, 133, 341, 127, 129, 130, 133, 342, - 341, 127, 129, 130, 133, 342, 343, 397, 216, 217, 228, 229, 117, 127, 128, 129, - 130, 118, 119, 333, 131, 339, 96, 97, 108, 109, 286, 287, 319, 33, 43, 45, - 44, 35, 36, 50, 60, 62, 61, 52, 53, 87, 88, 242, 243, 254, 264, 266, - 265, 256, 257, 271, 281, 283, 282, 273, 274, + 10, 11, 25, 26, 45, 52, 46, 47, 49, 53, 45, 54, 52, 46, 47, 49, + 55, 56, 57, 45, 52, 46, 47, 49, 45, 54, 52, 46, 47, 49, 45, 54, + 52, 46, 47, 49, 55, 45, 54, 52, 46, 47, 49, 55, 56, 62, 69, 63, + 64, 66, 70, 62, 71, 69, 63, 64, 66, 72, 73, 74, 62, 69, 63, 64, + 66, 62, 71, 69, 63, 64, 66, 62, 71, 69, 63, 64, 66, 72, 62, 71, + 69, 63, 64, 66, 72, 73, 81, 85, 82, 86, 81, 87, 85, 82, 88, 89, + 90, 81, 85, 82, 81, 87, 85, 82, 81, 87, 85, 82, 88, 81, 87, 85, + 82, 88, 89, 85, 81, 82, 94, 95, 85, 81, 82, 96, 97, 98, 85, 81, + 82, 95, 85, 81, 82, 95, 85, 81, 82, 96, 95, 85, 81, 82, 96, 97, + 100, 104, 101, 105, 100, 106, 104, 101, 107, 108, 109, 100, 104, 101, 100, 106, + 104, 101, 100, 106, 104, 101, 107, 100, 106, 104, 101, 107, 108, 113, 117, 114, + 118, 113, 119, 117, 114, 120, 121, 122, 113, 117, 114, 113, 119, 117, 114, 113, + 119, 117, 114, 120, 113, 119, 117, 114, 120, 121, 117, 113, 114, 126, 127, 117, + 113, 114, 128, 129, 130, 117, 113, 114, 127, 117, 113, 114, 127, 117, 113, 114, + 128, 127, 117, 113, 114, 128, 129, 132, 133, 140, 144, 141, 145, 140, 146, 144, + 141, 147, 148, 149, 140, 144, 141, 140, 146, 144, 141, 140, 146, 144, 141, 147, + 140, 146, 144, 141, 147, 148, 150, 152, 153, 156, 157, 150, 158, 152, 153, 156, + 159, 160, 161, 150, 152, 153, 156, 150, 158, 152, 153, 156, 150, 158, 152, 153, + 156, 159, 150, 158, 152, 153, 156, 159, 160, 241, 245, 242, 246, 241, 247, 245, + 242, 248, 249, 250, 241, 245, 242, 241, 247, 245, 242, 241, 247, 245, 242, 248, + 241, 247, 245, 242, 248, 249, 245, 241, 242, 254, 255, 245, 241, 242, 256, 257, + 258, 245, 241, 242, 255, 245, 241, 242, 255, 245, 241, 242, 256, 255, 245, 241, + 242, 256, 257, 261, 273, 290, 263, 264, 307, 261, 262, 263, 264, 261, 263, 264, + 267, 268, 261, 269, 263, 264, 267, 270, 271, 272, 261, 263, 264, 267, 261, 269, + 263, 264, 267, 261, 269, 263, 264, 267, 270, 261, 269, 263, 264, 267, 270, 271, + 274, 275, 276, 278, 274, 281, 275, 276, 278, 282, 274, 283, 281, 275, 276, 278, + 284, 285, 286, 274, 281, 275, 276, 278, 274, 283, 281, 275, 276, 278, 274, 283, + 281, 275, 276, 278, 284, 274, 283, 281, 275, 276, 278, 284, 285, 291, 292, 293, + 295, 291, 298, 292, 293, 295, 299, 291, 300, 298, 292, 293, 295, 301, 302, 303, + 291, 298, 292, 293, 295, 291, 300, 298, 292, 293, 295, 291, 300, 298, 292, 293, + 295, 301, 291, 300, 298, 292, 293, 295, 301, 302, 261, 273, 290, 262, 263, 264, + 307, 311, 317, 313, 314, 315, 316, 313, 314, 315, 318, 322, 326, 330, 334, 338, + 313, 336, 337, 313, 339, 340, 341, 313, 339, 340, 321, 347, 348, 349, 321, 347, + 348, 351, 344, 352, 353, 354, 351, 344, 352, 351, 344, 352, 353, 144, 140, 141, + 357, 358, 144, 140, 141, 359, 360, 361, 144, 140, 141, 358, 144, 140, 141, 358, + 144, 140, 141, 359, 358, 144, 140, 141, 359, 360, 150, 152, 153, 156, 363, 364, + 150, 152, 153, 156, 365, 366, 367, 364, 150, 152, 153, 156, 364, 150, 152, 153, + 156, 365, 364, 150, 152, 153, 156, 365, 366, 420, 239, 240, 251, 252, 140, 150, + 151, 152, 153, 141, 142, 356, 154, 362, 111, 112, 123, 124, 309, 310, 342, 48, + 58, 60, 59, 50, 51, 65, 75, 77, 76, 67, 68, 102, 103, 265, 266, 277, + 287, 289, 288, 279, 280, 294, 304, 306, 305, 296, 297, }; /** Token literal values. */ @@ -4058,7 +4158,7 @@ null, null, null, null, null, null, null, null, null, null, null, null, null, nu null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, -null, null, null, null, null, null, null, null, }; +null, null, null, null, null, null, null, null, null, null, }; /** Lexer state names. */ public static final String[] lexStateNames = { @@ -4074,10 +4174,10 @@ public static final int[] jjnewLexState = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }; static final long[] jjtoToken = { - 0xffffc03ffffffc03L, 0xe00ffffffefL, + 0xffffc03ffffffc03L, 0x3c01ffffffdfL, }; static final long[] jjtoSkip = { 0x190L, 0x0L, @@ -4089,8 +4189,8 @@ static final long[] jjtoMore = { 0x26cL, 0x0L, }; protected CharStream input_stream; -private final int[] jjrounds = new int[400]; -private final int[] jjstateSet = new int[800]; +private final int[] jjrounds = new int[423]; +private final int[] jjstateSet = new int[846]; private final StringBuilder jjimage = new StringBuilder(); private StringBuilder image = jjimage; private int jjimageLen; @@ -4119,7 +4219,7 @@ private void ReInitRounds() { int i; jjround = 0x80000001; - for (i = 400; i-- > 0;) + for (i = 423; i-- > 0;) jjrounds[i] = 0x80000000; } @@ -4203,9 +4303,9 @@ public Token getNextToken() jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_0(); - if (jjmatchedPos == 0 && jjmatchedKind > 107) + if (jjmatchedPos == 0 && jjmatchedKind > 109) { - jjmatchedKind = 107; + jjmatchedKind = 109; } break; case 1: diff --git a/theme-compiler/src/com/vaadin/sass/tree/BlockNode.java b/theme-compiler/src/com/vaadin/sass/tree/BlockNode.java index cde7c9425a..bd240324ba 100644 --- a/theme-compiler/src/com/vaadin/sass/tree/BlockNode.java +++ b/theme-compiler/src/com/vaadin/sass/tree/BlockNode.java @@ -18,35 +18,32 @@ package com.vaadin.sass.tree; import java.util.ArrayList; -import org.w3c.css.sac.Selector; -import org.w3c.css.sac.SelectorList; - -import com.vaadin.sass.parser.SelectorListImpl; -import com.vaadin.sass.selector.SelectorUtil; -import com.vaadin.sass.util.Clonable; -import com.vaadin.sass.util.DeepCopy; - -public class BlockNode extends Node implements Clonable, IVariableNode { +public class BlockNode extends Node implements IVariableNode { private static final long serialVersionUID = 5742962631468325048L; - SelectorList selectorList; + ArrayList<String> selectorList; - public BlockNode(SelectorList selectorList) { + public BlockNode(ArrayList<String> selectorList) { this.selectorList = selectorList; } - public SelectorList getSelectorList() { + public ArrayList<String> getSelectorList() { return selectorList; } - public void setSelectorList(SelectorList selectorList) { + public void setSelectorList(ArrayList<String> selectorList) { this.selectorList = selectorList; } public String toString(boolean indent) { StringBuilder string = new StringBuilder(); - string.append(SelectorUtil.toString(selectorList)); + for (final String s : selectorList) { + string.append(s); + if (selectorList.indexOf(s) != selectorList.size() - 1) { + string.append(", "); + } + } string.append(" {\n"); for (Node child : children) { if (indent) { @@ -67,52 +64,17 @@ public class BlockNode extends Node implements Clonable, IVariableNode { } @Override - public Object clone() throws CloneNotSupportedException { - - SelectorListImpl clonedSelectorList = null; - - if (selectorList != null) { - clonedSelectorList = new SelectorListImpl(); - for (int i = 0; i < selectorList.getLength(); i++) { - clonedSelectorList.addSelector(selectorList.item(i)); - } - } - final BlockNode clone = new BlockNode(clonedSelectorList); - for (Node child : getChildren()) { - clone.getChildren().add((Node) DeepCopy.copy(child)); - } - return clone; - } - - @Override public void replaceVariables(ArrayList<VariableNode> variables) { - SelectorListImpl newList = new SelectorListImpl(); - - if (selectorList != null) { - for (int i = 0; i < selectorList.getLength(); i++) { - Selector selector = selectorList.item(i); - for (final VariableNode node : variables) { - - if (SelectorUtil.toString(selector) - .contains(node.getName())) { - try { - selector = SelectorUtil - .createSelectorAndreplaceSelectorVariableWithValue( - selector, node.getName(), node - .getExpr().toString()); - break; - } catch (Exception e) { - e.printStackTrace(); - return; - } - } - } - newList.addSelector(selector); - } + } - selectorList = newList; + public String getSelectors() { + StringBuilder b = new StringBuilder(); + for (final String s : selectorList) { + b.append(s); } + + return b.toString(); } } diff --git a/theme-compiler/src/com/vaadin/sass/tree/ExtendNode.java b/theme-compiler/src/com/vaadin/sass/tree/ExtendNode.java index b70c20bcfe..909e69e12f 100644 --- a/theme-compiler/src/com/vaadin/sass/tree/ExtendNode.java +++ b/theme-compiler/src/com/vaadin/sass/tree/ExtendNode.java @@ -18,52 +18,31 @@ package com.vaadin.sass.tree; import java.util.ArrayList; -import org.w3c.css.sac.Selector; -import org.w3c.css.sac.SelectorList; - -import com.vaadin.sass.parser.SelectorListImpl; -import com.vaadin.sass.selector.SelectorUtil; - public class ExtendNode extends Node implements IVariableNode { private static final long serialVersionUID = 3301805078983796878L; - SelectorList list; + ArrayList<String> list; - public ExtendNode(SelectorList list) { + public ExtendNode(ArrayList<String> list) { super(); this.list = list; } - public SelectorList getList() { + public ArrayList<String> getList() { return list; } @Override public void replaceVariables(ArrayList<VariableNode> variables) { - SelectorListImpl newList = new SelectorListImpl(); - - for (int i = 0; i < list.getLength(); i++) { - Selector selector = list.item(i); - for (final VariableNode node : variables) { + } - if (SelectorUtil.toString(selector).contains(node.getName())) { - try { - selector = SelectorUtil - .createSelectorAndreplaceSelectorVariableWithValue( - selector, node.getName(), node - .getExpr().toString()); - break; - } catch (Exception e) { - e.printStackTrace(); - return; - } - } - } - newList.addSelector(selector); + public String getListAsString() { + StringBuilder b = new StringBuilder(); + for (final String s : list) { + b.append(s); } - list = newList; + return b.toString(); } - } diff --git a/theme-compiler/src/com/vaadin/sass/tree/ListModifyNode.java b/theme-compiler/src/com/vaadin/sass/tree/ListModifyNode.java new file mode 100644 index 0000000000..71c32a5c06 --- /dev/null +++ b/theme-compiler/src/com/vaadin/sass/tree/ListModifyNode.java @@ -0,0 +1,11 @@ +package com.vaadin.sass.tree; + +public interface ListModifyNode { + + public boolean isModifyingVariable(); + + public String getVariable(); + + public VariableNode getModifiedList(VariableNode variableNode); + +} diff --git a/theme-compiler/src/com/vaadin/sass/tree/ListRemoveNode.java b/theme-compiler/src/com/vaadin/sass/tree/ListRemoveNode.java new file mode 100644 index 0000000000..9c6400ec02 --- /dev/null +++ b/theme-compiler/src/com/vaadin/sass/tree/ListRemoveNode.java @@ -0,0 +1,114 @@ +package com.vaadin.sass.tree; + +import java.util.ArrayList; + +import com.vaadin.sass.parser.LexicalUnitImpl; +import com.vaadin.sass.util.DeepCopy; + +public class ListRemoveNode extends Node implements ListModifyNode, + IVariableNode { + + private ArrayList<String> list; + private ArrayList<String> remove; + private String separator; + + public ListRemoveNode(ArrayList<String> list, ArrayList<String> remove, + String separator) { + this.list = list; + this.remove = remove; + this.separator = separator; + } + + @Override + public boolean isModifyingVariable() { + if (list != null) { + return list.size() == 1 && list.get(0).startsWith("$"); + } + return false; + } + + @Override + public String getVariable() { + if (list != null && list.size() == 1) { + String string = list.get(0); + return string.substring(1, string.length()); + } + return null; + } + + @Override + public VariableNode getModifiedList(VariableNode variableNode) { + + VariableNode clone = (VariableNode) DeepCopy.copy(variableNode); + + LexicalUnitImpl first = null; + LexicalUnitImpl current = (LexicalUnitImpl) clone.getExpr(); + LexicalUnitImpl lastAccepted = null; + while (current != null) { + + if (shouldInclude(current, lastAccepted)) { + LexicalUnitImpl temp = current.clone(); + temp.setNextLexicalUnit(null); + + if (lastAccepted != null) { + lastAccepted.setNextLexicalUnit(temp); + } + + lastAccepted = temp; + + if (first == null) { + first = lastAccepted; + } + } + current = (LexicalUnitImpl) current.getNextLexicalUnit(); + } + + clone.setExpr(first); + + return clone; + } + + private boolean shouldInclude(LexicalUnitImpl current, + LexicalUnitImpl lastAccepted) { + + if (lastAccepted != null + && lastAccepted.getLexicalUnitType() == LexicalUnitImpl.SAC_OPERATOR_COMMA + && current.getLexicalUnitType() == LexicalUnitImpl.SAC_OPERATOR_COMMA) { + return false; + } + + String string = current.getValue().toString(); + for (final String s : remove) { + if (s.equals(string)) { + return false; + } + } + return true; + } + + @Override + public void replaceVariables(ArrayList<VariableNode> variables) { + ArrayList<String> newList = new ArrayList<String>(); + + for (final String removeVar : remove) { + if (!removeVar.startsWith("$")) { + continue; + } + + for (final VariableNode var : variables) { + if (removeVar.equals("$" + var.getName())) { + LexicalUnitImpl expr = var.getExpr(); + while (expr != null) { + newList.add(expr.getValue().toString()); + expr = expr.getNextLexicalUnit(); + } + + } + } + } + if (newList.size() > 0) { + remove = newList; + } + + } +} diff --git a/theme-compiler/src/com/vaadin/sass/tree/MicrosoftRuleNode.java b/theme-compiler/src/com/vaadin/sass/tree/MicrosoftRuleNode.java new file mode 100644 index 0000000000..cbd3b14289 --- /dev/null +++ b/theme-compiler/src/com/vaadin/sass/tree/MicrosoftRuleNode.java @@ -0,0 +1,29 @@ +package com.vaadin.sass.tree; + +import java.util.ArrayList; + +public class MicrosoftRuleNode extends Node implements IVariableNode { + + private final String name; + private String value; + + public MicrosoftRuleNode(String name, String value) { + this.name = name; + this.value = value; + } + + @Override + public void replaceVariables(ArrayList<VariableNode> variables) { + for (final VariableNode var : variables) { + if (value.contains("$" + var.getName())) { + value = value.replaceAll("$" + var.getName(), var.getExpr() + .toString()); + } + } + } + + @Override + public String toString() { + return name + ": " + value + ";"; + } +} diff --git a/theme-compiler/src/com/vaadin/sass/tree/MixinDefNode.java b/theme-compiler/src/com/vaadin/sass/tree/MixinDefNode.java index a872d13654..6e8f689ed1 100644 --- a/theme-compiler/src/com/vaadin/sass/tree/MixinDefNode.java +++ b/theme-compiler/src/com/vaadin/sass/tree/MixinDefNode.java @@ -70,8 +70,8 @@ public class MixinDefNode extends Node implements IVariableNode { public void replaceVariables(ArrayList<VariableNode> variables) { for (final VariableNode var : variables) { for (final VariableNode arg : new ArrayList<VariableNode>(arglist)) { - - if (arg.getName().equals(var.getName())) { + if (arg.getName().equals(var.getName()) + && arg.getExpr() == null) { arglist.add(arglist.indexOf(arg), (VariableNode) DeepCopy.copy(var)); arglist.remove(arg); diff --git a/theme-compiler/src/com/vaadin/sass/tree/MixinNode.java b/theme-compiler/src/com/vaadin/sass/tree/MixinNode.java index 2b9299bbd1..205f20b500 100644 --- a/theme-compiler/src/com/vaadin/sass/tree/MixinNode.java +++ b/theme-compiler/src/com/vaadin/sass/tree/MixinNode.java @@ -19,20 +19,18 @@ package com.vaadin.sass.tree; import java.util.ArrayList; import java.util.Collection; -import org.w3c.css.sac.LexicalUnit; - import com.vaadin.sass.parser.LexicalUnitImpl; public class MixinNode extends Node implements IVariableNode { private static final long serialVersionUID = 4725008226813110658L; private String name; - private ArrayList<LexicalUnit> arglist; + private ArrayList<LexicalUnitImpl> arglist; - public MixinNode(String name, Collection<LexicalUnit> args) { + public MixinNode(String name, Collection<LexicalUnitImpl> args) { super(); this.name = name; - arglist = new ArrayList<LexicalUnit>(); + arglist = new ArrayList<LexicalUnitImpl>(); if (args != null && !args.isEmpty()) { arglist.addAll(args); } @@ -51,21 +49,22 @@ public class MixinNode extends Node implements IVariableNode { this.name = name; } - public ArrayList<LexicalUnit> getArglist() { + public ArrayList<LexicalUnitImpl> getArglist() { return arglist; } - public void setArglist(ArrayList<LexicalUnit> arglist) { + public void setArglist(ArrayList<LexicalUnitImpl> arglist) { this.arglist = arglist; } @Override public void replaceVariables(ArrayList<VariableNode> variables) { for (final VariableNode var : variables) { - for (final LexicalUnit arg : new ArrayList<LexicalUnit>(arglist)) { + for (final LexicalUnitImpl arg : new ArrayList<LexicalUnitImpl>( + arglist)) { if (arg.getLexicalUnitType() == LexicalUnitImpl.SCSS_VARIABLE && arg.getStringValue().equals(var.getName())) { - ((LexicalUnitImpl) arg).replaceValue(var.getExpr()); + arg.replaceValue(var.getExpr()); } } } diff --git a/theme-compiler/src/com/vaadin/sass/tree/RuleNode.java b/theme-compiler/src/com/vaadin/sass/tree/RuleNode.java index fe52844979..ee8d8145f1 100644 --- a/theme-compiler/src/com/vaadin/sass/tree/RuleNode.java +++ b/theme-compiler/src/com/vaadin/sass/tree/RuleNode.java @@ -18,19 +18,17 @@ package com.vaadin.sass.tree; import java.util.ArrayList; -import org.w3c.css.sac.LexicalUnit; - import com.vaadin.sass.parser.LexicalUnitImpl; public class RuleNode extends Node implements IVariableNode { private static final long serialVersionUID = 6653493127869037022L; String variable; - LexicalUnit value; + LexicalUnitImpl value; String comment; private boolean important; - public RuleNode(String variable, LexicalUnit value, boolean important, + public RuleNode(String variable, LexicalUnitImpl value, boolean important, String comment) { this.variable = variable; this.value = value; @@ -46,11 +44,11 @@ public class RuleNode extends Node implements IVariableNode { this.variable = variable; } - public LexicalUnit getValue() { + public LexicalUnitImpl getValue() { return value; } - public void setValue(LexicalUnit value) { + public void setValue(LexicalUnitImpl value) { this.value = value; } @@ -84,25 +82,43 @@ public class RuleNode extends Node implements IVariableNode { @Override public void replaceVariables(ArrayList<VariableNode> variables) { for (final VariableNode node : variables) { - LexicalUnit current = value; - if (current.getLexicalUnitType() == LexicalUnitImpl.SAC_FUNCTION) { - if (current.getParameters().toString().contains(node.getName())) { - LexicalUnit param = value.getParameters(); - if (param != null) { - if (param.toString().contains(node.getName())) { - ((LexicalUnitImpl) param).replaceValue(node - .getExpr()); + if (value.getLexicalUnitType() == LexicalUnitImpl.SAC_FUNCTION) { + if (value.getParameters().toString().contains(node.getName())) { + if (value.getParameters() != null) { + if (value.getParameters().toString() + .contains("$" + node.getName())) { + + LexicalUnitImpl param = value.getParameters(); + while (param != null) { + if (param.getValue().toString() + .contains(node.getName())) { + + LexicalUnitImpl expr = node.getExpr(); + + LexicalUnitImpl prev = param + .getPreviousLexicalUnit(); + LexicalUnitImpl next = param + .getNextLexicalUnit(); + + if (param.getLexicalUnitType() == LexicalUnitImpl.SCSS_VARIABLE) { + param.replaceValue(expr); + param.setPrevLexicalUnit(prev); + param.setNextLexicalUnit(next); + } + } + param = param.getNextLexicalUnit(); + } } } } } else { + LexicalUnitImpl current = value; while (current != null) { if (current.getLexicalUnitType() == LexicalUnitImpl.SCSS_VARIABLE - && current.toString() - .contains("$" + node.getName())) { + && current.getValue().toString() + .equals(node.getName())) { - ((LexicalUnitImpl) current) - .replaceValue(node.getExpr()); + current.replaceValue(node.getExpr()); } current = current.getNextLexicalUnit(); } diff --git a/theme-compiler/src/com/vaadin/sass/tree/VariableNode.java b/theme-compiler/src/com/vaadin/sass/tree/VariableNode.java index b7e9a21d51..ffe6b77896 100644 --- a/theme-compiler/src/com/vaadin/sass/tree/VariableNode.java +++ b/theme-compiler/src/com/vaadin/sass/tree/VariableNode.java @@ -27,27 +27,32 @@ public class VariableNode extends Node implements IVariableNode { private static final long serialVersionUID = 7003372557547748734L; private String name; - private LexicalUnit expr; + private LexicalUnitImpl expr; private boolean guarded; - public VariableNode(String name, LexicalUnit expr, boolean guarded) { + public VariableNode(String name, LexicalUnitImpl expr, boolean guarded) { super(); this.name = name; this.expr = expr; this.guarded = guarded; + checkSeparators(); } - public VariableNode(String name, String raw) { - super(raw); - this.name = name; - } - - public LexicalUnit getExpr() { + public LexicalUnitImpl getExpr() { return expr; } - public void setExpr(LexicalUnit expr) { + public void setExpr(LexicalUnitImpl expr) { this.expr = expr; + checkSeparators(); + } + + private void checkSeparators() { + if (expr != null) { + if (expr.toString().contains(",")) { + + } + } } public String getName() { @@ -75,7 +80,7 @@ public class VariableNode extends Node implements IVariableNode { if (!this.equals(node)) { if (name.equals(node.getName())) { - expr = (LexicalUnit) DeepCopy.copy(node.getExpr()); + expr = (LexicalUnitImpl) DeepCopy.copy(node.getExpr()); guarded = node.isGuarded(); continue; } @@ -93,19 +98,4 @@ public class VariableNode extends Node implements IVariableNode { } } } - - public boolean replacePossibleVariables(ArrayList<VariableNode> list) { - list.remove(this); - LexicalUnit oldExpr = (LexicalUnit) DeepCopy.copy(expr); - replaceVariables(list); - - if (!oldExpr.toString().equals(expr.toString())) { - for (VariableNode n : list) { - if (expr.toString().equals(n.getExpr().toString())) { - return true; - } - } - } - return false; - } } diff --git a/theme-compiler/src/com/vaadin/sass/tree/controldirective/EachDefNode.java b/theme-compiler/src/com/vaadin/sass/tree/controldirective/EachDefNode.java index 2cb9aeb1c3..f75d5ed7b5 100644 --- a/theme-compiler/src/com/vaadin/sass/tree/controldirective/EachDefNode.java +++ b/theme-compiler/src/com/vaadin/sass/tree/controldirective/EachDefNode.java @@ -19,20 +19,30 @@ package com.vaadin.sass.tree.controldirective; import java.util.ArrayList; import java.util.List; +import com.vaadin.sass.parser.LexicalUnitImpl; +import com.vaadin.sass.tree.IVariableNode; import com.vaadin.sass.tree.Node; +import com.vaadin.sass.tree.VariableNode; -public class EachDefNode extends Node { +public class EachDefNode extends Node implements IVariableNode { private static final long serialVersionUID = 7943948981204906221L; private String var; private ArrayList<String> list; + private String listVariable; + public EachDefNode(String var, ArrayList<String> list) { super(); this.var = var; this.list = list; } + public EachDefNode(String var, String listVariable) { + this.var = var; + this.listVariable = listVariable; + } + public List<String> getVariables() { return list; } @@ -46,4 +56,37 @@ public class EachDefNode extends Node { return "Each Definition Node: {variable : " + var + ", " + "children : " + list.size() + "}"; } + + public boolean hasListVariable() { + return listVariable != null; + } + + @Override + public void replaceVariables(ArrayList<VariableNode> variables) { + if (listVariable != null) { + for (final VariableNode var : variables) { + if (listVariable.equals(var.getName())) { + + LexicalUnitImpl current = (LexicalUnitImpl) var.getExpr(); + list = new ArrayList<String>(); + + while (current != null) { + if (current.getValue() != null + && current.getLexicalUnitType() != LexicalUnitImpl.SAC_OPERATOR_COMMA) { + list.add(current.getValue().toString()); + } + current = (LexicalUnitImpl) current + .getNextLexicalUnit(); + } + listVariable = null; + break; + } + } + + } + } + + public String getListVariable() { + return listVariable; + } } diff --git a/theme-compiler/src/com/vaadin/sass/visitor/BlockVisitor.java b/theme-compiler/src/com/vaadin/sass/visitor/BlockVisitor.java index 6d2489e494..3cbf7e1f98 100644 --- a/theme-compiler/src/com/vaadin/sass/visitor/BlockVisitor.java +++ b/theme-compiler/src/com/vaadin/sass/visitor/BlockVisitor.java @@ -16,14 +16,10 @@ package com.vaadin.sass.visitor; +import java.util.ArrayList; import java.util.HashSet; import java.util.Set; -import org.w3c.css.sac.Selector; -import org.w3c.css.sac.SelectorList; - -import com.vaadin.sass.parser.SelectorListImpl; -import com.vaadin.sass.selector.CompositeSelector; import com.vaadin.sass.tree.BlockNode; import com.vaadin.sass.tree.Node; @@ -48,6 +44,9 @@ public class BlockVisitor implements Visitor { toBeDeleted.add(child); parent.appendChild(child, after); after = child; + } else if (child instanceof BlockNode + && child.getChildren().size() == 0) { + toBeDeleted.add(child); } } for (Node child : toBeDeleted) { @@ -57,16 +56,16 @@ public class BlockVisitor implements Visitor { private void combineParentSelectorListToChild(Node parent, Node child) { if (parent instanceof BlockNode && child instanceof BlockNode) { - SelectorListImpl newList = new SelectorListImpl(); - SelectorList parentSelectors = ((BlockNode) parent) + ArrayList<String> newList = new ArrayList<String>(); + ArrayList<String> parentSelectors = ((BlockNode) parent) + .getSelectorList(); + ArrayList<String> childSelectors = ((BlockNode) child) .getSelectorList(); - SelectorList childSelectors = ((BlockNode) child).getSelectorList(); - for (int i = 0; i < parentSelectors.getLength(); i++) { - Selector parentSelector = parentSelectors.item(i); - for (int j = 0; j < childSelectors.getLength(); j++) { - Selector childSelector = childSelectors.item(j); - newList.addSelector(new CompositeSelector(parentSelector, - childSelector)); + for (int i = 0; i < parentSelectors.size(); i++) { + String parentSelector = parentSelectors.get(i); + for (int j = 0; j < childSelectors.size(); j++) { + String childSelector = childSelectors.get(j); + newList.add(parentSelector + " " + childSelector); } } diff --git a/theme-compiler/src/com/vaadin/sass/visitor/EachVisitor.java b/theme-compiler/src/com/vaadin/sass/visitor/EachVisitor.java index 0e4fb46a23..cc7e4e5930 100644 --- a/theme-compiler/src/com/vaadin/sass/visitor/EachVisitor.java +++ b/theme-compiler/src/com/vaadin/sass/visitor/EachVisitor.java @@ -36,6 +36,7 @@ public class EachVisitor implements Visitor { private void replaceEachDefNode(EachDefNode defNode) { for (final Node child : defNode.getChildren()) { if (child instanceof BlockNode) { + Node lastNode = defNode; for (final String variable : defNode.getVariables()) { String output = child.toString(); @@ -44,7 +45,8 @@ public class EachVisitor implements Visitor { + "}"), variable); SimpleNode simple = new SimpleNode(output); - rootNode.appendChild(simple, defNode); + rootNode.appendChild(simple, lastNode); + lastNode = simple; } } } diff --git a/theme-compiler/src/com/vaadin/sass/visitor/ExtendVisitor.java b/theme-compiler/src/com/vaadin/sass/visitor/ExtendVisitor.java index 605c7930c3..23519b6e69 100644 --- a/theme-compiler/src/com/vaadin/sass/visitor/ExtendVisitor.java +++ b/theme-compiler/src/com/vaadin/sass/visitor/ExtendVisitor.java @@ -22,16 +22,12 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -import org.w3c.css.sac.SelectorList; - -import com.vaadin.sass.parser.SelectorListImpl; -import com.vaadin.sass.selector.SelectorUtil; import com.vaadin.sass.tree.BlockNode; import com.vaadin.sass.tree.ExtendNode; import com.vaadin.sass.tree.Node; public class ExtendVisitor implements Visitor { - private Map<String, List<SelectorList>> extendsMap = new HashMap<String, List<SelectorList>>(); + private Map<String, List<ArrayList<String>>> extendsMap = new HashMap<String, List<ArrayList<String>>>(); @Override public void traverse(Node node) throws Exception { @@ -39,31 +35,29 @@ public class ExtendVisitor implements Visitor { modifyTree(node); } + @SuppressWarnings("unchecked") private void modifyTree(Node node) throws Exception { for (Node child : node.getChildren()) { if (child instanceof BlockNode) { BlockNode blockNode = (BlockNode) child; - String selectorString = SelectorUtil.toString(blockNode - .getSelectorList()); + String selectorString = blockNode.getSelectors(); if (extendsMap.get(selectorString) != null) { - for (SelectorList sList : extendsMap.get(selectorString)) { - SelectorList newList = SelectorUtil - .createNewSelectorListFromAnOldOneWithSomPartReplaced( - blockNode.getSelectorList(), - selectorString, sList); - addAdditionalSelectorListToBlockNode(blockNode, newList); + for (ArrayList<String> sList : extendsMap + .get(selectorString)) { + ArrayList<String> clone = (ArrayList<String>) sList + .clone(); + addAdditionalSelectorListToBlockNode(blockNode, clone, + null); } } else { - for (Entry<String, List<SelectorList>> entry : extendsMap + for (Entry<String, List<ArrayList<String>>> entry : extendsMap .entrySet()) { if (selectorString.contains(entry.getKey())) { - for (SelectorList sList : entry.getValue()) { - SelectorList newList = SelectorUtil - .createNewSelectorListFromAnOldOneWithSomPartReplaced( - blockNode.getSelectorList(), - entry.getKey(), sList); + for (ArrayList<String> sList : entry.getValue()) { + ArrayList<String> clone = (ArrayList<String>) sList + .clone(); addAdditionalSelectorListToBlockNode(blockNode, - newList); + clone, entry.getKey()); } } } @@ -81,11 +75,11 @@ public class ExtendVisitor implements Visitor { for (Node child : new ArrayList<Node>(node.getChildren())) { if (child instanceof ExtendNode) { ExtendNode extendNode = (ExtendNode) child; - String extendedString = SelectorUtil.toString(extendNode - .getList()); + + String extendedString = extendNode.getListAsString(); if (extendsMap.get(extendedString) == null) { extendsMap.put(extendedString, - new ArrayList<SelectorList>()); + new ArrayList<ArrayList<String>>()); } extendsMap.get(extendedString).add( blockNode.getSelectorList()); @@ -103,11 +97,21 @@ public class ExtendVisitor implements Visitor { } private void addAdditionalSelectorListToBlockNode(BlockNode blockNode, - SelectorList list) { + ArrayList<String> list, String selectorString) { if (list != null) { - for (int i = 0; i < list.getLength(); i++) { - ((SelectorListImpl) blockNode.getSelectorList()) - .addSelector(list.item(i)); + for (int i = 0; i < list.size(); i++) { + if (selectorString == null) { + blockNode.getSelectorList().add(list.get(i)); + } else { + ArrayList<String> newTags = new ArrayList<String>(); + for (final String existing : blockNode.getSelectorList()) { + if (existing.contains(selectorString)) { + newTags.add(existing.replace(selectorString, + list.get(i))); + } + } + blockNode.getSelectorList().addAll(newTags); + } } } } diff --git a/theme-compiler/src/com/vaadin/sass/visitor/ListModifyVisitor.java b/theme-compiler/src/com/vaadin/sass/visitor/ListModifyVisitor.java new file mode 100644 index 0000000000..3edb599a07 --- /dev/null +++ b/theme-compiler/src/com/vaadin/sass/visitor/ListModifyVisitor.java @@ -0,0 +1,27 @@ +package com.vaadin.sass.visitor; + +import java.util.ArrayList; + +import com.vaadin.sass.tree.ListModifyNode; +import com.vaadin.sass.tree.Node; + +public class ListModifyVisitor implements Visitor { + + @Override + public void traverse(Node node) throws Exception { + for (final Node child : new ArrayList<Node>(node.getChildren())) { + removeNodes(child, node); + } + } + + private void removeNodes(Node child, Node parent) { + for (final Node c : new ArrayList<Node>(child.getChildren())) { + removeNodes(c, child); + } + + if (child instanceof ListModifyNode) { + parent.removeChild(child); + } + + } +} diff --git a/theme-compiler/src/com/vaadin/sass/visitor/MixinVisitor.java b/theme-compiler/src/com/vaadin/sass/visitor/MixinVisitor.java index 9b440fae2a..bf1fb65ae3 100644 --- a/theme-compiler/src/com/vaadin/sass/visitor/MixinVisitor.java +++ b/theme-compiler/src/com/vaadin/sass/visitor/MixinVisitor.java @@ -20,8 +20,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Map; -import org.w3c.css.sac.LexicalUnit; - +import com.vaadin.sass.parser.LexicalUnitImpl; import com.vaadin.sass.tree.IVariableNode; import com.vaadin.sass.tree.MixinDefNode; import com.vaadin.sass.tree.MixinNode; @@ -76,19 +75,29 @@ public class MixinVisitor implements Visitor { pre = child; } } else { + + MixinDefNode defClone = (MixinDefNode) DeepCopy.copy(mixinDef); + int i = 0; - for (final LexicalUnit unit : mixinNode.getArglist()) { - mixinDef.getArglist().get(i) - .setExpr((LexicalUnit) DeepCopy.copy(unit)); + for (final LexicalUnitImpl unit : mixinNode.getArglist()) { + defClone.getArglist().get(i) + .setExpr((LexicalUnitImpl) DeepCopy.copy(unit)); i++; } - for (int j = mixinDef.getChildren().size() - 1; j >= 0; j--) { - Node child = (Node) DeepCopy - .copy(mixinDef.getChildren().get(j)); - replaceChildVariables(mixinDef, child); - current.appendChild(child, mixinNode); + Node previous = mixinNode; + for (final Node child : defClone.getChildren()) { + + Node clone = (Node) DeepCopy.copy(child); + + replaceChildVariables(defClone, clone); + + current.appendChild(clone, previous); + + previous = clone; + } + } current.removeChild(mixinNode); } diff --git a/theme-compiler/src/com/vaadin/sass/visitor/ParentSelectorVisitor.java b/theme-compiler/src/com/vaadin/sass/visitor/ParentSelectorVisitor.java index f24d7ae09d..f515d63e96 100644 --- a/theme-compiler/src/com/vaadin/sass/visitor/ParentSelectorVisitor.java +++ b/theme-compiler/src/com/vaadin/sass/visitor/ParentSelectorVisitor.java @@ -18,9 +18,6 @@ package com.vaadin.sass.visitor; import java.util.ArrayList; -import org.w3c.css.sac.SelectorList; - -import com.vaadin.sass.selector.SelectorUtil; import com.vaadin.sass.tree.BlockNode; import com.vaadin.sass.tree.Node; @@ -41,16 +38,21 @@ public class ParentSelectorVisitor implements Visitor { if (child instanceof BlockNode) { BlockNode blockChild = (BlockNode) child; traverse(block, blockChild); - if (SelectorUtil - .hasParentSelector(blockChild.getSelectorList())) { - parent.appendChild(child, pre); - pre = child; - block.removeChild(child); - SelectorList newSelectorList = SelectorUtil - .createNewSelectorListFromAnOldOneWithSomPartReplaced( - blockChild.getSelectorList(), "&", - block.getSelectorList()); - blockChild.setSelectorList(newSelectorList); + for (final String s : blockChild.getSelectorList()) { + + if (s.contains("&")) { + parent.appendChild(child, pre); + pre = child; + block.removeChild(child); + + ArrayList<String> newList = new ArrayList<String>(block + .getSelectorList().size()); + for (final String parentSelector : block + .getSelectorList()) { + newList.add(s.replace("&", parentSelector)); + } + blockChild.setSelectorList(newList); + } } } } diff --git a/theme-compiler/src/com/vaadin/sass/visitor/VariableVisitor.java b/theme-compiler/src/com/vaadin/sass/visitor/VariableVisitor.java index 4508237cb9..50143180d2 100644 --- a/theme-compiler/src/com/vaadin/sass/visitor/VariableVisitor.java +++ b/theme-compiler/src/com/vaadin/sass/visitor/VariableVisitor.java @@ -19,9 +19,12 @@ package com.vaadin.sass.visitor; import java.util.ArrayList; import java.util.HashMap; +import com.vaadin.sass.parser.ParseException; import com.vaadin.sass.tree.IVariableNode; +import com.vaadin.sass.tree.ListModifyNode; import com.vaadin.sass.tree.Node; import com.vaadin.sass.tree.VariableNode; +import com.vaadin.sass.util.DeepCopy; public class VariableVisitor implements Visitor { @@ -61,6 +64,27 @@ public class VariableVisitor implements Visitor { continue; } this.variables.put(variableNode.getName(), variableNode); + } else if (node instanceof ListModifyNode) { + + ((IVariableNode) node) + .replaceVariables(new ArrayList<VariableNode>( + this.variables.values())); + + ListModifyNode modify = (ListModifyNode) node; + + if (modify.isModifyingVariable()) { + String variable = modify.getVariable(); + + if (!this.variables.containsKey(variable)) { + throw new ParseException("No variable with name $" + + variable + " found."); + } + + VariableNode modifiedList = modify + .getModifiedList(this.variables.get(variable)); + this.variables.put(variable, modifiedList); + } + } else if (node instanceof IVariableNode) { ((IVariableNode) node) .replaceVariables(new ArrayList<VariableNode>( diff --git a/theme-compiler/tests/resources/css/control-directives.css b/theme-compiler/tests/resources/css/control-directives.css index a92cf4b501..83acab53c0 100644 --- a/theme-compiler/tests/resources/css/control-directives.css +++ b/theme-compiler/tests/resources/css/control-directives.css @@ -1,26 +1,26 @@ -.salamander-icon #animal, .menu { - background-image: url(/images/salamander.png); +.puma-icon #animal, .menu { + background-image: url('/images/puma.png'); font-size: 10px; font-color: blue; border: 1px solid; } -.egret-icon #animal, .menu { - background-image: url(/images/egret.png); +.sea-slug-icon #animal, .menu { + background-image: url('/images/sea-slug.png'); font-size: 10px; font-color: blue; border: 1px solid; } -.sea-slug-icon #animal, .menu { - background-image: url(/images/sea-slug.png); +.egret-icon #animal, .menu { + background-image: url('/images/egret.png'); font-size: 10px; font-color: blue; border: 1px solid; } -.puma-icon #animal, .menu { - background-image: url(/images/puma.png); +.salamander-icon #animal, .menu { + background-image: url('/images/salamander.png'); font-size: 10px; font-color: blue; border: 1px solid; @@ -36,4 +36,16 @@ .falseIfTrueElse { border: 1px solid; +} + +.cube-icon { + background-image: url('/images/cube.png'); +} + +.triangle-icon { + background-image: url('/images/triangle.png'); +} + +.circle-icon { + background-image: url('/images/circle.png'); }
\ No newline at end of file diff --git a/theme-compiler/tests/resources/css/functions.css b/theme-compiler/tests/resources/css/functions.css index 0fef5d899f..3f6c2bd810 100644 --- a/theme-compiler/tests/resources/css/functions.css +++ b/theme-compiler/tests/resources/css/functions.css @@ -11,4 +11,6 @@ color: #200; color: #f00000; color: #f00; + color: hsl(33, 7%, 89%); + color: hsl(33, 7%, 95%); }
\ No newline at end of file diff --git a/theme-compiler/tests/resources/css/microsoft-extensions.css b/theme-compiler/tests/resources/css/microsoft-extensions.css index 69670969de..18bc34ca6c 100644 --- a/theme-compiler/tests/resources/css/microsoft-extensions.css +++ b/theme-compiler/tests/resources/css/microsoft-extensions.css @@ -3,4 +3,4 @@ filter: progid:DXImageTransform.Microsoft.Blur(pixelRadius=5 ) alpha(opacity = 20); margin-top: 2px; margin-left: 2px; -} +}
\ No newline at end of file diff --git a/theme-compiler/tests/resources/css/mixins.css b/theme-compiler/tests/resources/css/mixins.css index 5c727c193b..aefa20ac01 100644 --- a/theme-compiler/tests/resources/css/mixins.css +++ b/theme-compiler/tests/resources/css/mixins.css @@ -20,6 +20,10 @@ border-radius: 10px; } +.banner { + border: 1px solid black; +} + .header { width: 100%; } diff --git a/theme-compiler/tests/resources/css/parent-selector.css b/theme-compiler/tests/resources/css/parent-selector.css index 9c7140e313..32f8484457 100644 --- a/theme-compiler/tests/resources/css/parent-selector.css +++ b/theme-compiler/tests/resources/css/parent-selector.css @@ -21,4 +21,8 @@ body.firefox a { #main a:hover { color: red; +} + +.mixin-parent:hover { + color: blue; }
\ No newline at end of file diff --git a/theme-compiler/tests/resources/css/remove-directive.css b/theme-compiler/tests/resources/css/remove-directive.css new file mode 100644 index 0000000000..b7fd2c7e6c --- /dev/null +++ b/theme-compiler/tests/resources/css/remove-directive.css @@ -0,0 +1,31 @@ +.animals .platypus-icon { + background-image: url('/images/platypus.png'); +} + +.animals .rhinoceros-icon { + background-image: url('/images/rhinoceros.png'); +} + +.animals .llama-icon { + background-image: url('/images/llama.png'); +} + +.animals .duck-icon { + background-image: url('/images/duck.png'); +} + +.animals .duck-icon { + background-image: url('/images/duck.png'); +} + +.exotic-animals .platypus-icon { + background-image: url('/images/platypus.png'); +} + +.exotic-animals .rhinoceros-icon { + background-image: url('/images/rhinoceros.png'); +} + +.exotic-animals .llama-icon { + background-image: url('/images/llama.png'); +}
\ No newline at end of file diff --git a/theme-compiler/tests/resources/scss/control-directives.scss b/theme-compiler/tests/resources/scss/control-directives.scss index f9773bb108..6cf05518bf 100644 --- a/theme-compiler/tests/resources/scss/control-directives.scss +++ b/theme-compiler/tests/resources/scss/control-directives.scss @@ -1,13 +1,17 @@ $borderWeight : solid; -@each $animal in puma, sea-slug, egret, salamander { - .#{$animal}-icon #animal, .menu { - background-image: url('/images/#{$animal}.png'); - @include logo(10px); - @if 1+1 == 2 { border: 1px solid; } - } +@mixin animals($list : puma, sea-slug, egret, salamander){ + @each $animal in $list { + .#{$animal}-icon #animal, .menu { + background-image: url('/images/#{$animal}.png'); + @include logo(10px); + @if 1+1 == 2 { border: 1px solid; } + } + } } +@include animals; + .trueIf { @if solid != dotted { border: 1px $borderWeight; } @else { border: 2px solid; } @@ -24,6 +28,12 @@ $borderWeight : solid; @else { border: 3px solid; } } +@each $thing in cube, triangle, circle{ + .#{$thing}-icon { + background-image: url('/images/#{$thing}.png'); + } +} + @mixin logo($size){ font: { size: $size; diff --git a/theme-compiler/tests/resources/scss/functions.scss b/theme-compiler/tests/resources/scss/functions.scss index abf6f6187d..b9860311ea 100644 --- a/theme-compiler/tests/resources/scss/functions.scss +++ b/theme-compiler/tests/resources/scss/functions.scss @@ -1,3 +1,5 @@ +$base-color : hsl(33, 7%, 89%); +$app-bg-color : lighten($base-color, 6%); .main { margin: abs(-2px); border: ceil(10.4px); @@ -11,6 +13,8 @@ color: darken(#800, 20%); color: lighten(#880000, 20%); color: lighten(#800, 20%); + color : $base-color; + color : $app-bg-color; } diff --git a/theme-compiler/tests/resources/scss/mixins.scss b/theme-compiler/tests/resources/scss/mixins.scss index 0fbfed6f93..1f9cdf03de 100644 --- a/theme-compiler/tests/resources/scss/mixins.scss +++ b/theme-compiler/tests/resources/scss/mixins.scss @@ -54,4 +54,12 @@ $mixinVar : 1px; } } +.banner { + @include fontType(1px solid black); +} + +@mixin fontType($border){ + border : $border; +} + @include layout;
\ No newline at end of file diff --git a/theme-compiler/tests/resources/scss/parent-selector.scss b/theme-compiler/tests/resources/scss/parent-selector.scss index 3d0f694801..60e7608c07 100644 --- a/theme-compiler/tests/resources/scss/parent-selector.scss +++ b/theme-compiler/tests/resources/scss/parent-selector.scss @@ -11,4 +11,14 @@ a { font-weight: bold; &:hover { color: red; } } +} + +@mixin parent { + &:hover { + color: blue; + } +} + +.mixin-parent { + @include parent; }
\ No newline at end of file diff --git a/theme-compiler/tests/resources/scss/remove-directive.scss b/theme-compiler/tests/resources/scss/remove-directive.scss new file mode 100644 index 0000000000..cbfca9dcda --- /dev/null +++ b/theme-compiler/tests/resources/scss/remove-directive.scss @@ -0,0 +1,16 @@ +$animals : platypus, rhinoceros, llama, duck, duck; +$remove : duck; + +@each $animal in $animals { + .animals .#{$animal}-icon { + background-image: url('/images/#{$animal}.png'); + } +} + +remove($animals, $remove, space); + +@each $animal in $animals{ + .exotic-animals .#{$animal}-icon { + background-image: url('/images/#{$animal}.png'); + } +} diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/ControlDirectives.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/ControlDirectives.java index f6b32e32a2..7a0f1f1a25 100644 --- a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/ControlDirectives.java +++ b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/ControlDirectives.java @@ -29,7 +29,12 @@ import com.vaadin.sass.ScssStylesheet; import com.vaadin.sass.handler.SCSSDocumentHandler; import com.vaadin.sass.handler.SCSSDocumentHandlerImpl; import com.vaadin.sass.parser.Parser; +import com.vaadin.sass.tree.BlockNode; +import com.vaadin.sass.tree.MixinDefNode; +import com.vaadin.sass.tree.MixinNode; import com.vaadin.sass.tree.Node; +import com.vaadin.sass.tree.controldirective.EachDefNode; +import com.vaadin.sass.tree.controldirective.IfElseDefNode; public class ControlDirectives extends AbstractTestBase { @@ -46,24 +51,21 @@ public class ControlDirectives extends AbstractTestBase { Assert.assertNotNull(root); ArrayList<Node> children = root.getChildren(); - Assert.assertEquals(6, root.getChildren().size()); - // - // Assert.assertTrue(children.get(1) instanceof EachDefNode); - // Assert.assertTrue(children.get(2) instanceof BlockNode); - // Assert.assertTrue(children.get(3) instanceof BlockNode); - // Assert.assertTrue(children.get(4) instanceof BlockNode); - // Assert.assertTrue(children.get(5) instanceof MixinDefNode); - // - // Assert.assertTrue(children.get(2).getChildren().get(0) instanceof - // IfElseDefNode); - // Assert.assertTrue(children.get(3).getChildren().get(0) instanceof - // IfElseDefNode); - // Assert.assertTrue(children.get(4).getChildren().get(0) instanceof - // IfElseDefNode); - // Assert.assertTrue(!(children.get(5).getChildren().get(0) instanceof - // IfElseDefNode)); - // - // Assert.assertEquals(1, children.get(1).getChildren().size()); + Assert.assertEquals(8, root.getChildren().size()); + + Assert.assertTrue(children.get(1) instanceof MixinDefNode); + Assert.assertTrue(children.get(2) instanceof MixinNode); + Assert.assertTrue(children.get(3) instanceof BlockNode); + Assert.assertTrue(children.get(4) instanceof BlockNode); + Assert.assertTrue(children.get(5) instanceof BlockNode); + Assert.assertTrue(children.get(7) instanceof MixinDefNode); + + Assert.assertTrue(children.get(1).getChildren().get(0) instanceof EachDefNode); + Assert.assertTrue(children.get(3).getChildren().get(0) instanceof IfElseDefNode); + Assert.assertTrue(children.get(4).getChildren().get(0) instanceof IfElseDefNode); + Assert.assertTrue(!(children.get(7).getChildren().get(0) instanceof IfElseDefNode)); + + Assert.assertEquals(1, children.get(1).getChildren().size()); } diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Functions.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Functions.java index d2e890c052..cc6d67795c 100644 --- a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Functions.java +++ b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Functions.java @@ -18,8 +18,7 @@ package com.vaadin.sass.testcases.scss; import java.io.IOException; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Test; import org.w3c.css.sac.CSSException; @@ -42,9 +41,9 @@ public class Functions extends AbstractTestBase { parser.setDocumentHandler(handler); parser.parseStyleSheet(getClass().getResource(scss).getPath()); ScssStylesheet root = handler.getStyleSheet(); - Assert.assertEquals(1, root.getChildren().size()); - BlockNode blockNode = (BlockNode) root.getChildren().get(0); - Assert.assertEquals(12, blockNode.getChildren().size()); + Assert.assertEquals(3, root.getChildren().size()); + BlockNode blockNode = (BlockNode) root.getChildren().get(2); + Assert.assertEquals(14, blockNode.getChildren().size()); } @Test diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Mixins.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Mixins.java index 4efa88275f..ac3ad20e15 100644 --- a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Mixins.java +++ b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Mixins.java @@ -29,6 +29,7 @@ import com.vaadin.sass.AbstractTestBase; import com.vaadin.sass.ScssStylesheet; import com.vaadin.sass.handler.SCSSDocumentHandler; import com.vaadin.sass.handler.SCSSDocumentHandlerImpl; +import com.vaadin.sass.parser.LexicalUnitImpl; import com.vaadin.sass.parser.Parser; import com.vaadin.sass.tree.BlockNode; import com.vaadin.sass.tree.MixinDefNode; @@ -71,48 +72,37 @@ public class Mixins extends AbstractTestBase { Assert.assertEquals(3, mainBlockNode.getChildren().size()); MixinNode mixinNode0MainBlock = (MixinNode) mainBlockNode.getChildren() .get(0); - // Assert.assertEquals("rounded-borders", - // mixinNode0MainBlock.getName()); - // Assert.assertEquals(1f, mixinNode0MainBlock.getArglist().get(0) - // .getFloatValue()); - // Assert.assertEquals(LexicalUnit.SAC_PIXEL, mixinNode0MainBlock - // .getArglist().get(0).getLexicalUnitType()); - // MixinNode mixinNOde1MainBlock = (MixinNode) - // mainBlockNode.getChildren() - // .get(1); - // Assert.assertEquals("font-settings", mixinNOde1MainBlock.getName()); - // Assert.assertTrue(mixinNOde1MainBlock.getArglist().isEmpty()); - // - // MixinNode mixinNOde2MainBlock = (MixinNode) - // mainBlockNode.getChildren() - // .get(2); - // Assert.assertEquals("main-details", mixinNOde2MainBlock.getName()); - // Assert.assertTrue(mixinNOde1MainBlock.getArglist().isEmpty()); - // - // MixinNode mixinNode1MainBlock = (MixinNode) - // mainBlockNode.getChildren() - // .get(1); - // Assert.assertTrue(mixinNode1MainBlock.getArglist().isEmpty()); - // - // BlockNode footerBlockNode = (BlockNode) root.getChildren().get(3); - // MixinNode mixinNodeFooterBlock = (MixinNode) footerBlockNode - // .getChildren().get(0); - // Assert.assertEquals(2f, mixinNodeFooterBlock.getArglist().get(0) - // .getFloatValue()); - // Assert.assertEquals("px", mixinNodeFooterBlock.getArglist().get(0) - // .getDimensionUnitText()); - // - // Assert.assertEquals(10f, mixinNodeFooterBlock.getArglist().get(1) - // .getFloatValue()); - // Assert.assertEquals("px", mixinNodeFooterBlock.getArglist().get(1) - // .getDimensionUnitText()); - // - // Assert.assertTrue(root.getChildren().get(4) instanceof MixinDefNode); - // Assert.assertTrue(root.getChildren().get(4).getChildren().get(3) - // instanceof MediaNode); - // Assert.assertTrue(root.getChildren().get(4).getChildren().get(4) - // instanceof MixinNode); + Assert.assertEquals("rounded-borders", mixinNode0MainBlock.getName()); + Assert.assertEquals("mixinVar", mixinNode0MainBlock.getArglist().get(0) + .getStringValue()); + Assert.assertEquals(LexicalUnitImpl.SCSS_VARIABLE, mixinNode0MainBlock + .getArglist().get(0).getLexicalUnitType()); + MixinNode mixinNOde1MainBlock = (MixinNode) mainBlockNode.getChildren() + .get(1); + Assert.assertEquals("font-settings", mixinNOde1MainBlock.getName()); + Assert.assertTrue(mixinNOde1MainBlock.getArglist().isEmpty()); + MixinNode mixinNOde2MainBlock = (MixinNode) mainBlockNode.getChildren() + .get(2); + Assert.assertEquals("main-details", mixinNOde2MainBlock.getName()); + Assert.assertTrue(mixinNOde1MainBlock.getArglist().isEmpty()); + + MixinNode mixinNode1MainBlock = (MixinNode) mainBlockNode.getChildren() + .get(1); + Assert.assertTrue(mixinNode1MainBlock.getArglist().isEmpty()); + + BlockNode footerBlockNode = (BlockNode) root.getChildren().get(3); + MixinNode mixinNodeFooterBlock = (MixinNode) footerBlockNode + .getChildren().get(0); + Assert.assertEquals("mixinVar", mixinNodeFooterBlock.getArglist() + .get(0).getStringValue()); + + Assert.assertTrue(root.getChildren().get(0) instanceof MixinDefNode); + Assert.assertTrue(root.getChildren().get(1) instanceof MixinDefNode); + Assert.assertTrue(root.getChildren().get(5) instanceof MixinDefNode); + Assert.assertTrue(root.getChildren().get(6) instanceof MixinDefNode); + Assert.assertTrue(root.getChildren().get(8) instanceof MixinDefNode); + Assert.assertTrue(root.getChildren().get(9) instanceof MixinNode); } @Test diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/ParentSelector.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/ParentSelector.java index 7ac2450bfc..7f3b3d6551 100644 --- a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/ParentSelector.java +++ b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/ParentSelector.java @@ -28,7 +28,6 @@ import com.vaadin.sass.ScssStylesheet; import com.vaadin.sass.handler.SCSSDocumentHandler; import com.vaadin.sass.handler.SCSSDocumentHandlerImpl; import com.vaadin.sass.parser.Parser; -import com.vaadin.sass.selector.SelectorUtil; import com.vaadin.sass.tree.BlockNode; public class ParentSelector extends AbstractTestBase { @@ -45,11 +44,10 @@ public class ParentSelector extends AbstractTestBase { BlockNode blockNode = (BlockNode) root.getChildren().get(0); Assert.assertEquals(4, blockNode.getChildren().size()); BlockNode nestedBlock1 = (BlockNode) blockNode.getChildren().get(2); - Assert.assertEquals("&:hover", - SelectorUtil.toString(nestedBlock1.getSelectorList())); + Assert.assertEquals("&:hover", nestedBlock1.getSelectorList().get(0)); BlockNode nestedBlock2 = (BlockNode) blockNode.getChildren().get(3); - Assert.assertEquals("body.firefox &", - SelectorUtil.toString(nestedBlock2.getSelectorList())); + Assert.assertEquals("body.firefox &", nestedBlock2.getSelectorList() + .get(0)); } @Test diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/RemoveDirective.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/RemoveDirective.java new file mode 100644 index 0000000000..e9e87e7b56 --- /dev/null +++ b/theme-compiler/tests/src/com/vaadin/sass/testcases/scss/RemoveDirective.java @@ -0,0 +1,25 @@ +package com.vaadin.sass.testcases.scss; + +import java.io.IOException; + +import org.junit.Test; +import org.w3c.css.sac.CSSException; + +import com.vaadin.sass.AbstractTestBase; + +public class RemoveDirective extends AbstractTestBase { + + String scss = "/scss/remove-directive.scss"; + String css = "/css/remove-directive.css"; + + @Test + public void testParser() throws CSSException, IOException { + + } + + @Test + public void testCompiler() throws Exception { + testCompiler(scss, css); + } + +} diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/visitor/MixinVisitorTest.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/visitor/MixinVisitorTest.java index 46d6efbeac..56a35807d1 100644 --- a/theme-compiler/tests/src/com/vaadin/sass/testcases/visitor/MixinVisitorTest.java +++ b/theme-compiler/tests/src/com/vaadin/sass/testcases/visitor/MixinVisitorTest.java @@ -20,10 +20,9 @@ import java.util.ArrayList; import org.junit.Assert; import org.junit.Test; -import org.w3c.css.sac.LexicalUnit; -import com.steadystate.css.parser.LexicalUnitImpl; import com.vaadin.sass.ScssStylesheet; +import com.vaadin.sass.parser.LexicalUnitImpl; import com.vaadin.sass.parser.SCSSLexicalUnit; import com.vaadin.sass.tree.BlockNode; import com.vaadin.sass.tree.MixinDefNode; @@ -72,8 +71,10 @@ public class MixinVisitorTest { root.appendChild(mixinDefWithNonDefaultArg); BlockNode blockWithMixin = new BlockNode(null); - ArrayList<LexicalUnit> includeArgs = new ArrayList<LexicalUnit>(); - LexicalUnit includeArg = LexicalUnitImpl.createPixel(null, 1f); + ArrayList<LexicalUnitImpl> includeArgs = new ArrayList<LexicalUnitImpl>(); + LexicalUnitImpl includeArg = LexicalUnitImpl.createPixel(1f); + includeArg.setLexicalUnitType(LexicalUnitImpl.SAC_PIXEL); + includeArg.setFloatValue(1); includeArgs.add(includeArg); MixinNode mixin = new MixinNode("non-default-arg", includeArgs); blockWithMixin.appendChild(mixin); @@ -96,8 +97,8 @@ public class MixinVisitorTest { public void testTraverseMixinWithDefaultArgs() { ScssStylesheet root = new ScssStylesheet(); ArrayList<VariableNode> args = new ArrayList<VariableNode>(); - args.add(new VariableNode("arg", LexicalUnitImpl.createPixel(null, 1f), - false)); + LexicalUnitImpl includeArg = LexicalUnitImpl.createPixel(1f); + args.add(new VariableNode("arg", includeArg, false)); MixinDefNode mixinDefWithNonDefaultArg = new MixinDefNode( "default-arg", args); BlockNode blockNode = new BlockNode(null); @@ -135,16 +136,16 @@ public class MixinVisitorTest { MixinDefNode mixinDefNoArgs = new MixinDefNode("table-base", null); BlockNode thBlockNode = new BlockNode(null); RuleNode textAlignRuleNode = new RuleNode("text-align", - LexicalUnitImpl.createString(null, "center"), false, null); + LexicalUnitImpl.createString("center"), false, null); thBlockNode.appendChild(textAlignRuleNode); RuleNode fontWeightRuleNode = new RuleNode("font-weight", - LexicalUnitImpl.createString(null, "bold"), false, null); + LexicalUnitImpl.createString("bold"), false, null); thBlockNode.appendChild(fontWeightRuleNode); mixinDefNoArgs.appendChild(thBlockNode); BlockNode tdthBlockNode = new BlockNode(null); RuleNode paddingRuleNode = new RuleNode("padding", - LexicalUnitImpl.createPixel(null, 2f), false, null); + LexicalUnitImpl.createPixel(2f), false, null); tdthBlockNode.appendChild(paddingRuleNode); mixinDefNoArgs.appendChild(tdthBlockNode); root.appendChild(mixinDefNoArgs); @@ -205,7 +206,7 @@ public class MixinVisitorTest { MixinDefNode mixinDef = new MixinDefNode("left", argNameList); RuleNode floatRuleNode = new RuleNode("float", - LexicalUnitImpl.createString(null, "left"), false, null); + LexicalUnitImpl.createString("left"), false, null); mixinDef.appendChild(floatRuleNode); RuleNode marginLeftRuleNode = new RuleNode("margin-left", com.vaadin.sass.parser.LexicalUnitImpl.createVariable(0, 0, @@ -214,8 +215,8 @@ public class MixinVisitorTest { root.appendChild(mixinDef); BlockNode dataBlock = new BlockNode(null); - ArrayList<LexicalUnit> argValueList = new ArrayList<LexicalUnit>(); - LexicalUnit arg = LexicalUnitImpl.createPixel(null, 10f); + ArrayList<LexicalUnitImpl> argValueList = new ArrayList<LexicalUnitImpl>(); + LexicalUnitImpl arg = LexicalUnitImpl.createPixel(10f); argValueList.add(arg); MixinNode mixinNode = new MixinNode("left", argValueList); dataBlock.appendChild(mixinNode); diff --git a/theme-compiler/tests/src/com/vaadin/sass/testcases/visitor/NestedPropertiesVisitorTest.java b/theme-compiler/tests/src/com/vaadin/sass/testcases/visitor/NestedPropertiesVisitorTest.java index 3885869b72..eafdb4908f 100644 --- a/theme-compiler/tests/src/com/vaadin/sass/testcases/visitor/NestedPropertiesVisitorTest.java +++ b/theme-compiler/tests/src/com/vaadin/sass/testcases/visitor/NestedPropertiesVisitorTest.java @@ -22,7 +22,6 @@ import org.junit.Test; import com.vaadin.sass.ScssStylesheet; import com.vaadin.sass.tree.NestPropertiesNode; import com.vaadin.sass.tree.RuleNode; -import com.vaadin.sass.tree.VariableNode; import com.vaadin.sass.visitor.NestPropertiesVisitor; public class NestedPropertiesVisitorTest { @@ -37,15 +36,6 @@ public class NestedPropertiesVisitorTest { } @Test - public void testNoNestPropertiesNodeNoChange() { - ScssStylesheet root = new ScssStylesheet(); - root.appendChild(new VariableNode("", "")); - Assert.assertEquals(1, root.getChildren().size()); - visitor.traverse(root); - Assert.assertEquals(1, root.getChildren().size()); - } - - @Test public void testNestedPropertiesCanBeUnnested() { ScssStylesheet root = new ScssStylesheet(); NestPropertiesNode nested = new NestPropertiesNode("nested"); |