diff --git a/build.third_step6.gradle b/build.third_step6.gradle index 6fc167808..cad947e7b 100644 --- a/build.third_step6.gradle +++ b/build.third_step6.gradle @@ -32,6 +32,7 @@ sourceSets{ "${srcDir}/fine-cglib/resources", "${srcDir}/fine-jedis/src", "${srcDir}/fine-jedis/resources", + "${srcDir}/fine-cssparser/src", ] } @@ -53,6 +54,7 @@ def branchName=buildDir.substring(buildDir.lastIndexOf ('/')+1) dependencies{ compile fileTree(dir:"${srcDir}/fine-jackson/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/fine-ehcache/lib",include:'**/*.jar') + compile fileTree(dir:"${srcDir}/fine-cssparser/lib",include:'**/*.jar') compile fileTree(dir:"${srcDir}/build/libs/",include:'**/*.jar') compile fileTree(dir:"../../finereport-lib-base/${branchName}",include:'**/*.jar') compile fileTree(dir:"../../finereport-lib-other/${branchName}",include:'**/*.jar') @@ -85,6 +87,7 @@ task copyFiles(type:Copy,dependsOn:'compileJava'){ with dataContent.call("${srcDir}/fine-cglib/resources") with dataContent.call("${srcDir}/fine-jedis/src") with dataContent.call("${srcDir}/fine-jedis/resources") + with dataContent.call("${srcDir}/fine-cssparser/src") into "${classesDir}" } } diff --git a/fine-cssparser/lib/sac-1.3.jar b/fine-cssparser/lib/sac-1.3.jar new file mode 100644 index 000000000..39b92b1d8 Binary files /dev/null and b/fine-cssparser/lib/sac-1.3.jar differ diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/AbstractCSSRuleImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/AbstractCSSRuleImpl.java new file mode 100644 index 000000000..1123c7677 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/AbstractCSSRuleImpl.java @@ -0,0 +1,99 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import org.w3c.dom.css.CSSRule; +import org.w3c.dom.css.CSSStyleSheet; + +import com.fr.third.steadystate.css.format.CSSFormat; + +/** + * @author koch + * @author rbri + */ +public abstract class AbstractCSSRuleImpl extends CSSOMObjectImpl implements CSSFormatable { + + private static final long serialVersionUID = 7829784704712797815L; + + private CSSStyleSheetImpl parentStyleSheet_; + private CSSRule parentRule_; + + protected CSSStyleSheetImpl getParentStyleSheetImpl() { + return parentStyleSheet_; + } + + public void setParentStyleSheet(final CSSStyleSheetImpl parentStyleSheet) { + parentStyleSheet_ = parentStyleSheet; + } + + public void setParentRule(final CSSRule parentRule) { + parentRule_ = parentRule; + } + + public AbstractCSSRuleImpl(final CSSStyleSheetImpl parentStyleSheet, final CSSRule parentRule) { + super(); + parentStyleSheet_ = parentStyleSheet; + parentRule_ = parentRule; + } + + public AbstractCSSRuleImpl() { + super(); + } + + public CSSStyleSheet getParentStyleSheet() { + return parentStyleSheet_; + } + + public CSSRule getParentRule() { + return parentRule_; + } + + /** + * {@inheritDoc} + */ + public abstract String getCssText(CSSFormat format); + + /** + * Same as {@link #getCssText(CSSFormat)} but using the default format. + * + * @return the formated string + */ + public String getCssText() { + return getCssText(null); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof CSSRule)) { + return false; + } + return super.equals(obj); + // don't use parentRule and parentStyleSheet in equals() + // recursive loop -> stack overflow! + } + + @Override + public int hashCode() { + final int hash = super.hashCode(); + // don't use parentRule and parentStyleSheet in hashCode() + // recursive loop -> stack overflow! + return hash; + } +} \ No newline at end of file diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSCharsetRuleImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSCharsetRuleImpl.java new file mode 100644 index 000000000..de3c371cf --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSCharsetRuleImpl.java @@ -0,0 +1,145 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.io.IOException; +import java.io.StringReader; + +import com.fr.third.steadystate.css.parser.CSSOMParser; +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.InputSource; +import org.w3c.dom.DOMException; +import org.w3c.dom.css.CSSCharsetRule; +import org.w3c.dom.css.CSSRule; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.util.LangUtils; + +/** + * Implementation of {@link CSSCharsetRule}. + * + * @author David Schweinsberg + * @author rbri + */ +public class CSSCharsetRuleImpl extends AbstractCSSRuleImpl implements CSSCharsetRule { + + private static final long serialVersionUID = -2472209213089007127L; + + private String encoding_; + + public CSSCharsetRuleImpl( + final CSSStyleSheetImpl parentStyleSheet, + final CSSRule parentRule, + final String encoding) { + super(parentStyleSheet, parentRule); + encoding_ = encoding; + } + + public CSSCharsetRuleImpl() { + super(); + } + + public short getType() { + return CHARSET_RULE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCssText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder(); + + sb.append("@charset \""); + + final String enc = getEncoding(); + if (null != enc) { + sb.append(enc); + } + sb.append("\";"); + return sb.toString(); + } + + public void setCssText(final String cssText) throws DOMException { + final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheetImpl(); + if (parentStyleSheet != null && parentStyleSheet.isReadOnly()) { + throw new DOMExceptionImpl( + DOMException.NO_MODIFICATION_ALLOWED_ERR, + DOMExceptionImpl.READ_ONLY_STYLE_SHEET); + } + + try { + final InputSource is = new InputSource(new StringReader(cssText)); + final CSSOMParser parser = new CSSOMParser(); + final CSSRule r = parser.parseRule(is); + + // The rule must be a charset rule + if (r.getType() == CSSRule.CHARSET_RULE) { + encoding_ = ((CSSCharsetRuleImpl) r).encoding_; + } + else { + throw new DOMExceptionImpl( + DOMException.INVALID_MODIFICATION_ERR, + DOMExceptionImpl.EXPECTING_CHARSET_RULE); + } + } + catch (final CSSException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + catch (final IOException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + } + + public String getEncoding() { + return encoding_; + } + + public void setEncoding(final String encoding) throws DOMException { + encoding_ = encoding; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof CSSCharsetRule)) { + return false; + } + final CSSCharsetRule ccr = (CSSCharsetRule) obj; + return super.equals(obj) + && LangUtils.equals(getEncoding(), ccr.getEncoding()); + } + + @Override + public int hashCode() { + int hash = super.hashCode(); + hash = LangUtils.hashCode(hash, encoding_); + return hash; + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSFontFaceRuleImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSFontFaceRuleImpl.java new file mode 100644 index 000000000..34bb56f40 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSFontFaceRuleImpl.java @@ -0,0 +1,141 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.io.IOException; +import java.io.StringReader; + +import com.fr.third.steadystate.css.parser.CSSOMParser; +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.InputSource; +import org.w3c.dom.DOMException; +import org.w3c.dom.css.CSSFontFaceRule; +import org.w3c.dom.css.CSSRule; +import org.w3c.dom.css.CSSStyleDeclaration; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.util.LangUtils; + +/** + * Implementation of {@link CSSFontFaceRule}. + * + * @author David Schweinsberg + * @author rbri + */ +public class CSSFontFaceRuleImpl extends AbstractCSSRuleImpl implements CSSFontFaceRule { + + private static final long serialVersionUID = -3604191834588759088L; + + private CSSStyleDeclarationImpl style_; + + public CSSFontFaceRuleImpl(final CSSStyleSheetImpl parentStyleSheet, final CSSRule parentRule) { + super(parentStyleSheet, parentRule); + } + + public CSSFontFaceRuleImpl() { + super(); + } + + public short getType() { + return FONT_FACE_RULE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCssText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder(); + sb.append("@font-face {"); + + final CSSStyleDeclaration style = getStyle(); + if (null != style) { + sb.append(style.getCssText()); + } + sb.append("}"); + return sb.toString(); + } + + public void setCssText(final String cssText) throws DOMException { + final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheetImpl(); + if (parentStyleSheet != null && parentStyleSheet.isReadOnly()) { + throw new DOMExceptionImpl( + DOMException.NO_MODIFICATION_ALLOWED_ERR, + DOMExceptionImpl.READ_ONLY_STYLE_SHEET); + } + + try { + final InputSource is = new InputSource(new StringReader(cssText)); + final CSSOMParser parser = new CSSOMParser(); + final CSSRule r = parser.parseRule(is); + + // The rule must be a font face rule + if (r.getType() == CSSRule.FONT_FACE_RULE) { + style_ = ((CSSFontFaceRuleImpl) r).style_; + } + else { + throw new DOMExceptionImpl( + DOMException.INVALID_MODIFICATION_ERR, + DOMExceptionImpl.EXPECTING_FONT_FACE_RULE); + } + } + catch (final CSSException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + catch (final IOException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + } + + public CSSStyleDeclaration getStyle() { + return style_; + } + + public void setStyle(final CSSStyleDeclarationImpl style) { + style_ = style; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof CSSFontFaceRule)) { + return false; + } + final CSSFontFaceRule cffr = (CSSFontFaceRule) obj; + return super.equals(obj) + && LangUtils.equals(getStyle(), cffr.getStyle()); + } + + @Override + public int hashCode() { + int hash = super.hashCode(); + hash = LangUtils.hashCode(hash, style_); + return hash; + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSImportRuleImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSImportRuleImpl.java new file mode 100644 index 000000000..1a44ae070 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSImportRuleImpl.java @@ -0,0 +1,171 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.io.IOException; +import java.io.StringReader; + +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.InputSource; +import org.w3c.dom.DOMException; +import org.w3c.dom.css.CSSImportRule; +import org.w3c.dom.css.CSSRule; +import org.w3c.dom.css.CSSStyleSheet; +import org.w3c.dom.stylesheets.MediaList; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.parser.CSSOMParser; +import com.fr.third.steadystate.css.util.LangUtils; + +/** + * Implementation of {@link CSSImportRule}. + * + * TODO: Implement getStyleSheet() + * + * @author David Schweinsberg + * @author rbri + */ +public class CSSImportRuleImpl extends AbstractCSSRuleImpl implements CSSImportRule { + + private static final long serialVersionUID = 7807829682009179339L; + + private String href_; + private MediaList media_; + + public void setHref(final String href) { + href_ = href; + } + + public void setMedia(final MediaList media) { + media_ = media; + } + + public CSSImportRuleImpl( + final CSSStyleSheetImpl parentStyleSheet, + final CSSRule parentRule, + final String href, + final MediaList media) { + super(parentStyleSheet, parentRule); + href_ = href; + media_ = media; + } + + public CSSImportRuleImpl() { + super(); + } + + public short getType() { + return IMPORT_RULE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCssText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder(); + sb.append("@import"); + + final String href = getHref(); + if (null != href) { + sb.append(" url(").append(href).append(")"); + } + + final MediaList ml = getMedia(); + if (null != ml && ml.getLength() > 0) { + sb.append(" ").append(((MediaListImpl) getMedia()).getMediaText(format)); + } + sb.append(";"); + return sb.toString(); + } + + public void setCssText(final String cssText) throws DOMException { + final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheetImpl(); + if (parentStyleSheet != null && parentStyleSheet.isReadOnly()) { + throw new DOMExceptionImpl( + DOMException.NO_MODIFICATION_ALLOWED_ERR, + DOMExceptionImpl.READ_ONLY_STYLE_SHEET); + } + + try { + final InputSource is = new InputSource(new StringReader(cssText)); + final CSSOMParser parser = new CSSOMParser(); + final CSSRule r = parser.parseRule(is); + + // The rule must be an import rule + if (r.getType() == CSSRule.IMPORT_RULE) { + href_ = ((CSSImportRuleImpl) r).href_; + media_ = ((CSSImportRuleImpl) r).media_; + } + else { + throw new DOMExceptionImpl( + DOMException.INVALID_MODIFICATION_ERR, + DOMExceptionImpl.EXPECTING_IMPORT_RULE); + } + } + catch (final CSSException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + catch (final IOException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + } + + public String getHref() { + return href_; + } + + public MediaList getMedia() { + return media_; + } + + public CSSStyleSheet getStyleSheet() { + return null; + } + + @Override + public String toString() { + return getCssText(null); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof CSSImportRule)) { + return false; + } + final CSSImportRule cir = (CSSImportRule) obj; + return super.equals(obj) + && LangUtils.equals(getHref(), cir.getHref()) + && LangUtils.equals(getMedia(), cir.getMedia()); + } + + @Override + public int hashCode() { + int hash = super.hashCode(); + hash = LangUtils.hashCode(hash, href_); + hash = LangUtils.hashCode(hash, media_); + return hash; + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSMediaRuleImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSMediaRuleImpl.java new file mode 100644 index 000000000..576993a2b --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSMediaRuleImpl.java @@ -0,0 +1,250 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.StringReader; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.parser.CSSOMParser; +import com.fr.third.steadystate.css.util.ThrowCssExceptionErrorHandler; +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.InputSource; +import org.w3c.dom.DOMException; +import org.w3c.dom.css.CSSMediaRule; +import org.w3c.dom.css.CSSRule; +import org.w3c.dom.css.CSSRuleList; +import org.w3c.dom.stylesheets.MediaList; + +import com.fr.third.steadystate.css.util.LangUtils; + +/** + * Implementation of {@link CSSMediaRule}. + * + * @author David Schweinsberg + * @author rbri + */ +public class CSSMediaRuleImpl extends AbstractCSSRuleImpl implements CSSMediaRule { + + private static final long serialVersionUID = 6603734096445214651L; + + private MediaList media_; + private CSSRuleList cssRules_; + + public void setMedia(final MediaList media) { + media_ = media; + } + + public void setCssRules(final CSSRuleList cssRules) { + cssRules_ = cssRules; + } + + public CSSMediaRuleImpl( + final CSSStyleSheetImpl parentStyleSheet, + final CSSRule parentRule, + final MediaList media) { + super(parentStyleSheet, parentRule); + media_ = media; + } + + public CSSMediaRuleImpl() { + super(); + } + + public short getType() { + return MEDIA_RULE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCssText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder("@media "); + + sb.append(((MediaListImpl) getMedia()).getMediaText(format)); + sb.append(" {"); + for (int i = 0; i < getCssRules().getLength(); i++) { + final CSSRule rule = getCssRules().item(i); + sb.append(rule.getCssText()).append(" "); + } + sb.append("}"); + return sb.toString(); + } + + public void setCssText(final String cssText) throws DOMException { + final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheetImpl(); + if (parentStyleSheet != null && parentStyleSheet.isReadOnly()) { + throw new DOMExceptionImpl( + DOMException.NO_MODIFICATION_ALLOWED_ERR, + DOMExceptionImpl.READ_ONLY_STYLE_SHEET); + } + + try { + final InputSource is = new InputSource(new StringReader(cssText)); + final CSSOMParser parser = new CSSOMParser(); + final CSSRule r = parser.parseRule(is); + + // The rule must be a media rule + if (r.getType() == CSSRule.MEDIA_RULE) { + media_ = ((CSSMediaRuleImpl) r).media_; + cssRules_ = ((CSSMediaRuleImpl) r).cssRules_; + } + else { + throw new DOMExceptionImpl( + DOMException.INVALID_MODIFICATION_ERR, + DOMExceptionImpl.EXPECTING_MEDIA_RULE); + } + } + catch (final CSSException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + catch (final IOException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + } + + public MediaList getMedia() { + return media_; + } + + public CSSRuleList getCssRules() { + if (cssRules_ == null) { + cssRules_ = new CSSRuleListImpl(); + } + return cssRules_; + } + + public int insertRule(final String rule, final int index) throws DOMException { + final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheetImpl(); + if (parentStyleSheet != null && parentStyleSheet.isReadOnly()) { + throw new DOMExceptionImpl( + DOMException.NO_MODIFICATION_ALLOWED_ERR, + DOMExceptionImpl.READ_ONLY_STYLE_SHEET); + } + + try { + final InputSource is = new InputSource(new StringReader(rule)); + final CSSOMParser parser = new CSSOMParser(); + parser.setParentStyleSheet(parentStyleSheet); + parser.setErrorHandler(ThrowCssExceptionErrorHandler.INSTANCE); + // parser._parentRule is never read + // parser.setParentRule(_parentRule); + final CSSRule r = parser.parseRule(is); + + // Insert the rule into the list of rules + ((CSSRuleListImpl) getCssRules()).insert(r, index); + + } + catch (final IndexOutOfBoundsException e) { + throw new DOMExceptionImpl( + DOMException.INDEX_SIZE_ERR, + DOMExceptionImpl.INDEX_OUT_OF_BOUNDS, + e.getMessage()); + } + catch (final CSSException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + catch (final IOException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + return index; + } + + public void deleteRule(final int index) throws DOMException { + final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheetImpl(); + if (parentStyleSheet != null && parentStyleSheet.isReadOnly()) { + throw new DOMExceptionImpl( + DOMException.NO_MODIFICATION_ALLOWED_ERR, + DOMExceptionImpl.READ_ONLY_STYLE_SHEET); + } + try { + ((CSSRuleListImpl) getCssRules()).delete(index); + } + catch (final IndexOutOfBoundsException e) { + throw new DOMExceptionImpl( + DOMException.INDEX_SIZE_ERR, + DOMExceptionImpl.INDEX_OUT_OF_BOUNDS, + e.getMessage()); + } + } + + public void setRuleList(final CSSRuleListImpl rules) { + cssRules_ = rules; + } + + @Override + public String toString() { + return getCssText(); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof CSSMediaRule)) { + return false; + } + final CSSMediaRule cmr = (CSSMediaRule) obj; + return super.equals(obj) + && LangUtils.equals(getMedia(), cmr.getMedia()) + && LangUtils.equals(getCssRules(), cmr.getCssRules()); + } + + @Override + public int hashCode() { + int hash = super.hashCode(); + hash = LangUtils.hashCode(hash, media_); + hash = LangUtils.hashCode(hash, cssRules_); + return hash; + } + + private void writeObject(final ObjectOutputStream out) throws IOException { + out.writeObject(cssRules_); + out.writeObject(media_); + } + + private void readObject(final ObjectInputStream in) + throws IOException, ClassNotFoundException { + + cssRules_ = (CSSRuleList) in.readObject(); + if (cssRules_ != null) { + for (int i = 0; i < cssRules_.getLength(); i++) { + final CSSRule cssRule = cssRules_.item(i); + if (cssRule instanceof AbstractCSSRuleImpl) { + ((AbstractCSSRuleImpl) cssRule).setParentRule(this); + ((AbstractCSSRuleImpl) cssRule).setParentStyleSheet(getParentStyleSheetImpl()); + } + } + } + media_ = (MediaList) in.readObject(); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSOMObject.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSOMObject.java new file mode 100644 index 000000000..a1e5a3ec4 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSOMObject.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +/** + * @author koch + */ +public interface CSSOMObject { + + Object getUserData(String key); + + Object setUserData(String key, Object data); +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSOMObjectImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSOMObjectImpl.java new file mode 100644 index 000000000..1261f28e8 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSOMObjectImpl.java @@ -0,0 +1,76 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.io.Serializable; +import java.util.Hashtable; +import java.util.Map; + +import com.fr.third.steadystate.css.util.LangUtils; + +/** + * Implementation of {@link CSSOMObject}. + * + * @author koch + */ +public class CSSOMObjectImpl implements CSSOMObject, Serializable { + + private static final long serialVersionUID = 0L; + + private Map userDataMap_; + + public Map getUserDataMap() { + if (userDataMap_ == null) { + userDataMap_ = new Hashtable(); + } + return userDataMap_; + } + + public void setUserDataMap(final Map userDataMap) { + userDataMap_ = userDataMap; + } + + public CSSOMObjectImpl() { + super(); + } + + public Object getUserData(final String key) { + return getUserDataMap().get(key); + } + + public Object setUserData(final String key, final Object data) { + return getUserDataMap().put(key, data); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof CSSOMObjectImpl)) { + return false; + } + final CSSOMObjectImpl coi = (CSSOMObjectImpl) obj; + return LangUtils.equals(userDataMap_, coi.userDataMap_); + } + + @Override + public int hashCode() { + int hash = LangUtils.HASH_SEED; + hash = LangUtils.hashCode(hash, userDataMap_); + return hash; + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSPageRuleImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSPageRuleImpl.java new file mode 100644 index 000000000..7d778a0f3 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSPageRuleImpl.java @@ -0,0 +1,172 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.io.IOException; +import java.io.StringReader; + +import com.fr.third.steadystate.css.parser.CSSOMParser; +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.InputSource; +import org.w3c.dom.DOMException; +import org.w3c.dom.css.CSSPageRule; +import org.w3c.dom.css.CSSRule; +import org.w3c.dom.css.CSSStyleDeclaration; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.util.LangUtils; + +/** + * Implementation of {@link CSSPageRule}. + * + * TODO: Implement setSelectorText() + * + * @author David Schweinsberg + * @author rbri + */ +public class CSSPageRuleImpl extends AbstractCSSRuleImpl implements CSSPageRule { + + private static final long serialVersionUID = -6007519872104320812L; + + private String pseudoPage_; + private CSSStyleDeclaration style_; + + public CSSPageRuleImpl( + final CSSStyleSheetImpl parentStyleSheet, + final CSSRule parentRule, + final String pseudoPage) { + super(parentStyleSheet, parentRule); + pseudoPage_ = pseudoPage; + } + + public CSSPageRuleImpl() { + super(); + } + + public short getType() { + return PAGE_RULE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCssText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder(); + + final String sel = getSelectorText(); + sb.append("@page ").append(sel); + + if (sel.length() > 0) { + sb.append(" "); + } + sb.append("{"); + + final CSSStyleDeclaration style = getStyle(); + if (null != style) { + sb.append(style.getCssText()); + } + sb.append("}"); + return sb.toString(); + } + + public void setCssText(final String cssText) throws DOMException { + final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheetImpl(); + if (parentStyleSheet != null && parentStyleSheet.isReadOnly()) { + throw new DOMExceptionImpl( + DOMException.NO_MODIFICATION_ALLOWED_ERR, + DOMExceptionImpl.READ_ONLY_STYLE_SHEET); + } + + try { + final InputSource is = new InputSource(new StringReader(cssText)); + final CSSOMParser parser = new CSSOMParser(); + final CSSRule r = parser.parseRule(is); + + // The rule must be a page rule + if (r.getType() == CSSRule.PAGE_RULE) { + pseudoPage_ = ((CSSPageRuleImpl) r).pseudoPage_; + style_ = ((CSSPageRuleImpl) r).style_; + } + else { + throw new DOMExceptionImpl( + DOMException.INVALID_MODIFICATION_ERR, + DOMExceptionImpl.EXPECTING_PAGE_RULE); + } + } + catch (final CSSException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + catch (final IOException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + } + + public String getSelectorText() { + if (null == pseudoPage_) { + return ""; + } + return pseudoPage_; + } + + public void setSelectorText(final String selectorText) throws DOMException { + } + + public CSSStyleDeclaration getStyle() { + return style_; + } + + public void setPseudoPage(final String pseudoPage) { + pseudoPage_ = pseudoPage; + } + + public void setStyle(final CSSStyleDeclarationImpl style) { + style_ = style; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof CSSPageRule)) { + return false; + } + final CSSPageRule cpr = (CSSPageRule) obj; + return super.equals(obj) + && LangUtils.equals(getSelectorText(), cpr.getSelectorText()) + && LangUtils.equals(getStyle(), cpr.getStyle()); + } + + @Override + public int hashCode() { + int hash = super.hashCode(); + hash = LangUtils.hashCode(hash, pseudoPage_); + hash = LangUtils.hashCode(hash, style_); + return hash; + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSRuleListImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSRuleListImpl.java new file mode 100644 index 000000000..b02a3898d --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSRuleListImpl.java @@ -0,0 +1,141 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.format.CSSFormatable; +import org.w3c.dom.css.CSSRule; +import org.w3c.dom.css.CSSRuleList; + +import com.fr.third.steadystate.css.util.LangUtils; + +/** + * Implementation of {@link CSSRuleList}. + * + * @author David Schweinsberg + * @author rbri + */ +public class CSSRuleListImpl implements CSSRuleList, CSSFormatable, Serializable { + + private static final long serialVersionUID = -1269068897476453290L; + + private List rules_; + + public List getRules() { + if (rules_ == null) { + rules_ = new ArrayList(); + } + return rules_; + } + + public void setRules(final List rules) { + rules_ = rules; + } + + public CSSRuleListImpl() { + super(); + } + + public int getLength() { + return getRules().size(); + } + + public CSSRule item(final int index) { + if (index < 0 || null == rules_ || index >= rules_.size()) { + return null; + } + return rules_.get(index); + } + + public void add(final CSSRule rule) { + getRules().add(rule); + } + + public void insert(final CSSRule rule, final int index) { + getRules().add(index, rule); + } + + public void delete(final int index) { + getRules().remove(index); + } + + /** + * Same as {@link #getCssText(CSSFormat)} but using the default format. + * + * @return the formated string + */ + public String getCssText() { + return getCssText(null); + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder(); + for (int i = 0; i < getLength(); i++) { + if (i > 0) { + sb.append("\r\n"); + } + + final CSSRule rule = item(i); + sb.append(((CSSFormatable) rule).getCssText(format)); + } + return sb.toString(); + } + + @Override + public String toString() { + return getCssText(null); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof CSSRuleList)) { + return false; + } + final CSSRuleList crl = (CSSRuleList) obj; + return equalsRules(crl); + } + + private boolean equalsRules(final CSSRuleList crl) { + if ((crl == null) || (getLength() != crl.getLength())) { + return false; + } + for (int i = 0; i < getLength(); i++) { + final CSSRule cssRule1 = item(i); + final CSSRule cssRule2 = crl.item(i); + if (!LangUtils.equals(cssRule1, cssRule2)) { + return false; + } + } + return true; + } + + @Override + public int hashCode() { + int hash = LangUtils.HASH_SEED; + hash = LangUtils.hashCode(hash, rules_); + return hash; + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSStyleDeclarationImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSStyleDeclarationImpl.java new file mode 100644 index 000000000..ffa845403 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSStyleDeclarationImpl.java @@ -0,0 +1,1374 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.io.Serializable; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.List; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.CSSOMParser; +import org.w3c.css.sac.InputSource; +import org.w3c.dom.DOMException; +import org.w3c.dom.css.CSS2Properties; +import org.w3c.dom.css.CSSRule; +import org.w3c.dom.css.CSSStyleDeclaration; +import org.w3c.dom.css.CSSValue; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.util.LangUtils; + +/** + * Implementation of {@link CSSStyleDeclaration}. + * + * @author David Schweinsberg + * @author rbri + * @author Ahmed Ashour + */ +public class CSSStyleDeclarationImpl implements CSSStyleDeclaration, CSSFormatable, CSS2Properties, Serializable { + private static final long serialVersionUID = -2373755821317100189L; + + private static final String PRIORITY_IMPORTANT = "important"; + + private CSSRule parentRule_; + private List properties_ = new ArrayList(); + + public void setParentRule(final CSSRule parentRule) { + parentRule_ = parentRule; + } + + public List getProperties() { + return properties_; + } + + public void setProperties(final List properties) { + properties_ = properties; + } + + public CSSStyleDeclarationImpl(final CSSRule parentRule) { + parentRule_ = parentRule; + } + + public CSSStyleDeclarationImpl() { + // Empty. + } + + /** + * {@inheritDoc} + */ + public String getCssText() { + return getCssText(null); + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final boolean nl = format != null && format.getPropertiesInSeparateLines(); + + final StringBuilder sb = new StringBuilder(); + for (int i = 0; i < properties_.size(); ++i) { + final Property p = properties_.get(i); + if (p != null) { + if (nl) { + sb.append(format.getNewLine()); + sb.append(format.getPropertiesIndent()); + } + sb.append(p.getCssText(format)); + } + if (i < properties_.size() - 1) { + sb.append(";"); + if (!nl) { + sb.append(' '); + } + } + else if (nl) { + sb.append(format.getNewLine()); + } + } + return sb.toString(); + } + + public void setCssText(final String cssText) throws DOMException { + try { + final InputSource is = new InputSource(new StringReader(cssText)); + final CSSOMParser parser = new CSSOMParser(); + properties_.clear(); + parser.parseStyleDeclaration(this, is); + } + catch (final Exception e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + } + + public String getPropertyValue(final String propertyName) { + final Property p = getPropertyDeclaration(propertyName); + if (p == null || p.getValue() == null) { + return ""; + } + return p.getValue().toString(); + } + + public CSSValue getPropertyCSSValue(final String propertyName) { + final Property p = getPropertyDeclaration(propertyName); + return (p == null) ? null : p.getValue(); + } + + public String removeProperty(final String propertyName) throws DOMException { + if (null == propertyName) { + return ""; + } + for (int i = 0; i < properties_.size(); i++) { + final Property p = properties_.get(i); + if (p != null && propertyName.equalsIgnoreCase(p.getName())) { + properties_.remove(i); + if (p.getValue() == null) { + return ""; + } + return p.getValue().toString(); + } + } + return ""; + } + + public String getPropertyPriority(final String propertyName) { + final Property p = getPropertyDeclaration(propertyName); + if (p == null) { + return ""; + } + return p.isImportant() ? PRIORITY_IMPORTANT : ""; + } + + public void setProperty( + final String propertyName, + final String value, + final String priority) throws DOMException { + try { + CSSValue expr = null; + if (!value.isEmpty()) { + final CSSOMParser parser = new CSSOMParser(); + final InputSource is = new InputSource(new StringReader(value)); + expr = parser.parsePropertyValue(is); + } + Property p = getPropertyDeclaration(propertyName); + final boolean important = PRIORITY_IMPORTANT.equalsIgnoreCase(priority); + if (p == null) { + p = new Property(propertyName, expr, important); + addProperty(p); + } + else { + p.setValue(expr); + p.setImportant(important); + } + } + catch (final Exception e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + } + + public int getLength() { + return properties_.size(); + } + + public String item(final int index) { + final Property p = properties_.get(index); + return (p == null) ? "" : p.getName(); + } + + public CSSRule getParentRule() { + return parentRule_; + } + + public void addProperty(final Property p) { + if (null == p) { + return; + } + properties_.add(p); + } + + public Property getPropertyDeclaration(final String propertyName) { + if (null == propertyName) { + return null; + } + for (int i = properties_.size() - 1; i > -1; i--) { + final Property p = properties_.get(i); + if (p != null && propertyName.equalsIgnoreCase(p.getName())) { + return p; + } + } + return null; + } + + @Override + public String toString() { + return getCssText(); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof CSSStyleDeclaration)) { + return false; + } + final CSSStyleDeclaration csd = (CSSStyleDeclaration) obj; + + // don't use parentRule in equals() + // recursive loop -> stack overflow! + return equalsProperties(csd); + } + + private boolean equalsProperties(final CSSStyleDeclaration csd) { + if ((csd == null) || (getLength() != csd.getLength())) { + return false; + } + for (int i = 0; i < getLength(); i++) { + final String propertyName = item(i); + // CSSValue propertyCSSValue1 = getPropertyCSSValue(propertyName); + // CSSValue propertyCSSValue2 = csd.getPropertyCSSValue(propertyName); + final String propertyValue1 = getPropertyValue(propertyName); + final String propertyValue2 = csd.getPropertyValue(propertyName); + if (!LangUtils.equals(propertyValue1, propertyValue2)) { + return false; + } + final String propertyPriority1 = getPropertyPriority(propertyName); + final String propertyPriority2 = csd.getPropertyPriority(propertyName); + if (!LangUtils.equals(propertyPriority1, propertyPriority2)) { + return false; + } + } + return true; + } + + @Override + public int hashCode() { + int hash = LangUtils.HASH_SEED; + // don't use parentRule in hashCode() + // recursive loop -> stack overflow! + hash = LangUtils.hashCode(hash, properties_); + return hash; + } + + // ---- start CSS2Properties interface ---- + private static final String AZIMUTH = "azimuth"; + private static final String BACKGROUND = "background"; + private static final String BACKGROUND_ATTACHMENT = "background-attachment"; + private static final String BACKGROUND_COLOR = "background-color"; + private static final String BACKGROUND_IMAGE = "background-image"; + private static final String BACKGROUND_POSITION = "background-position"; + private static final String BACKGROUND_REPEAT = "background-repeat"; + private static final String BORDER = "border"; + private static final String BORDER_BOTTOM = "border-bottom"; + private static final String BORDER_BOTTOM_COLOR = "border-bottom-color"; + private static final String BORDER_BOTTOM_STYLE = "border-bottom-style"; + private static final String BORDER_BOTTOM_WIDTH = "border-bottom-width"; + private static final String BORDER_COLLAPSE = "border-collapse"; + private static final String BORDER_COLOR = "border-color"; + private static final String BORDER_LEFT = "border-left"; + private static final String BORDER_LEFT_COLOR = "border-left-color"; + private static final String BORDER_LEFT_STYLE = "border-left-style"; + private static final String BORDER_LEFT_WIDTH = "border-left-width"; + private static final String BORDER_RIGHT = "border-right"; + private static final String BORDER_RIGHT_COLOR = "border-right-color"; + private static final String BORDER_RIGHT_STYLE = "border-right-style"; + private static final String BORDER_RIGHT_WIDTH = "border-right-width"; + private static final String BORDER_SPACING = "border-spacing"; + private static final String BORDER_STYLE = "border-style"; + private static final String BORDER_TOP = "border-top"; + private static final String BORDER_TOP_COLOR = "border-top-color"; + private static final String BORDER_TOP_STYLE = "border-top-style"; + private static final String BORDER_TOP_WIDTH = "border-top-width"; + private static final String BORDER_WIDTH = "border-width"; + private static final String BOTTOM = "bottom"; + private static final String CAPTION_SIDE = "caption-side"; + private static final String CLEAR = "clear"; + private static final String CLIP = "clip"; + private static final String COLOR = "color"; + private static final String CONTENT = "content"; + private static final String COUNTER_INCREMENT = "counter-increment"; + private static final String COUNTER_RESET = "counter-reset"; + private static final String CSS_FLOAT = "css-float"; + private static final String CUE = "cue"; + private static final String CUE_AFTER = "cue-after"; + private static final String CUE_BEFORE = "cue-before"; + private static final String CURSOR = "cursor"; + private static final String DIRECTION = "direction"; + private static final String DISPLAY = "display"; + private static final String ELEVATION = "elevation"; + private static final String EMPTY_CELLS = "empty-cells"; + private static final String FONT = "font"; + private static final String FONT_FAMILY = "font-family"; + private static final String FONT_SIZE = "font-size"; + private static final String FONT_SIZE_ADJUST = "font-size-adjust"; + private static final String FONT_STRETCH = "font-stretch"; + private static final String FONT_STYLE = "font-style"; + private static final String FONT_VARIANT = "font-variant"; + private static final String FONT_WEIGHT = "font-weight"; + private static final String HEIGHT = "height"; + private static final String LEFT = "left"; + private static final String LETTER_SPACING = "letter-spacing"; + private static final String LINE_HEIGHT = "line-height"; + private static final String LIST_STYLE = "list-style"; + private static final String LIST_STYLE_IMAGE = "list-style-image"; + private static final String LIST_STYLE_POSITION = "list-style-position"; + private static final String LIST_STYLE_TYPE = "list-style-type"; + private static final String MARGIN = "margin"; + private static final String MARGIN_BOTTOM = "margin-bottom"; + private static final String MARGIN_LEFT = "margin-left"; + private static final String MARGIN_RIGHT = "margin-right"; + private static final String MARGIN_TOP = "margin-top"; + private static final String MARKER_OFFSET = "marker-offset"; + private static final String MARKS = "marks"; + private static final String MAX_HEIGHT = "max-height"; + private static final String MAX_WIDTH = "max-width"; + private static final String MIN_HEIGHT = "min-height"; + private static final String MIN_WIDTH = "min-width"; + private static final String ORPHANS = "orphans"; + private static final String OUTLINE = "outline"; + private static final String OUTLINE_COLOR = "outline-color"; + private static final String OUTLINE_STYLE = "outline-style"; + private static final String OUTLINE_WIDTH = "outline-width"; + private static final String OVERFLOW = "overflow"; + private static final String PADDING = "padding"; + private static final String PADDING_BOTTOM = "padding-bottom"; + private static final String PADDING_LEFT = "padding-left"; + private static final String PADDING_RIGHT = "padding-right"; + private static final String PADDING_TOP = "padding-top"; + private static final String PAGE = "page"; + private static final String PAGE_BREAK_AFTER = "page-break-after"; + private static final String PAGE_BREAK_BEFORE = "page-break-before"; + private static final String PAGE_BREAK_INSIDE = "page-break-inside"; + private static final String PAUSE = "pause"; + private static final String PAUSE_AFTER = "pause-after"; + private static final String PAUSE_BEFORE = "pause-before"; + private static final String PITCH = "pitch"; + private static final String PITCH_RANGE = "pitch-range"; + private static final String PLAY_DURING = "play-during"; + private static final String POSITION = "position"; + private static final String QUOTES = "quotes"; + private static final String RICHNESS = "richness"; + private static final String RIGHT = "right"; + private static final String SIZE = "size"; + private static final String SPEAK = "speak"; + private static final String SPEAK_HEADER = "speak-header"; + private static final String SPEAK_NUMERAL = "speak-numeral"; + private static final String SPEAK_PUNCTUATION = "speak-puctuation"; + private static final String SPEECH_RATE = "speech-rate"; + private static final String STRESS = "stress"; + private static final String TABLE_LAYOUT = "table-layout"; + private static final String TEXT_ALIGN = "text-align"; + private static final String TEXT_DECORATION = "text-decoration"; + private static final String TEXT_INDENT = "text-indent"; + private static final String TEXT_SHADOW = "text-shadow"; + private static final String TEXT_TRANSFORM = "text-transform"; + private static final String TOP = "top"; + private static final String UNICODE_BIDI = "unicode-bidi"; + private static final String VERTICAL_ALIGN = "vertical-align"; + private static final String VISIBILITY = "visibility"; + private static final String VOICE_FAMILY = "voice-family"; + private static final String VOLUME = "volume"; + private static final String WHITE_SPACE = "white-space"; + private static final String WIDOWS = "widows"; + private static final String WIDTH = "width"; + private static final String WORD_SPACING = "word_spacing"; + private static final String Z_INDEX = "z-index"; + + public String getAzimuth() { + return getPropertyValue(AZIMUTH); + } + + public void setAzimuth(final String azimuth) throws DOMException { + setProperty(AZIMUTH, azimuth, null); + } + + public String getBackground() { + return getPropertyValue(BACKGROUND); + } + + public void setBackground(final String background) throws DOMException { + setProperty(BACKGROUND, background, null); + } + + public String getBackgroundAttachment() { + return getPropertyValue(BACKGROUND_ATTACHMENT); + } + + public void setBackgroundAttachment(final String backgroundAttachment) throws DOMException { + setProperty(BACKGROUND_ATTACHMENT, backgroundAttachment, null); + } + + public String getBackgroundColor() { + return getPropertyValue(BACKGROUND_COLOR); + } + + public void setBackgroundColor(final String backgroundColor) throws DOMException { + setProperty(BACKGROUND_COLOR, backgroundColor, null); + } + + public String getBackgroundImage() { + return getPropertyValue(BACKGROUND_IMAGE); + } + + public void setBackgroundImage(final String backgroundImage) throws DOMException { + setProperty(BACKGROUND_IMAGE, backgroundImage, null); + } + + public String getBackgroundPosition() { + return getPropertyValue(BACKGROUND_POSITION); + } + + public void setBackgroundPosition(final String backgroundPosition) throws DOMException { + setProperty(BACKGROUND_POSITION, backgroundPosition, null); + } + + public String getBackgroundRepeat() { + return getPropertyValue(BACKGROUND_REPEAT); + } + + public void setBackgroundRepeat(final String backgroundRepeat) throws DOMException { + setProperty(BACKGROUND_REPEAT, backgroundRepeat, null); + } + + public String getBorder() { + return getPropertyValue(BORDER); + } + + public void setBorder(final String border) throws DOMException { + setProperty(BORDER, border, null); + } + + public String getBorderCollapse() { + return getPropertyValue(BORDER_COLLAPSE); + } + + public void setBorderCollapse(final String borderCollapse) throws DOMException { + setProperty(BORDER_COLLAPSE, borderCollapse, null); + } + + public String getBorderColor() { + return getPropertyValue(BORDER_COLOR); + } + + public void setBorderColor(final String borderColor) throws DOMException { + setProperty(BORDER_COLOR, borderColor, null); + } + + public String getBorderSpacing() { + return getPropertyValue(BORDER_SPACING); + } + + public void setBorderSpacing(final String borderSpacing) throws DOMException { + setProperty(BORDER_SPACING, borderSpacing, null); + } + + public String getBorderStyle() { + return getPropertyValue(BORDER_STYLE); + } + + public void setBorderStyle(final String borderStyle) throws DOMException { + setProperty(BORDER_STYLE, borderStyle, null); + } + + public String getBorderTop() { + return getPropertyValue(BORDER_TOP); + } + + public void setBorderTop(final String borderTop) throws DOMException { + setProperty(BORDER_TOP, borderTop, null); + } + + public String getBorderRight() { + return getPropertyValue(BORDER_RIGHT); + } + + public void setBorderRight(final String borderRight) throws DOMException { + setProperty(BORDER_RIGHT, borderRight, null); + } + + public String getBorderBottom() { + return getPropertyValue(BORDER_BOTTOM); + } + + public void setBorderBottom(final String borderBottom) throws DOMException { + setProperty(BORDER_BOTTOM, borderBottom, null); + } + + public String getBorderLeft() { + return getPropertyValue(BORDER_LEFT); + } + + public void setBorderLeft(final String borderLeft) throws DOMException { + setProperty(BORDER_LEFT, borderLeft, null); + } + + public String getBorderTopColor() { + return getPropertyValue(BORDER_TOP_COLOR); + } + + public void setBorderTopColor(final String borderTopColor) throws DOMException { + setProperty(BORDER_TOP_COLOR, borderTopColor, null); + } + + public String getBorderRightColor() { + return getPropertyValue(BORDER_RIGHT_COLOR); + } + + public void setBorderRightColor(final String borderRightColor) throws DOMException { + setProperty(BORDER_RIGHT_COLOR, borderRightColor, null); + } + + public String getBorderBottomColor() { + return getPropertyValue(BORDER_BOTTOM_COLOR); + } + + public void setBorderBottomColor(final String borderBottomColor) throws DOMException { + setProperty(BORDER_BOTTOM_COLOR, borderBottomColor, null); + } + + public String getBorderLeftColor() { + return getPropertyValue(BORDER_LEFT_COLOR); + } + + public void setBorderLeftColor(final String borderLeftColor) throws DOMException { + setProperty(BORDER_LEFT_COLOR, borderLeftColor, null); + } + + public String getBorderTopStyle() { + return getPropertyValue(BORDER_TOP_STYLE); + } + + public void setBorderTopStyle(final String borderTopStyle) throws DOMException { + setProperty(BORDER_TOP_STYLE, borderTopStyle, null); + } + + public String getBorderRightStyle() { + return getPropertyValue(BORDER_RIGHT_STYLE); + } + + public void setBorderRightStyle(final String borderRightStyle) throws DOMException { + setProperty(BORDER_RIGHT_STYLE, borderRightStyle, null); + } + + public String getBorderBottomStyle() { + return getPropertyValue(BORDER_BOTTOM_STYLE); + } + + public void setBorderBottomStyle(final String borderBottomStyle) throws DOMException { + setProperty(BORDER_BOTTOM_STYLE, borderBottomStyle, null); + } + + public String getBorderLeftStyle() { + return getPropertyValue(BORDER_LEFT_STYLE); + } + + public void setBorderLeftStyle(final String borderLeftStyle) throws DOMException { + setProperty(BORDER_LEFT_STYLE, borderLeftStyle, null); + } + + public String getBorderTopWidth() { + return getPropertyValue(BORDER_TOP_WIDTH); + } + + public void setBorderTopWidth(final String borderTopWidth) throws DOMException { + setProperty(BORDER_TOP_WIDTH, borderTopWidth, null); + } + + public String getBorderRightWidth() { + return getPropertyValue(BORDER_RIGHT_WIDTH); + } + + public void setBorderRightWidth(final String borderRightWidth) throws DOMException { + setProperty(BORDER_RIGHT_WIDTH, borderRightWidth, null); + } + + public String getBorderBottomWidth() { + return getPropertyValue(BORDER_BOTTOM_WIDTH); + } + + public void setBorderBottomWidth(final String borderBottomWidth) throws DOMException { + setProperty(BORDER_BOTTOM_WIDTH, borderBottomWidth, null); + } + + public String getBorderLeftWidth() { + return getPropertyValue(BORDER_LEFT_WIDTH); + } + + public void setBorderLeftWidth(final String borderLeftWidth) throws DOMException { + setProperty(BORDER_LEFT_WIDTH, borderLeftWidth, null); + } + + public String getBorderWidth() { + return getPropertyValue(BORDER_WIDTH); + } + + public void setBorderWidth(final String borderWidth) throws DOMException { + setProperty(BORDER_WIDTH, borderWidth, null); + } + + public String getBottom() { + return getPropertyValue(BOTTOM); + } + + public void setBottom(final String bottom) throws DOMException { + setProperty(BOTTOM, bottom, null); + } + + public String getCaptionSide() { + return getPropertyValue(CAPTION_SIDE); + } + + public void setCaptionSide(final String captionSide) throws DOMException { + setProperty(CAPTION_SIDE, captionSide, null); + } + + public String getClear() { + return getPropertyValue(CLEAR); + } + + public void setClear(final String clear) throws DOMException { + setProperty(CLEAR, clear, null); + } + + public String getClip() { + return getPropertyValue(CLIP); + } + + public void setClip(final String clip) throws DOMException { + setProperty(CLIP, clip, null); + } + + public String getColor() { + return getPropertyValue(COLOR); + } + + public void setColor(final String color) throws DOMException { + setProperty(COLOR, color, null); + } + + public String getContent() { + return getPropertyValue(CONTENT); + } + + public void setContent(final String content) throws DOMException { + setProperty(CONTENT, content, null); + } + + public String getCounterIncrement() { + return getPropertyValue(COUNTER_INCREMENT); + } + + public void setCounterIncrement(final String counterIncrement) throws DOMException { + setProperty(COUNTER_INCREMENT, counterIncrement, null); + } + + public String getCounterReset() { + return getPropertyValue(COUNTER_RESET); + } + + public void setCounterReset(final String counterReset) throws DOMException { + setProperty(COUNTER_RESET, counterReset, null); + } + + public String getCue() { + return getPropertyValue(CUE); + } + + public void setCue(final String cue) throws DOMException { + setProperty(CUE, cue, null); + } + + public String getCueAfter() { + return getPropertyValue(CUE_AFTER); + } + + public void setCueAfter(final String cueAfter) throws DOMException { + setProperty(CUE_AFTER, cueAfter, null); + } + + public String getCueBefore() { + return getPropertyValue(CUE_BEFORE); + } + + public void setCueBefore(final String cueBefore) throws DOMException { + setProperty(CUE_BEFORE, cueBefore, null); + } + + public String getCursor() { + return getPropertyValue(CURSOR); + } + + public void setCursor(final String cursor) throws DOMException { + setProperty(CURSOR, cursor, null); + } + + public String getDirection() { + return getPropertyValue(DIRECTION); + } + + public void setDirection(final String direction) throws DOMException { + setProperty(DIRECTION, direction, null); + } + + public String getDisplay() { + return getPropertyValue(DISPLAY); + } + + public void setDisplay(final String display) throws DOMException { + setProperty(DISPLAY, display, null); + } + + public String getElevation() { + return getPropertyValue(ELEVATION); + } + + public void setElevation(final String elevation) throws DOMException { + setProperty(ELEVATION, elevation, null); + } + + public String getEmptyCells() { + return getPropertyValue(EMPTY_CELLS); + } + + public void setEmptyCells(final String emptyCells) throws DOMException { + setProperty(EMPTY_CELLS, emptyCells, null); + } + + public String getCssFloat() { + return getPropertyValue(CSS_FLOAT); + } + + public void setCssFloat(final String cssFloat) throws DOMException { + setProperty(CSS_FLOAT, cssFloat, null); + } + + public String getFont() { + return getPropertyValue(FONT); + } + + public void setFont(final String font) throws DOMException { + setProperty(FONT, font, null); + } + + public String getFontFamily() { + return getPropertyValue(FONT_FAMILY); + } + + public void setFontFamily(final String fontFamily) throws DOMException { + setProperty(FONT_FAMILY, fontFamily, null); + } + + public String getFontSize() { + return getPropertyValue(FONT_SIZE); + } + + public void setFontSize(final String fontSize) throws DOMException { + setProperty(FONT_SIZE, fontSize, null); + } + + public String getFontSizeAdjust() { + return getPropertyValue(FONT_SIZE_ADJUST); + } + + public void setFontSizeAdjust(final String fontSizeAdjust) throws DOMException { + setProperty(FONT_SIZE_ADJUST, fontSizeAdjust, null); + } + + public String getFontStretch() { + return getPropertyValue(FONT_STRETCH); + } + + public void setFontStretch(final String fontStretch) throws DOMException { + setProperty(FONT_STRETCH, fontStretch, null); + } + + public String getFontStyle() { + return getPropertyValue(FONT_STYLE); + } + + public void setFontStyle(final String fontStyle) throws DOMException { + setProperty(FONT_STYLE, fontStyle, null); + } + + public String getFontVariant() { + return getPropertyValue(FONT_VARIANT); + } + + public void setFontVariant(final String fontVariant) throws DOMException { + setProperty(FONT_VARIANT, fontVariant, null); + } + + public String getFontWeight() { + return getPropertyValue(FONT_WEIGHT); + } + + public void setFontWeight(final String fontWeight) throws DOMException { + setProperty(FONT_WEIGHT, fontWeight, null); + } + + public String getHeight() { + return getPropertyValue(HEIGHT); + } + + public void setHeight(final String height) throws DOMException { + setProperty(HEIGHT, height, null); + } + + public String getLeft() { + return getPropertyValue(LEFT); + } + + public void setLeft(final String left) throws DOMException { + setProperty(LEFT, left, null); + } + + public String getLetterSpacing() { + return getPropertyValue(LETTER_SPACING); + } + + public void setLetterSpacing(final String letterSpacing) throws DOMException { + setProperty(LETTER_SPACING, letterSpacing, null); + } + + public String getLineHeight() { + return getPropertyValue(LINE_HEIGHT); + } + + public void setLineHeight(final String lineHeight) throws DOMException { + setProperty(LINE_HEIGHT, lineHeight, null); + } + + public String getListStyle() { + return getPropertyValue(LIST_STYLE); + } + + public void setListStyle(final String listStyle) throws DOMException { + setProperty(LIST_STYLE, listStyle, null); + } + + public String getListStyleImage() { + return getPropertyValue(LIST_STYLE_IMAGE); + } + + public void setListStyleImage(final String listStyleImage) throws DOMException { + setProperty(LIST_STYLE_IMAGE, listStyleImage, null); + } + + public String getListStylePosition() { + return getPropertyValue(LIST_STYLE_POSITION); + } + + public void setListStylePosition(final String listStylePosition) throws DOMException { + setProperty(LIST_STYLE_POSITION, listStylePosition, null); + } + + public String getListStyleType() { + return getPropertyValue(LIST_STYLE_TYPE); + } + + public void setListStyleType(final String listStyleType) throws DOMException { + setProperty(LIST_STYLE_TYPE, listStyleType, null); + } + + public String getMargin() { + return getPropertyValue(MARGIN); + } + + public void setMargin(final String margin) throws DOMException { + setProperty(MARGIN, margin, null); + } + + public String getMarginTop() { + return getPropertyValue(MARGIN_TOP); + } + + public void setMarginTop(final String marginTop) throws DOMException { + setProperty(MARGIN_TOP, marginTop, null); + } + + public String getMarginRight() { + return getPropertyValue(MARGIN_RIGHT); + } + + public void setMarginRight(final String marginRight) throws DOMException { + setProperty(MARGIN_RIGHT, marginRight, null); + } + + public String getMarginBottom() { + return getPropertyValue(MARGIN_BOTTOM); + } + + public void setMarginBottom(final String marginBottom) throws DOMException { + setProperty(MARGIN_BOTTOM, marginBottom, null); + } + + public String getMarginLeft() { + return getPropertyValue(MARGIN_LEFT); + } + + public void setMarginLeft(final String marginLeft) throws DOMException { + setProperty(MARGIN_LEFT, marginLeft, null); + } + + public String getMarkerOffset() { + return getPropertyValue(MARKER_OFFSET); + } + + public void setMarkerOffset(final String markerOffset) throws DOMException { + setProperty(MARKER_OFFSET, markerOffset, null); + } + + public String getMarks() { + return getPropertyValue(MARKS); + } + + public void setMarks(final String marks) throws DOMException { + setProperty(MARKS, marks, null); + } + + public String getMaxHeight() { + return getPropertyValue(MAX_HEIGHT); + } + + public void setMaxHeight(final String maxHeight) throws DOMException { + setProperty(MAX_HEIGHT, maxHeight, null); + } + + public String getMaxWidth() { + return getPropertyValue(MAX_WIDTH); + } + + public void setMaxWidth(final String maxWidth) throws DOMException { + setProperty(MAX_WIDTH, maxWidth, null); + } + + public String getMinHeight() { + return getPropertyValue(MIN_HEIGHT); + } + + public void setMinHeight(final String minHeight) throws DOMException { + setProperty(MIN_HEIGHT, minHeight, null); + } + + public String getMinWidth() { + return getPropertyValue(MIN_WIDTH); + } + + public void setMinWidth(final String minWidth) throws DOMException { + setProperty(MIN_WIDTH, minWidth, null); + } + + public String getOrphans() { + return getPropertyValue(ORPHANS); + } + + public void setOrphans(final String orphans) throws DOMException { + setProperty(ORPHANS, orphans, null); + } + + public String getOutline() { + return getPropertyValue(OUTLINE); + } + + public void setOutline(final String outline) throws DOMException { + setProperty(OUTLINE, outline, null); + } + + public String getOutlineColor() { + return getPropertyValue(OUTLINE_COLOR); + } + + public void setOutlineColor(final String outlineColor) throws DOMException { + setProperty(OUTLINE_COLOR, outlineColor, null); + } + + public String getOutlineStyle() { + return getPropertyValue(OUTLINE_STYLE); + } + + public void setOutlineStyle(final String outlineStyle) throws DOMException { + setProperty(OUTLINE_STYLE, outlineStyle, null); + } + + public String getOutlineWidth() { + return getPropertyValue(OUTLINE_WIDTH); + } + + public void setOutlineWidth(final String outlineWidth) throws DOMException { + setProperty(OUTLINE_WIDTH, outlineWidth, null); + } + + public String getOverflow() { + return getPropertyValue(OVERFLOW); + } + + public void setOverflow(final String overflow) throws DOMException { + setProperty(OVERFLOW, overflow, null); + } + + public String getPadding() { + return getPropertyValue(PADDING); + } + + public void setPadding(final String padding) throws DOMException { + setProperty(PADDING, padding, null); + } + + public String getPaddingTop() { + return getPropertyValue(PADDING_TOP); + } + + public void setPaddingTop(final String paddingTop) throws DOMException { + setProperty(PADDING_TOP, paddingTop, null); + } + + public String getPaddingRight() { + return getPropertyValue(PADDING_RIGHT); + } + + public void setPaddingRight(final String paddingRight) throws DOMException { + setProperty(PADDING_RIGHT, paddingRight, null); + } + + public String getPaddingBottom() { + return getPropertyValue(PADDING_BOTTOM); + } + + public void setPaddingBottom(final String paddingBottom) throws DOMException { + setProperty(PADDING_BOTTOM, paddingBottom, null); + } + + public String getPaddingLeft() { + return getPropertyValue(PADDING_LEFT); + } + + public void setPaddingLeft(final String paddingLeft) throws DOMException { + setProperty(PADDING_LEFT, paddingLeft, null); + } + + public String getPage() { + return getPropertyValue(PAGE); + } + + public void setPage(final String page) throws DOMException { + setProperty(PAGE, page, null); + } + + public String getPageBreakAfter() { + return getPropertyValue(PAGE_BREAK_AFTER); + } + + public void setPageBreakAfter(final String pageBreakAfter) throws DOMException { + setProperty(PAGE_BREAK_AFTER, pageBreakAfter, null); + } + + public String getPageBreakBefore() { + return getPropertyValue(PAGE_BREAK_BEFORE); + } + + public void setPageBreakBefore(final String pageBreakBefore) throws DOMException { + setProperty(PAGE_BREAK_BEFORE, PAGE_BREAK_BEFORE, null); + } + + public String getPageBreakInside() { + return getPropertyValue(PAGE_BREAK_INSIDE); + } + + public void setPageBreakInside(final String pageBreakInside) throws DOMException { + setProperty(PAGE_BREAK_INSIDE, pageBreakInside, null); + } + + public String getPause() { + return getPropertyValue(PAUSE); + } + + public void setPause(final String pause) throws DOMException { + setProperty(PAUSE, pause, null); + } + + public String getPauseAfter() { + return getPropertyValue(PAUSE_AFTER); + } + + public void setPauseAfter(final String pauseAfter) throws DOMException { + setProperty(PAUSE_AFTER, pauseAfter, null); + } + + public String getPauseBefore() { + return getPropertyValue(PAUSE_BEFORE); + } + + public void setPauseBefore(final String pauseBefore) throws DOMException { + setProperty(PAUSE_BEFORE, PAUSE_BEFORE, null); + } + + public String getPitch() { + return getPropertyValue(PITCH); + } + + public void setPitch(final String pitch) throws DOMException { + setProperty(PITCH, pitch, null); + } + + public String getPitchRange() { + return getPropertyValue(PITCH_RANGE); + } + + public void setPitchRange(final String pitchRange) throws DOMException { + setProperty(PITCH_RANGE, pitchRange, null); + } + + public String getPlayDuring() { + return getPropertyValue(PLAY_DURING); + } + + public void setPlayDuring(final String playDuring) throws DOMException { + setProperty(PLAY_DURING, playDuring, null); + } + + public String getPosition() { + return getPropertyValue(POSITION); + } + + public void setPosition(final String position) throws DOMException { + setProperty(POSITION, position, null); + } + + public String getQuotes() { + return getPropertyValue(QUOTES); + } + + public void setQuotes(final String quotes) throws DOMException { + setProperty(QUOTES, quotes, null); + } + + public String getRichness() { + return getPropertyValue(RICHNESS); + } + + public void setRichness(final String richness) throws DOMException { + setProperty(RICHNESS, richness, null); + } + + public String getRight() { + return getPropertyValue(RIGHT); + } + + public void setRight(final String right) throws DOMException { + setProperty(RIGHT, right, null); + } + + public String getSize() { + return getPropertyValue(SIZE); + } + + public void setSize(final String size) throws DOMException { + setProperty(SIZE, size, null); + } + + public String getSpeak() { + return getPropertyValue(SPEAK); + } + + public void setSpeak(final String speak) throws DOMException { + setProperty(SPEAK, speak, null); + } + + public String getSpeakHeader() { + return getPropertyValue(SPEAK_HEADER); + } + + public void setSpeakHeader(final String speakHeader) throws DOMException { + setProperty(SPEAK_HEADER, speakHeader, null); + } + + public String getSpeakNumeral() { + return getPropertyValue(SPEAK_NUMERAL); + } + + public void setSpeakNumeral(final String speakNumeral) throws DOMException { + setProperty(SPEAK_NUMERAL, speakNumeral, null); + } + + public String getSpeakPunctuation() { + return getPropertyValue(SPEAK_PUNCTUATION); + } + + public void setSpeakPunctuation(final String speakPunctuation) throws DOMException { + setProperty(SPEAK_PUNCTUATION, speakPunctuation, null); + } + + public String getSpeechRate() { + return getPropertyValue(SPEECH_RATE); + } + + public void setSpeechRate(final String speechRate) throws DOMException { + setProperty(SPEECH_RATE, speechRate, null); + } + + public String getStress() { + return getPropertyValue(STRESS); + } + + public void setStress(final String stress) throws DOMException { + setProperty(STRESS, stress, null); + } + + public String getTableLayout() { + return getPropertyValue(TABLE_LAYOUT); + } + + public void setTableLayout(final String tableLayout) throws DOMException { + setProperty(TABLE_LAYOUT, tableLayout, null); + } + + public String getTextAlign() { + return getPropertyValue(TEXT_ALIGN); + } + + public void setTextAlign(final String textAlign) throws DOMException { + setProperty(TEXT_ALIGN, textAlign, null); + } + + public String getTextDecoration() { + return getPropertyValue(TEXT_DECORATION); + } + + public void setTextDecoration(final String textDecoration) throws DOMException { + setProperty(TEXT_DECORATION, textDecoration, null); + } + + public String getTextIndent() { + return getPropertyValue(TEXT_INDENT); + } + + public void setTextIndent(final String textIndent) throws DOMException { + setProperty(TEXT_INDENT, textIndent, null); + } + + public String getTextShadow() { + return getPropertyValue(TEXT_SHADOW); + } + + public void setTextShadow(final String textShadow) throws DOMException { + setProperty(TEXT_SHADOW, textShadow, null); + } + + public String getTextTransform() { + return getPropertyValue(TEXT_TRANSFORM); + } + + public void setTextTransform(final String textTransform) throws DOMException { + setProperty(TEXT_TRANSFORM, textTransform, null); + } + + public String getTop() { + return getPropertyValue(TOP); + } + + public void setTop(final String top) throws DOMException { + setProperty(TOP, top, null); + } + + public String getUnicodeBidi() { + return getPropertyValue(UNICODE_BIDI); + } + + public void setUnicodeBidi(final String unicodeBidi) throws DOMException { + setProperty(UNICODE_BIDI, unicodeBidi, null); + } + + public String getVerticalAlign() { + return getPropertyValue(VERTICAL_ALIGN); + } + + public void setVerticalAlign(final String verticalAlign) throws DOMException { + setProperty(VERTICAL_ALIGN, verticalAlign, null); + } + + public String getVisibility() { + return getPropertyValue(VISIBILITY); + } + + public void setVisibility(final String visibility) throws DOMException { + setProperty(VISIBILITY, visibility, null); + } + + public String getVoiceFamily() { + return getPropertyValue(VOICE_FAMILY); + } + + public void setVoiceFamily(final String voiceFamily) throws DOMException { + setProperty(VOICE_FAMILY, voiceFamily, null); + } + + public String getVolume() { + return getPropertyValue(VOLUME); + } + + public void setVolume(final String volume) throws DOMException { + setProperty(VOLUME, volume, null); + } + + public String getWhiteSpace() { + return getPropertyValue(WHITE_SPACE); + } + + public void setWhiteSpace(final String whiteSpace) throws DOMException { + setProperty(WHITE_SPACE, whiteSpace, null); + } + + public String getWidows() { + return getPropertyValue(WIDOWS); + } + + public void setWidows(final String widows) throws DOMException { + setProperty(WIDOWS, widows, null); + } + + public String getWidth() { + return getPropertyValue(WIDTH); + } + + public void setWidth(final String width) throws DOMException { + setProperty(WIDTH, width, null); + } + + public String getWordSpacing() { + return getPropertyValue(WORD_SPACING); + } + + public void setWordSpacing(final String wordSpacing) throws DOMException { + setProperty(WORD_SPACING, wordSpacing, null); + } + + public String getZIndex() { + return getPropertyValue(Z_INDEX); + } + + public void setZIndex(final String zIndex) throws DOMException { + setProperty(Z_INDEX, zIndex, null); + } + + // ---- end CSS2Properties interface ---- +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSStyleRuleImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSStyleRuleImpl.java new file mode 100644 index 000000000..c0c50ede6 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSStyleRuleImpl.java @@ -0,0 +1,196 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.io.IOException; +import java.io.StringReader; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.CSSOMParser; +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.InputSource; +import org.w3c.css.sac.SelectorList; +import org.w3c.dom.DOMException; +import org.w3c.dom.css.CSSRule; +import org.w3c.dom.css.CSSStyleDeclaration; +import org.w3c.dom.css.CSSStyleRule; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.util.LangUtils; + +/** + * Implementation of {@link CSSStyleRule}. + * + * @author David Schweinsberg + * @author rbri + */ +public class CSSStyleRuleImpl extends AbstractCSSRuleImpl implements CSSStyleRule { + + private static final long serialVersionUID = -697009251364657426L; + + private SelectorList selectors_; + private CSSStyleDeclaration style_; + + public SelectorList getSelectors() { + return selectors_; + } + + public void setSelectors(final SelectorList selectors) { + selectors_ = selectors; + } + + public CSSStyleRuleImpl(final CSSStyleSheetImpl parentStyleSheet, + final CSSRule parentRule, final SelectorList selectors) { + super(parentStyleSheet, parentRule); + selectors_ = selectors; + } + + public CSSStyleRuleImpl() { + super(); + } + + public short getType() { + return STYLE_RULE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCssText(final CSSFormat format) { + final CSSStyleDeclaration style = getStyle(); + if (null == style) { + return ""; + } + + final String selectorText = ((CSSFormatable) selectors_).getCssText(format); + final String styleText = ((CSSFormatable) style).getCssText(format); + + if (null == styleText || styleText.length() == 0) { + return selectorText + " { }"; + } + + if (format != null && format.getPropertiesInSeparateLines()) { + return selectorText + " {" + styleText + "}"; + } + + return selectorText + " { " + styleText + " }"; + } + + public void setCssText(final String cssText) throws DOMException { + final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheetImpl(); + if (parentStyleSheet != null && parentStyleSheet.isReadOnly()) { + throw new DOMExceptionImpl( + DOMException.NO_MODIFICATION_ALLOWED_ERR, + DOMExceptionImpl.READ_ONLY_STYLE_SHEET); + } + + try { + final InputSource is = new InputSource(new StringReader(cssText)); + final CSSOMParser parser = new CSSOMParser(); + final CSSRule r = parser.parseRule(is); + + // The rule must be a style rule + if (r.getType() == CSSRule.STYLE_RULE) { + selectors_ = ((CSSStyleRuleImpl) r).selectors_; + style_ = ((CSSStyleRuleImpl) r).style_; + } + else { + throw new DOMExceptionImpl( + DOMException.INVALID_MODIFICATION_ERR, + DOMExceptionImpl.EXPECTING_STYLE_RULE); + } + } + catch (final CSSException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + catch (final IOException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + } + + public String getSelectorText() { + return selectors_.toString(); + } + + public void setSelectorText(final String selectorText) throws DOMException { + final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheetImpl(); + if (parentStyleSheet != null && parentStyleSheet.isReadOnly()) { + throw new DOMExceptionImpl( + DOMException.NO_MODIFICATION_ALLOWED_ERR, + DOMExceptionImpl.READ_ONLY_STYLE_SHEET); + } + + try { + final InputSource is = new InputSource(new StringReader(selectorText)); + final CSSOMParser parser = new CSSOMParser(); + selectors_ = parser.parseSelectors(is); + } + catch (final CSSException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + catch (final IOException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + } + + public CSSStyleDeclaration getStyle() { + return style_; + } + + public void setStyle(final CSSStyleDeclaration style) { + style_ = style; + } + + @Override + public String toString() { + return getCssText(); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof CSSStyleRule)) { + return false; + } + final CSSStyleRule csr = (CSSStyleRule) obj; + return super.equals(obj) + && LangUtils.equals(getSelectorText(), csr.getSelectorText()) + && LangUtils.equals(getStyle(), csr.getStyle()); + } + + @Override + public int hashCode() { + int hash = super.hashCode(); + hash = LangUtils.hashCode(hash, selectors_); + hash = LangUtils.hashCode(hash, style_); + return hash; + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSStyleSheetImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSStyleSheetImpl.java new file mode 100644 index 000000000..836f31fd8 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSStyleSheetImpl.java @@ -0,0 +1,411 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.io.StringReader; +import java.net.URI; +import java.net.URISyntaxException; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.CSSOMParser; +import com.fr.third.steadystate.css.util.ThrowCssExceptionErrorHandler; +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.InputSource; +import org.w3c.css.sac.SACMediaList; +import org.w3c.dom.DOMException; +import org.w3c.dom.Node; +import org.w3c.dom.css.CSSImportRule; +import org.w3c.dom.css.CSSRule; +import org.w3c.dom.css.CSSRuleList; +import org.w3c.dom.css.CSSStyleSheet; +import org.w3c.dom.stylesheets.MediaList; +import org.w3c.dom.stylesheets.StyleSheet; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.util.LangUtils; + +/** + * Implementation of {@link CSSStyleSheet}. + * + * @author David Schweinsberg + * @author rbri + */ +public class CSSStyleSheetImpl implements CSSStyleSheet, CSSFormatable, Serializable { + + private static final long serialVersionUID = -2300541300646796363L; + + private boolean disabled_; + private Node ownerNode_; + private StyleSheet parentStyleSheet_; + private String href_; + private String title_; + private MediaList media_; + private CSSRule ownerRule_; + private boolean readOnly_; + private CSSRuleList cssRules_; + private String baseUri_; + + public void setMedia(final MediaList media) { + media_ = media; + } + + private String getBaseUri() { + return baseUri_; + } + + public void setBaseUri(final String baseUri) { + baseUri_ = baseUri; + } + + public CSSStyleSheetImpl() { + super(); + } + + public String getType() { + return "text/css"; + } + + public boolean getDisabled() { + return disabled_; + } + + /** + * We will need to respond more fully if a stylesheet is disabled, probably + * by generating an event for the main application. + */ + public void setDisabled(final boolean disabled) { + disabled_ = disabled; + } + + public Node getOwnerNode() { + return ownerNode_; + } + + public StyleSheet getParentStyleSheet() { + return parentStyleSheet_; + } + + public String getHref() { + return href_; + } + + public String getTitle() { + return title_; + } + + public MediaList getMedia() { + return media_; + } + + public CSSRule getOwnerRule() { + return ownerRule_; + } + + public CSSRuleList getCssRules() { + if (cssRules_ == null) { + cssRules_ = new CSSRuleListImpl(); + } + return cssRules_; + } + + public int insertRule(final String rule, final int index) throws DOMException { + if (readOnly_) { + throw new DOMExceptionImpl( + DOMException.NO_MODIFICATION_ALLOWED_ERR, + DOMExceptionImpl.READ_ONLY_STYLE_SHEET); + } + + try { + final InputSource is = new InputSource(new StringReader(rule)); + final CSSOMParser parser = new CSSOMParser(); + parser.setParentStyleSheet(this); + parser.setErrorHandler(ThrowCssExceptionErrorHandler.INSTANCE); + final CSSRule r = parser.parseRule(is); + + if (r == null) { + // this should neven happen because of the ThrowCssExceptionErrorHandler + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + "Parsing rule '" + rule + "' failed."); + } + + if (getCssRules().getLength() > 0) { + // We need to check that this type of rule can legally go into + // the requested position. + int msg = -1; + if (r.getType() == CSSRule.CHARSET_RULE) { + + // Index must be 0, and there can be only one charset rule + if (index != 0) { + msg = DOMExceptionImpl.CHARSET_NOT_FIRST; + } + else if (getCssRules().item(0).getType() == CSSRule.CHARSET_RULE) { + msg = DOMExceptionImpl.CHARSET_NOT_UNIQUE; + } + } + else if (r.getType() == CSSRule.IMPORT_RULE) { + // Import rules must preceed all other rules (except + // charset rules) + if (index <= getCssRules().getLength()) { + for (int i = 0; i < index; i++) { + final int rt = getCssRules().item(i).getType(); + if ((rt != CSSRule.CHARSET_RULE) && (rt != CSSRule.IMPORT_RULE)) { + msg = DOMExceptionImpl.IMPORT_NOT_FIRST; + break; + } + } + } + } + else { + if (index <= getCssRules().getLength()) { + for (int i = index; i < getCssRules().getLength(); i++) { + final int rt = getCssRules().item(i).getType(); + if ((rt == CSSRule.CHARSET_RULE) || (rt == CSSRule.IMPORT_RULE)) { + msg = DOMExceptionImpl.INSERT_BEFORE_IMPORT; + break; + } + } + } + } + if (msg > -1) { + throw new DOMExceptionImpl(DOMException.HIERARCHY_REQUEST_ERR, msg); + } + } + + // Insert the rule into the list of rules + ((CSSRuleListImpl) getCssRules()).insert(r, index); + + } + catch (final IndexOutOfBoundsException e) { + throw new DOMExceptionImpl( + DOMException.INDEX_SIZE_ERR, + DOMExceptionImpl.INDEX_OUT_OF_BOUNDS, + e.getMessage()); + } + catch (final CSSException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + catch (final IOException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + return index; + } + + public void deleteRule(final int index) throws DOMException { + if (readOnly_) { + throw new DOMExceptionImpl( + DOMException.NO_MODIFICATION_ALLOWED_ERR, + DOMExceptionImpl.READ_ONLY_STYLE_SHEET); + } + + try { + ((CSSRuleListImpl) getCssRules()).delete(index); + } + catch (final IndexOutOfBoundsException e) { + throw new DOMExceptionImpl( + DOMException.INDEX_SIZE_ERR, + DOMExceptionImpl.INDEX_OUT_OF_BOUNDS, + e.getMessage()); + } + } + + public boolean isReadOnly() { + return readOnly_; + } + + public void setReadOnly(final boolean b) { + readOnly_ = b; + } + + public void setOwnerNode(final Node ownerNode) { + ownerNode_ = ownerNode; + } + + public void setParentStyleSheet(final StyleSheet parentStyleSheet) { + parentStyleSheet_ = parentStyleSheet; + } + + public void setHref(final String href) { + href_ = href; + } + + public void setTitle(final String title) { + title_ = title; + } + + public void setMediaText(final String mediaText) { + final InputSource source = new InputSource(new StringReader(mediaText)); + try { + final CSSOMParser parser = new CSSOMParser(); + final SACMediaList sml = parser.parseMedia(source); + media_ = new MediaListImpl(sml); + } + catch (final IOException e) { + // TODO handle exception + } + } + + public void setOwnerRule(final CSSRule ownerRule) { + ownerRule_ = ownerRule; + } + + public void setCssRules(final CSSRuleList rules) { + cssRules_ = rules; + } + + /** + * Same as {@link #getCssText(CSSFormat)} but using the default format. + * + * @return the formated string + */ + public String getCssText() { + return getCssText(null); + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final CSSRuleList rules = getCssRules(); + if (rules instanceof CSSFormatable) { + return ((CSSRuleListImpl) rules).getCssText(format); + } + return getCssRules().toString(); + } + + @Override + public String toString() { + return getCssText(null); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof CSSStyleSheet)) { + return false; + } + final CSSStyleSheet css = (CSSStyleSheet) obj; + boolean eq = LangUtils.equals(getCssRules(), css.getCssRules()); + eq = eq && (getDisabled() == css.getDisabled()); + eq = eq && LangUtils.equals(getHref(), css.getHref()); + eq = eq && LangUtils.equals(getMedia(), css.getMedia()); + // TODO implement some reasonful equals method for ownerNode +// eq = eq && Utils.equals(getOwnerNode(), css.getOwnerNode()); + // don't use ownerNode and parentStyleSheet in equals() + // recursive loop -> stack overflow! + eq = eq && LangUtils.equals(getTitle(), css.getTitle()); + return eq; + } + + @Override + public int hashCode() { + int hash = LangUtils.HASH_SEED; + hash = LangUtils.hashCode(hash, baseUri_); + hash = LangUtils.hashCode(hash, cssRules_); + hash = LangUtils.hashCode(hash, disabled_); + hash = LangUtils.hashCode(hash, href_); + hash = LangUtils.hashCode(hash, media_); + hash = LangUtils.hashCode(hash, ownerNode_); + // don't use ownerNode and parentStyleSheet in hashCode() + // recursive loop -> stack overflow! + hash = LangUtils.hashCode(hash, readOnly_); + hash = LangUtils.hashCode(hash, title_); + return hash; + } + + private void writeObject(final ObjectOutputStream out) throws IOException { + out.writeObject(baseUri_); + out.writeObject(cssRules_); + out.writeBoolean(disabled_); + out.writeObject(href_); + out.writeObject(media_); + // TODO ownerNode may not be serializable! +// out.writeObject(ownerNode); + out.writeBoolean(readOnly_); + out.writeObject(title_); + } + + private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { + baseUri_ = (String) in.readObject(); + cssRules_ = (CSSRuleList) in.readObject(); + if (cssRules_ != null) { + for (int i = 0; i < cssRules_.getLength(); i++) { + final CSSRule cssRule = cssRules_.item(i); + if (cssRule instanceof AbstractCSSRuleImpl) { + ((AbstractCSSRuleImpl) cssRule).setParentStyleSheet(this); + } + } + } + disabled_ = in.readBoolean(); + href_ = (String) in.readObject(); + media_ = (MediaList) in.readObject(); + // TODO ownerNode may not be serializable! +// ownerNode = (Node) in.readObject(); + readOnly_ = in.readBoolean(); + title_ = (String) in.readObject(); + } + + /** + * Imports referenced CSSStyleSheets. + * + * @param recursive true if the import should be done + * recursively, false otherwise + */ + public void importImports(final boolean recursive) throws DOMException { + for (int i = 0; i < getCssRules().getLength(); i++) { + final CSSRule cssRule = getCssRules().item(i); + if (cssRule.getType() == CSSRule.IMPORT_RULE) { + final CSSImportRule cssImportRule = (CSSImportRule) cssRule; + try { + final URI importURI = new URI(getBaseUri()).resolve(cssImportRule.getHref()); + final CSSStyleSheetImpl importedCSS = (CSSStyleSheetImpl) + new CSSOMParser().parseStyleSheet(new InputSource( + importURI.toString()), null, importURI.toString()); + if (recursive) { + importedCSS.importImports(recursive); + } + final MediaList mediaList = cssImportRule.getMedia(); + if (mediaList.getLength() == 0) { + mediaList.appendMedium("all"); + } + final CSSMediaRuleImpl cssMediaRule = new CSSMediaRuleImpl(this, null, mediaList); + cssMediaRule.setRuleList((CSSRuleListImpl) importedCSS.getCssRules()); + deleteRule(i); + ((CSSRuleListImpl) getCssRules()).insert(cssMediaRule, i); + } + catch (final URISyntaxException e) { + throw new DOMException(DOMException.SYNTAX_ERR, e.getLocalizedMessage()); + } + catch (final IOException e) { + // TODO handle exception + } + } + } + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSStyleSheetListImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSStyleSheetListImpl.java new file mode 100644 index 000000000..14a98d8cb --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSStyleSheetListImpl.java @@ -0,0 +1,126 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import com.fr.third.steadystate.css.util.LangUtils; +import org.w3c.dom.css.CSSStyleSheet; + +import org.w3c.dom.stylesheets.StyleSheet; +import org.w3c.dom.stylesheets.StyleSheetList; + +/** + * Implementation of {@link StyleSheetList}. + * + * @author Johannes Koch + */ +public class CSSStyleSheetListImpl implements StyleSheetList { + private List cssStyleSheets_; + + public List getCSSStyleSheets() { + if (cssStyleSheets_ == null) { + cssStyleSheets_ = new ArrayList(); + } + return cssStyleSheets_; + } + + public void setCSSStyleSheets(final List cssStyleSheets) { + cssStyleSheets_ = cssStyleSheets; + } + + /** + * Creates a new instance of CSSStyleSheetListImpl + */ + public CSSStyleSheetListImpl() { + super(); + } + + // start StyleSheetList + public int getLength() { + return getCSSStyleSheets().size(); + } + + public StyleSheet item(final int index) { + return getCSSStyleSheets().get(index); + } + + /** + * Adds a CSSStyleSheet. + * + * @param cssStyleSheet the CSSStyleSheet + */ + public void add(final CSSStyleSheet cssStyleSheet) { + getCSSStyleSheets().add(cssStyleSheet); + } + // end StyleSheetList + + /** + * Merges all StyleSheets in this list into one. + * + * @return the new (merged) StyleSheet + */ + public StyleSheet merge() { + final CSSStyleSheetImpl merged = new CSSStyleSheetImpl(); + final CSSRuleListImpl cssRuleList = new CSSRuleListImpl(); + final Iterator it = getCSSStyleSheets().iterator(); + while (it.hasNext()) { + final CSSStyleSheetImpl cssStyleSheet = (CSSStyleSheetImpl) it.next(); + final CSSMediaRuleImpl cssMediaRule = new CSSMediaRuleImpl(merged, null, cssStyleSheet.getMedia()); + cssMediaRule.setRuleList((CSSRuleListImpl) cssStyleSheet.getCssRules()); + cssRuleList.add(cssMediaRule); + } + merged.setCssRules(cssRuleList); + merged.setMediaText("all"); + return merged; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof StyleSheetList)) { + return false; + } + final StyleSheetList ssl = (StyleSheetList) obj; + return equalsStyleSheets(ssl); + } + + private boolean equalsStyleSheets(final StyleSheetList ssl) { + if ((ssl == null) || (getLength() != ssl.getLength())) { + return false; + } + for (int i = 0; i < getLength(); i++) { + final StyleSheet styleSheet1 = item(i); + final StyleSheet styleSheet2 = ssl.item(i); + if (!LangUtils.equals(styleSheet1, styleSheet2)) { + return false; + } + } + return true; + } + + @Override + public int hashCode() { + int hash = LangUtils.HASH_SEED; + hash = LangUtils.hashCode(hash, cssStyleSheets_); + return hash; + } + +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSUnknownRuleImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSUnknownRuleImpl.java new file mode 100644 index 000000000..b8eb14563 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSUnknownRuleImpl.java @@ -0,0 +1,140 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.io.IOException; +import java.io.StringReader; + +import com.fr.third.steadystate.css.parser.CSSOMParser; +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.InputSource; +import org.w3c.dom.DOMException; +import org.w3c.dom.css.CSSRule; +import org.w3c.dom.css.CSSUnknownRule; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.util.LangUtils; + +/** + * Implementation of {@link CSSUnknownRule}. + * + * @author David Schweinsberg + * @author rbri + */ +public class CSSUnknownRuleImpl extends AbstractCSSRuleImpl implements CSSUnknownRule { + + private static final long serialVersionUID = -268104019127675990L; + + private String text_; + + public String getText() { + return text_; + } + + public void setText(final String text) { + text_ = text; + } + + public CSSUnknownRuleImpl( + final CSSStyleSheetImpl parentStyleSheet, + final CSSRule parentRule, + final String text) { + super(parentStyleSheet, parentRule); + text_ = text; + } + + public CSSUnknownRuleImpl() { + super(); + } + + public short getType() { + return UNKNOWN_RULE; + } + + /** + * {@inheritDoc} + */ + @Override + public String getCssText(final CSSFormat format) { + if (null == text_) { + return ""; + } + return text_; + } + + public void setCssText(final String cssText) throws DOMException { + final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheetImpl(); + if (parentStyleSheet != null && parentStyleSheet.isReadOnly()) { + throw new DOMExceptionImpl( + DOMException.NO_MODIFICATION_ALLOWED_ERR, + DOMExceptionImpl.READ_ONLY_STYLE_SHEET); + } + + try { + final InputSource is = new InputSource(new StringReader(cssText)); + final CSSOMParser parser = new CSSOMParser(); + final CSSRule r = parser.parseRule(is); + + // The rule must be an unknown rule + if (r.getType() == CSSRule.UNKNOWN_RULE) { + text_ = ((CSSUnknownRuleImpl) r).text_; + } + else { + throw new DOMExceptionImpl( + DOMException.INVALID_MODIFICATION_ERR, + DOMExceptionImpl.EXPECTING_FONT_FACE_RULE); + } + } + catch (final CSSException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + catch (final IOException e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + } + + @Override + public String toString() { + return getCssText(null); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof CSSUnknownRule)) { + return false; + } + final CSSUnknownRule cur = (CSSUnknownRule) obj; + return super.equals(obj) + && LangUtils.equals(getCssText(), cur.getCssText()); + } + + @Override + public int hashCode() { + int hash = super.hashCode(); + hash = LangUtils.hashCode(hash, text_); + return hash; + } + +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSValueImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSValueImpl.java new file mode 100644 index 000000000..023a0ccf1 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSValueImpl.java @@ -0,0 +1,431 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.io.StringReader; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.CSSOMParser; +import com.fr.third.steadystate.css.parser.LexicalUnitImpl; +import com.fr.third.steadystate.css.userdata.UserDataConstants; +import org.w3c.css.sac.InputSource; +import org.w3c.css.sac.LexicalUnit; +import org.w3c.css.sac.Locator; +import org.w3c.dom.DOMException; +import org.w3c.dom.css.CSSPrimitiveValue; +import org.w3c.dom.css.CSSValue; +import org.w3c.dom.css.CSSValueList; +import org.w3c.dom.css.Counter; +import org.w3c.dom.css.RGBColor; +import org.w3c.dom.css.Rect; + +import com.fr.third.steadystate.css.util.LangUtils; + +/** + * The CSSValueImpl class can represent either a + * CSSPrimitiveValue or a CSSValueList so that + * the type can successfully change when using setCssText. + * + * TODO: + * Float unit conversions, + * A means of checking valid primitive types for properties + * + * @author David Schweinsberg + * @author rbri + */ +public class CSSValueImpl extends CSSOMObjectImpl implements CSSPrimitiveValue, CSSValueList, CSSFormatable { + + private static final long serialVersionUID = 406281136418322579L; + + private Object value_; + + public Object getValue() { + return value_; + } + + public void setValue(final Object value) { + value_ = value; + } + + /** + * Constructor + */ + public CSSValueImpl(final LexicalUnit value, final boolean forcePrimitive) { + LexicalUnit parameters = null; + try { + parameters = value.getParameters(); + } + catch (final IllegalStateException e) { + // Batik SAC parser throws IllegalStateException in some cases + } + + if (!forcePrimitive && (value.getNextLexicalUnit() != null)) { + value_ = getValues(value); + } + else if (parameters != null) { + if (value.getLexicalUnitType() == LexicalUnit.SAC_RECT_FUNCTION) { + // Rect + value_ = new RectImpl(value.getParameters()); + } + else if (value.getLexicalUnitType() == LexicalUnit.SAC_RGBCOLOR) { + // RGBColor + value_ = new RGBColorImpl(value.getParameters()); + } + else if (value.getLexicalUnitType() == LexicalUnit.SAC_COUNTER_FUNCTION) { + // Counter + value_ = new CounterImpl(false, value.getParameters()); + } + else if (value.getLexicalUnitType() == LexicalUnit.SAC_COUNTERS_FUNCTION) { + // Counter + value_ = new CounterImpl(true, value.getParameters()); + } + else { + value_ = value; + } + } + else { + // We need to be a CSSPrimitiveValue + value_ = value; + } + + if (value instanceof LexicalUnitImpl) { + final Locator locator = ((LexicalUnitImpl) value).getLocator(); + if (locator != null) { + setUserData(UserDataConstants.KEY_LOCATOR, locator); + } + } + } + + public CSSValueImpl() { + super(); + } + + private List getValues(final LexicalUnit value) { + final List values = new ArrayList(); + LexicalUnit lu = value; + while (lu != null) { + values.add(new CSSValueImpl(lu, true)); + lu = lu.getNextLexicalUnit(); + } + return values; + } + + public CSSValueImpl(final LexicalUnit value) { + this(value, false); + } + + public String getCssText() { + return getCssText(null); + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + if (getCssValueType() == CSS_VALUE_LIST) { + + // Create the string from the LexicalUnits so we include the correct + // operators in the string + final StringBuilder sb = new StringBuilder(); + final List> list = (List>) value_; + final Iterator> it = list.iterator(); + + boolean separate = false; + while (it.hasNext()) { + final Object o = it.next(); + + final CSSValueImpl cssValue = (CSSValueImpl) o; + if (separate) { + if (cssValue.value_ instanceof LexicalUnit) { + final LexicalUnit lu = (LexicalUnit) cssValue.value_; + if (lu.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) { + sb.append(" "); + } + } + else { + sb.append(" "); + } + } + + if (cssValue.value_ instanceof CSSFormatable) { + sb.append(((CSSFormatable) o).getCssText(format)); + } + else { + sb.append(o.toString()); + } + separate = true; + } + return sb.toString(); + } + if (value_ instanceof CSSFormatable) { + return ((CSSFormatable) value_).getCssText(format); + } + return value_ != null ? value_.toString() : ""; + } + + public void setCssText(final String cssText) throws DOMException { + try { + final InputSource is = new InputSource(new StringReader(cssText)); + final CSSOMParser parser = new CSSOMParser(); + final CSSValueImpl v2 = (CSSValueImpl) parser.parsePropertyValue(is); + value_ = v2.value_; + setUserDataMap(v2.getUserDataMap()); + } + catch (final Exception e) { + throw new DOMExceptionImpl( + DOMException.SYNTAX_ERR, + DOMExceptionImpl.SYNTAX_ERROR, + e.getMessage()); + } + } + + public short getCssValueType() { + if (value_ instanceof List) { + return CSS_VALUE_LIST; + } + if ((value_ instanceof LexicalUnit) + && (((LexicalUnit) value_).getLexicalUnitType() == LexicalUnit.SAC_INHERIT)) { + return CSS_INHERIT; + } + return CSS_PRIMITIVE_VALUE; + } + + public short getPrimitiveType() { + if (value_ instanceof LexicalUnit) { + final LexicalUnit lu = (LexicalUnit) value_; + switch (lu.getLexicalUnitType()) { + case LexicalUnit.SAC_INHERIT: + return CSS_IDENT; + case LexicalUnit.SAC_INTEGER: + case LexicalUnit.SAC_REAL: + return CSS_NUMBER; + case LexicalUnit.SAC_EM: + return CSS_EMS; + case LexicalUnit.SAC_EX: + return CSS_EXS; + case LexicalUnit.SAC_PIXEL: + return CSS_PX; + case LexicalUnit.SAC_INCH: + return CSS_IN; + case LexicalUnit.SAC_CENTIMETER: + return CSS_CM; + case LexicalUnit.SAC_MILLIMETER: + return CSS_MM; + case LexicalUnit.SAC_POINT: + return CSS_PT; + case LexicalUnit.SAC_PICA: + return CSS_PC; + case LexicalUnit.SAC_PERCENTAGE: + return CSS_PERCENTAGE; + case LexicalUnit.SAC_URI: + return CSS_URI; + case LexicalUnit.SAC_COUNTER_FUNCTION: + // case LexicalUnit.SAC_COUNTERS_FUNCTION: + return CSS_COUNTER; + // case LexicalUnit.SAC_RGBCOLOR: + // return CSS_RGBCOLOR; + case LexicalUnit.SAC_DEGREE: + return CSS_DEG; + case LexicalUnit.SAC_GRADIAN: + return CSS_GRAD; + case LexicalUnit.SAC_RADIAN: + return CSS_RAD; + case LexicalUnit.SAC_MILLISECOND: + return CSS_MS; + case LexicalUnit.SAC_SECOND: + return CSS_S; + case LexicalUnit.SAC_HERTZ: + return CSS_HZ; + case LexicalUnit.SAC_KILOHERTZ: + return CSS_KHZ; + case LexicalUnit.SAC_IDENT: + return CSS_IDENT; + case LexicalUnit.SAC_STRING_VALUE: + return CSS_STRING; + case LexicalUnit.SAC_ATTR: + return CSS_ATTR; + // case LexicalUnit.SAC_RECT_FUNCTION: + // return CSS_RECT; + case LexicalUnit.SAC_UNICODERANGE: + case LexicalUnit.SAC_SUB_EXPRESSION: + case LexicalUnit.SAC_FUNCTION: + return CSS_STRING; + case LexicalUnit.SAC_DIMENSION: + return CSS_DIMENSION; + default: + return CSS_UNKNOWN; + } + } + else if (value_ instanceof RectImpl) { + return CSS_RECT; + } + else if (value_ instanceof RGBColorImpl) { + return CSS_RGBCOLOR; + } + else if (value_ instanceof CounterImpl) { + return CSS_COUNTER; + } + return CSS_UNKNOWN; + } + + public void setFloatValue(final short unitType, final float floatValue) throws DOMException { + value_ = LexicalUnitImpl.createNumber(null, floatValue); + } + + public float getFloatValue(final short unitType) throws DOMException { + if (value_ instanceof LexicalUnit) { + final LexicalUnit lu = (LexicalUnit) value_; + return lu.getFloatValue(); + } + throw new DOMExceptionImpl( + DOMException.INVALID_ACCESS_ERR, + DOMExceptionImpl.FLOAT_ERROR); + + // We need to attempt a conversion + // return 0; + } + + public void setStringValue(final short stringType, final String stringValue) throws DOMException { + switch (stringType) { + case CSS_STRING: + value_ = LexicalUnitImpl.createString(null, stringValue); + break; + case CSS_URI: + value_ = LexicalUnitImpl.createURI(null, stringValue); + break; + case CSS_IDENT: + value_ = LexicalUnitImpl.createIdent(null, stringValue); + break; + case CSS_ATTR: + // _value = LexicalUnitImpl.createAttr(null, stringValue); + // break; + throw new DOMExceptionImpl( + DOMException.NOT_SUPPORTED_ERR, + DOMExceptionImpl.NOT_IMPLEMENTED); + default: + throw new DOMExceptionImpl( + DOMException.INVALID_ACCESS_ERR, + DOMExceptionImpl.STRING_ERROR); + } + } + + /** + * TODO: return a value for a list type + */ + public String getStringValue() throws DOMException { + if (value_ instanceof LexicalUnit) { + final LexicalUnit lu = (LexicalUnit) value_; + if ((lu.getLexicalUnitType() == LexicalUnit.SAC_IDENT) + || (lu.getLexicalUnitType() == LexicalUnit.SAC_STRING_VALUE) + || (lu.getLexicalUnitType() == LexicalUnit.SAC_URI) + || (lu.getLexicalUnitType() == LexicalUnit.SAC_INHERIT) + || (lu.getLexicalUnitType() == LexicalUnit.SAC_ATTR)) { + return lu.getStringValue(); + } + + // for rgba values we are using this type + if (lu.getLexicalUnitType() == LexicalUnit.SAC_FUNCTION) { + return lu.toString(); + } + } + else if (value_ instanceof List) { + return null; + } + + throw new DOMExceptionImpl( + DOMException.INVALID_ACCESS_ERR, + DOMExceptionImpl.STRING_ERROR); + } + + public Counter getCounterValue() throws DOMException { + if (value_ instanceof Counter) { + return (Counter) value_; + } + + throw new DOMExceptionImpl( + DOMException.INVALID_ACCESS_ERR, + DOMExceptionImpl.COUNTER_ERROR); + } + + public Rect getRectValue() throws DOMException { + if (value_ instanceof Rect) { + return (Rect) value_; + } + + throw new DOMExceptionImpl( + DOMException.INVALID_ACCESS_ERR, + DOMExceptionImpl.RECT_ERROR); + } + + public RGBColor getRGBColorValue() throws DOMException { + if (value_ instanceof RGBColor) { + return (RGBColor) value_; + } + + throw new DOMExceptionImpl( + DOMException.INVALID_ACCESS_ERR, + DOMExceptionImpl.RGBCOLOR_ERROR); + } + + @SuppressWarnings("unchecked") + public int getLength() { + if (value_ instanceof List) { + return ((List) value_).size(); + } + return 0; + } + + @SuppressWarnings("unchecked") + public CSSValue item(final int index) { + if (value_ instanceof List) { + final List list = (List) value_; + return list.get(index); + } + return null; + } + + @Override + public String toString() { + return getCssText(null); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof CSSValue)) { + return false; + } + final CSSValue cv = (CSSValue) obj; + // TODO to be improved! + return super.equals(obj) + && (getCssValueType() == cv.getCssValueType()) + && LangUtils.equals(getCssText(), cv.getCssText()); + } + + @Override + public int hashCode() { + int hash = super.hashCode(); + hash = LangUtils.hashCode(hash, value_); + return hash; + } + +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/CounterImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CounterImpl.java new file mode 100644 index 000000000..71eb9367d --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/CounterImpl.java @@ -0,0 +1,144 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import org.w3c.css.sac.LexicalUnit; +import org.w3c.dom.DOMException; +import org.w3c.dom.css.Counter; + +import com.fr.third.steadystate.css.format.CSSFormat; + +/** + * Implementation of {@link Counter}. + * + * @author David Schweinsberg + * @author rbri + */ +public class CounterImpl implements Counter, CSSFormatable, Serializable { + + private static final long serialVersionUID = 7996279151817598904L; + + private String identifier_; + private String listStyle_; + private String separator_; + + public void setIdentifier(final String identifier) { + identifier_ = identifier; + } + + public void setListStyle(final String listStyle) { + listStyle_ = listStyle; + } + + public void setSeparator(final String separator) { + separator_ = separator; + } + + /** + * Creates new CounterImpl + */ + public CounterImpl(final boolean separatorSpecified, final LexicalUnit lu) throws DOMException { + LexicalUnit next = lu; + identifier_ = next.getStringValue(); + next = next.getNextLexicalUnit(); // ',' + if (next != null) { + if (next.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) { + // error + throw new DOMException(DOMException.SYNTAX_ERR, + "Counter parameters must be separated by ','."); + } + next = next.getNextLexicalUnit(); + if (separatorSpecified && (next != null)) { + separator_ = next.getStringValue(); + next = next.getNextLexicalUnit(); // ',' + if (next != null) { + if (next.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) { + // error + throw new DOMException(DOMException.SYNTAX_ERR, + "Counter parameters must be separated by ','."); + } + next = next.getNextLexicalUnit(); + } + } + if (next != null) { + listStyle_ = next.getStringValue(); + next = next.getNextLexicalUnit(); + if (next != null) { + // error + throw new DOMException(DOMException.SYNTAX_ERR, + "Too many parameters for counter function."); + } + } + } + } + + public CounterImpl() { + super(); + } + + public String getIdentifier() { + return identifier_; + } + + public String getListStyle() { + return listStyle_; + } + + public String getSeparator() { + return separator_; + } + + /** + * Same as {@link #getCssText(CSSFormat)} but using the default format. + * + * @return the formated string + */ + public String getCssText() { + return getCssText(null); + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder(); + if (separator_ == null) { + // This is a 'counter()' function + sb.append("counter("); + } + else { + // This is a 'counters()' function + sb.append("counters("); + } + sb.append(identifier_); + if (separator_ != null) { + sb.append(", \"").append(separator_).append("\""); + } + if (listStyle_ != null) { + sb.append(", ").append(listStyle_); + } + sb.append(")"); + return sb.toString(); + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/DOMExceptionImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/DOMExceptionImpl.java new file mode 100644 index 000000000..5e8318c1f --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/DOMExceptionImpl.java @@ -0,0 +1,80 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.util.Locale; +import java.util.ResourceBundle; + +import org.w3c.dom.DOMException; + +/** + * Custom {@link DOMException} extension. + * + * @author David Schweinsberg + * @author rbri + */ +public class DOMExceptionImpl extends DOMException { + + private static final long serialVersionUID = 7365733663951145145L; + + public static final int SYNTAX_ERROR = 0; + public static final int INDEX_OUT_OF_BOUNDS = 1; + public static final int READ_ONLY_STYLE_SHEET = 2; + public static final int EXPECTING_UNKNOWN_RULE = 3; + public static final int EXPECTING_STYLE_RULE = 4; + public static final int EXPECTING_CHARSET_RULE = 5; + public static final int EXPECTING_IMPORT_RULE = 6; + public static final int EXPECTING_MEDIA_RULE = 7; + public static final int EXPECTING_FONT_FACE_RULE = 8; + public static final int EXPECTING_PAGE_RULE = 9; + public static final int FLOAT_ERROR = 10; + public static final int STRING_ERROR = 11; + public static final int COUNTER_ERROR = 12; + public static final int RECT_ERROR = 13; + public static final int RGBCOLOR_ERROR = 14; + public static final int CHARSET_NOT_FIRST = 15; + public static final int CHARSET_NOT_UNIQUE = 16; + public static final int IMPORT_NOT_FIRST = 17; + public static final int NOT_FOUND = 18; + public static final int NOT_IMPLEMENTED = 19; + public static final int INSERT_BEFORE_IMPORT = 20; + + private static ResourceBundle ExceptionResource_ = + ResourceBundle.getBundle( + "com.steadystate.css.parser.ExceptionResource", + Locale.getDefault()); + + public DOMExceptionImpl(final short code, final int messageKey) { + this(code, messageKey, null); + } + + public DOMExceptionImpl(final int code, final int messageKey) { + this(code, messageKey, null); + } + + public DOMExceptionImpl(final int code, final int messageKey, final String info) { + super((short) code, constructMessage(messageKey, info)); + } + + private static String constructMessage(final int key, final String info) { + final String messageKey = "s" + String.valueOf(key); + String message = ExceptionResource_.getString(messageKey); + if (null != info && info.length() > 0) { + message = message + " (" + info + ")"; + } + return message; + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/MediaListImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/MediaListImpl.java new file mode 100644 index 000000000..744a2af76 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/MediaListImpl.java @@ -0,0 +1,210 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.io.IOException; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.List; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.parser.CSSOMParser; +import com.fr.third.steadystate.css.parser.Locatable; +import com.fr.third.steadystate.css.parser.SACMediaListImpl; +import com.fr.third.steadystate.css.userdata.UserDataConstants; +import com.fr.third.steadystate.css.util.ThrowCssExceptionErrorHandler; +import org.w3c.css.sac.CSSParseException; +import org.w3c.css.sac.InputSource; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.SACMediaList; +import org.w3c.dom.DOMException; +import org.w3c.dom.stylesheets.MediaList; + +import com.fr.third.steadystate.css.parser.media.MediaQuery; +import com.fr.third.steadystate.css.util.LangUtils; + +/** + * Implements {@link MediaList}. + * + * @author David Schweinsberg + * @author rbri + */ +public class MediaListImpl extends CSSOMObjectImpl implements MediaList { + private static final long serialVersionUID = 6662784733573034870L; + + private List mediaQueries_; + + /** + * Creates new MediaList. + * @param mediaList the media list + */ + public MediaListImpl(final SACMediaList mediaList) { + this(); + + setMediaList(mediaList); + + if (mediaList instanceof Locatable) { + final Locator locator = ((Locatable) mediaList).getLocator(); + if (locator != null) { + setUserData(UserDataConstants.KEY_LOCATOR, locator); + } + } + } + + /** + * Constructor. + * The attributes are null. + */ + public MediaListImpl() { + mediaQueries_ = new ArrayList(10); + } + + public String getMediaText() { + return getMediaText(null); + } + + /** + * Returns a string representation of the rule based on the given format. + * If provided format is null, the result is the same as getCssText() + * + * @param format the formatting rules + * @return the formated string + */ + public String getMediaText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder(""); + boolean isNotFirst = false; + for (MediaQuery mediaQuery : mediaQueries_) { + if (isNotFirst) { + sb.append(", "); + } + else { + isNotFirst = true; + } + sb.append(mediaQuery.getCssText(format)); + } + return sb.toString(); + } + + public void setMediaText(final String mediaText) throws DOMException { + final InputSource source = new InputSource(new StringReader(mediaText)); + try { + final CSSOMParser parser = new CSSOMParser(); + parser.setErrorHandler(ThrowCssExceptionErrorHandler.INSTANCE); + final SACMediaList sml = parser.parseMedia(source); + setMediaList(sml); + } + catch (final CSSParseException e) { + throw new DOMException(DOMException.SYNTAX_ERR, e.getLocalizedMessage()); + } + catch (final IOException e) { + throw new DOMException(DOMException.NOT_FOUND_ERR, e.getLocalizedMessage()); + } + } + + public int getLength() { + return mediaQueries_.size(); + } + + public String item(final int index) { + final MediaQuery mq = mediaQuery(index); + if (null == mq) { + return null; + } + + return mq.getMedia(); + } + + public MediaQuery mediaQuery(final int index) { + if (index < 0 || (index >= mediaQueries_.size())) { + return null; + } + return mediaQueries_.get(index); + } + + public void deleteMedium(final String oldMedium) throws DOMException { + for (MediaQuery mediaQuery : mediaQueries_) { + final String str = mediaQuery.getMedia(); + if (str.equalsIgnoreCase(oldMedium)) { + mediaQueries_.remove(mediaQuery); + return; + } + } + throw new DOMExceptionImpl(DOMException.NOT_FOUND_ERR, DOMExceptionImpl.NOT_FOUND); + } + + public void appendMedium(final String newMedium) throws DOMException { + mediaQueries_.add(new MediaQuery(newMedium)); + } + + @Override + public String toString() { + return getMediaText(null); + } + + public void setMedia(final List media) { + mediaQueries_.clear(); + for (String medium : media) { + mediaQueries_.add(new MediaQuery(medium)); + } + } + + private void setMediaList(final SACMediaList mediaList) { + if (mediaList instanceof SACMediaListImpl) { + final SACMediaListImpl impl = (SACMediaListImpl) mediaList; + for (int i = 0; i < mediaList.getLength(); i++) { + mediaQueries_.add(impl.mediaQuery(i)); + } + return; + } + + for (int i = 0; i < mediaList.getLength(); i++) { + mediaQueries_.add(new MediaQuery(mediaList.item(i))); + } + } + + private boolean equalsMedia(final MediaList ml) { + if ((ml == null) || (getLength() != ml.getLength())) { + return false; + } + for (int i = 0; i < getLength(); i++) { + final String m1 = item(i); + final String m2 = ml.item(i); + if (!LangUtils.equals(m1, m2)) { + return false; + } + } + return true; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof MediaList)) { + return false; + } + final MediaList ml = (MediaList) obj; + return super.equals(obj) && equalsMedia(ml); + } + + @Override + public int hashCode() { + int hash = super.hashCode(); + hash = LangUtils.hashCode(hash, mediaQueries_); + return hash; + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/Property.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/Property.java new file mode 100644 index 000000000..fa0ffd65f --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/Property.java @@ -0,0 +1,165 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.format.CSSFormatable; +import org.w3c.dom.css.CSSValue; + +import com.fr.third.steadystate.css.util.LangUtils; + +/** + * @author David Schweinsberg + * @author rbri + */ +public class Property extends CSSOMObjectImpl implements CSSFormatable { + private static final long serialVersionUID = 8720637891949104989L; + + private String name_; + private CSSValue value_; + private boolean important_; + + /** + * Creates new Property. + * @param name the name + * @param value the value + * @param important true if the important flag set + */ + public Property(final String name, final CSSValue value, final boolean important) { + name_ = name; + value_ = value; + important_ = important; + } + + /** + * Constructor. + * The attributes are null. + */ + public Property() { + super(); + } + + /** + * Returns the name. + * @return the name + */ + public String getName() { + return name_; + } + + /** + * Sets the name to a new value. + * @param name the new name + */ + public void setName(final String name) { + name_ = name; + } + + /** + * Returns the value. + * @return the value + */ + public CSSValue getValue() { + return value_; + } + + /** + * Returns true if the important flag is set. + * @return true or false + */ + public boolean isImportant() { + return important_; + } + + /** + * Sets the value to a new value. + * @param value the new CSSValue + */ + public void setValue(final CSSValue value) { + value_ = value; + } + + /** + * Sets the important flag to a new value. + * @param important the new flag value + */ + public void setImportant(final boolean important) { + important_ = important; + } + + /** + * Same as {@link #getCssText(CSSFormat)} but using the default format. + * + * @return the formated string + */ + public String getCssText() { + return getCssText(null); + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder(); + sb.append(name_); + if (null != value_) { + sb.append(": "); + sb.append(((CSSValueImpl) value_).getCssText(format)); + } + if (important_) { + sb.append(" !important"); + } + return sb.toString(); + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return getCssText(null); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof Property)) { + return false; + } + final Property p = (Property) obj; + return super.equals(obj) + && (important_ == p.important_) + && LangUtils.equals(name_, p.name_) + && LangUtils.equals(value_, p.value_); + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + int hash = super.hashCode(); + hash = LangUtils.hashCode(hash, important_); + hash = LangUtils.hashCode(hash, name_); + hash = LangUtils.hashCode(hash, value_); + return hash; + } +} \ No newline at end of file diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/RGBColorImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/RGBColorImpl.java new file mode 100644 index 000000000..87d474829 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/RGBColorImpl.java @@ -0,0 +1,178 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import org.w3c.css.sac.LexicalUnit; +import org.w3c.dom.DOMException; +import org.w3c.dom.css.CSSPrimitiveValue; +import org.w3c.dom.css.RGBColor; + +import com.fr.third.steadystate.css.format.CSSFormat; + +/** + * Implementation of {@link RGBColor}. + * + * @author David Schweinsberg + * @author rbri + */ +public class RGBColorImpl implements RGBColor, CSSFormatable, Serializable { + + private static final long serialVersionUID = 8152675334081993160L; + private CSSPrimitiveValue red_; + private CSSPrimitiveValue green_; + private CSSPrimitiveValue blue_; + + /** + * Constructor that reads the values from the given + * chain of LexicalUnits. + * @param lu the values + * @throws DOMException in case of error + */ + public RGBColorImpl(final LexicalUnit lu) throws DOMException { + LexicalUnit next = lu; + red_ = new CSSValueImpl(next, true); + next = next.getNextLexicalUnit(); // , + if (next != null) { + if (next.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) { + // error + throw new DOMException(DOMException.SYNTAX_ERR, + "rgb parameters must be separated by ','."); + } + next = next.getNextLexicalUnit(); + if (next != null) { + green_ = new CSSValueImpl(next, true); + next = next.getNextLexicalUnit(); // , + if (next != null) { + if (next.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) { + // error + throw new DOMException(DOMException.SYNTAX_ERR, + "rgb parameters must be separated by ','."); + } + next = next.getNextLexicalUnit(); + blue_ = new CSSValueImpl(next, true); + next = next.getNextLexicalUnit(); + if (next != null) { + // error + throw new DOMException(DOMException.SYNTAX_ERR, + "Too many parameters for rgb function."); + } + } + } + } + } + + /** + * Constructor. + * The values for the colors are null. + */ + public RGBColorImpl() { + super(); + } + + /** + * Returns the red part. + */ + public CSSPrimitiveValue getRed() { + return red_; + } + + /** + * Sets the red part to a new value. + * @param red the new CSSPrimitiveValue + */ + public void setRed(final CSSPrimitiveValue red) { + red_ = red; + } + + /** + * Returns the green part. + */ + public CSSPrimitiveValue getGreen() { + return green_; + } + + /** + * Sets the green part to a new value. + * @param green the new CSSPrimitiveValue + */ + public void setGreen(final CSSPrimitiveValue green) { + green_ = green; + } + + /** + * Returns the blue part. + */ + public CSSPrimitiveValue getBlue() { + return blue_; + } + + /** + * Sets the blue part to a new value. + * @param blue the new CSSPrimitiveValue + */ + public void setBlue(final CSSPrimitiveValue blue) { + blue_ = blue; + } + + /** + * Same as {@link #getCssText(CSSFormat)} but using the default format. + * + * @return the formated string + */ + public String getCssText() { + return getCssText(null); + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder(); + if (null != format && format.isRgbAsHex()) { + sb + .append("#") + .append(getColorAsHex(red_)) + .append(getColorAsHex(green_)) + .append(getColorAsHex(blue_)); + return sb.toString(); + } + + sb + .append("rgb(") + .append(red_) + .append(", ") + .append(green_) + .append(", ") + .append(blue_) + .append(")"); + return sb.toString(); + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return getCssText(null); + } + + private String getColorAsHex(final CSSPrimitiveValue color) { + return String.format("%02x", Math.round(color.getFloatValue(LexicalUnit.SAC_INTEGER))); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/dom/RectImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/dom/RectImpl.java new file mode 100644 index 000000000..a14be836b --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/RectImpl.java @@ -0,0 +1,219 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.dom; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import org.w3c.css.sac.LexicalUnit; +import org.w3c.dom.DOMException; +import org.w3c.dom.css.CSSPrimitiveValue; +import org.w3c.dom.css.Rect; + +import com.fr.third.steadystate.css.format.CSSFormat; + +/** + * Implementation of {@link Rect}. + * + * @author David Schweinsberg + */ +public class RectImpl implements Rect, CSSFormatable, Serializable { + + private static final long serialVersionUID = -7031248513917920621L; + + private CSSPrimitiveValue top_; + private CSSPrimitiveValue right_; + private CSSPrimitiveValue bottom_; + private CSSPrimitiveValue left_; + + /** + * Constructor that reads the values from the given + * chain of LexicalUnits. + * @param lu the values + * @throws DOMException in case of error + */ + public RectImpl(final LexicalUnit lu) throws DOMException { + // top + if (lu == null) { + throw new DOMException(DOMException.SYNTAX_ERR, "Rect misses first parameter."); + } + top_ = new CSSValueImpl(lu, true); + + // right + LexicalUnit next = lu.getNextLexicalUnit(); // , + if (next == null) { + throw new DOMException(DOMException.SYNTAX_ERR, "Rect misses second parameter."); + } + + boolean isCommaSeparated = false; + if (next.getLexicalUnitType() == LexicalUnit.SAC_OPERATOR_COMMA) { + isCommaSeparated = true; + next = next.getNextLexicalUnit(); + if (next == null) { + throw new DOMException(DOMException.SYNTAX_ERR, "Rect misses second parameter."); + } + } + right_ = new CSSValueImpl(next, true); + + // bottom + next = next.getNextLexicalUnit(); + if (next == null) { + throw new DOMException(DOMException.SYNTAX_ERR, "Rect misses third parameter."); + } + if (isCommaSeparated) { + if (next.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) { + throw new DOMException(DOMException.SYNTAX_ERR, + "All or none rect parameters must be separated by ','."); + } + next = next.getNextLexicalUnit(); + if (next == null) { + throw new DOMException(DOMException.SYNTAX_ERR, "Rect misses third parameter."); + } + } + else { + if (next.getLexicalUnitType() == LexicalUnit.SAC_OPERATOR_COMMA) { + throw new DOMException(DOMException.SYNTAX_ERR, + "All or none rect parameters must be separated by ','."); + } + } + bottom_ = new CSSValueImpl(next, true); + + // left + next = next.getNextLexicalUnit(); + if (next == null) { + throw new DOMException(DOMException.SYNTAX_ERR, "Rect misses fourth parameter."); + } + if (isCommaSeparated) { + if (next.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) { + throw new DOMException(DOMException.SYNTAX_ERR, + "All or none rect parameters must be separated by ','."); + } + next = next.getNextLexicalUnit(); + if (next == null) { + throw new DOMException(DOMException.SYNTAX_ERR, "Rect misses fourth parameter."); + } + } + else { + if (next.getLexicalUnitType() == LexicalUnit.SAC_OPERATOR_COMMA) { + throw new DOMException(DOMException.SYNTAX_ERR, + "All or none rect parameters must be separated by ','."); + } + } + left_ = new CSSValueImpl(next, true); + + // too many + next = next.getNextLexicalUnit(); + if (next != null) { + throw new DOMException(DOMException.SYNTAX_ERR, "Too many parameters for rect function."); + } + } + + /** + * Constructor. + * The values for the coordinates are null. + */ + public RectImpl() { + super(); + } + + /** + * Returns the top part. + */ + public CSSPrimitiveValue getTop() { + return top_; + } + + /** + * Sets the top part to a new value. + * @param top the new CSSPrimitiveValue + */ + public void setTop(final CSSPrimitiveValue top) { + top_ = top; + } + + /** + * Returns the right part. + */ + public CSSPrimitiveValue getRight() { + return right_; + } + + /** + * Sets the right part to a new value. + * @param right the new CSSPrimitiveValue + */ + public void setRight(final CSSPrimitiveValue right) { + right_ = right; + } + + /** + * Returns the bottom part. + */ + public CSSPrimitiveValue getBottom() { + return bottom_; + } + + /** + * Sets the bottom part to a new value. + * @param bottom the new CSSPrimitiveValue + */ + public void setBottom(final CSSPrimitiveValue bottom) { + bottom_ = bottom; + } + + /** + * Returns the left part. + */ + public CSSPrimitiveValue getLeft() { + return left_; + } + + /** + * Sets the left part to a new value. + * @param left the new CSSPrimitiveValue + */ + public void setLeft(final CSSPrimitiveValue left) { + left_ = left; + } + + /** + * Same as {@link #getCssText(CSSFormat)} but using the default format. + * + * @return the formated string + */ + public String getCssText() { + return getCssText(null); + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + return new StringBuilder("rect(") + .append(top_).append(", ") + .append(right_).append(", ") + .append(bottom_).append(", ") + .append(left_).append(")").toString(); + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return getCssText(null); + } +} \ No newline at end of file diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/format/CSSFormat.java b/fine-cssparser/src/com/fr/third/steadystate/css/format/CSSFormat.java new file mode 100644 index 000000000..bbf0429cd --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/format/CSSFormat.java @@ -0,0 +1,84 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.format; + +import java.util.Arrays; + +/** + * Format object that controls the output produced by toString(CssFormat). + * + * @author rbri + */ +public class CSSFormat { + private static final String NEW_LINE = System.getProperty("line.separator"); + + private boolean rgbAsHex_; + private boolean propertiesInSeparateLines_; + private boolean useSourceStringValues_; + private String propertiesIndent_ = ""; + + public boolean isRgbAsHex() { + return rgbAsHex_; + } + + public CSSFormat setRgbAsHex(final boolean rgbAsHex) { + rgbAsHex_ = rgbAsHex; + return this; + } + + public boolean useSourceStringValues() { + return useSourceStringValues_; + } + + public CSSFormat setUseSourceStringValues(final boolean useSourceStringValues) { + useSourceStringValues_ = useSourceStringValues; + return this; + } + + public boolean getPropertiesInSeparateLines() { + return propertiesInSeparateLines_; + } + + public String getPropertiesIndent() { + return propertiesIndent_; + } + + /** + * If this value is larger than -1 the individual properties from a rule + * are rendered in separate lines; the parameter defines the indentation level. + * Set this to -1 to disable the feature (default) + * + * @param anIndent the number of blanks used for indentation + * @return the format itself + */ + public CSSFormat setPropertiesInSeparateLines(final int anIndent) { + propertiesInSeparateLines_ = anIndent > -1; + + if (anIndent > 0) { + final char[] chars = new char[anIndent]; + Arrays.fill(chars, ' '); + propertiesIndent_ = new String(chars); + } + else { + propertiesIndent_ = ""; + } + return this; + } + + public String getNewLine() { + return NEW_LINE; + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/format/CSSFormatable.java b/fine-cssparser/src/com/fr/third/steadystate/css/format/CSSFormatable.java new file mode 100644 index 000000000..049ff6f42 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/format/CSSFormatable.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.format; + +/** + * Common interface for all classes supporting formated output. + * + * @author rbri + */ +public interface CSSFormatable { + + /** + * Returns a string representation of the rule based on the given format. + * If provided format is null, the result is the same as getCssText() + * + * @param format the formatting rules + * @return the formated string + */ + String getCssText(CSSFormat format); +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/AbstractSACParser.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/AbstractSACParser.java new file mode 100644 index 000000000..1d18bed73 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/AbstractSACParser.java @@ -0,0 +1,800 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.parser; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URL; +import java.nio.charset.Charset; +import java.text.MessageFormat; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import com.fr.third.steadystate.css.sac.SelectorFactoryAdapter; +import org.w3c.css.sac.CSSParseException; +import org.w3c.css.sac.ConditionFactory; +import org.w3c.css.sac.DocumentHandler; +import org.w3c.css.sac.ErrorHandler; +import org.w3c.css.sac.InputSource; +import org.w3c.css.sac.LexicalUnit; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.Parser; +import org.w3c.css.sac.SACMediaList; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SelectorFactory; +import org.w3c.css.sac.SelectorList; +import org.w3c.dom.DOMException; + +import com.fr.third.steadystate.css.parser.selectors.ConditionFactoryImpl; +import com.fr.third.steadystate.css.parser.selectors.SelectorFactoryImpl; +import com.fr.third.steadystate.css.sac.ConditionFactoryAdapter; +import com.fr.third.steadystate.css.sac.ConditionFactoryExt; +import com.fr.third.steadystate.css.sac.DocumentHandlerAdapter; +import com.fr.third.steadystate.css.sac.DocumentHandlerExt; +import com.fr.third.steadystate.css.sac.SelectorFactoryExt; + +/** + * Base implementation of {@link Parser}. + * + * @author koch + * @author RBRi + */ +abstract class AbstractSACParser implements SACParser { + private DocumentHandlerExt documentHandler_; + private ErrorHandler errorHandler_; + private InputSource source_; + private Locale locale_; + private SelectorFactoryExt selectorFactory_; + private ConditionFactoryExt conditionFactory_; + private ResourceBundle sacParserMessages_; + + private boolean ieStarHackAccepted_; + + private static final String NUM_CHARS = "0123456789."; + + protected DocumentHandlerExt getDocumentHandler() { + if (documentHandler_ == null) { + setDocumentHandler(new HandlerBase()); + } + return documentHandler_; + } + + public void setDocumentHandler(final DocumentHandler handler) { + if (handler instanceof DocumentHandlerExt) { + documentHandler_ = (DocumentHandlerExt) handler; + } + else { + documentHandler_ = new DocumentHandlerAdapter(handler); + } + } + + protected ErrorHandler getErrorHandler() { + if (errorHandler_ == null) { + setErrorHandler(new HandlerBase()); + } + return errorHandler_; + } + + public void setErrorHandler(final ErrorHandler eh) { + errorHandler_ = eh; + } + + protected InputSource getInputSource() { + return source_; + } + + public void setIeStarHackAccepted(final boolean accepted) { + ieStarHackAccepted_ = accepted; + } + + public boolean isIeStarHackAccepted() { + return ieStarHackAccepted_; + } + + public void setLocale(final Locale locale) { + if (locale_ != locale) { + sacParserMessages_ = null; + } + locale_ = locale; + } + + protected Locale getLocale() { + if (locale_ == null) { + setLocale(Locale.getDefault()); + } + return locale_; + } + + protected SelectorFactoryExt getSelectorFactory() { + if (selectorFactory_ == null) { + selectorFactory_ = new SelectorFactoryImpl(); + } + return selectorFactory_; + } + + public void setSelectorFactory(final SelectorFactory selectorFactory) { + if (selectorFactory instanceof SelectorFactoryExt) { + selectorFactory_ = (SelectorFactoryExt) selectorFactory; + } + else { + selectorFactory_ = new SelectorFactoryAdapter(selectorFactory); + } + } + + protected ConditionFactoryExt getConditionFactory() { + if (conditionFactory_ == null) { + conditionFactory_ = new ConditionFactoryImpl(); + } + return conditionFactory_; + } + + public void setConditionFactory(final ConditionFactory conditionFactory) { + if (conditionFactory instanceof ConditionFactoryExt) { + conditionFactory_ = (ConditionFactoryExt) conditionFactory; + } + else { + conditionFactory_ = new ConditionFactoryAdapter(conditionFactory); + } + } + + protected ResourceBundle getSACParserMessages() { + if (sacParserMessages_ == null) { + try { + sacParserMessages_ = ResourceBundle.getBundle( + "com.steadystate.css.parser.SACParserMessages", + getLocale()); + } + catch (final MissingResourceException e) { + e.printStackTrace(); + } + } + return sacParserMessages_; + } + + protected Locator createLocator(final Token t) { + return new LocatorImpl(getInputSource().getURI(), + t == null ? 0 : t.beginLine, + t == null ? 0 : t.beginColumn); + } + + protected String add_escapes(final String str) { + final StringBuilder sb = new StringBuilder(); + char ch; + for (int i = 0; i < str.length(); i++) { + ch = str.charAt(i); + switch (ch) { + case 0 : + continue; + case '\b': + sb.append("\\b"); + continue; + case '\t': + sb.append("\\t"); + continue; + case '\n': + sb.append("\\n"); + continue; + case '\f': + sb.append("\\f"); + continue; + case '\r': + sb.append("\\r"); + continue; + case '\"': + sb.append("\\\""); + continue; + case '\'': + sb.append("\\\'"); + continue; + case '\\': + sb.append("\\\\"); + continue; + default: + if (ch < 0x20 || ch > 0x7e) { + final String s = "0000" + Integer.toString(ch, 16); + sb.append("\\u" + s.substring(s.length() - 4, s.length())); + } + else { + sb.append(ch); + } + continue; + } + } + return sb.toString(); + } + + protected CSSParseException toCSSParseException(final String key, final ParseException e) { + final String messagePattern1 = getSACParserMessages().getString("invalidExpectingOne"); + final String messagePattern2 = getSACParserMessages().getString("invalidExpectingMore"); + int maxSize = 0; + final StringBuilder expected = new StringBuilder(); + for (int i = 0; i < e.expectedTokenSequences.length; i++) { + if (maxSize < e.expectedTokenSequences[i].length) { + maxSize = e.expectedTokenSequences[i].length; + } + for (int j = 0; j < e.expectedTokenSequences[i].length; j++) { + expected.append(e.tokenImage[e.expectedTokenSequences[i][j]]); + } + if (i < e.expectedTokenSequences.length - 1) { + expected.append(", "); + } + } + final StringBuilder invalid = new StringBuilder(); + Token tok = e.currentToken.next; + for (int i = 0; i < maxSize; i++) { + if (i != 0) { + invalid.append(" "); + } + if (tok.kind == 0) { + invalid.append(e.tokenImage[0]); + break; + } + invalid.append(add_escapes(tok.image)); + tok = tok.next; + } + String s = null; + try { + s = getSACParserMessages().getString(key); + } + catch (final MissingResourceException ex) { + s = key; + } + final StringBuilder message = new StringBuilder(s); + message.append(" ("); + if (e.expectedTokenSequences.length == 1) { + message.append(MessageFormat.format(messagePattern1, new Object[] {invalid, expected})); + } + else { + message.append(MessageFormat.format(messagePattern2, new Object[] {invalid, expected})); + } + message.append(")"); + return new CSSParseException(message.toString(), + getInputSource().getURI(), e.currentToken.next.beginLine, + e.currentToken.next.beginColumn); + } + + protected CSSParseException toCSSParseException(final DOMException e) { + final String messagePattern = getSACParserMessages().getString("domException"); + return new CSSParseException( + MessageFormat.format(messagePattern, e.getMessage()), getInputSource().getURI(), 1, 1); + } + + protected CSSParseException toCSSParseException(final TokenMgrError e) { + final String messagePattern = getSACParserMessages().getString("tokenMgrError"); + return new CSSParseException(messagePattern, getInputSource().getURI(), 1, 1); + } + + protected CSSParseException toCSSParseException(final String messageKey, + final Object[] msgParams, final Locator locator) { + final String messagePattern = getSACParserMessages().getString(messageKey); + return new CSSParseException(MessageFormat.format(messagePattern, msgParams), locator); + } + + protected CSSParseException createSkipWarning(final String key, final CSSParseException e) { + String s = null; + try { + s = getSACParserMessages().getString(key); + } + catch (final MissingResourceException ex) { + s = key; + } + return new CSSParseException(s, e.getURI(), e.getLineNumber(), e.getColumnNumber()); + } + + public void parseStyleSheet(final InputSource source) throws IOException { + source_ = source; + ReInit(getCharStream(source)); + try { + styleSheet(); + } + catch (final ParseException e) { + getErrorHandler().error(toCSSParseException("invalidStyleSheet", e)); + } + catch (final TokenMgrError e) { + getErrorHandler().error(toCSSParseException(e)); + } + catch (final CSSParseException e) { + getErrorHandler().error(e); + } + } + + public void parseStyleSheet(final String uri) throws IOException { + parseStyleSheet(new InputSource(uri)); + } + + public void parseStyleDeclaration(final InputSource source) throws IOException { + source_ = source; + ReInit(getCharStream(source)); + try { + styleDeclaration(); + } + catch (final ParseException e) { + getErrorHandler().error(toCSSParseException("invalidStyleDeclaration", e)); + } + catch (final TokenMgrError e) { + getErrorHandler().error(toCSSParseException(e)); + } + catch (final CSSParseException e) { + getErrorHandler().error(e); + } + } + + public void parseRule(final InputSource source) throws IOException { + source_ = source; + ReInit(getCharStream(source)); + try { + styleSheetRuleSingle(); + } + catch (final ParseException e) { + getErrorHandler().error(toCSSParseException("invalidRule", e)); + } + catch (final TokenMgrError e) { + getErrorHandler().error(toCSSParseException(e)); + } + catch (final CSSParseException e) { + getErrorHandler().error(e); + } + } + + public SelectorList parseSelectors(final InputSource source) throws IOException { + source_ = source; + ReInit(getCharStream(source)); + SelectorList sl = null; + try { + sl = parseSelectorsInternal(); + } + catch (final ParseException e) { + getErrorHandler().error(toCSSParseException("invalidSelectorList", e)); + } + catch (final TokenMgrError e) { + getErrorHandler().error(toCSSParseException(e)); + } + catch (final CSSParseException e) { + getErrorHandler().error(e); + } + return sl; + } + + public LexicalUnit parsePropertyValue(final InputSource source) throws IOException { + source_ = source; + ReInit(getCharStream(source)); + LexicalUnit lu = null; + try { + lu = expr(); + } + catch (final ParseException e) { + getErrorHandler().error(toCSSParseException("invalidExpr", e)); + } + catch (final TokenMgrError e) { + getErrorHandler().error(toCSSParseException(e)); + } + catch (final CSSParseException e) { + getErrorHandler().error(e); + } + return lu; + } + + public boolean parsePriority(final InputSource source) throws IOException { + source_ = source; + ReInit(getCharStream(source)); + boolean b = false; + try { + b = prio(); + } + catch (final ParseException e) { + getErrorHandler().error(toCSSParseException("invalidPrio", e)); + } + catch (final TokenMgrError e) { + getErrorHandler().error(toCSSParseException(e)); + } + catch (final CSSParseException e) { + getErrorHandler().error(e); + } + return b; + } + + public SACMediaList parseMedia(final InputSource source) throws IOException { + source_ = source; + ReInit(getCharStream(source)); + final SACMediaListImpl ml = new SACMediaListImpl(); + try { + mediaList(ml); + } + catch (final ParseException e) { + getErrorHandler().error(toCSSParseException("invalidMediaList", e)); + } + catch (final TokenMgrError e) { + getErrorHandler().error(toCSSParseException(e)); + } + catch (final CSSParseException e) { + getErrorHandler().error(e); + } + return ml; + } + + private CharStream getCharStream(final InputSource source) throws IOException { + if (source.getCharacterStream() != null) { + return new CssCharStream(source.getCharacterStream(), 1, 1); + } + if (source.getByteStream() != null) { + final InputStreamReader reader; + final String encoding = source.getEncoding(); + if (encoding == null || encoding.length() < 1) { + reader = new InputStreamReader(source.getByteStream(), Charset.defaultCharset()); + } + else { + reader = new InputStreamReader(source.getByteStream(), encoding); + } + return new CssCharStream(reader, 1, 1); + } + if (source.getURI() != null) { + final InputStreamReader reader = new InputStreamReader(new URL(source.getURI()).openStream()); + return new CssCharStream(reader, 1, 1); + } + return null; + } + + public abstract String getParserVersion(); + protected abstract String getGrammarUri(); + protected abstract void ReInit(CharStream charStream); + protected abstract void styleSheet() throws CSSParseException, ParseException; + protected abstract void styleDeclaration() throws ParseException; + protected abstract void styleSheetRuleSingle() throws ParseException; + protected abstract SelectorList parseSelectorsInternal() throws ParseException; + protected abstract SelectorList selectorList() throws ParseException; + protected abstract LexicalUnit expr() throws ParseException; + protected abstract boolean prio() throws ParseException; + protected abstract void mediaList(SACMediaListImpl ml) throws ParseException; + + protected void handleStartDocument() { + getDocumentHandler().startDocument(getInputSource()); + } + + protected void handleEndDocument() { + getDocumentHandler().endDocument(getInputSource()); + } + + protected void handleIgnorableAtRule(final String s, final Locator locator) { + getDocumentHandler().ignorableAtRule(s, locator); + } + + protected void handleCharset(final String characterEncoding, final Locator locator) { + getDocumentHandler().charset(characterEncoding, locator); + } + + protected void handleImportStyle(final String uri, final SACMediaList media, + final String defaultNamespaceURI, final Locator locator) { + getDocumentHandler().importStyle(uri, media, defaultNamespaceURI, locator); + } + + protected void handleStartMedia(final SACMediaList media, final Locator locator) { + getDocumentHandler().startMedia(media, locator); + } + + protected void handleMedium(final String medium, final Locator locator) { + // empty default impl + } + + protected void handleEndMedia(final SACMediaList media) { + getDocumentHandler().endMedia(media); + } + + protected void handleStartPage(final String name, final String pseudoPage, final Locator locator) { + getDocumentHandler().startPage(name, pseudoPage, locator); + } + + protected void handleEndPage(final String name, final String pseudoPage) { + getDocumentHandler().endPage(name, pseudoPage); + } + + protected void handleStartFontFace(final Locator locator) { + getDocumentHandler().startFontFace(locator); + } + + protected void handleEndFontFace() { + getDocumentHandler().endFontFace(); + } + + protected void handleSelector(final Selector selector) { + // empty default impl + } + + protected void handleStartSelector(final SelectorList selectors, final Locator locator) { + getDocumentHandler().startSelector(selectors, locator); + } + + protected void handleEndSelector(final SelectorList selectors) { + getDocumentHandler().endSelector(selectors); + } + + protected void handleProperty(final String name, final LexicalUnit value, + final boolean important, final Locator locator) { + getDocumentHandler().property(name, value, important, locator); + } + + protected LexicalUnit functionInternal(final LexicalUnit prev, final String funct, + final LexicalUnit params) { + + if ("counter(".equalsIgnoreCase(funct)) { + return LexicalUnitImpl.createCounter(prev, params); + } + else if ("counters(".equalsIgnoreCase(funct)) { + return LexicalUnitImpl.createCounters(prev, params); + } + else if ("attr(".equalsIgnoreCase(funct)) { + return LexicalUnitImpl.createAttr(prev, params.getStringValue()); + } + else if ("rect(".equalsIgnoreCase(funct)) { + return LexicalUnitImpl.createRect(prev, params); + } + else if ("rgb(".equalsIgnoreCase(funct)) { + return LexicalUnitImpl.createRgbColor(prev, params); + } + return LexicalUnitImpl.createFunction( + prev, + funct.substring(0, funct.length() - 1), + params); + } + + protected LexicalUnit hexcolorInternal(final LexicalUnit prev, final Token t) { + // Step past the hash at the beginning + final int i = 1; + int r = 0; + int g = 0; + int b = 0; + final int len = t.image.length() - 1; + try { + if (len == 3) { + r = Integer.parseInt(t.image.substring(i + 0, i + 1), 16); + g = Integer.parseInt(t.image.substring(i + 1, i + 2), 16); + b = Integer.parseInt(t.image.substring(i + 2, i + 3), 16); + r = (r << 4) | r; + g = (g << 4) | g; + b = (b << 4) | b; + } + else if (len == 6) { + r = Integer.parseInt(t.image.substring(i + 0, i + 2), 16); + g = Integer.parseInt(t.image.substring(i + 2, i + 4), 16); + b = Integer.parseInt(t.image.substring(i + 4, i + 6), 16); + } + else { + final String pattern = getSACParserMessages().getString("invalidColor"); + throw new CSSParseException(MessageFormat.format( + pattern, new Object[] {t}), + getInputSource().getURI(), t.beginLine, + t.beginColumn); + } + + // Turn into an "rgb()" + final LexicalUnit lr = LexicalUnitImpl.createNumber(null, r); + final LexicalUnit lc1 = LexicalUnitImpl.createComma(lr); + final LexicalUnit lg = LexicalUnitImpl.createNumber(lc1, g); + final LexicalUnit lc2 = LexicalUnitImpl.createComma(lg); + LexicalUnitImpl.createNumber(lc2, b); + + return LexicalUnitImpl.createRgbColor(prev, lr); + } + catch (final NumberFormatException ex) { + final String pattern = getSACParserMessages().getString("invalidColor"); + throw new CSSParseException(MessageFormat.format( + pattern, new Object[] {t}), + getInputSource().getURI(), t.beginLine, + t.beginColumn, ex); + } + } + + int intValue(final char op, final String s) { + final int result = Integer.parseInt(s); + if (op == '-') { + return -1 * result; + } + return result; + } + + float floatValue(final char op, final String s) { + final float result = Float.parseFloat(s); + if (op == '-') { + return -1 * result; + } + return result; + } + + int getLastNumPos(final String s) { + int i = 0; + for ( ; i < s.length(); i++) { + if (NUM_CHARS.indexOf(s.charAt(i)) < 0) { + break; + } + } + return i - 1; + } + + /** + * Unescapes escaped characters in the specified string, according to the + * CSS specification. + * + * This could be done directly in the parser, but portions of the lexer would have to be moved + * to the parser, meaning that the grammar would no longer match the standard grammar specified + * by the W3C. This would make the parser and lexer much less maintainable. + */ + public String unescape(final String s, final boolean unescapeDoubleQuotes) { + if (s == null) { + return s; + } + + // avoid creation of new string if possible + StringBuilder buf = null; + int index = -1; + int len = s.length(); + len--; + if (unescapeDoubleQuotes) { + while (index < len) { + final char c = s.charAt(++index); + + if (c == '\\' || (c == '\"')) { + buf = new StringBuilder(len); + buf.append(s.substring(0, index)); + index--; + break; + } + } + } + else { + while (index < len) { + if ('\\' == s.charAt(++index)) { + buf = new StringBuilder(len); + buf.append(s.substring(0, index)); + index--; + break; + } + } + } + + if (null == buf) { + return s; + } + + // ok, we have to construct a new string + int numValue = -1; + int hexval; + int digitCount = 0; + + while (index < len) { + final char c = s.charAt(++index); + + if (numValue > -1) { + hexval = hexval(c); + if (hexval != -1) { + numValue = (numValue * 16) + hexval; + if (++digitCount < 6) { + continue; + } + + if (numValue > 0xFFFF || numValue == 0) { + numValue = 0xFFFD; + } + buf.append((char) numValue); + numValue = -1; + continue; + } + + if (digitCount > 0) { + if (numValue > 0xFFFF || numValue == 0) { + numValue = 0xFFFD; + } + + buf.append((char) numValue); + + if (c == ' ' || c == '\t') { + numValue = -1; + continue; + } + } + + numValue = -1; + if (digitCount == 0 && c == '\\') { + buf.append('\\'); + continue; + } + + if (c == '\n' || c == '\f') { + continue; + } + if (c == '\r') { + if (index < len) { + if (s.charAt(index + 1) == '\n') { + index++; + } + } + continue; + } + } + + if (c == '\\') { + numValue = 0; + digitCount = 0; + continue; + } + + if (c == '\"' && !unescapeDoubleQuotes) { + buf.append('\\'); + } + + buf.append(c); + } + + if (numValue > -1) { + if (digitCount == 0) { + buf.append('\\'); + } + else { + if (numValue > 0xFFFF || numValue == 0) { + numValue = 0xFFFD; + } + buf.append((char) numValue); + } + } + + return buf.toString(); + } + + private static int hexval(final char c) { + switch (c) { + case '0' : + return 0; + case '1' : + return 1; + case '2' : + return 2; + case '3' : + return 3; + case '4' : + return 4; + case '5' : + return 5; + case '6' : + return 6; + case '7' : + return 7; + case '8' : + return 8; + case '9' : + return 9; + + case 'a' : + case 'A' : + return 10; + case 'b' : + case 'B' : + return 11; + case 'c' : + case 'C' : + return 12; + case 'd' : + case 'D' : + return 13; + case 'e' : + case 'E' : + return 14; + case 'f' : + case 'F' : + return 15; + default : + return -1; + } + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/CSSOMParser.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/CSSOMParser.java new file mode 100644 index 000000000..88a7e6516 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/CSSOMParser.java @@ -0,0 +1,506 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.parser; + +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Stack; +import java.util.logging.Logger; + +import com.fr.third.steadystate.css.dom.CSSImportRuleImpl; +import com.fr.third.steadystate.css.sac.DocumentHandlerExt; +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.ErrorHandler; +import org.w3c.css.sac.InputSource; +import org.w3c.css.sac.LexicalUnit; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.Parser; +import org.w3c.css.sac.SACMediaList; +import org.w3c.css.sac.SelectorList; +import org.w3c.css.sac.helpers.ParserFactory; +import org.w3c.dom.DOMException; +import org.w3c.dom.Node; +import org.w3c.dom.css.CSSRule; +import org.w3c.dom.css.CSSStyleDeclaration; +import org.w3c.dom.css.CSSStyleSheet; +import org.w3c.dom.css.CSSValue; + +import com.fr.third.steadystate.css.dom.CSSCharsetRuleImpl; +import com.fr.third.steadystate.css.dom.CSSFontFaceRuleImpl; +import com.fr.third.steadystate.css.dom.CSSMediaRuleImpl; +import com.fr.third.steadystate.css.dom.CSSOMObject; +import com.fr.third.steadystate.css.dom.CSSPageRuleImpl; +import com.fr.third.steadystate.css.dom.CSSRuleListImpl; +import com.fr.third.steadystate.css.dom.CSSStyleDeclarationImpl; +import com.fr.third.steadystate.css.dom.CSSStyleRuleImpl; +import com.fr.third.steadystate.css.dom.CSSStyleSheetImpl; +import com.fr.third.steadystate.css.dom.CSSUnknownRuleImpl; +import com.fr.third.steadystate.css.dom.CSSValueImpl; +import com.fr.third.steadystate.css.dom.MediaListImpl; +import com.fr.third.steadystate.css.dom.Property; +import com.fr.third.steadystate.css.userdata.UserDataConstants; + +/** + * @author David Schweinsberg + */ +public class CSSOMParser { + + private static final Object LOCK = new Object(); + private static final String DEFAULT_PARSER = "com.steadystate.css.parser.SACParserCSS21"; + + private static String LastFailed_; + + private Parser parser_; + private CSSStyleSheetImpl parentStyleSheet_; + + /** Creates new CSSOMParser */ + public CSSOMParser() { + this (null); + } + + /** + * Creates new CSSOMParser. + * + * @param parser the SAC Parser + */ + public CSSOMParser(final Parser parser) { + synchronized (LOCK) { + if (null != parser) { + System.setProperty("org.w3c.css.sac.parser", parser.getClass().getCanonicalName()); + parser_ = parser; + return; + } + + // no parser provided, determine the correct one + String currentParser = System.getProperty("org.w3c.css.sac.parser"); + try { + // use the direct method if we already failed once before + if (null != LastFailed_ && LastFailed_.equals(currentParser)) { + parser_ = new SACParserCSS21(); + } + else { + if (null == currentParser) { + System.setProperty("org.w3c.css.sac.parser", DEFAULT_PARSER); + currentParser = DEFAULT_PARSER; + } + final ParserFactory factory = new ParserFactory(); + parser_ = factory.makeParser(); + } + } + catch (final Exception e) { + final Logger log = Logger.getLogger("com.steadystate.css"); + log.warning(e.toString()); + log.warning("using the default 'SACParserCSS21' instead"); + log.throwing("CSSOMParser", "consturctor", e); + LastFailed_ = currentParser; + parser_ = new SACParserCSS21(); + } + } + } + + public void setErrorHandler(final ErrorHandler eh) { + parser_.setErrorHandler(eh); + } + + /** + * Parses a SAC input source into a CSSOM style sheet. + * + * @param source the SAC input source + * @param ownerNode the owner node (see the definition of + * ownerNode in org.w3c.dom.css.StyleSheet) + * @param href the href (see the definition of href in + * org.w3c.dom.css.StyleSheet) + * @return the CSSOM style sheet + * @throws IOException if the underlying SAC parser throws an IOException + */ + public CSSStyleSheet parseStyleSheet(final InputSource source, + final Node ownerNode, final String href) throws IOException { + final CSSOMHandler handler = new CSSOMHandler(); + handler.setOwnerNode(ownerNode); + handler.setHref(href); + parser_.setDocumentHandler(handler); + parser_.parseStyleSheet(source); + final Object o = handler.getRoot(); + if (o instanceof CSSStyleSheet) { + return (CSSStyleSheet) o; + } + return null; + } + + /** + * Parses a SAC input source into a CSSOM style declaration. + * + * @param source the SAC input source + * @return the CSSOM style declaration + * @throws IOException if the underlying SAC parser throws an IOException + */ + public CSSStyleDeclaration parseStyleDeclaration(final InputSource source) throws IOException { + final CSSStyleDeclarationImpl sd = new CSSStyleDeclarationImpl(null); + parseStyleDeclaration(sd, source); + return sd; + } + + public void parseStyleDeclaration(final CSSStyleDeclaration sd, final InputSource source) throws IOException { + final Stack nodeStack = new Stack(); + nodeStack.push(sd); + final CSSOMHandler handler = new CSSOMHandler(nodeStack); + parser_.setDocumentHandler(handler); + parser_.parseStyleDeclaration(source); + } + + public CSSValue parsePropertyValue(final InputSource source) throws IOException { + final CSSOMHandler handler = new CSSOMHandler(); + parser_.setDocumentHandler(handler); + final LexicalUnit lu = parser_.parsePropertyValue(source); + if (null == lu) { + return null; + } + return new CSSValueImpl(lu); + } + + public CSSRule parseRule(final InputSource source) throws IOException { + final CSSOMHandler handler = new CSSOMHandler(); + parser_.setDocumentHandler(handler); + parser_.parseRule(source); + return (CSSRule) handler.getRoot(); + } + + public SelectorList parseSelectors(final InputSource source) throws IOException { + final HandlerBase handler = new HandlerBase(); + parser_.setDocumentHandler(handler); + return parser_.parseSelectors(source); + } + + public SACMediaList parseMedia(final InputSource source) throws IOException { + final HandlerBase handler = new HandlerBase(); + parser_.setDocumentHandler(handler); + if (parser_ instanceof AbstractSACParser) { + return ((AbstractSACParser) parser_).parseMedia(source); + } + return null; + } + + public void setParentStyleSheet(final CSSStyleSheetImpl parentStyleSheet) { + parentStyleSheet_ = parentStyleSheet; + } + + protected CSSStyleSheetImpl getParentStyleSheet() { + return parentStyleSheet_; + } + + class CSSOMHandler implements DocumentHandlerExt { + private Stack nodeStack_; + private Object root_; + private Node ownerNode_; + private String href_; + + private Node getOwnerNode() { + return ownerNode_; + } + + private void setOwnerNode(final Node ownerNode) { + ownerNode_ = ownerNode; + } + + private String getHref() { + return href_; + } + + private void setHref(final String href) { + href_ = href; + } + + CSSOMHandler(final Stack nodeStack) { + nodeStack_ = nodeStack; + } + + CSSOMHandler() { + nodeStack_ = new Stack(); + } + + Object getRoot() { + return root_; + } + + public void startDocument(final InputSource source) throws CSSException { + if (nodeStack_.empty()) { + final CSSStyleSheetImpl ss = new CSSStyleSheetImpl(); + CSSOMParser.this.setParentStyleSheet(ss); + ss.setOwnerNode(getOwnerNode()); + ss.setBaseUri(source.getURI()); + ss.setHref(getHref()); + ss.setMediaText(source.getMedia()); + ss.setTitle(source.getTitle()); + // Create the rule list + final CSSRuleListImpl rules = new CSSRuleListImpl(); + ss.setCssRules(rules); + nodeStack_.push(ss); + nodeStack_.push(rules); + } + else { + // Error + } + } + + public void endDocument(final InputSource source) throws CSSException { + // Pop the rule list and style sheet nodes + nodeStack_.pop(); + root_ = nodeStack_.pop(); + } + + public void comment(final String text) throws CSSException { + // empty default impl + } + + public void ignorableAtRule(final String atRule) throws CSSException { + ignorableAtRule(atRule, null); + } + + public void ignorableAtRule(final String atRule, final Locator locator) throws CSSException { + // Create the unknown rule and add it to the rule list + final CSSUnknownRuleImpl ir = new CSSUnknownRuleImpl( + CSSOMParser.this.getParentStyleSheet(), + getParentRule(), + atRule); + addLocator(locator, ir); + if (!nodeStack_.empty()) { + ((CSSRuleListImpl) nodeStack_.peek()).add(ir); + } + else { + root_ = ir; + } + } + + public void namespaceDeclaration(final String prefix, final String uri) throws CSSException { + // empty default impl + } + + public void charset(final String characterEncoding, final Locator locator) + throws CSSException { + final CSSCharsetRuleImpl cr = new CSSCharsetRuleImpl( + CSSOMParser.this.getParentStyleSheet(), + getParentRule(), + characterEncoding); + addLocator(locator, cr); + if (!nodeStack_.empty()) { + ((CSSRuleListImpl) nodeStack_.peek()).add(cr); + } + else { + root_ = cr; + } + } + + public void importStyle( + final String uri, + final SACMediaList media, + final String defaultNamespaceURI) throws CSSException { + importStyle(uri, media, defaultNamespaceURI, null); + } + + public void importStyle(final String uri, final SACMediaList media, + final String defaultNamespaceURI, final Locator locator) throws CSSException { + // Create the import rule and add it to the rule list + final CSSImportRuleImpl ir = new CSSImportRuleImpl( + CSSOMParser.this.getParentStyleSheet(), + getParentRule(), + uri, + new MediaListImpl(media)); + addLocator(locator, ir); + if (!nodeStack_.empty()) { + ((CSSRuleListImpl) nodeStack_.peek()).add(ir); + } + else { + root_ = ir; + } + } + + public void startMedia(final SACMediaList media) throws CSSException { + startMedia(media, null); + } + + public void startMedia(final SACMediaList media, final Locator locator) throws CSSException { + final MediaListImpl ml = new MediaListImpl(media); + // Create the media rule and add it to the rule list + final CSSMediaRuleImpl mr = new CSSMediaRuleImpl( + CSSOMParser.this.getParentStyleSheet(), + getParentRule(), + ml); + addLocator(locator, mr); + if (!nodeStack_.empty()) { + ((CSSRuleListImpl) nodeStack_.peek()).add(mr); + } + + // Create the rule list + final CSSRuleListImpl rules = new CSSRuleListImpl(); + mr.setRuleList(rules); + nodeStack_.push(mr); + nodeStack_.push(rules); + } + + public void endMedia(final SACMediaList media) throws CSSException { + // Pop the rule list and media rule nodes + nodeStack_.pop(); + root_ = nodeStack_.pop(); + } + + public void startPage(final String name, final String pseudoPage) throws CSSException { + startPage(name, pseudoPage, null); + } + + public void startPage(final String name, final String pseudoPage, final Locator locator) + throws CSSException { + // Create the page rule and add it to the rule list + final CSSPageRuleImpl pr = new CSSPageRuleImpl( + CSSOMParser.this.getParentStyleSheet(), + getParentRule(), pseudoPage); + addLocator(locator, pr); + if (!nodeStack_.empty()) { + ((CSSRuleListImpl) nodeStack_.peek()).add(pr); + } + + // Create the style declaration + final CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(pr); + pr.setStyle(decl); + nodeStack_.push(pr); + nodeStack_.push(decl); + } + + public void endPage(final String name, final String pseudoPage) throws CSSException { + // Pop both the style declaration and the page rule nodes + nodeStack_.pop(); + root_ = nodeStack_.pop(); + } + + public void startFontFace() throws CSSException { + startFontFace(null); + } + + public void startFontFace(final Locator locator) throws CSSException { + // Create the font face rule and add it to the rule list + final CSSFontFaceRuleImpl ffr = new CSSFontFaceRuleImpl( + CSSOMParser.this.getParentStyleSheet(), + getParentRule()); + addLocator(locator, ffr); + if (!nodeStack_.empty()) { + ((CSSRuleListImpl) nodeStack_.peek()).add(ffr); + } + + // Create the style declaration + final CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(ffr); + ffr.setStyle(decl); + nodeStack_.push(ffr); + nodeStack_.push(decl); + } + + public void endFontFace() throws CSSException { + // Pop both the style declaration and the font face rule nodes + nodeStack_.pop(); + root_ = nodeStack_.pop(); + } + + public void startSelector(final SelectorList selectors) throws CSSException { + startSelector(selectors, null); + } + + public void startSelector(final SelectorList selectors, final Locator locator) throws CSSException { + // Create the style rule and add it to the rule list + final CSSStyleRuleImpl sr = new CSSStyleRuleImpl( + CSSOMParser.this.getParentStyleSheet(), + getParentRule(), selectors); + addLocator(locator, sr); + if (!nodeStack_.empty()) { + final Object o = nodeStack_.peek(); + ((CSSRuleListImpl) o).add(sr); + } + + // Create the style declaration + final CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(sr); + sr.setStyle(decl); + nodeStack_.push(sr); + nodeStack_.push(decl); + } + + public void endSelector(final SelectorList selectors) throws CSSException { + // Pop both the style declaration and the style rule nodes + nodeStack_.pop(); + root_ = nodeStack_.pop(); + } + + public void property(final String name, final LexicalUnit value, final boolean important) throws CSSException { + property(name, value, important, null); + } + + public void property(final String name, final LexicalUnit value, final boolean important, + final Locator locator) { + final CSSStyleDeclarationImpl decl = (CSSStyleDeclarationImpl) nodeStack_.peek(); + try { + final Property property = new Property(name, new CSSValueImpl(value), important); + addLocator(locator, property); + decl.addProperty(property); + } + catch (final DOMException e) { + if (parser_ instanceof AbstractSACParser) { + final AbstractSACParser parser = (AbstractSACParser) parser_; + parser.getErrorHandler().error(parser.toCSSParseException(e)); + + } + // call ErrorHandler? + } + } + + private CSSRule getParentRule() { + if (!nodeStack_.empty() && nodeStack_.size() > 1) { + final Object node = nodeStack_.get(nodeStack_.size() - 2); + if (node instanceof CSSRule) { + return (CSSRule) node; + } + } + return null; + } + + private void addLocator(Locator locator, final CSSOMObject cssomObject) { + if (locator == null) { + final Parser parser = CSSOMParser.this.parser_; + try { + final Method getLocatorMethod = parser.getClass().getMethod( + "getLocator", (Class[]) null); + locator = (Locator) getLocatorMethod.invoke( + parser, (Object[]) null); + } + catch (final SecurityException e) { + // TODO + } + catch (final NoSuchMethodException e) { + // TODO + } + catch (final IllegalArgumentException e) { + // TODO + } + catch (final IllegalAccessException e) { + // TODO + } + catch (final InvocationTargetException e) { + // TODO + } + } + if (locator != null) { + cssomObject.setUserData(UserDataConstants.KEY_LOCATOR, locator); + } + } + + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/CharStream.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/CharStream.java new file mode 100644 index 000000000..5026e2129 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/CharStream.java @@ -0,0 +1,120 @@ +/* Generated By:JavaCC: Do not edit this line. CharStream.java Version 7.0 */ +/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +package com.fr.third.steadystate.css.parser; + +/** + * This interface describes a character stream that maintains line and + * column number positions of the characters. It also has the capability + * to backup the stream to some extent. An implementation of this + * interface is used in the TokenManager implementation generated by + * JavaCCParser. + * + * All the methods except backup can be implemented in any fashion. backup + * needs to be implemented correctly for the correct operation of the lexer. + * Rest of the methods are all used to get information like line number, + * column number and the String that constitutes a token and are not used + * by the lexer. Hence their implementation won't affect the generated lexer's + * operation. + */ + +public +interface CharStream { + + /** + * Returns the next character from the selected input. The method + * of selecting the input is the responsibility of the class + * implementing this interface. Can throw any java.io.IOException. + */ + char readChar() throws java.io.IOException; + + @Deprecated + /** + * Returns the column position of the character last read. + * @deprecated + * @see #getEndColumn + */ + int getColumn(); + + @Deprecated + /** + * Returns the line number of the character last read. + * @deprecated + * @see #getEndLine + */ + int getLine(); + + /** + * Returns the column number of the last character for current token (being + * matched after the last call to BeginTOken). + */ + int getEndColumn(); + + /** + * Returns the line number of the last character for current token (being + * matched after the last call to BeginTOken). + */ + int getEndLine(); + + /** + * Returns the column number of the first character for current token (being + * matched after the last call to BeginTOken). + */ + int getBeginColumn(); + + /** + * Returns the line number of the first character for current token (being + * matched after the last call to BeginTOken). + */ + int getBeginLine(); + + /** + * Backs up the input stream by amount steps. Lexer calls this method if it + * had already read some characters, but could not use them to match a + * (longer) token. So, they will be used again as the prefix of the next + * token and it is the implemetation's responsibility to do this right. + */ + void backup(int amount); + + /** + * Returns the next character that marks the beginning of the next token. + * All characters must remain in the buffer between two successive calls + * to this method to implement backup correctly. + */ + char BeginToken() throws java.io.IOException; + + /** + * Returns a string made up of characters from the marked token beginning + * to the current buffer position. Implementations have the choice of returning + * anything that they want to. For example, for efficiency, one might decide + * to just return null, which is a valid implementation. + */ + String GetImage(); + + /** + * Returns an array of characters that make up the suffix of length 'len' for + * the currently matched token. This is used to build up the matched string + * for use in actions in the case of MORE. A simple and inefficient + * implementation of this is as follows : + * + * { + * String t = GetImage(); + * return t.substring(t.length() - len, t.length()).toCharArray(); + * } + */ + char[] GetSuffix(int len); + + /** + * The lexer calls this function to indicate that it is done with the stream + * and hence implementations can free any resources held by this class. + * Again, the body of this function can be just empty and it will not + * affect the lexer's operation. + */ + void Done(); + + + void setTabSize(int i); + int getTabSize(); + boolean getTrackLineColumn(); + void setTrackLineColumn(boolean trackLineColumn); +} +/* JavaCC - OriginalChecksum=5226f2ae40a0ca5a5d5c722f00281ba2 (do not edit this line) */ diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/CssCharStream.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/CssCharStream.java new file mode 100644 index 000000000..a9fc49c49 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/CssCharStream.java @@ -0,0 +1,365 @@ +/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 5.0 */ +/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +package com.fr.third.steadystate.css.parser; + +/** + * An implementation of interface CharStream. + * There is no processing of escaping in this class because the escaping is + * part of the parser. CSS has some strange rules about that, so processing + * unicode escapes in this class is too early. + */ + +public final class CssCharStream implements CharStream +{ + /** Whether parser is static. */ + public static final boolean staticFlag = false; + + private static final int BUFFER_SIZE = 2048; + + int bufsize; + int available; + int tokenBegin; + /** Position in buffer. */ + public int bufpos = -1; + private int bufline[]; + private int bufcolumn[]; + + private int column = 0; + private int line = 1; + + private boolean prevCharIsCR = false; + private boolean prevCharIsLF = false; + + private java.io.Reader inputStream; + + private char[] buffer; + private int maxNextCharInd = 0; + private int inBuf = 0; + + private int tabSize = 1; + private boolean trackLineColumn = true; + + private void ExpandBuff(boolean wrapAround) + { + char[] newbuffer = new char[bufsize + BUFFER_SIZE]; + int newbufline[] = new int[bufsize + BUFFER_SIZE]; + int newbufcolumn[] = new int[bufsize + BUFFER_SIZE]; + + try + { + if (wrapAround) + { + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); + System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos); + buffer = newbuffer; + + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); + System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); + bufline = newbufline; + + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); + System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); + bufcolumn = newbufcolumn; + + maxNextCharInd = (bufpos += (bufsize - tokenBegin)); + } + else + { + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); + buffer = newbuffer; + + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); + bufline = newbufline; + + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); + bufcolumn = newbufcolumn; + + maxNextCharInd = (bufpos -= tokenBegin); + } + } + catch (Throwable t) + { + throw new Error(t.getMessage()); + } + + bufsize += BUFFER_SIZE; + available = bufsize; + tokenBegin = 0; + } + + private final void FillBuff() throws java.io.IOException + { + if (maxNextCharInd == available) + { + if (available == bufsize) + { + if (tokenBegin > BUFFER_SIZE) + { + bufpos = maxNextCharInd = 0; + available = tokenBegin; + } + else if (tokenBegin < 0) + bufpos = maxNextCharInd = 0; + else + ExpandBuff(false); + } + else if (available > tokenBegin) + available = bufsize; + else if ((tokenBegin - available) < BUFFER_SIZE) + ExpandBuff(true); + else + available = tokenBegin; + } + + int i; + try { + if ((i = inputStream.read(buffer, maxNextCharInd, available - maxNextCharInd)) == -1) + { + inputStream.close(); + throw new java.io.IOException(); + } + + maxNextCharInd += i; + return; + } + catch(java.io.IOException e) { + --bufpos; + backup(0); + if (tokenBegin == -1) + tokenBegin = bufpos; + throw e; + } + } + + /** Start. */ + public final char BeginToken() throws java.io.IOException + { + tokenBegin = -1; + char c = readChar(); + tokenBegin = bufpos; + + return c; + } + + private final void UpdateLineColumn(char c) + { + column++; + + if (prevCharIsLF) + { + prevCharIsLF = false; + line += (column = 1); + } + else if (prevCharIsCR) + { + prevCharIsCR = false; + if (c == '\n') + { + prevCharIsLF = true; + } + else + line += (column = 1); + } + + switch (c) + { + case '\r' : + prevCharIsCR = true; + break; + case '\n' : + prevCharIsLF = true; + break; +// case '\t' : +// column--; +// column += (8 - (column & 07)); +// break; + default : + break; + } + + bufline[bufpos] = line; + bufcolumn[bufpos] = column; + } + + /** Read a character. */ + public final char readChar() throws java.io.IOException + { + if (inBuf > 0) + { + --inBuf; + + if (++bufpos == bufsize) + bufpos = 0; + + return buffer[bufpos]; + } + + if (++bufpos >= maxNextCharInd) + FillBuff(); + + char c = buffer[bufpos]; + + UpdateLineColumn(c); + return c; + } + + @Deprecated + /** + * @deprecated + * @see #getEndColumn + */ + public final int getColumn() { + return bufcolumn[bufpos]; + } + + @Deprecated + /** + * @deprecated + * @see #getEndLine + */ + public final int getLine() { + return bufline[bufpos]; + } + + /** Get token end column number. */ + public final int getEndColumn() { + return bufcolumn[bufpos]; + } + + /** Get token end line number. */ + public final int getEndLine() { + return bufline[bufpos]; + } + + /** Get token beginning column number. */ + public final int getBeginColumn() { + return bufcolumn[tokenBegin]; + } + + /** Get token beginning line number. */ + public final int getBeginLine() { + return bufline[tokenBegin]; + } + + /** Backup a number of characters. */ + public final void backup(int amount) { + inBuf += amount; + if ((bufpos -= amount) < 0) + bufpos += bufsize; + } + + /** Constructor. */ + public CssCharStream(java.io.Reader dstream, int startline, int startcolumn, int buffersize) + { + inputStream = dstream; + line = startline; + column = startcolumn - 1; + + available = bufsize = buffersize; + buffer = new char[buffersize]; + bufline = new int[buffersize]; + bufcolumn = new int[buffersize]; + } + + /** Constructor. */ + public CssCharStream(java.io.Reader dstream, int startline, + int startcolumn) + { + this(dstream, startline, startcolumn, 4096); + } + + /** Get token literal value. */ + public final String GetImage() + { + if (bufpos >= tokenBegin) + return new String(buffer, tokenBegin, bufpos - tokenBegin + 1); + return new String(buffer, tokenBegin, bufsize - tokenBegin) + new String(buffer, 0, bufpos + 1); + } + + /** Get the suffix. */ + public final char[] GetSuffix(int len) + { + char[] ret = new char[len]; + + if ((bufpos + 1) >= len) + System.arraycopy(buffer, bufpos - len + 1, ret, 0, len); + else + { + System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, len - bufpos - 1); + System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1); + } + + return ret; + } + + /** Reset buffer when finished. */ + public void Done() + { + buffer = null; + bufline = null; + bufcolumn = null; + } + + /** + * Method to adjust line and column numbers for the start of a token. + */ + public void adjustBeginLineColumn(int newLine, int newCol) + { + int start = tokenBegin; + int len; + + if (bufpos >= tokenBegin) + { + len = bufpos - tokenBegin + inBuf + 1; + } + else + { + len = bufsize - tokenBegin + bufpos + 1 + inBuf; + } + + int i = 0, j = 0, k = 0; + int nextColDiff = 0, columnDiff = 0; + + while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) + { + bufline[j] = newLine; + nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; + bufcolumn[j] = newCol + columnDiff; + columnDiff = nextColDiff; + i++; + } + + if (i < len) + { + bufline[j] = newLine++; + bufcolumn[j] = newCol + columnDiff; + + while (i++ < len) + { + if (bufline[j = start % bufsize] != bufline[++start % bufsize]) + bufline[j] = newLine++; + else + bufline[j] = newLine; + } + } + + line = bufline[j]; + column = bufcolumn[j]; + } + + public void setTabSize(int i) { + tabSize = i; + } + + public int getTabSize() { + return tabSize; + } + + public boolean getTrackLineColumn() { + return trackLineColumn; + } + + public void setTrackLineColumn(boolean tlc) { + trackLineColumn = tlc; + } +} \ No newline at end of file diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/ExceptionResource.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/ExceptionResource.java new file mode 100644 index 000000000..c429addae --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/ExceptionResource.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.parser; + +import java.util.ListResourceBundle; + +/** + * ExceptionResource. + * + * @author David Schweinsberg + * @author rbri + */ +public class ExceptionResource extends ListResourceBundle { + + @Override + public Object[][] getContents() { + return contents; + } + + static final Object[][] contents = { + {"s0", "Syntax error"}, + {"s1", "Index out of bounds error"}, + {"s2", "This style sheet is read only"}, + {"s3", "The text does not represent an unknown rule"}, + {"s4", "The text does not represent a style rule"}, + {"s5", "The text does not represent a charset rule"}, + {"s6", "The text does not represent an import rule"}, + {"s7", "The text does not represent a media rule"}, + {"s8", "The text does not represent a font face rule"}, + {"s9", "The text does not represent a page rule"}, + {"s10", "This isn't a Float type"}, + {"s11", "This isn't a String type"}, + {"s12", "This isn't a Counter type"}, + {"s13", "This isn't a Rect type"}, + {"s14", "This isn't an RGBColor type"}, + {"s15", "A charset rule must be the first rule"}, + {"s16", "A charset rule already exists"}, + {"s17", "An import rule must preceed all other rules"}, + {"s18", "The specified type was not found"}, + {"s20", "Can't insert a rule before the last charset or import rule"} + }; +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/HandlerBase.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/HandlerBase.java new file mode 100644 index 000000000..e2064eaef --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/HandlerBase.java @@ -0,0 +1,162 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.parser; + +import com.fr.third.steadystate.css.sac.DocumentHandlerExt; +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.CSSParseException; +import org.w3c.css.sac.ErrorHandler; +import org.w3c.css.sac.InputSource; +import org.w3c.css.sac.LexicalUnit; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.SACMediaList; +import org.w3c.css.sac.SelectorList; + +/** + * Empty implementation of the DocumentHandlerExt interface. + */ +public class HandlerBase implements DocumentHandlerExt, ErrorHandler { + + public void startDocument(final InputSource source) throws CSSException { + // empty default impl + } + + public void endDocument(final InputSource source) throws CSSException { + // empty default impl + } + + public void comment(final String text) throws CSSException { + // empty default impl + } + + public void ignorableAtRule(final String atRule) throws CSSException { + // empty default impl + } + + public void ignorableAtRule(final String atRule, final Locator locator) throws CSSException { + // empty default impl + } + + public void namespaceDeclaration(final String prefix, final String uri) throws CSSException { + // empty default impl + } + + public void importStyle(final String uri, final SACMediaList media, + final String defaultNamespaceURI) throws CSSException { + // empty default impl + } + + public void importStyle(final String uri, final SACMediaList media, + final String defaultNamespaceURI, final Locator locator) throws CSSException { + // empty default impl + } + + public void startMedia(final SACMediaList media) throws CSSException { + // empty default impl + } + + public void startMedia(final SACMediaList media, final Locator locator) throws CSSException { + // empty default impl + } + + public void endMedia(final SACMediaList media) throws CSSException { + // empty default impl + } + + public void startPage(final String name, final String pseudoPage) throws CSSException { + // empty default impl + } + + public void startPage(final String name, final String pseudoPage, final Locator locator) throws CSSException { + // empty default impl + } + + public void endPage(final String name, final String pseudoPage) throws CSSException { + // empty default impl + } + + public void startFontFace() throws CSSException { + // empty default impl + } + + public void startFontFace(final Locator locator) throws CSSException { + // empty default impl + } + + public void endFontFace() throws CSSException { + // empty default impl + } + + public void startSelector(final SelectorList selectors) throws CSSException { + // empty default impl + } + + public void startSelector(final SelectorList selectors, final Locator locator) throws CSSException { + // empty default impl + } + + public void endSelector(final SelectorList selectors) throws CSSException { + // empty default impl + } + + public void property(final String name, final LexicalUnit value, final boolean important) throws CSSException { + // empty default impl + } + + public void property(final String name, final LexicalUnit value, final boolean important, final Locator locator) { + // empty default impl + } + + public void charset(final String characterEncoding, final Locator locator) throws CSSException { + // empty default impl + } + + public void warning(final CSSParseException exception) throws CSSException { + final StringBuilder sb = new StringBuilder(); + sb.append(exception.getURI()) + .append(" [") + .append(exception.getLineNumber()) + .append(":") + .append(exception.getColumnNumber()) + .append("] ") + .append(exception.getMessage()); + System.err.println(sb.toString()); + } + + public void error(final CSSParseException exception) throws CSSException { + final StringBuilder sb = new StringBuilder(); + sb.append(exception.getURI()) + .append(" [") + .append(exception.getLineNumber()) + .append(":") + .append(exception.getColumnNumber()) + .append("] ") + .append(exception.getMessage()); + System.err.println(sb.toString()); + } + + public void fatalError(final CSSParseException exception) throws CSSException { + final StringBuilder sb = new StringBuilder(); + sb.append(exception.getURI()) + .append(" [") + .append(exception.getLineNumber()) + .append(":") + .append(exception.getColumnNumber()) + .append("] ") + .append(exception.getMessage()); + System.err.println(sb.toString()); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/LexicalUnitImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/LexicalUnitImpl.java new file mode 100644 index 000000000..7f21f8de9 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/LexicalUnitImpl.java @@ -0,0 +1,780 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.parser; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import org.w3c.css.sac.LexicalUnit; + +import com.fr.third.steadystate.css.format.CSSFormat; + +/** + * Implementation of {@link LexicalUnit}. + * + * @author David Schweinsberg + * @author rbri + */ +public class LexicalUnitImpl extends LocatableImpl implements LexicalUnit, CSSFormatable, Serializable { + + private static final long serialVersionUID = -7260032046960116891L; + + private short lexicalUnitType_; + private LexicalUnit nextLexicalUnit_; + private LexicalUnit previousLexicalUnit_; + private float floatValue_; + private String dimension_; + private String functionName_; + private LexicalUnit parameters_; + private String stringValue_; + private String sourceStringValue_; + + /** cache */ + private transient String toString_; + + public void setLexicalUnitType(final short type) { + lexicalUnitType_ = type; + toString_ = null; + } + + public void setNextLexicalUnit(final LexicalUnit next) { + nextLexicalUnit_ = next; + } + + public void setPreviousLexicalUnit(final LexicalUnit prev) { + previousLexicalUnit_ = prev; + } + + public void setFloatValue(final float floatVal) { + floatValue_ = floatVal; + toString_ = null; + } + + public String getDimension() { + return dimension_; + } + + public void setDimension(final String dimension) { + dimension_ = dimension; + toString_ = null; + } + + public void setFunctionName(final String function) { + functionName_ = function; + toString_ = null; + } + + public void setParameters(final LexicalUnit params) { + parameters_ = params; + toString_ = null; + } + + public void setStringValue(final String stringVal) { + stringValue_ = stringVal; + toString_ = null; + } + + protected LexicalUnitImpl(final LexicalUnit previous, final short type) { + this(); + lexicalUnitType_ = type; + previousLexicalUnit_ = previous; + if (previousLexicalUnit_ != null) { + ((LexicalUnitImpl) previousLexicalUnit_).nextLexicalUnit_ = this; + } + } + + /** + * Integer + */ + protected LexicalUnitImpl(final LexicalUnit previous, final int value) { + this(previous, SAC_INTEGER); + floatValue_ = value; + } + + /** + * Dimension + */ + protected LexicalUnitImpl(final LexicalUnit previous, final short type, final float value) { + this(previous, type); + floatValue_ = value; + } + + /** + * Unknown dimension + */ + protected LexicalUnitImpl( + final LexicalUnit previous, + final short type, + final String dimension, + final float value) { + this(previous, type); + dimension_ = dimension; + floatValue_ = value; + } + + /** + * String + */ + protected LexicalUnitImpl(final LexicalUnit previous, final short type, final String value) { + this(previous, type); + stringValue_ = value; + } + + /** + * Function + */ + protected LexicalUnitImpl( + final LexicalUnit previous, + final short type, + final String name, + final LexicalUnit params) { + this(previous, type); + functionName_ = name; + parameters_ = params; + } + + protected LexicalUnitImpl(final LexicalUnit previous, final short type, final String name, + final String stringValue) { + this(previous, type); + functionName_ = name; + stringValue_ = stringValue; + } + + /** + * Default constructor. + */ + protected LexicalUnitImpl() { + } + + public short getLexicalUnitType() { + return lexicalUnitType_; + } + + public LexicalUnit getNextLexicalUnit() { + return nextLexicalUnit_; + } + + public LexicalUnit getPreviousLexicalUnit() { + return previousLexicalUnit_; + } + + public int getIntegerValue() { + return (int) floatValue_; + } + + public float getFloatValue() { + return floatValue_; + } + + public String getDimensionUnitText() { + switch (lexicalUnitType_) { + case SAC_EM: + return "em"; + case SAC_EX: + return "ex"; + case SAC_PIXEL: + return "px"; + case SAC_INCH: + return "in"; + case SAC_CENTIMETER: + return "cm"; + case SAC_MILLIMETER: + return "mm"; + case SAC_POINT: + return "pt"; + case SAC_PICA: + return "pc"; + case SAC_PERCENTAGE: + return "%"; + case SAC_DEGREE: + return "deg"; + case SAC_GRADIAN: + return "grad"; + case SAC_RADIAN: + return "rad"; + case SAC_MILLISECOND: + return "ms"; + case SAC_SECOND: + return "s"; + case SAC_HERTZ: + return "Hz"; + case SAC_KILOHERTZ: + return "kHz"; + case SAC_DIMENSION: + return dimension_; + default: + return ""; + } + } + + public String getFunctionName() { + return functionName_; + } + + public LexicalUnit getParameters() { + return parameters_; + } + + public String getStringValue() { + return stringValue_; + } + + public String getSourceStringValue() { + return sourceStringValue_; + } + + public LexicalUnit getSubValues() { + return parameters_; + } + + /** + * Same as {@link #getCssText(CSSFormat)} but using the default format. + * + * @return the formated string + */ + public String getCssText() { + return getCssText(null); + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + if (null != toString_ && (format == null || !format.useSourceStringValues())) { + return toString_; + } + + final StringBuilder sb = new StringBuilder(); + switch (lexicalUnitType_) { + case SAC_OPERATOR_COMMA: + sb.append(","); + break; + case SAC_OPERATOR_PLUS: + sb.append("+"); + break; + case SAC_OPERATOR_MINUS: + sb.append("-"); + break; + case SAC_OPERATOR_MULTIPLY: + sb.append("*"); + break; + case SAC_OPERATOR_SLASH: + sb.append("/"); + break; + case SAC_OPERATOR_MOD: + sb.append("%"); + break; + case SAC_OPERATOR_EXP: + sb.append("^"); + break; + case SAC_OPERATOR_LT: + sb.append("<"); + break; + case SAC_OPERATOR_GT: + sb.append(">"); + break; + case SAC_OPERATOR_LE: + sb.append("<="); + break; + case SAC_OPERATOR_GE: + sb.append(">="); + break; + case SAC_OPERATOR_TILDE: + sb.append("~"); + break; + case SAC_INHERIT: + sb.append("inherit"); + break; + case SAC_INTEGER: + sb.append(String.valueOf(getIntegerValue())); + break; + case SAC_REAL: + sb.append(getTrimedFloatValue()); + break; + case SAC_EM: + case SAC_EX: + case SAC_PIXEL: + case SAC_INCH: + case SAC_CENTIMETER: + case SAC_MILLIMETER: + case SAC_POINT: + case SAC_PICA: + case SAC_PERCENTAGE: + case SAC_DEGREE: + case SAC_GRADIAN: + case SAC_RADIAN: + case SAC_MILLISECOND: + case SAC_SECOND: + case SAC_HERTZ: + case SAC_KILOHERTZ: + case SAC_DIMENSION: + sb.append(getTrimedFloatValue()); + final String dimUnitText = getDimensionUnitText(); + if (null != dimUnitText) { + sb.append(dimUnitText); + } + break; + case SAC_URI: + sb.append("url(").append(getStringValue()).append(")"); + break; + case SAC_COUNTER_FUNCTION: + sb.append("counter("); + appendParams(sb); + sb.append(")"); + break; + case SAC_COUNTERS_FUNCTION: + sb.append("counters("); + appendParams(sb); + sb.append(")"); + break; + case SAC_RGBCOLOR: + sb.append("rgb("); + appendParams(sb); + sb.append(")"); + break; + case SAC_IDENT: + sb.append(getStringValue()); + break; + case SAC_STRING_VALUE: + sb.append("\""); + + String value = getStringValue(); + if (null != format && format.useSourceStringValues() + && sourceStringValue_ != null + && value != sourceStringValue_) { + value = sourceStringValue_; + } + else { + // replace line breaks + value = value.replace("\n", "\\A ").replace("\r", "\\D "); + } + sb.append(value); + + sb.append("\""); + break; + case SAC_ATTR: + sb.append("attr(") + .append(getStringValue()) + .append(")"); + break; + case SAC_RECT_FUNCTION: + sb.append("rect("); + appendParams(sb); + sb.append(")"); + break; + case SAC_UNICODERANGE: + final String range = getStringValue(); + if (null != range) { + sb.append(range); + } + break; + case SAC_SUB_EXPRESSION: + final String subExpression = getStringValue(); + if (null != subExpression) { + sb.append(subExpression); + } + break; + case SAC_FUNCTION: + final String functName = getFunctionName(); + if (null != functName) { + sb.append(functName); + } + sb.append('('); + appendParams(sb); + sb.append(")"); + break; + default: + break; + } + toString_ = sb.toString(); + return toString_; + } + + @Override + public String toString() { + return getCssText(null); + } + + public String toDebugString() { + final StringBuilder sb = new StringBuilder(); + switch (lexicalUnitType_) { + case SAC_OPERATOR_COMMA: + sb.append("SAC_OPERATOR_COMMA"); + break; + case SAC_OPERATOR_PLUS: + sb.append("SAC_OPERATOR_PLUS"); + break; + case SAC_OPERATOR_MINUS: + sb.append("SAC_OPERATOR_MINUS"); + break; + case SAC_OPERATOR_MULTIPLY: + sb.append("SAC_OPERATOR_MULTIPLY"); + break; + case SAC_OPERATOR_SLASH: + sb.append("SAC_OPERATOR_SLASH"); + break; + case SAC_OPERATOR_MOD: + sb.append("SAC_OPERATOR_MOD"); + break; + case SAC_OPERATOR_EXP: + sb.append("SAC_OPERATOR_EXP"); + break; + case SAC_OPERATOR_LT: + sb.append("SAC_OPERATOR_LT"); + break; + case SAC_OPERATOR_GT: + sb.append("SAC_OPERATOR_GT"); + break; + case SAC_OPERATOR_LE: + sb.append("SAC_OPERATOR_LE"); + break; + case SAC_OPERATOR_GE: + sb.append("SAC_OPERATOR_GE"); + break; + case SAC_OPERATOR_TILDE: + sb.append("SAC_OPERATOR_TILDE"); + break; + case SAC_INHERIT: + sb.append("SAC_INHERIT"); + break; + case SAC_INTEGER: + sb.append("SAC_INTEGER(") + .append(String.valueOf(getIntegerValue())) + .append(")"); + break; + case SAC_REAL: + sb.append("SAC_REAL(") + .append(getTrimedFloatValue()) + .append(")"); + break; + case SAC_EM: + sb.append("SAC_EM(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_EX: + sb.append("SAC_EX(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_PIXEL: + sb.append("SAC_PIXEL(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_INCH: + sb.append("SAC_INCH(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_CENTIMETER: + sb.append("SAC_CENTIMETER(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_MILLIMETER: + sb.append("SAC_MILLIMETER(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_POINT: + sb.append("SAC_POINT(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_PICA: + sb.append("SAC_PICA(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_PERCENTAGE: + sb.append("SAC_PERCENTAGE(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_DEGREE: + sb.append("SAC_DEGREE(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_GRADIAN: + sb.append("SAC_GRADIAN(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_RADIAN: + sb.append("SAC_RADIAN(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_MILLISECOND: + sb.append("SAC_MILLISECOND(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_SECOND: + sb.append("SAC_SECOND(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_HERTZ: + sb.append("SAC_HERTZ(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_KILOHERTZ: + sb.append("SAC_KILOHERTZ(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_DIMENSION: + sb.append("SAC_DIMENSION(") + .append(getTrimedFloatValue()) + .append(getDimensionUnitText()) + .append(")"); + break; + case SAC_URI: + sb.append("SAC_URI(url(") + .append(getStringValue()) + .append("))"); + break; + case SAC_COUNTER_FUNCTION: + sb.append("SAC_COUNTER_FUNCTION(counter("); + appendParams(sb); + sb.append("))"); + break; + case SAC_COUNTERS_FUNCTION: + sb.append("SAC_COUNTERS_FUNCTION(counters("); + appendParams(sb); + sb.append("))"); + break; + case SAC_RGBCOLOR: + sb.append("SAC_RGBCOLOR(rgb("); + appendParams(sb); + sb.append("))"); + break; + case SAC_IDENT: + sb.append("SAC_IDENT(") + .append(getStringValue()) + .append(")"); + break; + case SAC_STRING_VALUE: + sb.append("SAC_STRING_VALUE(\"") + .append(getStringValue()) + .append("\")"); + break; + case SAC_ATTR: + sb.append("SAC_ATTR(attr(") + .append(getStringValue()) + .append("))"); + break; + case SAC_RECT_FUNCTION: + sb.append("SAC_RECT_FUNCTION(rect("); + appendParams(sb); + sb.append("))"); + break; + case SAC_UNICODERANGE: + sb.append("SAC_UNICODERANGE(") + .append(getStringValue()) + .append(")"); + break; + case SAC_SUB_EXPRESSION: + sb.append("SAC_SUB_EXPRESSION(") + .append(getStringValue()) + .append(")"); + break; + case SAC_FUNCTION: + sb.append("SAC_FUNCTION(") + .append(getFunctionName()) + .append("("); + LexicalUnit l = parameters_; + while (l != null) { + sb.append(l.toString()); + l = l.getNextLexicalUnit(); + } + sb.append("))"); + break; + default: + break; + } + return sb.toString(); + } + + private void appendParams(final StringBuilder sb) { + LexicalUnit l = parameters_; + if (l != null) { + sb.append(l.toString()); + l = l.getNextLexicalUnit(); + while (l != null) { + if (l.getLexicalUnitType() != SAC_OPERATOR_COMMA) { + sb.append(" "); + } + sb.append(l.toString()); + l = l.getNextLexicalUnit(); + } + } + } + + private String getTrimedFloatValue() { + final float f = getFloatValue(); + final int i = (int) f; + + if (f - i == 0) { + return Integer.toString((int) f); + } + return Float.toString(f); + } + + public static LexicalUnit createNumber(final LexicalUnit prev, final int i) { + return new LexicalUnitImpl(prev, i); + } + + public static LexicalUnit createNumber(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_REAL, f); + } + + public static LexicalUnit createPercentage(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_PERCENTAGE, f); + } + + public static LexicalUnit createPixel(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_PIXEL, f); + } + + public static LexicalUnit createCentimeter(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_CENTIMETER, f); + } + + public static LexicalUnit createMillimeter(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_MILLIMETER, f); + } + + public static LexicalUnit createInch(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_INCH, f); + } + + public static LexicalUnit createPoint(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_POINT, f); + } + + public static LexicalUnit createPica(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_PICA, f); + } + + public static LexicalUnit createEm(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_EM, f); + } + + public static LexicalUnit createEx(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_EX, f); + } + + public static LexicalUnit createDegree(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_DEGREE, f); + } + + public static LexicalUnit createRadian(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_RADIAN, f); + } + + public static LexicalUnit createGradian(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_GRADIAN, f); + } + + public static LexicalUnit createMillisecond(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_MILLISECOND, f); + } + + public static LexicalUnit createSecond(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_SECOND, f); + } + + public static LexicalUnit createHertz(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_HERTZ, f); + } + + public static LexicalUnit createDimension(final LexicalUnit prev, final float f, final String dim) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_DIMENSION, dim, f); + } + + public static LexicalUnit createKiloHertz(final LexicalUnit prev, final float f) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_KILOHERTZ, f); + } + + public static LexicalUnit createCounter(final LexicalUnit prev, final LexicalUnit params) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_COUNTER_FUNCTION, "counter", params); + } + + public static LexicalUnit createCounters(final LexicalUnit prev, final LexicalUnit params) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_COUNTERS_FUNCTION, "counters", params); + } + + public static LexicalUnit createAttr(final LexicalUnit prev, final String value) { + // according to LexicalUnit.SAC_ATTR, LexicalUnit.getStringValue(), not + // LexicalUnit.getParameters() is applicable + return new LexicalUnitImpl(prev, LexicalUnit.SAC_ATTR, "name", value); + } + + public static LexicalUnit createRect(final LexicalUnit prev, final LexicalUnit params) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_RECT_FUNCTION, "rect", params); + } + + public static LexicalUnit createRgbColor(final LexicalUnit prev, final LexicalUnit params) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_RGBCOLOR, "rgb", params); + } + + public static LexicalUnit createFunction(final LexicalUnit prev, final String name, final LexicalUnit params) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_FUNCTION, name, params); + } + + public static LexicalUnit createString(final LexicalUnit prev, final String value) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_STRING_VALUE, value); + } + + public static LexicalUnit createString(final LexicalUnit prev, final String value, final String sourceStringValue) { + final LexicalUnitImpl unit = new LexicalUnitImpl(prev, LexicalUnit.SAC_STRING_VALUE, value); + unit.sourceStringValue_ = sourceStringValue; + return unit; + } + + public static LexicalUnit createIdent(final LexicalUnit prev, final String value) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_IDENT, value); + } + + public static LexicalUnit createURI(final LexicalUnit prev, final String value) { + return new LexicalUnitImpl(prev, LexicalUnit.SAC_URI, value); + } + + public static LexicalUnit createComma(final LexicalUnit prev) { + return new LexicalUnitImpl(prev, SAC_OPERATOR_COMMA); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/Locatable.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/Locatable.java new file mode 100644 index 000000000..ce2a4e8a5 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/Locatable.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.parser; + +import org.w3c.css.sac.Locator; + +/** + * An object that provides a SAC locator + * + * @author Johannes Koch + */ +public interface Locatable { + + Locator getLocator(); + + void setLocator(Locator locator); +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/LocatableImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/LocatableImpl.java new file mode 100644 index 000000000..7ebdfe1f4 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/LocatableImpl.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.parser; + +import org.w3c.css.sac.Locator; + +/** + * Implementation of {@link Locatable} + * + * @author Johannes Koch + */ +public class LocatableImpl implements Locatable { + + private Locator locator_; + + public Locator getLocator() { + return locator_; + } + + public void setLocator(final Locator locator) { + locator_ = locator; + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/LocatorImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/LocatorImpl.java new file mode 100644 index 000000000..22b26265e --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/LocatorImpl.java @@ -0,0 +1,146 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.parser; + +import java.io.Serializable; + +import org.w3c.css.sac.Locator; + +import com.fr.third.steadystate.css.util.LangUtils; + +/** + * Implementation of {@link Locator}. + * + * @author David Schweinsberg + */ +public class LocatorImpl implements Locator, Serializable { + + private static final long serialVersionUID = 2240824537064705530L; + + private String uri_; + private int lineNumber_; + private int columnNumber_; + + /** + * Creates new LocatorImpl + * @param uri the uri + * @param line the lineNumber + * @param column the columnNumber + */ + public LocatorImpl(final String uri, final int line, final int column) { + uri_ = uri; + lineNumber_ = line; + columnNumber_ = column; + } + + /** + * Return the URI for the current document event. + * + * The parser must resolve the URI fully before passing it to the + * application. + * + * @return A string containing the URI, or null + * if none is available. + */ + public String getURI() { + return uri_; + } + + /** + * @return @see #getURI() + */ + public String getUri() { + return uri_; + } + + /** + * Set the uri to a new value. + * @see #getURI() + * @param uri the new uri + */ + public void setUri(final String uri) { + uri_ = uri; + } + + /** + * Return the column number where the current document event ends. + * Note that this is the column number of the first + * character after the text associated with the document + * event. The first column in a line is position 1. + * @return The column number, or -1 if none is available. + * @see #getLineNumber + */ + public int getColumnNumber() { + return columnNumber_; + } + + /** + * Set the columnNumber to a new value. + * @param column the new columnNumber + */ + public void setColumnNumber(final int column) { + columnNumber_ = column; + } + + /** + * Return the line number where the current document event ends. + * Note that this is the line position of the first character + * after the text associated with the document event. + * @return The line number, or -1 if none is available. + * @see #getColumnNumber + */ + public int getLineNumber() { + return lineNumber_; + } + + /** + * Set the lineNumber to a new value. + * @param line the new lineNumber + */ + public void setLineNumber(final int line) { + lineNumber_ = line; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof Locator)) { + return false; + } + final Locator l = (Locator) obj; + return (getColumnNumber() == l.getColumnNumber()) + && (getLineNumber() == l.getLineNumber()) + && LangUtils.equals(getURI(), l.getURI()); + } + + @Override + public int hashCode() { + int hash = LangUtils.HASH_SEED; + hash = LangUtils.hashCode(hash, columnNumber_); + hash = LangUtils.hashCode(hash, lineNumber_); + hash = LangUtils.hashCode(hash, uri_); + return hash; + } + + @Override + public String toString() { + return new StringBuilder().append(getUri()).append(" (") + .append(getLineNumber()).append(':') + .append(getColumnNumber()).append(')').toString(); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/ParseException.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/ParseException.java new file mode 100644 index 000000000..85dd3909d --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/ParseException.java @@ -0,0 +1,193 @@ +/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 7.0 */ +/* JavaCCOptions:KEEP_LINE_COLUMN=true */ +package com.fr.third.steadystate.css.parser; + +/** + * This exception is thrown when parse errors are encountered. + * You can explicitly create objects of this exception type by + * calling the method generateParseException in the generated + * parser. + * + * You can modify this class to customize your error reporting + * mechanisms so long as you retain the public fields. + */ +public class ParseException extends Exception { + + /** + * The version identifier for this Serializable class. + * Increment only if the serialized form of the + * class changes. + */ + private static final long serialVersionUID = 1L; + + /** + * The end of line string for this machine. + */ + protected static String EOL = System.getProperty("line.separator", "\n"); + + /** + * This constructor is used by the method "generateParseException" + * in the generated parser. Calling this constructor generates + * a new object of this type with the fields "currentToken", + * "expectedTokenSequences", and "tokenImage" set. + */ + public ParseException(Token currentTokenVal, + int[][] expectedTokenSequencesVal, + String[] tokenImageVal + ) + { + super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal)); + currentToken = currentTokenVal; + expectedTokenSequences = expectedTokenSequencesVal; + tokenImage = tokenImageVal; + } + + /** + * The following constructors are for use by you for whatever + * purpose you can think of. Constructing the exception in this + * manner makes the exception behave in the normal way - i.e., as + * documented in the class "Throwable". The fields "errorToken", + * "expectedTokenSequences", and "tokenImage" do not contain + * relevant information. The JavaCC generated code does not use + * these constructors. + */ + + public ParseException() { + super(); + } + + /** Constructor with message. */ + public ParseException(String message) { + super(message); + } + + + /** + * This is the last token that has been consumed successfully. If + * this object has been created due to a parse error, the token + * followng this token will (therefore) be the first error token. + */ + public Token currentToken; + + /** + * Each entry in this array is an array of integers. Each array + * of integers represents a sequence of tokens (by their ordinal + * values) that is expected at this point of the parse. + */ + public int[][] expectedTokenSequences; + + /** + * This is a reference to the "tokenImage" array of the generated + * parser within which the parse error occurred. This array is + * defined in the generated ...Constants interface. + */ + public String[] tokenImage; + + /** + * It uses "currentToken" and "expectedTokenSequences" to generate a parse + * error message and returns it. If this object has been created + * due to a parse error, and you do not catch it (it gets thrown + * from the parser) the correct error message + * gets displayed. + */ + private static String initialise(Token currentToken, + int[][] expectedTokenSequences, + String[] tokenImage) { + + StringBuffer expected = new StringBuffer(); + int maxSize = 0; + for (int i = 0; i < expectedTokenSequences.length; i++) { + if (maxSize < expectedTokenSequences[i].length) { + maxSize = expectedTokenSequences[i].length; + } + for (int j = 0; j < expectedTokenSequences[i].length; j++) { + expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' '); + } + if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) { + expected.append("..."); + } + expected.append(EOL).append(" "); + } + String retval = "Encountered \""; + Token tok = currentToken.next; + for (int i = 0; i < maxSize; i++) { + if (i != 0) retval += " "; + if (tok.kind == 0) { + retval += tokenImage[0]; + break; + } + retval += " " + tokenImage[tok.kind]; + retval += " \""; + retval += add_escapes(tok.image); + retval += " \""; + tok = tok.next; + } + retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn; + retval += "." + EOL; + + + if (expectedTokenSequences.length == 0) { + // Nothing to add here + } else { + if (expectedTokenSequences.length == 1) { + retval += "Was expecting:" + EOL + " "; + } else { + retval += "Was expecting one of:" + EOL + " "; + } + retval += expected.toString(); + } + + return retval; + } + + + /** + * Used to convert raw characters to their escaped version + * when these raw version cannot be used as part of an ASCII + * string literal. + */ + static String add_escapes(String str) { + StringBuffer retval = new StringBuffer(); + char ch; + for (int i = 0; i < str.length(); i++) { + switch (str.charAt(i)) + { + case '\b': + retval.append("\\b"); + continue; + case '\t': + retval.append("\\t"); + continue; + case '\n': + retval.append("\\n"); + continue; + case '\f': + retval.append("\\f"); + continue; + case '\r': + retval.append("\\r"); + continue; + case '\"': + retval.append("\\\""); + continue; + case '\'': + retval.append("\\\'"); + continue; + case '\\': + retval.append("\\\\"); + continue; + default: + if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { + String s = "0000" + Integer.toString(ch, 16); + retval.append("\\u" + s.substring(s.length() - 4, s.length())); + } else { + retval.append(ch); + } + continue; + } + } + return retval.toString(); + } + +} +/* JavaCC - OriginalChecksum=a8a58654a5ee2b5eb919333733c9ca09 (do not edit this line) */ diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/ParserUtils.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/ParserUtils.java new file mode 100644 index 000000000..723f389ef --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/ParserUtils.java @@ -0,0 +1,63 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.parser; + +/** + * Util methods used by the parser and lexer. + * + * @author RBRi + */ +public final class ParserUtils { + + private ParserUtils() { + } + + /** + * Remove the given number of chars from start and end. + * There is no parameter checking, the caller has to take care of this. + * + * @param s the StringBuilder + * @param left no of chars to be removed from start + * @param right no of chars to be removed from end + * @return the trimmed string + */ + public static String trimBy(final StringBuilder s, final int left, final int right) { + return s.substring(left, s.length() - right); + } + + /** + * Helper that removes the leading "url(", the trailing ")" + * and surrounding quotes from the given string builder. + * @param s the StringBuilder + * @return + */ + public static String trimUrl(final StringBuilder s) { + final String s1 = trimBy(s, 4, 1).trim(); + if (s1.length() == 0) { + return s1; + } + + final int end = s1.length() - 1; + final char c0 = s1.charAt(0); + if ((c0 == '"' && s1.charAt(end) == '"') + || (c0 == '\'' && s1.charAt(end) == '\'')) { + return s1.substring(1, end); + } + + return s1; + } + +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACMediaListImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACMediaListImpl.java new file mode 100644 index 000000000..0e00410c1 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACMediaListImpl.java @@ -0,0 +1,71 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.parser; + +import java.util.ArrayList; +import java.util.List; + +import org.w3c.css.sac.SACMediaList; + +import com.fr.third.steadystate.css.parser.media.MediaQuery; + +/** + * Implementation of {@link SACMediaList}. + * + * @author David Schweinsberg + * @author rbri + */ +public class SACMediaListImpl extends LocatableImpl implements SACMediaList { + + private final List mediaQueries_; + + public SACMediaListImpl() { + mediaQueries_ = new ArrayList(); + } + + public int getLength() { + return mediaQueries_.size(); + } + + public String item(final int index) { + return mediaQuery(index).getMedia(); + } + + public MediaQuery mediaQuery(final int index) { + return mediaQueries_.get(index); + } + + public void add(final String s) { + add(new MediaQuery(s)); + } + + public void add(final MediaQuery mediaQuery) { + mediaQueries_.add(mediaQuery); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + final int len = getLength(); + for (int i = 0; i < len; i++) { + sb.append(item(i)); + if (i < len - 1) { + sb.append(", "); + } + } + return sb.toString(); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParser.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParser.java new file mode 100644 index 000000000..d04dc76ef --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParser.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 1999-2018 David Schweinsberg. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.fr.third.steadystate.css.parser; + +import org.w3c.css.sac.Parser; + +/** + * Our extension of the {@link Parser} interface. + * + * @author RBRi + */ +public interface SACParser extends Parser { + + void setIeStarHackAccepted(boolean accepted); + + boolean isIeStarHackAccepted(); +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS1.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS1.java new file mode 100644 index 000000000..7438371b2 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS1.java @@ -0,0 +1,1657 @@ +/* SACParserCSS1.java */ +/* Generated By:JavaCC: Do not edit this line. SACParserCSS1.java */ +package com.fr.third.steadystate.css.parser; + +import org.w3c.css.sac.CSSParseException; +import org.w3c.css.sac.Condition; +import org.w3c.css.sac.LexicalUnit; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.Parser; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SelectorList; +import org.w3c.css.sac.SimpleSelector; + +/** + * @author David Schweinsberg + * @author waldbaer + * @author rbri + */ +@SuppressWarnings("all") public class SACParserCSS1 extends AbstractSACParser implements SACParserCSS1Constants { + + public SACParserCSS1() { + this((CharStream) null); + } + + public String getParserVersion() { + return "http://www.w3.org/TR/REC-CSS1"; + } + + protected String getGrammarUri() + { + return "http://www.w3.org/TR/REC-CSS1#appendix-b"; + } + + public void mediaList(SACMediaListImpl ml) + { + } + +// +// stylesheet +// : [S|CDO|CDC]* [ import [S|CDO|CDC]* ]* +// [ ruleset [S|CDO|CDC]* ]* +// ; +// + final public void styleSheet() throws ParseException { + try { +handleStartDocument(); + styleSheetRuleList(); + jj_consume_token(0); + } finally { +handleEndDocument(); + } +} + +// Although the grammar does not include [S|CDO|CDC] but [CDO|CDC], white space +// should be allowed + final public void styleSheetRuleList() throws ParseException {boolean ruleFound = false; + label_1: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S: + case CDO: + case CDC:{ + ; + break; + } + default: + jj_la1[0] = jj_gen; + break label_1; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + jj_consume_token(S); + break; + } + case CDO:{ + jj_consume_token(CDO); + break; + } + case CDC:{ + jj_consume_token(CDC); + break; + } + default: + jj_la1[1] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + label_2: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case LINK_PSCLASS: + case VISITED_PSCLASS: + case ACTIVE_PSCLASS: + case HASH: + case DOT: + case IMPORT_SYM: + case ATKEYWORD:{ + ; + break; + } + default: + jj_la1[2] = jj_gen; + break label_2; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IMPORT_SYM:{ + importRule(ruleFound); + break; + } + case IDENT: + case LINK_PSCLASS: + case VISITED_PSCLASS: + case ACTIVE_PSCLASS: + case HASH: + case DOT: + case ATKEYWORD:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case LINK_PSCLASS: + case VISITED_PSCLASS: + case ACTIVE_PSCLASS: + case HASH: + case DOT:{ + styleRule(); + break; + } + case ATKEYWORD:{ + unknownAtRule(); + break; + } + default: + jj_la1[3] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +ruleFound = true; + break; + } + default: + jj_la1[4] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_3: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S: + case CDO: + case CDC:{ + ; + break; + } + default: + jj_la1[5] = jj_gen; + break label_3; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + jj_consume_token(S); + break; + } + case CDO:{ + jj_consume_token(CDO); + break; + } + case CDC:{ + jj_consume_token(CDC); + break; + } + default: + jj_la1[6] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } +} + +// +// This is used by ASTStyleSheet.insertRule to parse a single rule +// + final public void styleSheetRuleSingle() throws ParseException { + label_4: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[7] = jj_gen; + break label_4; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IMPORT_SYM:{ + importRule(false); + break; + } + case IDENT: + case LINK_PSCLASS: + case VISITED_PSCLASS: + case ACTIVE_PSCLASS: + case HASH: + case DOT:{ + styleRule(); + break; + } + case ATKEYWORD:{ + unknownAtRule(); + break; + } + default: + jj_la1[8] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +} + + final public void unknownAtRule() throws ParseException {String s; + Locator locator; + try { + jj_consume_token(ATKEYWORD); +locator = createLocator(token); + s = skip(); + handleIgnorableAtRule(s, locator); + } catch (ParseException e) { +getErrorHandler().error(toCSSParseException("invalidUnknownRule", e)); + } +} + +// +// import +// : IMPORT_SYM S* +// [STRING|URI] ';' S* +// ; +// + final public void importRule(final boolean nonImportRuleFoundBefore) throws ParseException {Token t; + Locator locator; + try { +ParseException e = null; + if (nonImportRuleFoundBefore) + { + e = generateParseException(); + } + jj_consume_token(IMPORT_SYM); +locator = createLocator(token); + label_5: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[9] = jj_gen; + break label_5; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case STRING:{ + t = jj_consume_token(STRING); + break; + } + case URL:{ + t = jj_consume_token(URL); + break; + } + default: + jj_la1[10] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_6: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[11] = jj_gen; + break label_6; + } + jj_consume_token(S); + } + jj_consume_token(SEMICOLON); +if (nonImportRuleFoundBefore) + { + getErrorHandler().error(toCSSParseException("invalidImportRuleIgnored", e)); + } + else + { + handleImportStyle(unescape(t.image, false), new SACMediaListImpl(), null, locator); + } + } catch (CSSParseException e) { +getErrorHandler().error(e); + error_skipAtRule(); + } catch (ParseException e) { +getErrorHandler().error(toCSSParseException("invalidImportRule", e)); + error_skipAtRule(); + } +} + +// +// medium +// : IDENT S* +// ; +// + final public String medium() throws ParseException {Token t; + t = jj_consume_token(IDENT); + label_7: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[12] = jj_gen; + break label_7; + } + jj_consume_token(S); + } +handleMedium(t.image, createLocator(t)); + return t.image; +} + +// +// operator +// : '/' | ',' | /* empty */ +// ; +// + final public LexicalUnit operator(LexicalUnit prev) throws ParseException { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SLASH:{ + jj_consume_token(SLASH); + label_8: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[13] = jj_gen; + break label_8; + } + jj_consume_token(S); + } +return new LexicalUnitImpl(prev, LexicalUnit.SAC_OPERATOR_SLASH); + } + case COMMA:{ + jj_consume_token(COMMA); + label_9: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[14] = jj_gen; + break label_9; + } + jj_consume_token(S); + } +return LexicalUnitImpl.createComma(prev); + } + default: + jj_la1[15] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +} + +// +// unary_operator +// : '-' | '+' +// ; +// + final public char unaryOperator() throws ParseException { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case MINUS:{ + jj_consume_token(MINUS); +return '-'; + } + case PLUS:{ + jj_consume_token(PLUS); +return '+'; + } + default: + jj_la1[16] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +} + +// +// property +// : IDENT S* +// ; +// + final public String property() throws ParseException {Token t; + t = jj_consume_token(IDENT); + label_10: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[17] = jj_gen; + break label_10; + } + jj_consume_token(S); + } +return unescape(t.image, false); +} + +// +// ruleset +// : selector [ ',' S* selector ]* +// '{' S* declaration [ ';' S* declaration ]* '}' S* +// ; +// + final public void styleRule() throws ParseException {SelectorList selList = null; + boolean start = false; + Token t; + try { +t = token; + selList = selectorList(); + jj_consume_token(LBRACE); + label_11: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[18] = jj_gen; + break label_11; + } + jj_consume_token(S); + } +start = true; + handleStartSelector(selList, createLocator(t.next)); + styleDeclaration(); + jj_consume_token(RBRACE); + } catch (CSSParseException e) { +getErrorHandler().error(e); + error_skipblock(); + } catch (ParseException e) { +getErrorHandler().error(toCSSParseException("invalidStyleRule", e)); + error_skipblock(); + } finally { +if (start) { + handleEndSelector(selList); + } + } +} + + final public SelectorList parseSelectorsInternal() throws ParseException {SelectorList selectors; + label_12: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[19] = jj_gen; + break label_12; + } + jj_consume_token(S); + } + selectors = selectorList(); + jj_consume_token(0); +return selectors; +} + + final public SelectorList selectorList() throws ParseException {SelectorListImpl selList = new SelectorListImpl(); + Selector sel; + sel = selector(); +if (sel instanceof Locatable) { ((Locatable) selList).setLocator(((Locatable) sel).getLocator()); } + label_13: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[20] = jj_gen; + break label_13; + } + jj_consume_token(COMMA); + label_14: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[21] = jj_gen; + break label_14; + } + jj_consume_token(S); + } +selList.add(sel); + sel = selector(); +if (sel instanceof Locatable) { ((Locatable) selList).setLocator(((Locatable) sel).getLocator()); } + } + label_15: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[22] = jj_gen; + break label_15; + } + jj_consume_token(S); + } +selList.add(sel); + return selList; +} + +// +// selector +// : simple_selector+ [ pseudo_element ]? +// ; +// + final public Selector selector() throws ParseException {Selector sel; + SimpleSelector pseudoElementSel = null; + try { + sel = simpleSelector(null, ' '); + label_16: + while (true) { + if (jj_2_1(2)) { + ; + } else { + break label_16; + } + jj_consume_token(S); + sel = simpleSelector(sel, ' '); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case FIRST_LINE: + case FIRST_LETTER:{ + pseudoElementSel = pseudoElement(); + break; + } + default: + jj_la1[23] = jj_gen; + ; + } +if (pseudoElementSel != null) + { + sel = getSelectorFactory().createDescendantSelector(sel, pseudoElementSel); + } + handleSelector(sel); + return sel; } catch (ParseException e) { +throw toCSSParseException("invalidSelector", e); + } +} + +// +// simple_selector +// : element_name id? class? pseudo_class? /* eg: H1.subject */ +// | class? pseudo_class? /* eg: #xyz33 */ +// | pseudo_class? /* eg: .author */ +// ; +// + final public Selector simpleSelector(Selector sel, char comb) throws ParseException {SimpleSelector simpleSel = null; + Condition c = null; + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + simpleSel = elementName(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case HASH:{ + c = hash(c); + break; + } + default: + jj_la1[24] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT:{ + c = _class(c); + break; + } + default: + jj_la1[25] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LINK_PSCLASS: + case VISITED_PSCLASS: + case ACTIVE_PSCLASS:{ + c = pseudoClass(c); + break; + } + default: + jj_la1[26] = jj_gen; + ; + } + break; + } + case HASH:{ +simpleSel = ((com.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelectorFactory()).createSyntheticElementSelector(); + c = hash(c); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT:{ + c = _class(c); + break; + } + default: + jj_la1[27] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LINK_PSCLASS: + case VISITED_PSCLASS: + case ACTIVE_PSCLASS:{ + c = pseudoClass(c); + break; + } + default: + jj_la1[28] = jj_gen; + ; + } + break; + } + case DOT:{ +simpleSel = ((com.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelectorFactory()).createSyntheticElementSelector(); + c = _class(c); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LINK_PSCLASS: + case VISITED_PSCLASS: + case ACTIVE_PSCLASS:{ + c = pseudoClass(c); + break; + } + default: + jj_la1[29] = jj_gen; + ; + } + break; + } + case LINK_PSCLASS: + case VISITED_PSCLASS: + case ACTIVE_PSCLASS:{ +simpleSel = ((com.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelectorFactory()).createSyntheticElementSelector(); + c = pseudoClass(c); + break; + } + default: + jj_la1[30] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +if (c != null) { + simpleSel = getSelectorFactory().createConditionalSelector(simpleSel, c); + } + + if (sel != null) { + switch (comb) { + case ' ': + sel = getSelectorFactory().createDescendantSelector(sel, simpleSel); + break; + } + } else { + sel = simpleSel; + } + + return sel; } catch (ParseException e) { +throw toCSSParseException("invalidSimpleSelector", e); + } +} + +// +// class +// : '.' IDENT +// ; +// + final public Condition _class(Condition pred) throws ParseException {Token t; + Locator locator; + try { + jj_consume_token(DOT); +locator = createLocator(token); + t = jj_consume_token(IDENT); +Condition c = getConditionFactory().createClassCondition(null, t.image, locator); + return (pred == null) ? c : getConditionFactory().createAndCondition(pred, c); } catch (ParseException e) { +throw toCSSParseException("invalidClassSelector", e); + } +} + +// +// element_name +// : IDENT +// ; +// + final public SimpleSelector elementName() throws ParseException {Token t; + SimpleSelector sel; + try { + t = jj_consume_token(IDENT); +sel = getSelectorFactory().createElementSelector(null, unescape(t.image, false), createLocator(token)); + return sel; } catch (ParseException e) { +throw toCSSParseException("invalidElementName", e); + } +} + +// +// solitary_pseudo_class /* as in: :link */ +// : LINK_PSCLASS +// | VISITED_PSCLASS +// | ACTIVE_PSCLASS +// ; +// + final public Condition pseudoClass(Condition pred) throws ParseException {Condition c; + Token t; + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case LINK_PSCLASS:{ + t = jj_consume_token(LINK_PSCLASS); + break; + } + case VISITED_PSCLASS:{ + t = jj_consume_token(VISITED_PSCLASS); + break; + } + case ACTIVE_PSCLASS:{ + t = jj_consume_token(ACTIVE_PSCLASS); + break; + } + default: + jj_la1[31] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +c = getConditionFactory().createPseudoClassCondition(null, t.image, createLocator(token), false); + {if ("" != null) return (pred == null) + ? c + : getConditionFactory().createAndCondition(pred, c);} + } catch (ParseException e) { +throw toCSSParseException("invalidPseudoClass", e); + } +return null; +} + +// +// pseudo_element /* as in: P:first-line */ +// : FIRST_LETTER_AFTER_IDENT +// | FIRST_LINE_AFTER_IDENT +// ; +// + final public SimpleSelector pseudoElement() throws ParseException {Token t; + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case FIRST_LETTER:{ + t = jj_consume_token(FIRST_LETTER); + break; + } + case FIRST_LINE:{ + t = jj_consume_token(FIRST_LINE); + break; + } + default: + jj_la1[32] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return getSelectorFactory().createPseudoElementSelector(null, t.image, createLocator(token), false); } catch (ParseException e) { +throw toCSSParseException("invalidPseudoElement", e); + } +} + + final public Condition hash(Condition pred) throws ParseException {Token t; + try { + t = jj_consume_token(HASH); +Condition c = getConditionFactory().createIdCondition(unescape(t.image.substring(1), false), createLocator(token)); + return (pred == null) ? c : getConditionFactory().createAndCondition(pred, c); } catch (ParseException e) { +throw toCSSParseException("invalidHash", e); + } +} + + final public void styleDeclaration() throws ParseException { + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + declaration(); + break; + } + default: + jj_la1[33] = jj_gen; + ; + } + label_17: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SEMICOLON:{ + ; + break; + } + default: + jj_la1[34] = jj_gen; + break label_17; + } + jj_consume_token(SEMICOLON); + label_18: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[35] = jj_gen; + break label_18; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + declaration(); + break; + } + default: + jj_la1[36] = jj_gen; + ; + } + } + } catch (ParseException ex) { +CSSParseException cpe = toCSSParseException("invalidDeclaration", ex); + getErrorHandler().error(cpe); + getErrorHandler().warning(createSkipWarning("ignoringFollowingDeclarations", cpe)); + error_skipdecl(); + } +} + +// +// declaration +// : property ':' S* expr prio? +// | +// ; +// + final public void declaration() throws ParseException {String p; + LexicalUnit e; + boolean priority = false; + Locator locator = null; + try { + p = property(); +locator = createLocator(token); + jj_consume_token(COLON); + label_19: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[37] = jj_gen; + break label_19; + } + jj_consume_token(S); + } + e = expr(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IMPORTANT_SYM:{ + priority = prio(); + break; + } + default: + jj_la1[38] = jj_gen; + ; + } +handleProperty(p, e, priority, locator); + } catch (CSSParseException ex) { +getErrorHandler().error(ex); + getErrorHandler().warning(createSkipWarning("ignoringFollowingDeclarations", ex)); + error_skipdecl(); + } catch (ParseException ex) { +CSSParseException cpe = toCSSParseException("invalidDeclaration", ex); + getErrorHandler().error(cpe); + getErrorHandler().warning(createSkipWarning("ignoringFollowingDeclarations", cpe)); + error_skipdecl(); + } +} + +// +// prio +// : IMPORTANT_SYM S* +// ; +// + final public boolean prio() throws ParseException { + jj_consume_token(IMPORTANT_SYM); + label_20: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[39] = jj_gen; + break label_20; + } + jj_consume_token(S); + } +return true; +} + +// +// expr +// : term [ operator term ]* +// ; + final public LexicalUnit expr() throws ParseException {LexicalUnit head; + LexicalUnit body; + try { + head = term(null); +body = head; + label_21: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case HASH: + case COMMA: + case SLASH: + case PLUS: + case MINUS: + case STRING: + case URL: + case EMS: + case EXS: + case LENGTH_PX: + case LENGTH_CM: + case LENGTH_MM: + case LENGTH_IN: + case LENGTH_PT: + case LENGTH_PC: + case PERCENTAGE: + case NUMBER: + case RGB: + case UNICODERANGE:{ + ; + break; + } + default: + jj_la1[40] = jj_gen; + break label_21; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA: + case SLASH:{ + body = operator(body); + break; + } + default: + jj_la1[41] = jj_gen; + ; + } + body = term(body); + } +return head; } catch (ParseException ex) { +throw toCSSParseException("invalidExpr", ex); + } +} + +// +// term +// : unary_operator? +// [ NUMBER | PERCENTAGE | LENGTH | EMS | EXS ] +// | STRING | IDENT| URL | UNICODERANGE | RGB | hexcolor +// S* +// ; +// + final public LexicalUnit term(LexicalUnit prev) throws ParseException {Token t; + char op = ' '; + LexicalUnit value = null; + Locator locator = null; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PLUS: + case MINUS:{ + op = unaryOperator(); + break; + } + default: + jj_la1[42] = jj_gen; + ; + } +if (op != ' ') + { + locator = createLocator(token); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case EMS: + case EXS: + case LENGTH_PX: + case LENGTH_CM: + case LENGTH_MM: + case LENGTH_IN: + case LENGTH_PT: + case LENGTH_PC: + case PERCENTAGE: + case NUMBER:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case NUMBER:{ + t = jj_consume_token(NUMBER); +try + { + value = LexicalUnitImpl.createNumber(prev, intValue(op, t.image)); + } + catch (NumberFormatException e) + { + value = LexicalUnitImpl.createNumber(prev, floatValue(op, t.image)); + } + break; + } + case PERCENTAGE:{ + t = jj_consume_token(PERCENTAGE); +value = LexicalUnitImpl.createPercentage(prev, floatValue(op, t.image)); + break; + } + case LENGTH_PX:{ + t = jj_consume_token(LENGTH_PX); +value = LexicalUnitImpl.createPixel(prev, floatValue(op, t.image)); + break; + } + case LENGTH_CM:{ + t = jj_consume_token(LENGTH_CM); +value = LexicalUnitImpl.createCentimeter(prev, floatValue(op, t.image)); + break; + } + case LENGTH_MM:{ + t = jj_consume_token(LENGTH_MM); +value = LexicalUnitImpl.createMillimeter(prev, floatValue(op, t.image)); + break; + } + case LENGTH_IN:{ + t = jj_consume_token(LENGTH_IN); +value = LexicalUnitImpl.createInch(prev, floatValue(op, t.image)); + break; + } + case LENGTH_PT:{ + t = jj_consume_token(LENGTH_PT); +value = LexicalUnitImpl.createPoint(prev, floatValue(op, t.image)); + break; + } + case LENGTH_PC:{ + t = jj_consume_token(LENGTH_PC); +value = LexicalUnitImpl.createPica(prev, floatValue(op, t.image)); + break; + } + case EMS:{ + t = jj_consume_token(EMS); +value = LexicalUnitImpl.createEm(prev, floatValue(op, t.image)); + break; + } + case EXS:{ + t = jj_consume_token(EXS); +value = LexicalUnitImpl.createEx(prev, floatValue(op, t.image)); + break; + } + default: + jj_la1[43] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + } + case STRING:{ + t = jj_consume_token(STRING); +value = LexicalUnitImpl.createString(prev, t.image, null); + break; + } + case IDENT:{ + t = jj_consume_token(IDENT); +value = LexicalUnitImpl.createIdent(prev, t.image); + break; + } + case URL:{ + t = jj_consume_token(URL); +value = LexicalUnitImpl.createURI(prev, t.image); + break; + } + case UNICODERANGE:{ + t = jj_consume_token(UNICODERANGE); +value = new LexicalUnitImpl(prev, LexicalUnit.SAC_UNICODERANGE, t.image); + break; + } + case RGB:{ + value = rgb(prev); + break; + } + case HASH:{ + value = hexcolor(prev); + break; + } + default: + jj_la1[44] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +if (locator == null) + { + locator = createLocator(token); + } + label_22: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[45] = jj_gen; + break label_22; + } + jj_consume_token(S); + } +if (value instanceof Locatable) + { + ((Locatable) value).setLocator(locator); + } + return value; +} + +// +// rgb +// : RGB S* expr ')' S* +// ; +// + final public LexicalUnit rgb(LexicalUnit prev) throws ParseException {LexicalUnit params; + jj_consume_token(RGB); + label_23: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[46] = jj_gen; + break label_23; + } + jj_consume_token(S); + } + params = expr(); + jj_consume_token(RROUND); +return LexicalUnitImpl.createRgbColor(prev, params); +} + +// +// hexcolor +// : HASH +// ; +// + final public LexicalUnit hexcolor(LexicalUnit prev) throws ParseException {Token t; + t = jj_consume_token(HASH); +return hexcolorInternal(prev, t); +} + + String skip() throws ParseException {StringBuilder sb = new StringBuilder(); + int nesting = 0; + Token t = getToken(0); + if (t.image != null) { + sb.append(t.image); + } + + do { + t = getNextToken(); + if (t.kind == EOF) { + break; + } + sb.append(t.image); + appendUnit(t, sb); + + if (t.kind == LBRACE) { + nesting++; + } + else if (t.kind == RBRACE) { + nesting--; + } + } + while ((t.kind != RBRACE && t.kind != SEMICOLON) || nesting > 0); + + return sb.toString(); + } + + void appendUnit(Token t, StringBuilder sb) throws ParseException {if (t.kind == EMS) { + sb.append("ems"); + return; + } + if (t.kind == EXS) { + sb.append("ex"); + return; + } + if (t.kind == LENGTH_PX) { + sb.append("px"); + return; + } + if (t.kind == LENGTH_CM) { + sb.append("cm"); + return; + } + if (t.kind == LENGTH_MM) { + sb.append("mm"); + return; + } + if (t.kind == LENGTH_IN) { + sb.append("in"); + return; + } + if (t.kind == LENGTH_PT) { + sb.append("pt"); + return; + } + if (t.kind == LENGTH_PC) { + sb.append("pc"); + return; + } + if (t.kind == PERCENTAGE) { + sb.append('%'); + return; + } + } + + void error_skipblock() throws ParseException {Token t; + int nesting = 0; + do { + t = getNextToken(); + if (t.kind == LBRACE) { + nesting++; + } + else if (t.kind == RBRACE) { + nesting--; + } + } + while (t.kind != EOF && (t.kind != RBRACE || nesting > 0)); + } + + void error_skipdecl() throws ParseException {Token t = getToken(1); + if (t.kind == LBRACE) { + error_skipblock(); + return; + } + if (t.kind == RBRACE) { + // next will be RBRACE so we are finished + return; + } + + Token oldToken = token; + while (t.kind != SEMICOLON && t.kind != RBRACE && t.kind != EOF) { + oldToken = t; + t = getNextToken(); + } + if (t.kind != EOF) { + token = oldToken; + } + } + + void error_skipAtRule() throws ParseException {Token t = null; + do { + t = getNextToken(); + } + while (t.kind != SEMICOLON && t.kind != EOF); + } + + 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_3_1() + { + if (jj_scan_token(S)) return true; + if (jj_3R_24()) return true; + return false; + } + + private boolean jj_3R_24() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_25()) { + jj_scanpos = xsp; + if (jj_3R_26()) { + jj_scanpos = xsp; + if (jj_3R_27()) { + jj_scanpos = xsp; + if (jj_3R_28()) return true; + } + } + } + return false; + } + + private boolean jj_3R_27() + { + if (jj_3R_31()) return true; + return false; + } + + private boolean jj_3R_29() + { + if (jj_scan_token(IDENT)) return true; + return false; + } + + private boolean jj_3R_26() + { + if (jj_3R_30()) return true; + return false; + } + + private boolean jj_3R_31() + { + if (jj_scan_token(DOT)) return true; + return false; + } + + private boolean jj_3R_30() + { + if (jj_scan_token(HASH)) return true; + return false; + } + + private boolean jj_3R_25() + { + if (jj_3R_29()) return true; + return false; + } + + private boolean jj_3R_32() + { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(4)) { + jj_scanpos = xsp; + if (jj_scan_token(5)) { + jj_scanpos = xsp; + if (jj_scan_token(6)) return true; + } + } + return false; + } + + private boolean jj_3R_28() + { + if (jj_3R_32()) return true; + return false; + } + + /** Generated Token Manager. */ + public SACParserCSS1TokenManager 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[47]; + static private int[] jj_la1_0; + static private int[] jj_la1_1; + static private int[] jj_la1_2; + static { + jj_la1_init_0(); + jj_la1_init_1(); + jj_la1_init_2(); + } + private static void jj_la1_init_0() { + jj_la1_0 = new int[] {0xc000002,0xc000002,0x50002278,0x40002278,0x50002278,0xc000002,0xc000002,0x2,0x50002278,0x2,0x2800000,0x2,0x2,0x2,0x2,0x11000,0x60000,0x2,0x2,0x2,0x1000,0x2,0x2,0x180,0x200,0x2000,0x70,0x2000,0x70,0x70,0x2278,0x70,0x180,0x8,0x4000,0x2,0x8,0x2,0x20000000,0x2,0x82871208,0x11000,0x60000,0x80000000,0x82800208,0x2,0x2,}; + } + private static void jj_la1_init_1() { + jj_la1_1 = new int[] {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,0x23ff,0x0,0x0,0x1ff,0x23ff,0x0,0x0,}; + } + private static void jj_la1_init_2() { + jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; + } + final private JJCalls[] jj_2_rtns = new JJCalls[1]; + private boolean jj_rescan = false; + private int jj_gc = 0; + + /** Constructor with user supplied CharStream. */ + public SACParserCSS1(CharStream stream) { + token_source = new SACParserCSS1TokenManager(stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 47; 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 < 47; 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 SACParserCSS1(SACParserCSS1TokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 47; 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(SACParserCSS1TokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 47; 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(); + } + + @SuppressWarnings("serial") + 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_f() { + 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 jj_expentries = new java.util.ArrayList(); + 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]; + } + + for (int[] oldentry : jj_expentries) { + if (oldentry.length == jj_expentry.length) { + boolean isMatched = true; + + for (int i = 0; i < jj_expentry.length; i++) { + if (oldentry[i] != jj_expentry[i]) { + isMatched = false; + break; + } + + } + if (isMatched) { + jj_expentries.add(jj_expentry); + break; + } + } + } + + if (pos != 0) { + jj_lasttokens[(jj_endpos = pos) - 1] = kind; + } + } + } + + /** Generate ParseException. */ + public ParseException generateParseException() { + jj_expentries.clear(); + boolean[] la1tokens = new boolean[67]; + if (jj_kind >= 0) { + la1tokens[jj_kind] = true; + jj_kind = -1; + } + for (int i = 0; i < 47; i++) { + if (jj_la1[i] == jj_gen) { + for (int j = 0; j < 32; j++) { + if ((jj_la1_0[i] & (1< jj_gen) { + jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; + switch (i) { + case 0: jj_3_1(); 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; + } + +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS1Constants.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS1Constants.java new file mode 100644 index 000000000..af9db773d --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS1Constants.java @@ -0,0 +1,216 @@ +/* Generated By:JavaCC: Do not edit this line. SACParserCSS1Constants.java */ +package com.fr.third.steadystate.css.parser; + + +/** + * Token literal values and constants. + * Generated by org.javacc.parser.OtherFilesGen#start() + */ +public interface SACParserCSS1Constants { + + /** End of File. */ + int EOF = 0; + /** RegularExpression Id. */ + int S = 1; + /** RegularExpression Id. */ + int IDENT = 3; + /** RegularExpression Id. */ + int LINK_PSCLASS = 4; + /** RegularExpression Id. */ + int VISITED_PSCLASS = 5; + /** RegularExpression Id. */ + int ACTIVE_PSCLASS = 6; + /** RegularExpression Id. */ + int FIRST_LINE = 7; + /** RegularExpression Id. */ + int FIRST_LETTER = 8; + /** RegularExpression Id. */ + int HASH = 9; + /** RegularExpression Id. */ + int LBRACE = 10; + /** RegularExpression Id. */ + int RBRACE = 11; + /** RegularExpression Id. */ + int COMMA = 12; + /** RegularExpression Id. */ + int DOT = 13; + /** RegularExpression Id. */ + int SEMICOLON = 14; + /** RegularExpression Id. */ + int COLON = 15; + /** RegularExpression Id. */ + int SLASH = 16; + /** RegularExpression Id. */ + int PLUS = 17; + /** RegularExpression Id. */ + int MINUS = 18; + /** RegularExpression Id. */ + int EQUALS = 19; + /** RegularExpression Id. */ + int GT = 20; + /** RegularExpression Id. */ + int LSQUARE = 21; + /** RegularExpression Id. */ + int RSQUARE = 22; + /** RegularExpression Id. */ + int STRING = 23; + /** RegularExpression Id. */ + int RROUND = 24; + /** RegularExpression Id. */ + int URL = 25; + /** RegularExpression Id. */ + int CDO = 26; + /** RegularExpression Id. */ + int CDC = 27; + /** RegularExpression Id. */ + int IMPORT_SYM = 28; + /** RegularExpression Id. */ + int IMPORTANT_SYM = 29; + /** RegularExpression Id. */ + int ATKEYWORD = 30; + /** RegularExpression Id. */ + int EMS = 31; + /** RegularExpression Id. */ + int EXS = 32; + /** RegularExpression Id. */ + int LENGTH_PX = 33; + /** RegularExpression Id. */ + int LENGTH_CM = 34; + /** RegularExpression Id. */ + int LENGTH_MM = 35; + /** RegularExpression Id. */ + int LENGTH_IN = 36; + /** RegularExpression Id. */ + int LENGTH_PT = 37; + /** RegularExpression Id. */ + int LENGTH_PC = 38; + /** RegularExpression Id. */ + int PERCENTAGE = 39; + /** RegularExpression Id. */ + int NUMBER = 40; + /** RegularExpression Id. */ + int RGB = 41; + /** RegularExpression Id. */ + int NAME = 42; + /** RegularExpression Id. */ + int D = 43; + /** RegularExpression Id. */ + int NUM = 44; + /** RegularExpression Id. */ + int UNICODERANGE = 45; + /** RegularExpression Id. */ + int RANGE = 46; + /** RegularExpression Id. */ + int Q16 = 47; + /** RegularExpression Id. */ + int Q15 = 48; + /** RegularExpression Id. */ + int Q14 = 49; + /** RegularExpression Id. */ + int Q13 = 50; + /** RegularExpression Id. */ + int Q12 = 51; + /** RegularExpression Id. */ + int Q11 = 52; + /** RegularExpression Id. */ + int LATIN1 = 53; + /** RegularExpression Id. */ + int NMCHAR = 54; + /** RegularExpression Id. */ + int NMSTART = 55; + /** RegularExpression Id. */ + int STRING1 = 56; + /** RegularExpression Id. */ + int STRING2 = 57; + /** RegularExpression Id. */ + int NONASCII = 58; + /** RegularExpression Id. */ + int ESCAPE = 59; + /** RegularExpression Id. */ + int NL = 60; + /** RegularExpression Id. */ + int UNICODE = 61; + /** RegularExpression Id. */ + int HNUM = 62; + /** RegularExpression Id. */ + int H = 63; + /** RegularExpression Id. */ + int UNKNOWN = 66; + + /** Lexical state. */ + int DEFAULT = 0; + /** Lexical state. */ + int COMMENT = 1; + + /** Literal token values. */ + String[] tokenImage = { + "", + "", + "\"/*\"", + "", + "\":link\"", + "\":visited\"", + "\":active\"", + "\":first-line\"", + "\":first-letter\"", + "", + "\"{\"", + "\"}\"", + "\",\"", + "\".\"", + "\";\"", + "\":\"", + "\"/\"", + "\"+\"", + "\"-\"", + "\"=\"", + "\">\"", + "\"[\"", + "\"]\"", + "", + "\")\"", + "", + "\"\"", + "\"@import\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"rgb(\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"?\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"*/\"", + "", + "", + }; + +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS1TokenManager.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS1TokenManager.java new file mode 100644 index 000000000..e0f38a0d8 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS1TokenManager.java @@ -0,0 +1,3217 @@ +/* SACParserCSS1TokenManager.java */ +/* Generated By:JavaCC: Do not edit this line. SACParserCSS1TokenManager.java */ +package com.fr.third.steadystate.css.parser; +import org.w3c.css.sac.CSSParseException; +import org.w3c.css.sac.Condition; +import org.w3c.css.sac.LexicalUnit; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.Parser; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SelectorList; +import org.w3c.css.sac.SimpleSelector; + +/** Token Manager. */ +@SuppressWarnings("all") public class SACParserCSS1TokenManager implements SACParserCSS1Constants { + + /** Debug output. */ + public java.io.PrintStream debugStream = System.out; + /** Set debug output. */ + public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } +private final int jjStopStringLiteralDfa_0(int pos, long active0){ + switch (pos) + { + case 0: + if ((active0 & 0x20000000000L) != 0L) + { + jjmatchedKind = 3; + return 347; + } + if ((active0 & 0x2000L) != 0L) + return 348; + if ((active0 & 0x10000000L) != 0L) + return 72; + return -1; + case 1: + if ((active0 & 0x20000000000L) != 0L) + { + jjmatchedKind = 3; + jjmatchedPos = 1; + return 347; + } + if ((active0 & 0x10000000L) != 0L) + { + jjmatchedKind = 30; + jjmatchedPos = 1; + return 349; + } + return -1; + case 2: + if ((active0 & 0x20000000000L) != 0L) + { + jjmatchedKind = 3; + jjmatchedPos = 2; + return 347; + } + if ((active0 & 0x10000000L) != 0L) + { + jjmatchedKind = 30; + jjmatchedPos = 2; + return 349; + } + return -1; + case 3: + if ((active0 & 0x10000000L) != 0L) + { + jjmatchedKind = 30; + jjmatchedPos = 3; + return 349; + } + return -1; + case 4: + if ((active0 & 0x10000000L) != 0L) + { + jjmatchedKind = 30; + jjmatchedPos = 4; + return 349; + } + return -1; + case 5: + if ((active0 & 0x10000000L) != 0L) + { + jjmatchedKind = 30; + jjmatchedPos = 5; + return 349; + } + return -1; + case 6: + if ((active0 & 0x10000000L) != 0L) + return 349; + return -1; + default : + return -1; + } +} +private final int jjStartNfa_0(int pos, long active0){ + return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1); +} +private int jjStopAtPos(int pos, int kind) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + return pos + 1; +} +private int jjMoveStringLiteralDfa0_0(){ + switch(curChar) + { + case 41: + return jjStopAtPos(0, 24); + case 43: + return jjStopAtPos(0, 17); + case 44: + return jjStopAtPos(0, 12); + case 45: + jjmatchedKind = 18; + return jjMoveStringLiteralDfa1_0(0x8000000L); + case 46: + return jjStartNfaWithStates_0(0, 13, 348); + case 47: + jjmatchedKind = 16; + return jjMoveStringLiteralDfa1_0(0x4L); + case 58: + jjmatchedKind = 15; + return jjMoveStringLiteralDfa1_0(0x1f0L); + case 59: + return jjStopAtPos(0, 14); + case 60: + return jjMoveStringLiteralDfa1_0(0x4000000L); + case 61: + return jjStopAtPos(0, 19); + case 62: + return jjStopAtPos(0, 20); + case 64: + return jjMoveStringLiteralDfa1_0(0x10000000L); + case 91: + return jjStopAtPos(0, 21); + case 93: + return jjStopAtPos(0, 22); + case 82: + case 114: + return jjMoveStringLiteralDfa1_0(0x20000000000L); + case 123: + return jjStopAtPos(0, 10); + case 125: + return jjStopAtPos(0, 11); + default : + return jjMoveNfa_0(1, 0); + } +} +private int jjMoveStringLiteralDfa1_0(long active0){ + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(0, active0); + return 1; + } + switch(curChar) + { + case 33: + return jjMoveStringLiteralDfa2_0(active0, 0x4000000L); + case 42: + if ((active0 & 0x4L) != 0L) + return jjStopAtPos(1, 2); + break; + case 45: + return jjMoveStringLiteralDfa2_0(active0, 0x8000000L); + case 65: + case 97: + return jjMoveStringLiteralDfa2_0(active0, 0x40L); + case 70: + case 102: + return jjMoveStringLiteralDfa2_0(active0, 0x180L); + case 71: + case 103: + return jjMoveStringLiteralDfa2_0(active0, 0x20000000000L); + case 73: + case 105: + return jjMoveStringLiteralDfa2_0(active0, 0x10000000L); + case 76: + case 108: + return jjMoveStringLiteralDfa2_0(active0, 0x10L); + case 86: + case 118: + return jjMoveStringLiteralDfa2_0(active0, 0x20L); + default : + break; + } + return jjStartNfa_0(0, active0); +} +private int jjMoveStringLiteralDfa2_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(0, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(1, active0); + return 2; + } + switch(curChar) + { + case 45: + return jjMoveStringLiteralDfa3_0(active0, 0x4000000L); + case 62: + if ((active0 & 0x8000000L) != 0L) + return jjStopAtPos(2, 27); + break; + case 66: + case 98: + return jjMoveStringLiteralDfa3_0(active0, 0x20000000000L); + case 67: + case 99: + return jjMoveStringLiteralDfa3_0(active0, 0x40L); + case 73: + case 105: + return jjMoveStringLiteralDfa3_0(active0, 0x1b0L); + case 77: + case 109: + return jjMoveStringLiteralDfa3_0(active0, 0x10000000L); + default : + break; + } + return jjStartNfa_0(1, active0); +} +private int jjMoveStringLiteralDfa3_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(1, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(2, active0); + return 3; + } + switch(curChar) + { + case 40: + if ((active0 & 0x20000000000L) != 0L) + return jjStopAtPos(3, 41); + break; + case 45: + if ((active0 & 0x4000000L) != 0L) + return jjStopAtPos(3, 26); + break; + case 78: + case 110: + return jjMoveStringLiteralDfa4_0(active0, 0x10L); + case 80: + case 112: + return jjMoveStringLiteralDfa4_0(active0, 0x10000000L); + case 82: + case 114: + return jjMoveStringLiteralDfa4_0(active0, 0x180L); + case 83: + case 115: + return jjMoveStringLiteralDfa4_0(active0, 0x20L); + case 84: + case 116: + return jjMoveStringLiteralDfa4_0(active0, 0x40L); + default : + break; + } + return jjStartNfa_0(2, active0); +} +private int jjMoveStringLiteralDfa4_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(2, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(3, active0); + return 4; + } + switch(curChar) + { + case 73: + case 105: + return jjMoveStringLiteralDfa5_0(active0, 0x60L); + case 75: + case 107: + if ((active0 & 0x10L) != 0L) + return jjStopAtPos(4, 4); + break; + case 79: + case 111: + return jjMoveStringLiteralDfa5_0(active0, 0x10000000L); + case 83: + case 115: + return jjMoveStringLiteralDfa5_0(active0, 0x180L); + default : + break; + } + return jjStartNfa_0(3, active0); +} +private int jjMoveStringLiteralDfa5_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(3, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(4, active0); + return 5; + } + switch(curChar) + { + case 82: + case 114: + return jjMoveStringLiteralDfa6_0(active0, 0x10000000L); + case 84: + case 116: + return jjMoveStringLiteralDfa6_0(active0, 0x1a0L); + case 86: + case 118: + return jjMoveStringLiteralDfa6_0(active0, 0x40L); + default : + break; + } + return jjStartNfa_0(4, active0); +} +private int jjMoveStringLiteralDfa6_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(4, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(5, active0); + return 6; + } + switch(curChar) + { + case 45: + return jjMoveStringLiteralDfa7_0(active0, 0x180L); + case 69: + case 101: + if ((active0 & 0x40L) != 0L) + return jjStopAtPos(6, 6); + return jjMoveStringLiteralDfa7_0(active0, 0x20L); + case 84: + case 116: + if ((active0 & 0x10000000L) != 0L) + return jjStartNfaWithStates_0(6, 28, 349); + break; + default : + break; + } + return jjStartNfa_0(5, active0); +} +private int jjMoveStringLiteralDfa7_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(5, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(6, active0); + return 7; + } + switch(curChar) + { + case 68: + case 100: + if ((active0 & 0x20L) != 0L) + return jjStopAtPos(7, 5); + break; + case 76: + case 108: + return jjMoveStringLiteralDfa8_0(active0, 0x180L); + default : + break; + } + return jjStartNfa_0(6, active0); +} +private int jjMoveStringLiteralDfa8_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(6, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(7, active0); + return 8; + } + switch(curChar) + { + case 69: + case 101: + return jjMoveStringLiteralDfa9_0(active0, 0x100L); + case 73: + case 105: + return jjMoveStringLiteralDfa9_0(active0, 0x80L); + default : + break; + } + return jjStartNfa_0(7, active0); +} +private int jjMoveStringLiteralDfa9_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(7, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(8, active0); + return 9; + } + switch(curChar) + { + case 78: + case 110: + return jjMoveStringLiteralDfa10_0(active0, 0x80L); + case 84: + case 116: + return jjMoveStringLiteralDfa10_0(active0, 0x100L); + default : + break; + } + return jjStartNfa_0(8, active0); +} +private int jjMoveStringLiteralDfa10_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(8, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(9, active0); + return 10; + } + switch(curChar) + { + case 69: + case 101: + if ((active0 & 0x80L) != 0L) + return jjStopAtPos(10, 7); + break; + case 84: + case 116: + return jjMoveStringLiteralDfa11_0(active0, 0x100L); + default : + break; + } + return jjStartNfa_0(9, active0); +} +private int jjMoveStringLiteralDfa11_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(9, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(10, active0); + return 11; + } + switch(curChar) + { + case 69: + case 101: + return jjMoveStringLiteralDfa12_0(active0, 0x100L); + default : + break; + } + return jjStartNfa_0(10, active0); +} +private int jjMoveStringLiteralDfa12_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(10, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(11, active0); + return 12; + } + switch(curChar) + { + case 82: + case 114: + if ((active0 & 0x100L) != 0L) + return jjStopAtPos(12, 8); + break; + default : + break; + } + return jjStartNfa_0(11, active0); +} +private int jjStartNfaWithStates_0(int pos, int kind, int state) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return pos + 1; } + return jjMoveNfa_0(state, pos + 1); +} +static final long[] jjbitVec0 = { + 0x0L, 0x0L, 0xfffffffe00000000L, 0xffffffffffffffffL +}; +static final long[] jjbitVec1 = { + 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL +}; +static final long[] jjbitVec3 = { + 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL +}; +private int jjMoveNfa_0(int startState, int curPos) +{ + int startsAt = 0; + jjnewStateCnt = 347; + int i = 1; + jjstateSet[0] = startState; + int kind = 0x7fffffff; + for (;;) + { + if (++jjround == 0x7fffffff) + ReInitRounds(); + if (curChar < 64) + { + long l = 1L << curChar; + do + { + switch(jjstateSet[--i]) + { + case 348: + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 44) + kind = 44; + { jjCheckNAdd(271); } + } + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 40) + kind = 40; + { jjCheckNAdd(270); } + } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(268, 269); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(265, 267); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(262, 264); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(259, 261); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(256, 258); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(253, 255); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(250, 252); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(247, 249); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(244, 246); } + break; + case 349: + case 73: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 30) + kind = 30; + { jjCheckNAddTwoStates(73, 74); } + break; + case 347: + case 105: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(105, 106); } + break; + case 1: + if ((0x3ff200000000000L & l) != 0L) + { + if (kind > 54) + kind = 54; + } + else if ((0x100003600L & l) != 0L) + { + if (kind > 1) + kind = 1; + { jjCheckNAdd(0); } + } + else if (curChar == 46) + { jjCheckNAddStates(0, 10); } + else if (curChar == 33) + { jjCheckNAddTwoStates(61, 70); } + else if (curChar == 39) + { jjCheckNAddStates(11, 13); } + else if (curChar == 34) + { jjCheckNAddStates(14, 16); } + else if (curChar == 35) + { jjCheckNAddTwoStates(2, 3); } + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 40) + kind = 40; + { jjCheckNAddStates(17, 58); } + } + break; + case 0: + if ((0x100003600L & l) == 0L) + break; + if (kind > 1) + kind = 1; + { jjCheckNAdd(0); } + break; + case 2: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddTwoStates(2, 3); } + break; + case 4: + if ((0xffffffff00000000L & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddTwoStates(2, 3); } + break; + case 5: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddStates(59, 66); } + break; + case 6: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddStates(67, 69); } + break; + case 7: + if ((0x100003600L & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddTwoStates(2, 3); } + break; + case 8: + case 10: + case 13: + case 17: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(6); } + break; + case 9: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 10; + break; + case 11: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 12; + break; + case 12: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 13; + break; + case 14: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 15; + break; + case 15: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 16; + break; + case 16: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 17; + break; + case 18: + if (curChar == 34) + { jjCheckNAddStates(14, 16); } + break; + case 19: + if ((0xfffffffb00000200L & l) != 0L) + { jjCheckNAddStates(14, 16); } + break; + case 20: + if (curChar == 34 && kind > 23) + kind = 23; + break; + case 22: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(14, 16); } + break; + case 23: + if (curChar == 10) + { jjCheckNAddStates(14, 16); } + break; + case 24: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 23; + break; + case 25: + if ((0xffffffff00000000L & l) != 0L) + { jjCheckNAddStates(14, 16); } + break; + case 26: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(70, 78); } + break; + case 27: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(79, 82); } + break; + case 28: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(14, 16); } + break; + case 29: + case 31: + case 34: + case 38: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(27); } + break; + case 30: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 31; + break; + case 32: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 33; + break; + case 33: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 34; + break; + case 35: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 36; + break; + case 36: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 37; + break; + case 37: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 38; + break; + case 39: + if (curChar == 39) + { jjCheckNAddStates(11, 13); } + break; + case 40: + if ((0xffffff7f00000200L & l) != 0L) + { jjCheckNAddStates(11, 13); } + break; + case 41: + if (curChar == 39 && kind > 23) + kind = 23; + break; + case 43: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(11, 13); } + break; + case 44: + if (curChar == 10) + { jjCheckNAddStates(11, 13); } + break; + case 45: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 44; + break; + case 46: + if ((0xffffffff00000000L & l) != 0L) + { jjCheckNAddStates(11, 13); } + break; + case 47: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(83, 91); } + break; + case 48: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(92, 95); } + break; + case 49: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(11, 13); } + break; + case 50: + case 52: + case 55: + case 59: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(48); } + break; + case 51: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 52; + break; + case 53: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 54; + break; + case 54: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 55; + break; + case 56: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 57; + break; + case 57: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 58; + break; + case 58: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 59; + break; + case 60: + if (curChar == 33) + { jjCheckNAddTwoStates(61, 70); } + break; + case 61: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(61, 70); } + break; + case 75: + if ((0xffffffff00000000L & l) == 0L) + break; + if (kind > 30) + kind = 30; + { jjCheckNAddTwoStates(73, 74); } + break; + case 76: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 30) + kind = 30; + { jjCheckNAddStates(96, 103); } + break; + case 77: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 30) + kind = 30; + { jjCheckNAddStates(104, 106); } + break; + case 78: + if ((0x100003600L & l) == 0L) + break; + if (kind > 30) + kind = 30; + { jjCheckNAddTwoStates(73, 74); } + break; + case 79: + case 81: + case 84: + case 88: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(77); } + break; + case 80: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 81; + break; + case 82: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 83; + break; + case 83: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 84; + break; + case 85: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 86; + break; + case 86: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 87; + break; + case 87: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 88; + break; + case 90: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 30) + kind = 30; + { jjCheckNAddStates(107, 114); } + break; + case 91: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 30) + kind = 30; + { jjCheckNAddStates(115, 117); } + break; + case 92: + case 94: + case 97: + case 101: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(91); } + break; + case 93: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 94; + break; + case 95: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 96; + break; + case 96: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 97; + break; + case 98: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 99; + break; + case 99: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 100; + break; + case 100: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 101; + break; + case 103: + if ((0x3ff200000000000L & l) != 0L && kind > 54) + kind = 54; + break; + case 107: + if ((0xffffffff00000000L & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(105, 106); } + break; + case 108: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddStates(118, 125); } + break; + case 109: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddStates(126, 128); } + break; + case 110: + if ((0x100003600L & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(105, 106); } + break; + case 111: + case 113: + case 116: + case 120: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(109); } + break; + case 112: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 113; + break; + case 114: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 115; + break; + case 115: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 116; + break; + case 117: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 118; + break; + case 118: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 119; + break; + case 119: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 120; + break; + case 122: + if (curChar == 40) + { jjCheckNAddStates(129, 134); } + break; + case 123: + if ((0xfffffc7a00000000L & l) != 0L) + { jjCheckNAddStates(135, 138); } + break; + case 124: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(124, 125); } + break; + case 125: + if (curChar == 41 && kind > 25) + kind = 25; + break; + case 127: + if ((0xffffffff00000000L & l) != 0L) + { jjCheckNAddStates(135, 138); } + break; + case 128: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(139, 147); } + break; + case 129: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(148, 151); } + break; + case 130: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(135, 138); } + break; + case 131: + case 133: + case 136: + case 140: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(129); } + break; + case 132: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 133; + break; + case 134: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 135; + break; + case 135: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 136; + break; + case 137: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 138; + break; + case 138: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 139; + break; + case 139: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 140; + break; + case 141: + if (curChar == 39) + { jjCheckNAddStates(152, 154); } + break; + case 142: + if ((0xffffff7f00000200L & l) != 0L) + { jjCheckNAddStates(152, 154); } + break; + case 143: + if (curChar == 39) + { jjCheckNAddTwoStates(124, 125); } + break; + case 145: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(152, 154); } + break; + case 146: + if (curChar == 10) + { jjCheckNAddStates(152, 154); } + break; + case 147: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 146; + break; + case 148: + if ((0xffffffff00000000L & l) != 0L) + { jjCheckNAddStates(152, 154); } + break; + case 149: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(155, 163); } + break; + case 150: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(164, 167); } + break; + case 151: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(152, 154); } + break; + case 152: + case 154: + case 157: + case 161: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(150); } + break; + case 153: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 154; + break; + case 155: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 156; + break; + case 156: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 157; + break; + case 158: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 159; + break; + case 159: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 160; + break; + case 160: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 161; + break; + case 162: + if (curChar == 34) + { jjCheckNAddStates(168, 170); } + break; + case 163: + if ((0xfffffffb00000200L & l) != 0L) + { jjCheckNAddStates(168, 170); } + break; + case 164: + if (curChar == 34) + { jjCheckNAddTwoStates(124, 125); } + break; + case 166: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(168, 170); } + break; + case 167: + if (curChar == 10) + { jjCheckNAddStates(168, 170); } + break; + case 168: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 167; + break; + case 169: + if ((0xffffffff00000000L & l) != 0L) + { jjCheckNAddStates(168, 170); } + break; + case 170: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(171, 179); } + break; + case 171: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(180, 183); } + break; + case 172: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(168, 170); } + break; + case 173: + case 175: + case 178: + case 182: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(171); } + break; + case 174: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 175; + break; + case 176: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 177; + break; + case 177: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 178; + break; + case 179: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 180; + break; + case 180: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 181; + break; + case 181: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 182; + break; + case 183: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(184, 190); } + break; + case 186: + if (curChar == 43) + { jjCheckNAddStates(191, 193); } + break; + case 187: + case 216: + if (curChar == 63 && kind > 45) + kind = 45; + break; + case 188: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 45) + kind = 45; + { jjCheckNAddStates(194, 202); } + break; + case 189: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(190); } + break; + case 190: + if (curChar == 45) + jjstateSet[jjnewStateCnt++] = 191; + break; + case 191: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 45) + kind = 45; + { jjCheckNAddStates(203, 207); } + break; + case 192: + if ((0x3ff000000000000L & l) != 0L && kind > 45) + kind = 45; + break; + case 193: + case 195: + case 198: + case 202: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(192); } + break; + case 194: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 195; + break; + case 196: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 197; + break; + case 197: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 198; + break; + case 199: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 200; + break; + case 200: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 201; + break; + case 201: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 202; + break; + case 203: + case 205: + case 208: + case 212: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(189); } + break; + case 204: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 205; + break; + case 206: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 207; + break; + case 207: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 208; + break; + case 209: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 210; + break; + case 210: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 211; + break; + case 211: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 212; + break; + case 213: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 45) + kind = 45; + { jjCheckNAddStates(208, 210); } + break; + case 214: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 45) + kind = 45; + { jjCheckNAddStates(211, 213); } + break; + case 215: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 45) + kind = 45; + { jjCheckNAddStates(214, 216); } + break; + case 217: + case 220: + case 222: + case 223: + case 226: + case 227: + case 229: + case 233: + case 237: + case 240: + case 242: + if (curChar == 63) + { jjCheckNAdd(216); } + break; + case 218: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 45) + kind = 45; + { jjCheckNAddTwoStates(187, 192); } + break; + case 219: + if (curChar == 63) + { jjCheckNAddTwoStates(216, 220); } + break; + case 221: + if (curChar == 63) + { jjCheckNAddStates(217, 219); } + break; + case 224: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 223; + break; + case 225: + if (curChar == 63) + { jjCheckNAddStates(220, 223); } + break; + case 228: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 227; + break; + case 230: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 229; + break; + case 231: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 230; + break; + case 232: + if (curChar == 63) + { jjCheckNAddStates(224, 228); } + break; + case 234: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 233; + break; + case 235: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 234; + break; + case 236: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 235; + break; + case 238: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 237; + break; + case 239: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 238; + break; + case 241: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 240; + break; + case 243: + if (curChar == 46) + { jjCheckNAddStates(0, 10); } + break; + case 244: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(244, 246); } + break; + case 247: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(247, 249); } + break; + case 250: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(250, 252); } + break; + case 253: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(253, 255); } + break; + case 256: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(256, 258); } + break; + case 259: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(259, 261); } + break; + case 262: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(262, 264); } + break; + case 265: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(265, 267); } + break; + case 268: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(268, 269); } + break; + case 269: + if (curChar == 37 && kind > 39) + kind = 39; + break; + case 270: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 40) + kind = 40; + { jjCheckNAdd(270); } + break; + case 271: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 44) + kind = 44; + { jjCheckNAdd(271); } + break; + case 273: + if ((0xffffffff00000000L & l) != 0L && kind > 54) + kind = 54; + break; + case 274: + if ((0xffffffff00000000L & l) != 0L && kind > 55) + kind = 55; + break; + case 275: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 55) + kind = 55; + { jjCheckNAddStates(229, 234); } + break; + case 276: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 55) + kind = 55; + { jjCheckNAdd(277); } + break; + case 277: + if ((0x100003600L & l) != 0L && kind > 55) + kind = 55; + break; + case 278: + case 280: + case 283: + case 287: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(276); } + break; + case 279: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 280; + break; + case 281: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 282; + break; + case 282: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 283; + break; + case 284: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 285; + break; + case 285: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 286; + break; + case 286: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 287; + break; + case 288: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 54) + kind = 54; + { jjCheckNAddStates(235, 240); } + break; + case 289: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 54) + kind = 54; + { jjCheckNAdd(290); } + break; + case 290: + if ((0x100003600L & l) != 0L && kind > 54) + kind = 54; + break; + case 291: + case 293: + case 296: + case 300: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(289); } + break; + case 292: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 293; + break; + case 294: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 295; + break; + case 295: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 296; + break; + case 297: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 298; + break; + case 298: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 299; + break; + case 299: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 300; + break; + case 301: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddStates(241, 248); } + break; + case 302: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddStates(249, 251); } + break; + case 303: + case 305: + case 308: + case 312: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(302); } + break; + case 304: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 305; + break; + case 306: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 307; + break; + case 307: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 308; + break; + case 309: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 310; + break; + case 310: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 311; + break; + case 311: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 312; + break; + case 313: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 40) + kind = 40; + { jjCheckNAddStates(17, 58); } + break; + case 314: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(314, 246); } + break; + case 315: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(315, 316); } + break; + case 316: + if (curChar == 46) + { jjCheckNAdd(244); } + break; + case 317: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(317, 249); } + break; + case 318: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(318, 319); } + break; + case 319: + if (curChar == 46) + { jjCheckNAdd(247); } + break; + case 320: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(320, 252); } + break; + case 321: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(321, 322); } + break; + case 322: + if (curChar == 46) + { jjCheckNAdd(250); } + break; + case 323: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(323, 255); } + break; + case 324: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(324, 325); } + break; + case 325: + if (curChar == 46) + { jjCheckNAdd(253); } + break; + case 326: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(326, 258); } + break; + case 327: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(327, 328); } + break; + case 328: + if (curChar == 46) + { jjCheckNAdd(256); } + break; + case 329: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(329, 261); } + break; + case 330: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(330, 331); } + break; + case 331: + if (curChar == 46) + { jjCheckNAdd(259); } + break; + case 332: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(332, 264); } + break; + case 333: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(333, 334); } + break; + case 334: + if (curChar == 46) + { jjCheckNAdd(262); } + break; + case 335: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(335, 267); } + break; + case 336: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(336, 337); } + break; + case 337: + if (curChar == 46) + { jjCheckNAdd(265); } + break; + case 338: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(338, 269); } + break; + case 339: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(339, 340); } + break; + case 340: + if (curChar == 46) + { jjCheckNAdd(268); } + break; + case 341: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 40) + kind = 40; + { jjCheckNAdd(341); } + break; + case 342: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(342, 343); } + break; + case 343: + if (curChar == 46) + { jjCheckNAdd(270); } + break; + case 344: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 44) + kind = 44; + { jjCheckNAdd(344); } + break; + case 345: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(345, 346); } + break; + case 346: + if (curChar == 46) + { jjCheckNAdd(271); } + break; + default : break; + } + } while(i != startsAt); + } + else if (curChar < 128) + { + long l = 1L << (curChar & 077); + do + { + switch(jjstateSet[--i]) + { + case 72: + if ((0x7fffffe07fffffeL & l) != 0L) + { + if (kind > 30) + kind = 30; + { jjCheckNAddTwoStates(73, 74); } + } + else if (curChar == 92) + { jjCheckNAddTwoStates(75, 90); } + break; + case 349: + if ((0x7fffffe07fffffeL & l) != 0L) + { + if (kind > 30) + kind = 30; + { jjCheckNAddTwoStates(73, 74); } + } + else if (curChar == 92) + { jjCheckNAddTwoStates(75, 76); } + break; + case 347: + if ((0x7fffffe07fffffeL & l) != 0L) + { + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(105, 106); } + } + else if (curChar == 92) + { jjCheckNAddTwoStates(107, 108); } + break; + case 1: + if ((0x7fffffe07fffffeL & l) != 0L) + { + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(105, 106); } + } + else if (curChar == 92) + { jjCheckNAddStates(252, 257); } + else if (curChar == 64) + { jjAddStates(258, 259); } + if ((0x7fffffe07fffffeL & l) != 0L) + { + if (kind > 54) + kind = 54; + } + if ((0x20000000200000L & l) != 0L) + { jjAddStates(260, 261); } + break; + case 2: + if ((0x7fffffe07fffffeL & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddTwoStates(2, 3); } + break; + case 3: + if (curChar == 92) + { jjAddStates(262, 263); } + break; + case 4: + if ((0x7fffffffffffffffL & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddTwoStates(2, 3); } + break; + case 5: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddStates(59, 66); } + break; + case 6: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddStates(67, 69); } + break; + case 8: + case 10: + case 13: + case 17: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(6); } + break; + case 9: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 10; + break; + case 11: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 12; + break; + case 12: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 13; + break; + case 14: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 15; + break; + case 15: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 16; + break; + case 16: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 17; + break; + case 19: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(14, 16); } + break; + case 21: + if (curChar == 92) + { jjAddStates(264, 267); } + break; + case 25: + if ((0x7fffffffffffffffL & l) != 0L) + { jjCheckNAddStates(14, 16); } + break; + case 26: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(70, 78); } + break; + case 27: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(79, 82); } + break; + case 29: + case 31: + case 34: + case 38: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(27); } + break; + case 30: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 31; + break; + case 32: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 33; + break; + case 33: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 34; + break; + case 35: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 36; + break; + case 36: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 37; + break; + case 37: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 38; + break; + case 40: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(11, 13); } + break; + case 42: + if (curChar == 92) + { jjAddStates(268, 271); } + break; + case 46: + if ((0x7fffffffffffffffL & l) != 0L) + { jjCheckNAddStates(11, 13); } + break; + case 47: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(83, 91); } + break; + case 48: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(92, 95); } + break; + case 50: + case 52: + case 55: + case 59: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(48); } + break; + case 51: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 52; + break; + case 53: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 54; + break; + case 54: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 55; + break; + case 56: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 57; + break; + case 57: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 58; + break; + case 58: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 59; + break; + case 62: + if ((0x10000000100000L & l) != 0L && kind > 29) + kind = 29; + break; + case 63: + if ((0x400000004000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 62; + break; + case 64: + if ((0x200000002L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 63; + break; + case 65: + if ((0x10000000100000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 64; + break; + case 66: + if ((0x4000000040000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 65; + break; + case 67: + if ((0x800000008000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 66; + break; + case 68: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 67; + break; + case 69: + if ((0x200000002000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 68; + break; + case 70: + if ((0x20000000200L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 69; + break; + case 71: + if (curChar == 64) + { jjAddStates(258, 259); } + break; + case 73: + if ((0x7fffffe07fffffeL & l) == 0L) + break; + if (kind > 30) + kind = 30; + { jjCheckNAddTwoStates(73, 74); } + break; + case 74: + if (curChar == 92) + { jjCheckNAddTwoStates(75, 76); } + break; + case 75: + if ((0x7fffffffffffffffL & l) == 0L) + break; + if (kind > 30) + kind = 30; + { jjCheckNAddTwoStates(73, 74); } + break; + case 76: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 30) + kind = 30; + { jjCheckNAddStates(96, 103); } + break; + case 77: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 30) + kind = 30; + { jjCheckNAddStates(104, 106); } + break; + case 79: + case 81: + case 84: + case 88: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(77); } + break; + case 80: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 81; + break; + case 82: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 83; + break; + case 83: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 84; + break; + case 85: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 86; + break; + case 86: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 87; + break; + case 87: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 88; + break; + case 89: + if (curChar == 92) + { jjCheckNAddTwoStates(75, 90); } + break; + case 90: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 30) + kind = 30; + { jjCheckNAddStates(107, 114); } + break; + case 91: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 30) + kind = 30; + { jjCheckNAddStates(115, 117); } + break; + case 92: + case 94: + case 97: + case 101: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(91); } + break; + case 93: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 94; + break; + case 95: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 96; + break; + case 96: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 97; + break; + case 98: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 99; + break; + case 99: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 100; + break; + case 100: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 101; + break; + case 103: + if ((0x7fffffe07fffffeL & l) != 0L && kind > 54) + kind = 54; + break; + case 104: + if ((0x7fffffe07fffffeL & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(105, 106); } + break; + case 105: + if ((0x7fffffe07fffffeL & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(105, 106); } + break; + case 106: + if (curChar == 92) + { jjCheckNAddTwoStates(107, 108); } + break; + case 107: + if ((0x7fffffffffffffffL & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(105, 106); } + break; + case 108: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddStates(118, 125); } + break; + case 109: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddStates(126, 128); } + break; + case 111: + case 113: + case 116: + case 120: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(109); } + break; + case 112: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 113; + break; + case 114: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 115; + break; + case 115: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 116; + break; + case 117: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 118; + break; + case 118: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 119; + break; + case 119: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 120; + break; + case 121: + if ((0x20000000200000L & l) != 0L) + { jjAddStates(260, 261); } + break; + case 123: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(135, 138); } + break; + case 126: + if (curChar == 92) + { jjAddStates(272, 273); } + break; + case 127: + if ((0x7fffffffffffffffL & l) != 0L) + { jjCheckNAddStates(135, 138); } + break; + case 128: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(139, 147); } + break; + case 129: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(148, 151); } + break; + case 131: + case 133: + case 136: + case 140: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(129); } + break; + case 132: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 133; + break; + case 134: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 135; + break; + case 135: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 136; + break; + case 137: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 138; + break; + case 138: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 139; + break; + case 139: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 140; + break; + case 142: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(152, 154); } + break; + case 144: + if (curChar == 92) + { jjAddStates(274, 277); } + break; + case 148: + if ((0x7fffffffffffffffL & l) != 0L) + { jjCheckNAddStates(152, 154); } + break; + case 149: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(155, 163); } + break; + case 150: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(164, 167); } + break; + case 152: + case 154: + case 157: + case 161: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(150); } + break; + case 153: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 154; + break; + case 155: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 156; + break; + case 156: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 157; + break; + case 158: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 159; + break; + case 159: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 160; + break; + case 160: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 161; + break; + case 163: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(168, 170); } + break; + case 165: + if (curChar == 92) + { jjAddStates(278, 281); } + break; + case 169: + if ((0x7fffffffffffffffL & l) != 0L) + { jjCheckNAddStates(168, 170); } + break; + case 170: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(171, 179); } + break; + case 171: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(180, 183); } + break; + case 173: + case 175: + case 178: + case 182: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(171); } + break; + case 174: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 175; + break; + case 176: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 177; + break; + case 177: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 178; + break; + case 179: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 180; + break; + case 180: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 181; + break; + case 181: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 182; + break; + case 184: + if ((0x100000001000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 122; + break; + case 185: + if ((0x4000000040000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 184; + break; + case 188: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 45) + kind = 45; + { jjCheckNAddStates(194, 202); } + break; + case 189: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(190); } + break; + case 191: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 45) + kind = 45; + { jjCheckNAddStates(203, 207); } + break; + case 192: + if ((0x7e0000007eL & l) != 0L && kind > 45) + kind = 45; + break; + case 193: + case 195: + case 198: + case 202: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(192); } + break; + case 194: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 195; + break; + case 196: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 197; + break; + case 197: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 198; + break; + case 199: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 200; + break; + case 200: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 201; + break; + case 201: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 202; + break; + case 203: + case 205: + case 208: + case 212: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(189); } + break; + case 204: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 205; + break; + case 206: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 207; + break; + case 207: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 208; + break; + case 209: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 210; + break; + case 210: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 211; + break; + case 211: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 212; + break; + case 213: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 45) + kind = 45; + { jjCheckNAddStates(208, 210); } + break; + case 214: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 45) + kind = 45; + { jjCheckNAddStates(211, 213); } + break; + case 215: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 45) + kind = 45; + { jjCheckNAddStates(214, 216); } + break; + case 218: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 45) + kind = 45; + { jjCheckNAddTwoStates(187, 192); } + break; + case 245: + if ((0x200000002000L & l) != 0L && kind > 31) + kind = 31; + break; + case 246: + if ((0x2000000020L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 245; + break; + case 248: + if ((0x100000001000000L & l) != 0L && kind > 32) + kind = 32; + break; + case 249: + if ((0x2000000020L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 248; + break; + case 251: + if ((0x100000001000000L & l) != 0L && kind > 33) + kind = 33; + break; + case 252: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 251; + break; + case 254: + if ((0x200000002000L & l) != 0L && kind > 34) + kind = 34; + break; + case 255: + if ((0x800000008L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 254; + break; + case 257: + if ((0x200000002000L & l) != 0L && kind > 35) + kind = 35; + break; + case 258: + if ((0x200000002000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 257; + break; + case 260: + if ((0x400000004000L & l) != 0L && kind > 36) + kind = 36; + break; + case 261: + if ((0x20000000200L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 260; + break; + case 263: + if ((0x10000000100000L & l) != 0L && kind > 37) + kind = 37; + break; + case 264: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 263; + break; + case 266: + if ((0x800000008L & l) != 0L && kind > 38) + kind = 38; + break; + case 267: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 266; + break; + case 272: + if (curChar == 92) + { jjCheckNAddStates(252, 257); } + break; + case 273: + if ((0x7fffffffffffffffL & l) != 0L && kind > 54) + kind = 54; + break; + case 274: + if ((0x7fffffffffffffffL & l) != 0L && kind > 55) + kind = 55; + break; + case 275: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 55) + kind = 55; + { jjCheckNAddStates(229, 234); } + break; + case 276: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 55) + kind = 55; + { jjCheckNAdd(277); } + break; + case 278: + case 280: + case 283: + case 287: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(276); } + break; + case 279: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 280; + break; + case 281: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 282; + break; + case 282: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 283; + break; + case 284: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 285; + break; + case 285: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 286; + break; + case 286: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 287; + break; + case 288: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 54) + kind = 54; + { jjCheckNAddStates(235, 240); } + break; + case 289: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 54) + kind = 54; + { jjCheckNAdd(290); } + break; + case 291: + case 293: + case 296: + case 300: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(289); } + break; + case 292: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 293; + break; + case 294: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 295; + break; + case 295: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 296; + break; + case 297: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 298; + break; + case 298: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 299; + break; + case 299: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 300; + break; + case 301: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddStates(241, 248); } + break; + case 302: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddStates(249, 251); } + break; + case 303: + case 305: + case 308: + case 312: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(302); } + break; + case 304: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 305; + break; + case 306: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 307; + break; + case 307: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 308; + break; + case 309: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 310; + break; + case 310: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 311; + break; + case 311: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 312; + break; + default : break; + } + } while(i != startsAt); + } + else + { + int hiByte = (curChar >> 8); + int i1 = hiByte >> 6; + long l1 = 1L << (hiByte & 077); + int i2 = (curChar & 0xff) >> 6; + long l2 = 1L << (curChar & 077); + do + { + switch(jjstateSet[--i]) + { + case 72: + case 75: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 30) + kind = 30; + { jjCheckNAddTwoStates(73, 74); } + break; + case 349: + case 73: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 30) + kind = 30; + { jjCheckNAddTwoStates(73, 74); } + break; + case 347: + case 105: + case 107: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(105, 106); } + break; + case 1: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { + if (kind > 53) + kind = 53; + } + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { + if (kind > 54) + kind = 54; + } + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(105, 106); } + } + break; + case 2: + case 4: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddTwoStates(2, 3); } + break; + case 19: + if (jjCanMove_1(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(14, 16); } + break; + case 25: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(14, 16); } + break; + case 40: + if (jjCanMove_1(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(11, 13); } + break; + case 46: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(11, 13); } + break; + case 102: + if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 53) + kind = 53; + break; + case 103: + case 273: + if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 54) + kind = 54; + break; + case 104: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(105, 106); } + break; + case 123: + if (jjCanMove_1(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(135, 138); } + break; + case 127: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(135, 138); } + break; + case 142: + if (jjCanMove_1(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(152, 154); } + break; + case 148: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(152, 154); } + break; + case 163: + if (jjCanMove_1(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(168, 170); } + break; + case 169: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(168, 170); } + break; + case 274: + if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 55) + kind = 55; + break; + default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break; + } + } while(i != startsAt); + } + if (kind != 0x7fffffff) + { + jjmatchedKind = kind; + jjmatchedPos = curPos; + kind = 0x7fffffff; + } + ++curPos; + if ((i = jjnewStateCnt) == (startsAt = 347 - (jjnewStateCnt = startsAt))) + return curPos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return curPos; } + } +} +private int jjMoveStringLiteralDfa0_1(){ + switch(curChar) + { + case 42: + return jjMoveStringLiteralDfa1_1(0x1L); + default : + return 1; + } +} +private int jjMoveStringLiteralDfa1_1(long active1){ + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + return 1; + } + switch(curChar) + { + case 47: + if ((active1 & 0x1L) != 0L) + return jjStopAtPos(1, 64); + break; + default : + return 2; + } + return 2; +} + +/** Token literal values. */ +public static final String[] jjstrLiteralImages = { +"", null, null, null, null, null, null, null, null, null, "\173", "\175", +"\54", "\56", "\73", "\72", "\57", "\53", "\55", "\75", "\76", "\133", "\135", null, +"\51", null, "\74\41\55\55", "\55\55\76", 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, }; +protected Token jjFillToken() +{ + final Token t; + final String curTokenImage; + final int beginLine; + final int endLine; + final int beginColumn; + final int endColumn; + String im = jjstrLiteralImages[jjmatchedKind]; + curTokenImage = (im == null) ? input_stream.GetImage() : im; + beginLine = input_stream.getBeginLine(); + beginColumn = input_stream.getBeginColumn(); + endLine = input_stream.getEndLine(); + endColumn = input_stream.getEndColumn(); + t = Token.newToken(jjmatchedKind); + t.kind = jjmatchedKind; + t.image = curTokenImage; + + t.beginLine = beginLine; + t.endLine = endLine; + t.beginColumn = beginColumn; + t.endColumn = endColumn; + + return t; +} +static final int[] jjnextStates = { + 244, 247, 250, 253, 256, 259, 262, 265, 268, 270, 271, 40, 41, 42, 19, 20, + 21, 314, 315, 316, 246, 317, 318, 319, 249, 320, 321, 322, 252, 323, 324, 325, + 255, 326, 327, 328, 258, 329, 330, 331, 261, 332, 333, 334, 264, 335, 336, 337, + 267, 338, 339, 340, 269, 341, 342, 343, 344, 345, 346, 2, 6, 8, 9, 11, + 14, 7, 3, 2, 7, 3, 19, 27, 29, 30, 32, 35, 28, 20, 21, 19, + 28, 20, 21, 40, 48, 50, 51, 53, 56, 49, 41, 42, 40, 49, 41, 42, + 73, 77, 79, 80, 82, 85, 78, 74, 73, 78, 74, 91, 92, 93, 95, 98, + 78, 73, 74, 78, 73, 74, 105, 109, 111, 112, 114, 117, 110, 106, 105, 110, + 106, 123, 141, 162, 125, 126, 183, 123, 124, 125, 126, 123, 129, 131, 132, 134, + 137, 125, 126, 130, 123, 125, 126, 130, 142, 143, 144, 142, 150, 152, 153, 155, + 158, 151, 143, 144, 142, 151, 143, 144, 163, 164, 165, 163, 171, 173, 174, 176, + 179, 172, 164, 165, 163, 172, 164, 165, 123, 141, 162, 124, 125, 126, 183, 187, + 188, 232, 189, 203, 204, 206, 209, 190, 187, 213, 225, 192, 193, 194, 196, 199, + 187, 214, 221, 187, 215, 219, 187, 217, 218, 216, 222, 224, 216, 226, 228, 231, + 236, 239, 241, 242, 216, 276, 278, 279, 281, 284, 277, 289, 291, 292, 294, 297, + 290, 302, 303, 304, 306, 309, 110, 105, 106, 110, 105, 106, 107, 273, 274, 275, + 288, 301, 72, 89, 185, 186, 4, 5, 22, 24, 25, 26, 43, 45, 46, 47, + 127, 128, 145, 147, 148, 149, 166, 168, 169, 170, +}; +private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) +{ + switch(hiByte) + { + case 0: + return ((jjbitVec0[i2] & l2) != 0L); + default : + return false; + } +} +private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2) +{ + switch(hiByte) + { + case 0: + return ((jjbitVec3[i2] & l2) != 0L); + default : + if ((jjbitVec1[i1] & l1) != 0L) + return true; + return false; + } +} + +int curLexState = 0; +int defaultLexState = 0; +int jjnewStateCnt; +int jjround; +int jjmatchedPos; +int jjmatchedKind; + +/** Get the next Token. */ +public Token getNextToken() +{ + Token matchedToken; + int curPos = 0; + + EOFLoop : + for (;;) + { + try + { + curChar = input_stream.BeginToken(); + } + catch(Exception e) + { + jjmatchedKind = 0; + jjmatchedPos = -1; + matchedToken = jjFillToken(); + return matchedToken; + } + image = jjimage; + image.setLength(0); + jjimageLen = 0; + + for (;;) + { + switch(curLexState) + { + case 0: + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_0(); + if (jjmatchedPos == 0 && jjmatchedKind > 66) + { + jjmatchedKind = 66; + } + break; + case 1: + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_1(); + if (jjmatchedPos == 0 && jjmatchedKind > 65) + { + jjmatchedKind = 65; + } + break; + } + if (jjmatchedKind != 0x7fffffff) + { + if (jjmatchedPos + 1 < curPos) + input_stream.backup(curPos - jjmatchedPos - 1); + if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + matchedToken = jjFillToken(); + TokenLexicalActions(matchedToken); + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + return matchedToken; + } + else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + continue EOFLoop; + } + jjimageLen += jjmatchedPos + 1; + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + curPos = 0; + jjmatchedKind = 0x7fffffff; + try { + curChar = input_stream.readChar(); + continue; + } + catch (java.io.IOException e1) { } + } + int error_line = input_stream.getEndLine(); + int error_column = input_stream.getEndColumn(); + String error_after = null; + boolean EOFSeen = false; + try { input_stream.readChar(); input_stream.backup(1); } + catch (java.io.IOException e1) { + EOFSeen = true; + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + if (curChar == '\n' || curChar == '\r') { + error_line++; + error_column = 0; + } + else + error_column++; + } + if (!EOFSeen) { + input_stream.backup(1); + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + } + throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); + } + } +} + +void SkipLexicalActions(Token matchedToken) +{ + switch(jjmatchedKind) + { + default : + break; + } +} +void MoreLexicalActions() +{ + jjimageLen += (lengthOfMatch = jjmatchedPos + 1); + switch(jjmatchedKind) + { + default : + break; + } +} +void TokenLexicalActions(Token matchedToken) +{ + switch(jjmatchedKind) + { + case 4 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 1, 0); + break; + case 5 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 1, 0); + break; + case 6 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 1, 0); + break; + case 7 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 1, 0); + break; + case 8 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 1, 0); + break; + case 23 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 1, 1); + break; + case 25 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimUrl(image); + break; + case 31 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 32 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 33 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 34 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 35 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 36 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 37 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 38 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 39 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 1); + break; + default : + break; + } +} +private void jjCheckNAdd(int state) +{ + if (jjrounds[state] != jjround) + { + jjstateSet[jjnewStateCnt++] = state; + jjrounds[state] = jjround; + } +} +private void jjAddStates(int start, int end) +{ + do { + jjstateSet[jjnewStateCnt++] = jjnextStates[start]; + } while (start++ != end); +} +private void jjCheckNAddTwoStates(int state1, int state2) +{ + jjCheckNAdd(state1); + jjCheckNAdd(state2); +} + +private void jjCheckNAddStates(int start, int end) +{ + do { + jjCheckNAdd(jjnextStates[start]); + } while (start++ != end); +} + + /** Constructor. */ + public SACParserCSS1TokenManager(CharStream stream){ + + + input_stream = stream; + } + + /** Constructor. */ + public SACParserCSS1TokenManager (CharStream stream, int lexState){ + ReInit(stream); + SwitchTo(lexState); + } + + /** Reinitialise parser. */ + + public void ReInit(CharStream stream) + { + + + jjmatchedPos = + jjnewStateCnt = + 0; + curLexState = defaultLexState; + input_stream = stream; + ReInitRounds(); + } + + private void ReInitRounds() + { + int i; + jjround = 0x80000001; + for (i = 347; i-- > 0;) + jjrounds[i] = 0x80000000; + } + + /** Reinitialise parser. */ + public void ReInit(CharStream stream, int lexState) + + { + ReInit(stream); + SwitchTo(lexState); + } + + /** Switch to specified lex state. */ + public void SwitchTo(int lexState) + { + if (lexState >= 2 || lexState < 0) + throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); + else + curLexState = lexState; + } + + +/** Lexer state names. */ +public static final String[] lexStateNames = { + "DEFAULT", + "COMMENT", +}; + +/** Lex State array. */ +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, 0, -1, -1, +}; +static final long[] jjtoToken = { + 0xe033fffffffffbL, 0x4L, +}; +static final long[] jjtoSkip = { + 0x0L, 0x1L, +}; +static final long[] jjtoSpecial = { + 0x0L, 0x0L, +}; +static final long[] jjtoMore = { + 0x4L, 0x2L, +}; + protected CharStream input_stream; + + private final int[] jjrounds = new int[347]; + private final int[] jjstateSet = new int[2 * 347]; + private final StringBuilder jjimage = new StringBuilder(); + private StringBuilder image = jjimage; + private int jjimageLen; + private int lengthOfMatch; + protected int curChar; +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS2.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS2.java new file mode 100644 index 000000000..f6e160d90 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS2.java @@ -0,0 +1,2782 @@ +/* SACParserCSS2.java */ +/* Generated By:JavaCC: Do not edit this line. SACParserCSS2.java */ +package com.fr.third.steadystate.css.parser; + +import org.w3c.css.sac.CSSParseException; +import org.w3c.css.sac.Condition; +import org.w3c.css.sac.LexicalUnit; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.Parser; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SelectorList; +import org.w3c.css.sac.SimpleSelector; + +/** + * @author David Schweinsberg + * @author waldbaer + * @author rbri + */ +@SuppressWarnings("all") public class SACParserCSS2 extends AbstractSACParser implements SACParserCSS2Constants { + + public SACParserCSS2() { + this((CharStream) null); + } + + public String getParserVersion() { + return "http://www.w3.org/TR/REC-CSS2/"; + } + + protected String getGrammarUri() + { + return "http://www.w3.org/TR/REC-CSS2/grammar.html"; + } + +// +// stylesheet +// : [ CHARSET_SYM S* STRING S* ';' ]? +// [S|CDO|CDC]* [ import [S|CDO|CDC]* ]* +// [ [ ruleset | media | page | font_face ] [S|CDO|CDC]* ]* +// ; +// + final public void styleSheet() throws ParseException { + try { +handleStartDocument(); + styleSheetRuleList(); + jj_consume_token(0); + } finally { +handleEndDocument(); + } +} + + final public void styleSheetRuleList() throws ParseException {boolean ruleFound = false; + label_1: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S: + case CDO: + case CDC:{ + ; + break; + } + default: + jj_la1[0] = jj_gen; + break label_1; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + jj_consume_token(S); + break; + } + case CDO:{ + jj_consume_token(CDO); + break; + } + case CDC:{ + jj_consume_token(CDC); + break; + } + default: + jj_la1[1] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case CHARSET_SYM:{ + charsetRule(); + label_2: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S: + case CDO: + case CDC:{ + ; + break; + } + default: + jj_la1[2] = jj_gen; + break label_2; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + jj_consume_token(S); + break; + } + case CDO:{ + jj_consume_token(CDO); + break; + } + case CDC:{ + jj_consume_token(CDC); + break; + } + default: + jj_la1[3] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + } + default: + jj_la1[4] = jj_gen; + ; + } + label_3: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH: + case IMPORT_SYM: + case PAGE_SYM: + case MEDIA_SYM: + case FONT_FACE_SYM: + case ATKEYWORD: + case IDENT:{ + ; + break; + } + default: + jj_la1[5] = jj_gen; + break label_3; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IMPORT_SYM:{ + importRule(ruleFound); + break; + } + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH: + case PAGE_SYM: + case MEDIA_SYM: + case FONT_FACE_SYM: + case ATKEYWORD: + case IDENT:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH: + case IDENT:{ + styleRule(); + break; + } + case MEDIA_SYM:{ + mediaRule(); + break; + } + case PAGE_SYM:{ + pageRule(); + break; + } + case FONT_FACE_SYM:{ + fontFaceRule(); + break; + } + case ATKEYWORD:{ + unknownAtRule(); + break; + } + default: + jj_la1[6] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +ruleFound = true; + break; + } + default: + jj_la1[7] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_4: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S: + case CDO: + case CDC:{ + ; + break; + } + default: + jj_la1[8] = jj_gen; + break label_4; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + jj_consume_token(S); + break; + } + case CDO:{ + jj_consume_token(CDO); + break; + } + case CDC:{ + jj_consume_token(CDC); + break; + } + default: + jj_la1[9] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } +} + +// +// This is used by ASTStyleSheet.insertRule to parse a single rule +// + final public void styleSheetRuleSingle() throws ParseException { + label_5: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[10] = jj_gen; + break label_5; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case CHARSET_SYM:{ + charsetRule(); + break; + } + case IMPORT_SYM:{ + importRule(false); + break; + } + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH: + case IDENT:{ + styleRule(); + break; + } + case MEDIA_SYM:{ + mediaRule(); + break; + } + case PAGE_SYM:{ + pageRule(); + break; + } + case FONT_FACE_SYM:{ + fontFaceRule(); + break; + } + case ATKEYWORD:{ + unknownAtRule(); + break; + } + default: + jj_la1[11] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +} + + final public void charsetRule() throws ParseException {Token t; + Locator locator; + try { + jj_consume_token(CHARSET_SYM); +locator = createLocator(token); + label_6: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[12] = jj_gen; + break label_6; + } + jj_consume_token(S); + } + t = jj_consume_token(STRING); + label_7: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[13] = jj_gen; + break label_7; + } + jj_consume_token(S); + } + jj_consume_token(SEMICOLON); +handleCharset(t.toString(), locator); + } catch (ParseException e) { +getErrorHandler().error(toCSSParseException("invalidCharsetRule", e)); + } +} + + final public void unknownAtRule() throws ParseException {String s; + Locator locator; + try { + jj_consume_token(ATKEYWORD); +locator = createLocator(token); + s = skip(); + handleIgnorableAtRule(s, locator); + } catch (ParseException e) { +getErrorHandler().error(toCSSParseException("invalidUnknownRule", e)); + } +} + +// +// import +// : IMPORT_SYM S* +// [STRING|URI] S* [ medium [ ',' S* medium]* ]? ';' S* +// ; +// + final public void importRule(final boolean nonImportRuleFoundBefore) throws ParseException {Token t; + SACMediaListImpl ml = new SACMediaListImpl(); + Locator locator; + try { + jj_consume_token(IMPORT_SYM); +locator = createLocator(token); + label_8: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[14] = jj_gen; + break label_8; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case STRING:{ + t = jj_consume_token(STRING); + break; + } + case URI:{ + t = jj_consume_token(URI); + break; + } + default: + jj_la1[15] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_9: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[16] = jj_gen; + break label_9; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + mediaList(ml); + break; + } + default: + jj_la1[17] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); +if (nonImportRuleFoundBefore) + { + handleImportStyle(unescape(t.image, false), ml, null, locator); + } + else + { + handleImportStyle(unescape(t.image, false), ml, null, locator); + } + } catch (CSSParseException e) { +getErrorHandler().error(e); + error_skipAtRule(); + } catch (ParseException e) { +getErrorHandler().error(toCSSParseException("invalidImportRule", e)); + error_skipAtRule(); + } +} + +// +// media +// : MEDIA_SYM S* medium [ ',' S* medium ]* '{' S* ruleset* '}' S* +// ; +// + final public void mediaRule() throws ParseException {boolean start = false; + SACMediaListImpl ml = new SACMediaListImpl(); + Locator locator; + try { + jj_consume_token(MEDIA_SYM); +locator = createLocator(token); + label_10: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[18] = jj_gen; + break label_10; + } + jj_consume_token(S); + } + mediaList(ml); +start = true; + handleStartMedia(ml, locator); + jj_consume_token(LBRACE); + label_11: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[19] = jj_gen; + break label_11; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH: + case PAGE_SYM: + case ATKEYWORD: + case IDENT:{ + mediaRuleList(); + break; + } + default: + jj_la1[20] = jj_gen; + ; + } + jj_consume_token(RBRACE); + } catch (CSSParseException e) { +getErrorHandler().error(e); + error_skipblock(null, null); + } catch (ParseException e) { +CSSParseException cpe = toCSSParseException("invalidMediaRule", e); + getErrorHandler().error(cpe); + error_skipblock("ignoringRule", cpe); + } finally { +if (start) { + handleEndMedia(ml); + } + } +} + + final public void mediaList(SACMediaListImpl ml) throws ParseException {String s; + try { + s = medium(); +ml.setLocator(createLocator(token)); + label_12: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[21] = jj_gen; + break label_12; + } + jj_consume_token(COMMA); + label_13: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[22] = jj_gen; + break label_13; + } + jj_consume_token(S); + } +ml.add(s); + s = medium(); + } +ml.add(s); + } catch (ParseException e) { +throw toCSSParseException("invalidMediaList", e); + } +} + + final public void mediaRuleList() throws ParseException { + label_14: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH: + case IDENT:{ + styleRule(); + break; + } + case PAGE_SYM:{ + pageRule(); + break; + } + case ATKEYWORD:{ + unknownAtRule(); + break; + } + default: + jj_la1[23] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_15: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[24] = jj_gen; + break label_15; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH: + case PAGE_SYM: + case ATKEYWORD: + case IDENT:{ + ; + break; + } + default: + jj_la1[25] = jj_gen; + break label_14; + } + } +} + +// +// medium +// : IDENT S* +// ; +// + final public String medium() throws ParseException {Token t; + t = jj_consume_token(IDENT); + label_16: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[26] = jj_gen; + break label_16; + } + jj_consume_token(S); + } +handleMedium(t.image, createLocator(t)); + return t.image; +} + +// +// page +// : PAGE_SYM S* IDENT? pseudo_page? S* +// '{' S* declaration [ ';' S* declaration ]* '}' S* +// ; +// + final public void pageRule() throws ParseException {Token t = null; + String s = null; + boolean start = false; + Locator locator; + try { + jj_consume_token(PAGE_SYM); +locator = createLocator(token); + label_17: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[27] = jj_gen; + break label_17; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COLON: + case IDENT:{ + if (jj_2_1(2)) { + t = jj_consume_token(IDENT); + s = pseudoPage(); + label_18: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[28] = jj_gen; + break label_18; + } + jj_consume_token(S); + } + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + t = jj_consume_token(IDENT); + label_19: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[29] = jj_gen; + break label_19; + } + jj_consume_token(S); + } + break; + } + case COLON:{ + s = pseudoPage(); + label_20: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[30] = jj_gen; + break label_20; + } + jj_consume_token(S); + } + break; + } + default: + jj_la1[31] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + } + default: + jj_la1[32] = jj_gen; + ; + } + jj_consume_token(LBRACE); + label_21: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[33] = jj_gen; + break label_21; + } + jj_consume_token(S); + } +start = true; + handleStartPage((t != null) ? unescape(t.image, false) : null, s, locator); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + declaration(); + break; + } + default: + jj_la1[34] = jj_gen; + ; + } + label_22: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SEMICOLON:{ + ; + break; + } + default: + jj_la1[35] = jj_gen; + break label_22; + } + jj_consume_token(SEMICOLON); + label_23: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[36] = jj_gen; + break label_23; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + declaration(); + break; + } + default: + jj_la1[37] = jj_gen; + ; + } + } + jj_consume_token(RBRACE); + } catch (ParseException e) { +throw toCSSParseException("invalidPageRule", e); + } finally { +if (start) { + handleEndPage((t != null) ? unescape(t.image, false) : null, s); + } + } +} + +// +// pseudoPage +// : ':' IDENT +// ; +// + final public String pseudoPage() throws ParseException {Token t; + jj_consume_token(COLON); + t = jj_consume_token(IDENT); +return ":" + unescape(t.image, false); +} + +// +// font_face +// : FONT_FACE_SYM S* +// '{' S* declaration [ ';' S* declaration ]* '}' S* +// ; +// + final public void fontFaceRule() throws ParseException {boolean start = false; + Locator locator; + try { + jj_consume_token(FONT_FACE_SYM); +locator = createLocator(token); + label_24: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[38] = jj_gen; + break label_24; + } + jj_consume_token(S); + } + jj_consume_token(LBRACE); + label_25: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[39] = jj_gen; + break label_25; + } + jj_consume_token(S); + } +start = true; handleStartFontFace(locator); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + declaration(); + break; + } + default: + jj_la1[40] = jj_gen; + ; + } + label_26: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SEMICOLON:{ + ; + break; + } + default: + jj_la1[41] = jj_gen; + break label_26; + } + jj_consume_token(SEMICOLON); + label_27: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[42] = jj_gen; + break label_27; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + declaration(); + break; + } + default: + jj_la1[43] = jj_gen; + ; + } + } + jj_consume_token(RBRACE); + } catch (ParseException e) { +throw toCSSParseException("invalidFontFaceRule", e); + } finally { +if (start) { + handleEndFontFace(); + } + } +} + +// +// operator +// : '/' S* | ',' S* | +// ; +// + final public LexicalUnit operator(LexicalUnit prev) throws ParseException { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SLASH:{ + jj_consume_token(SLASH); + label_28: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[44] = jj_gen; + break label_28; + } + jj_consume_token(S); + } +return new LexicalUnitImpl(prev, LexicalUnit.SAC_OPERATOR_SLASH); + } + case COMMA:{ + jj_consume_token(COMMA); + label_29: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[45] = jj_gen; + break label_29; + } + jj_consume_token(S); + } +return LexicalUnitImpl.createComma(prev); + } + default: + jj_la1[46] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +} + +// +// combinator +// : '+' S* | '>' S* | +// ; +// + final public char combinator() throws ParseException {char c = ' '; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PLUS:{ + jj_consume_token(PLUS); +c='+'; + label_30: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[47] = jj_gen; + break label_30; + } + jj_consume_token(S); + } + break; + } + case GT:{ + jj_consume_token(GT); +c='>'; + label_31: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[48] = jj_gen; + break label_31; + } + jj_consume_token(S); + } + break; + } + case S:{ + jj_consume_token(S); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PLUS: + case GT:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PLUS:{ + jj_consume_token(PLUS); +c='+'; + break; + } + case GT:{ + jj_consume_token(GT); +c='>'; + break; + } + default: + jj_la1[49] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_32: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[50] = jj_gen; + break label_32; + } + jj_consume_token(S); + } + break; + } + default: + jj_la1[51] = jj_gen; + ; + } + break; + } + default: + jj_la1[52] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return c; +} + +// +// unary_operator +// : '-' | '+' +// ; +// + final public char unaryOperator() throws ParseException { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case MINUS:{ + jj_consume_token(MINUS); +return '-'; + } + case PLUS:{ + jj_consume_token(PLUS); +return '+'; + } + default: + jj_la1[53] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +} + +// +// property +// : IDENT S* +// ; +// + final public String property() throws ParseException {Token t; + t = jj_consume_token(IDENT); + label_33: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[54] = jj_gen; + break label_33; + } + jj_consume_token(S); + } +return unescape(t.image, false); +} + +// +// ruleset +// : selector [ ',' S* selector ]* +// '{' S* declaration [ ';' S* declaration ]* '}' S* +// ; +// + final public void styleRule() throws ParseException {SelectorList selList = null; + boolean start = false; + Token t; + try { +t = token; + selList = selectorList(); + jj_consume_token(LBRACE); + label_34: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[55] = jj_gen; + break label_34; + } + jj_consume_token(S); + } +start = true; + handleStartSelector(selList, createLocator(t.next)); + styleDeclaration(); + jj_consume_token(RBRACE); + } catch (CSSParseException e) { +getErrorHandler().error(e); + error_skipblock("ignoringRule", e); + } catch (ParseException e) { +CSSParseException cpe = toCSSParseException("invalidStyleRule", e); + getErrorHandler().error(cpe); + error_skipblock("ignoringFollowingDeclarations", cpe); + } finally { +if (start) { + handleEndSelector(selList); + } + } +} + + final public SelectorList parseSelectorsInternal() throws ParseException {SelectorList selectors; + label_35: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[56] = jj_gen; + break label_35; + } + jj_consume_token(S); + } + selectors = selectorList(); + jj_consume_token(0); +return selectors; +} + + final public SelectorList selectorList() throws ParseException {SelectorListImpl selList = new SelectorListImpl(); + Selector sel; + sel = selector(); +if (sel instanceof Locatable) { selList.setLocator(((Locatable) sel).getLocator()); } + label_36: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[57] = jj_gen; + break label_36; + } + jj_consume_token(COMMA); + label_37: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[58] = jj_gen; + break label_37; + } + jj_consume_token(S); + } +selList.add(sel); + sel = selector(); +if (sel instanceof Locatable) { selList.setLocator(((Locatable) sel).getLocator()); } + } +selList.add(sel); + return selList; +} + +// +// selector +// : simple_selector [ combinator simple_selector ]* +// ; +// + final public Selector selector() throws ParseException {Selector sel; + char comb; + try { + sel = simpleSelector(null, ' '); + label_38: + while (true) { + if (jj_2_2(2)) { + ; + } else { + break label_38; + } + comb = combinator(); + sel = simpleSelector(sel, comb); + } + label_39: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[59] = jj_gen; + break label_39; + } + jj_consume_token(S); + } +handleSelector(sel); + return sel; } catch (ParseException e) { +throw toCSSParseException("invalidSelector", e); + } +} + +// +// simple_selector +// : element_name? [ HASH | class | attrib | pseudo ]* S* +// ; +// + final public Selector simpleSelector(Selector sel, char comb) throws ParseException {SimpleSelector simpleSel = null; + Condition c = null; + SimpleSelector pseudoElementSel = null; + Object o = null; + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ASTERISK: + case IDENT:{ + simpleSel = elementName(); + label_40: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT: + case COLON: + case LSQUARE: + case HASH:{ + ; + break; + } + default: + jj_la1[60] = jj_gen; + break label_40; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case HASH:{ + c = hash(c, null != pseudoElementSel); + break; + } + case DOT:{ + c = _class(c, null != pseudoElementSel); + break; + } + case LSQUARE:{ + c = attrib(c, null != pseudoElementSel); + break; + } + case COLON:{ + o = pseudo(c, null != pseudoElementSel); +if (o instanceof Condition) + { c = (Condition) o; + } else { + pseudoElementSel = (SimpleSelector) o; + } + break; + } + default: + jj_la1[61] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + } + case DOT: + case COLON: + case LSQUARE: + case HASH:{ +simpleSel = ((com.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelectorFactory()).createSyntheticElementSelector(); + label_41: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case HASH:{ + c = hash(c, null != pseudoElementSel); + break; + } + case DOT:{ + c = _class(c, null != pseudoElementSel); + break; + } + case LSQUARE:{ + c = attrib(c, null != pseudoElementSel); + break; + } + case COLON:{ + o = pseudo(c, null != pseudoElementSel); +if (o instanceof Condition) + { c = (Condition) o; + } else { + pseudoElementSel = (SimpleSelector) o; + } + break; + } + default: + jj_la1[62] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT: + case COLON: + case LSQUARE: + case HASH:{ + ; + break; + } + default: + jj_la1[63] = jj_gen; + break label_41; + } + } + break; + } + default: + jj_la1[64] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +if (c != null) { + simpleSel = getSelectorFactory().createConditionalSelector(simpleSel, c); + } + + if (sel == null) { + sel = simpleSel; + } else { + switch (comb) { + case ' ': + sel = getSelectorFactory().createDescendantSelector(sel, simpleSel); + break; + case '+': + sel = getSelectorFactory().createDirectAdjacentSelector(sel.getSelectorType(), sel, simpleSel); + break; + case '>': + sel = getSelectorFactory().createChildSelector(sel, simpleSel); + break; + } + } + if (pseudoElementSel != null) + { + sel = getSelectorFactory().createDescendantSelector(sel, pseudoElementSel); + } + + return sel; } catch (ParseException e) { +throw toCSSParseException("invalidSimpleSelector", e); + } +} + +// +// class +// : '.' IDENT +// ; +// + final public Condition _class(Condition pred, boolean pseudoElementFound) throws ParseException {Token t; + Locator locator; + ParseException pe = null; + try { +if (pseudoElementFound) { pe = generateParseException(); } + jj_consume_token(DOT); +locator = createLocator(token); + t = jj_consume_token(IDENT); +if (pseudoElementFound) { throw pe;} + Condition c = getConditionFactory().createClassCondition(null, t.image, locator); + return (pred == null) ? c : getConditionFactory().createAndCondition(pred, c); } catch (ParseException e) { +throw toCSSParseException("invalidClassSelector", e); + } +} + +// +// element_name +// : IDENT | '*' +// ; +// + final public SimpleSelector elementName() throws ParseException {Token t; + SimpleSelector sel; + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + t = jj_consume_token(IDENT); +sel = getSelectorFactory().createElementSelector(null, unescape(t.image, false), createLocator(token)); + return sel; + } + case ASTERISK:{ + jj_consume_token(ASTERISK); +sel = getSelectorFactory().createElementSelector(null, null, createLocator(token)); + return sel; + } + default: + jj_la1[65] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (ParseException e) { +throw toCSSParseException("invalidElementName", e); + } +} + +// +// attrib +// : '[' S* IDENT S* [ [ '=' | INCLUDES | DASHMATCH ] S* +// [ IDENT | STRING ] S* ]? ']' +// ; +// + final public Condition attrib(Condition pred, boolean pseudoElementFound) throws ParseException {Token t; + String name = null; + String value = null; + int type = 0; + Locator locator; + try { + jj_consume_token(LSQUARE); +locator = createLocator(token); + label_42: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[66] = jj_gen; + break label_42; + } + jj_consume_token(S); + } +if (pseudoElementFound) { throw generateParseException();} + t = jj_consume_token(IDENT); +name = unescape(t.image, false); + label_43: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[67] = jj_gen; + break label_43; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case EQUALS: + case INCLUDES: + case DASHMATCH:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case EQUALS:{ + jj_consume_token(EQUALS); +type = 1; + break; + } + case INCLUDES:{ + jj_consume_token(INCLUDES); +type = 2; + break; + } + case DASHMATCH:{ + jj_consume_token(DASHMATCH); +type = 3; + break; + } + default: + jj_la1[68] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_44: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[69] = jj_gen; + break label_44; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + t = jj_consume_token(IDENT); +value = t.image; + break; + } + case STRING:{ + t = jj_consume_token(STRING); +value = unescape(t.image, false); + break; + } + default: + jj_la1[70] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_45: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[71] = jj_gen; + break label_45; + } + jj_consume_token(S); + } + break; + } + default: + jj_la1[72] = jj_gen; + ; + } + jj_consume_token(RSQUARE); +Condition c = null; + switch (type) { + case 0: + c = getConditionFactory().createAttributeCondition(name, null, false, null); + break; + case 1: + c = getConditionFactory().createAttributeCondition(name, null, null != value, value); + break; + case 2: + c = getConditionFactory().createOneOfAttributeCondition(name, null, null != value, value); + break; + case 3: + c = getConditionFactory().createBeginHyphenAttributeCondition(name, null, null != value, value); + break; + } + if (c instanceof Locatable) { + ((Locatable) c).setLocator(locator); + } + return (pred == null) ? c : getConditionFactory().createAndCondition(pred, c); } catch (ParseException e) { +throw toCSSParseException("invalidAttrib", e); + } +} + +// +// pseudo +// : ':' [ IDENT +// | FUNCTION_LANG S* IDENT S* ')' +// | FUNCTION S* IDENT S* ')' +// ] +// ; +// + final public Object pseudo(Condition pred, boolean pseudoElementFound) throws ParseException {Condition c = null; + Token t; + String function; + String arg = ""; + Locator locator; + try { + jj_consume_token(COLON); +locator = createLocator(token); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + t = jj_consume_token(IDENT); +String s = unescape(t.image, false); + if (pseudoElementFound) { throw toCSSParseException("duplicatePseudo", new String[] { s }, locator);} + if ("first-line".equals(s) + || "first-letter".equals(s) + || "before".equals(s) + || "after".equals(s)) + { + return getSelectorFactory().createPseudoElementSelector(null, s, locator, false); } + c = getConditionFactory().createPseudoClassCondition(null, s, locator, false); + {if ("" != null) return (pred == null) + ? c + : getConditionFactory().createAndCondition(pred, c);} + break; + } + case FUNCTION_LANG:{ + t = jj_consume_token(FUNCTION_LANG); +function = unescape(t.image, false); + label_46: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[73] = jj_gen; + break label_46; + } + jj_consume_token(S); + } + t = jj_consume_token(IDENT); +String lang = unescape(t.image, false); + label_47: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[74] = jj_gen; + break label_47; + } + jj_consume_token(S); + } + jj_consume_token(RROUND); +if (pseudoElementFound) { throw toCSSParseException("duplicatePseudo", new String[] { "lang(" + lang + ")" }, locator);} + c = getConditionFactory().createLangCondition(lang, locator); + {if ("" != null) return (pred == null) + ? c + : getConditionFactory().createAndCondition(pred, c);} + break; + } + case FUNCTION:{ + t = jj_consume_token(FUNCTION); +function = unescape(t.image, false); + label_48: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[75] = jj_gen; + break label_48; + } + jj_consume_token(S); + } + t = jj_consume_token(IDENT); +arg = unescape(t.image, false); + label_49: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[76] = jj_gen; + break label_49; + } + jj_consume_token(S); + } + jj_consume_token(RROUND); +if (pseudoElementFound) { throw toCSSParseException("duplicatePseudo", new String[] { function + arg + ")" }, locator);} + c = getConditionFactory().createPseudoClassCondition(null, function + arg + ")", locator, false); + {if ("" != null) return (pred == null) + ? c + : getConditionFactory().createAndCondition(pred, c);} + break; + } + default: + jj_la1[77] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (ParseException e) { +throw toCSSParseException("invalidPseudo", e); + } +return null; +} + + final public Condition hash(Condition pred, boolean pseudoElementFound) throws ParseException {Token t; + ParseException pe = null; + try { +if (pseudoElementFound) { pe = generateParseException(); } + t = jj_consume_token(HASH); +if (pseudoElementFound) { throw pe;} + Condition c = getConditionFactory().createIdCondition(unescape(t.image.substring(1), false), createLocator(token)); + return (pred == null) ? c : getConditionFactory().createAndCondition(pred, c); } catch (ParseException e) { +throw toCSSParseException("invalidHash", e); + } +} + + final public void styleDeclaration() throws ParseException { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + declaration(); + break; + } + default: + jj_la1[78] = jj_gen; + ; + } + label_50: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SEMICOLON:{ + ; + break; + } + default: + jj_la1[79] = jj_gen; + break label_50; + } + jj_consume_token(SEMICOLON); + label_51: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[80] = jj_gen; + break label_51; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + declaration(); + break; + } + default: + jj_la1[81] = jj_gen; + ; + } + } +} + +// +// declaration +// : property ':' S* expr prio? +// | +// ; +// + final public void declaration() throws ParseException {String p; + LexicalUnit e; + boolean priority = false; + Locator locator = null; + try { + p = property(); +locator = createLocator(token); + jj_consume_token(COLON); + label_52: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[82] = jj_gen; + break label_52; + } + jj_consume_token(S); + } + e = expr(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IMPORTANT_SYM:{ + priority = prio(); + break; + } + default: + jj_la1[83] = jj_gen; + ; + } +handleProperty(p, e, priority, locator); + } catch (CSSParseException ex) { +getErrorHandler().error(ex); + getErrorHandler().warning(createSkipWarning("ignoringFollowingDeclarations", ex)); + error_skipdecl(); + } catch (ParseException ex) { +CSSParseException cpe = toCSSParseException("invalidDeclaration", ex); + getErrorHandler().error(cpe); + getErrorHandler().warning(createSkipWarning("ignoringFollowingDeclarations", cpe)); + error_skipdecl(); + } +} + +// +// prio +// : IMPORTANT_SYM S* +// ; + final public boolean prio() throws ParseException { + jj_consume_token(IMPORTANT_SYM); + label_53: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[84] = jj_gen; + break label_53; + } + jj_consume_token(S); + } +return true; +} + +// +// expr +// : term [ operator term ]* +// ; + final public LexicalUnit expr() throws ParseException {LexicalUnit head; + LexicalUnit body; + try { + head = term(null); +body = head; + label_54: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA: + case SLASH: + case PLUS: + case MINUS: + case HASH: + case STRING: + case URI: + case INHERIT: + case EMS: + case EXS: + case LENGTH_PX: + case LENGTH_CM: + case LENGTH_MM: + case LENGTH_IN: + case LENGTH_PT: + case LENGTH_PC: + case ANGLE_DEG: + case ANGLE_RAD: + case ANGLE_GRAD: + case TIME_MS: + case TIME_S: + case FREQ_HZ: + case FREQ_KHZ: + case PERCENTAGE: + case DIMEN: + case NUMBER: + case RGB: + case FUNCTION: + case IDENT: + case UNICODERANGE:{ + ; + break; + } + default: + jj_la1[85] = jj_gen; + break label_54; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA: + case SLASH:{ + body = operator(body); + break; + } + default: + jj_la1[86] = jj_gen; + ; + } + body = term(body); + } +return head; } catch (ParseException ex) { +throw toCSSParseException("invalidExpr", ex); + } +} + +// +// term +// : unary_operator? +// [ NUMBER | PERCENTAGE | LENGTH | EMS | EXS | ANGLE | TIME | FREQ | function ] +// | STRING | IDENT | URI | RGB | UNICODERANGE | hexcolor | DIMEN +// S* +// ; +// + final public LexicalUnit term(LexicalUnit prev) throws ParseException {Token t; + char op = ' '; + LexicalUnit value = null; + Locator locator = null; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PLUS: + case MINUS:{ + op = unaryOperator(); + break; + } + default: + jj_la1[87] = jj_gen; + ; + } +if (op != ' ') + { + locator = createLocator(token); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case EMS: + case EXS: + case LENGTH_PX: + case LENGTH_CM: + case LENGTH_MM: + case LENGTH_IN: + case LENGTH_PT: + case LENGTH_PC: + case ANGLE_DEG: + case ANGLE_RAD: + case ANGLE_GRAD: + case TIME_MS: + case TIME_S: + case FREQ_HZ: + case FREQ_KHZ: + case PERCENTAGE: + case NUMBER: + case FUNCTION:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case NUMBER:{ + t = jj_consume_token(NUMBER); +try + { + value = LexicalUnitImpl.createNumber(prev, intValue(op, t.image)); + } + catch (NumberFormatException e) + { + value = LexicalUnitImpl.createNumber(prev, floatValue(op, t.image)); + } + break; + } + case PERCENTAGE:{ + t = jj_consume_token(PERCENTAGE); +value = LexicalUnitImpl.createPercentage(prev, floatValue(op, t.image)); + break; + } + case LENGTH_PX:{ + t = jj_consume_token(LENGTH_PX); +value = LexicalUnitImpl.createPixel(prev, floatValue(op, t.image)); + break; + } + case LENGTH_CM:{ + t = jj_consume_token(LENGTH_CM); +value = LexicalUnitImpl.createCentimeter(prev, floatValue(op, t.image)); + break; + } + case LENGTH_MM:{ + t = jj_consume_token(LENGTH_MM); +value = LexicalUnitImpl.createMillimeter(prev, floatValue(op, t.image)); + break; + } + case LENGTH_IN:{ + t = jj_consume_token(LENGTH_IN); +value = LexicalUnitImpl.createInch(prev, floatValue(op, t.image)); + break; + } + case LENGTH_PT:{ + t = jj_consume_token(LENGTH_PT); +value = LexicalUnitImpl.createPoint(prev, floatValue(op, t.image)); + break; + } + case LENGTH_PC:{ + t = jj_consume_token(LENGTH_PC); +value = LexicalUnitImpl.createPica(prev, floatValue(op, t.image)); + break; + } + case EMS:{ + t = jj_consume_token(EMS); +value = LexicalUnitImpl.createEm(prev, floatValue(op, t.image)); + break; + } + case EXS:{ + t = jj_consume_token(EXS); +value = LexicalUnitImpl.createEx(prev, floatValue(op, t.image)); + break; + } + case ANGLE_DEG:{ + t = jj_consume_token(ANGLE_DEG); +value = LexicalUnitImpl.createDegree(prev, floatValue(op, t.image)); + break; + } + case ANGLE_RAD:{ + t = jj_consume_token(ANGLE_RAD); +value = LexicalUnitImpl.createRadian(prev, floatValue(op, t.image)); + break; + } + case ANGLE_GRAD:{ + t = jj_consume_token(ANGLE_GRAD); +value = LexicalUnitImpl.createGradian(prev, floatValue(op, t.image)); + break; + } + case TIME_MS:{ + t = jj_consume_token(TIME_MS); +value = LexicalUnitImpl.createMillisecond(prev, floatValue(op, t.image)); + break; + } + case TIME_S:{ + t = jj_consume_token(TIME_S); +value = LexicalUnitImpl.createSecond(prev, floatValue(op, t.image)); + break; + } + case FREQ_HZ:{ + t = jj_consume_token(FREQ_HZ); +value = LexicalUnitImpl.createHertz(prev, floatValue(op, t.image)); + break; + } + case FREQ_KHZ:{ + t = jj_consume_token(FREQ_KHZ); +value = LexicalUnitImpl.createKiloHertz(prev, floatValue(op, t.image)); + break; + } + case FUNCTION:{ + value = function(prev); + break; + } + default: + jj_la1[88] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + } + case STRING:{ + t = jj_consume_token(STRING); +value = LexicalUnitImpl.createString(prev, unescape(t.image, false), t.image); + break; + } + case IDENT:{ + t = jj_consume_token(IDENT); +value = LexicalUnitImpl.createIdent(prev, unescape(t.image, false)); + break; + } + case URI:{ + t = jj_consume_token(URI); +value = LexicalUnitImpl.createURI(prev, t.image); + break; + } + case UNICODERANGE:{ + t = jj_consume_token(UNICODERANGE); +value = new LexicalUnitImpl(prev, LexicalUnit.SAC_UNICODERANGE, t.image); + break; + } + case RGB:{ + value = rgb(prev); + break; + } + case HASH:{ + value = hexcolor(prev); + break; + } + case DIMEN:{ + t = jj_consume_token(DIMEN); +int n = getLastNumPos(t.image); + value = LexicalUnitImpl.createDimension( + prev, + floatValue(op, t.image.substring(0, n+1)), + t.image.substring(n+1)); + break; + } + case INHERIT:{ + t = jj_consume_token(INHERIT); +value = new LexicalUnitImpl(prev, LexicalUnit.SAC_INHERIT, t.image); + break; + } + default: + jj_la1[89] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +if (locator == null) + { + locator = createLocator(token); + } + label_55: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[90] = jj_gen; + break label_55; + } + jj_consume_token(S); + } +if (value instanceof Locatable) + { + ((Locatable) value).setLocator(locator); + } + return value; +} + +// +// function +// : FUNCTION S* expr ')' S* +// ; +// + final public LexicalUnit function(LexicalUnit prev) throws ParseException {Token t; + LexicalUnit params; + t = jj_consume_token(FUNCTION); + label_56: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[91] = jj_gen; + break label_56; + } + jj_consume_token(S); + } + params = expr(); + jj_consume_token(RROUND); +return functionInternal(prev, t.image, params); +} + +// +// rgb +// : RGB S* expr ')' S* +// ; +// + final public LexicalUnit rgb(LexicalUnit prev) throws ParseException {LexicalUnit params; + jj_consume_token(RGB); + label_57: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[92] = jj_gen; + break label_57; + } + jj_consume_token(S); + } + params = expr(); + jj_consume_token(RROUND); +return LexicalUnitImpl.createRgbColor(prev, params); +} + +// +// hexcolor +// : HASH S* +// ; +// + final public LexicalUnit hexcolor(LexicalUnit prev) throws ParseException {Token t; + t = jj_consume_token(HASH); +return hexcolorInternal(prev, t); +} + + String skip() throws ParseException {StringBuilder sb = new StringBuilder(); + int nesting = 0; + Token t = getToken(0); + if (t.image != null) { + sb.append(t.image); + } + + do { + t = getNextToken(); + if (t.kind == EOF) { + break; + } + sb.append(t.image); + appendUnit(t, sb); + + if (t.kind == LBRACE) { + nesting++; + } + else if (t.kind == RBRACE) { + nesting--; + } + } + while ((t.kind != RBRACE && t.kind != SEMICOLON) || nesting > 0); + + return sb.toString(); + } + + void appendUnit(Token t, StringBuilder sb) throws ParseException {if (t.kind == EMS) { + sb.append("ems"); + return; + } + if (t.kind == EXS) { + sb.append("ex"); + return; + } + if (t.kind == LENGTH_PX) { + sb.append("px"); + return; + } + if (t.kind == LENGTH_CM) { + sb.append("cm"); + return; + } + if (t.kind == LENGTH_MM) { + sb.append("mm"); + return; + } + if (t.kind == LENGTH_IN) { + sb.append("in"); + return; + } + if (t.kind == LENGTH_PT) { + sb.append("pt"); + return; + } + if (t.kind == LENGTH_PC) { + sb.append("pc"); + return; + } + if (t.kind == ANGLE_DEG) { + sb.append("deg"); + return; + } + if (t.kind == ANGLE_RAD) { + sb.append("rad"); + return; + } + if (t.kind == ANGLE_GRAD) { + sb.append("grad"); + return; + } + if (t.kind == TIME_MS) { + sb.append("ms"); + return; + } + if (t.kind == TIME_S) { + sb.append('s'); + return; + } + if (t.kind == FREQ_HZ) { + sb.append("hz"); + return; + } + if (t.kind == FREQ_KHZ) { + sb.append("khz"); + return; + } + if (t.kind == PERCENTAGE) { + sb.append('%'); + return; + } + } + + void error_skipblock(String msgKey, CSSParseException e) throws ParseException {if (msgKey != null) { + getErrorHandler().warning(createSkipWarning(msgKey, e)); + } + + Token t; + int nesting = 0; + do { + t = getNextToken(); + if (t.kind == LBRACE) { + nesting++; + } + else if (t.kind == RBRACE) { + nesting--; + } + } + while (t.kind != EOF && (t.kind != RBRACE || nesting > 0)); + } + + void error_skipdecl() throws ParseException {Token t = getToken(1); + if (t.kind == LBRACE) { + error_skipblock(null, null); + return; + } + if (t.kind == RBRACE) { + // next will be RBRACE so we are finished + return; + } + + Token oldToken = token; + while (t.kind != SEMICOLON && t.kind != RBRACE && t.kind != EOF) { + oldToken = t; + t = getNextToken(); + } + if (t.kind != EOF) { + token = oldToken; + } + } + + void error_skipAtRule() throws ParseException {Token t = null; + do { + t = getNextToken(); + } + while (t.kind != SEMICOLON && t.kind != EOF); + } + + 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_3R_71() + { + if (jj_scan_token(IDENT)) return true; + return false; + } + + private boolean jj_3R_67() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_71()) { + jj_scanpos = xsp; + if (jj_3R_72()) return true; + } + return false; + } + + private boolean jj_3R_64() + { + if (jj_3R_67()) return true; + return false; + } + + private boolean jj_3R_69() + { + if (jj_scan_token(PLUS)) return true; + return false; + } + + private boolean jj_3R_66() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_69()) { + jj_scanpos = xsp; + if (jj_3R_70()) return true; + } + return false; + } + + private boolean jj_3R_79() + { + if (jj_scan_token(LSQUARE)) return true; + return false; + } + + private boolean jj_3R_77() + { + if (jj_scan_token(HASH)) return true; + return false; + } + + private boolean jj_3R_63() + { + if (jj_scan_token(S)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_66()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_62() + { + if (jj_scan_token(GT)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_scan_token(1)) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_60() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_64()) { + jj_scanpos = xsp; + if (jj_3R_65()) return true; + } + return false; + } + + private boolean jj_3_1() + { + if (jj_scan_token(IDENT)) return true; + if (jj_3R_58()) return true; + return false; + } + + private boolean jj_3R_61() + { + 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_59() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_61()) { + jj_scanpos = xsp; + if (jj_3R_62()) { + jj_scanpos = xsp; + if (jj_3R_63()) return true; + } + } + return false; + } + + private boolean jj_3R_76() + { + if (jj_3R_80()) return true; + return false; + } + + private boolean jj_3R_75() + { + if (jj_3R_79()) return true; + return false; + } + + private boolean jj_3R_78() + { + if (jj_scan_token(DOT)) return true; + return false; + } + + private boolean jj_3R_74() + { + if (jj_3R_78()) return true; + return false; + } + + private boolean jj_3R_73() + { + if (jj_3R_77()) return true; + return false; + } + + private boolean jj_3R_68() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_73()) { + jj_scanpos = xsp; + if (jj_3R_74()) { + jj_scanpos = xsp; + if (jj_3R_75()) { + jj_scanpos = xsp; + if (jj_3R_76()) return true; + } + } + } + return false; + } + + private boolean jj_3R_72() + { + if (jj_scan_token(ASTERISK)) return true; + return false; + } + + private boolean jj_3R_80() + { + if (jj_scan_token(COLON)) return true; + return false; + } + + private boolean jj_3R_70() + { + if (jj_scan_token(GT)) return true; + return false; + } + + private boolean jj_3_2() + { + if (jj_3R_59()) return true; + if (jj_3R_60()) return true; + return false; + } + + private boolean jj_3R_58() + { + if (jj_scan_token(COLON)) return true; + return false; + } + + private boolean jj_3R_65() + { + Token xsp; + if (jj_3R_68()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3R_68()) { jj_scanpos = xsp; break; } + } + return false; + } + + /** Generated Token Manager. */ + public SACParserCSS2TokenManager 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[93]; + static private int[] jj_la1_0; + static private int[] jj_la1_1; + static private int[] jj_la1_2; + static { + jj_la1_init_0(); + jj_la1_init_1(); + jj_la1_init_2(); + } + private static void jj_la1_init_0() { + jj_la1_0 = new int[] {0x6000002,0x6000002,0x6000002,0x6000002,0x0,0xe0141a00,0xc0141a00,0xe0141a00,0x6000002,0x6000002,0x2,0xe0141a00,0x2,0x2,0x2,0x1200000,0x2,0x0,0x2,0x2,0x40141a00,0x100,0x2,0x40141a00,0x2,0x40141a00,0x2,0x2,0x2,0x2,0x2,0x800,0x800,0x2,0x0,0x400,0x2,0x0,0x2,0x2,0x0,0x400,0x2,0x0,0x2,0x2,0x2100,0x2,0x2,0x24000,0x2,0x24000,0x24002,0xc000,0x2,0x2,0x2,0x100,0x2,0x2,0x140a00,0x140a00,0x140a00,0x140a00,0x141a00,0x1000,0x2,0x2,0x18010000,0x2,0x200000,0x2,0x18010000,0x2,0x2,0x2,0x2,0x0,0x0,0x400,0x2,0x0,0x2,0x0,0x2,0x130e100,0x2100,0xc000,0x0,0x1300000,0x2,0x2,0x2,}; + } + private static void jj_la1_init_1() { + jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x2,0x4000005,0x4000005,0x4000005,0x0,0x0,0x0,0x4000007,0x0,0x0,0x0,0x0,0x0,0x4000000,0x0,0x0,0x4000004,0x0,0x0,0x4000004,0x0,0x4000004,0x0,0x0,0x0,0x0,0x0,0x4000000,0x4000000,0x0,0x4000000,0x0,0x0,0x4000000,0x0,0x0,0x4000000,0x0,0x0,0x4000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4000000,0x4000000,0x0,0x0,0x0,0x0,0x4000000,0x0,0x0,0x0,0x0,0x0,0x0,0x7000000,0x4000000,0x0,0x0,0x4000000,0x0,0x8,0x0,0x26fffff0,0x0,0x0,0x25fffe0,0x26fffff0,0x0,0x0,0x0,}; + } + private static void jj_la1_init_2() { + jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,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,}; + } + final private JJCalls[] jj_2_rtns = new JJCalls[2]; + private boolean jj_rescan = false; + private int jj_gc = 0; + + /** Constructor with user supplied CharStream. */ + public SACParserCSS2(CharStream stream) { + token_source = new SACParserCSS2TokenManager(stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 93; 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 < 93; 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 SACParserCSS2(SACParserCSS2TokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 93; 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(SACParserCSS2TokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 93; 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(); + } + + @SuppressWarnings("serial") + 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_f() { + 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 jj_expentries = new java.util.ArrayList(); + 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]; + } + + for (int[] oldentry : jj_expentries) { + if (oldentry.length == jj_expentry.length) { + boolean isMatched = true; + + for (int i = 0; i < jj_expentry.length; i++) { + if (oldentry[i] != jj_expentry[i]) { + isMatched = false; + break; + } + + } + if (isMatched) { + jj_expentries.add(jj_expentry); + break; + } + } + } + + if (pos != 0) { + jj_lasttokens[(jj_endpos = pos) - 1] = kind; + } + } + } + + /** Generate ParseException. */ + public ParseException generateParseException() { + jj_expentries.clear(); + boolean[] la1tokens = new boolean[80]; + if (jj_kind >= 0) { + la1tokens[jj_kind] = true; + jj_kind = -1; + } + for (int i = 0; i < 93; i++) { + if (jj_la1[i] == jj_gen) { + for (int j = 0; j < 32; j++) { + if ((jj_la1_0[i] & (1< 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; + } + } + 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; + } + +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS21.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS21.java new file mode 100644 index 000000000..695ea2295 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS21.java @@ -0,0 +1,2659 @@ +/* SACParserCSS21.java */ +/* Generated By:JavaCC: Do not edit this line. SACParserCSS21.java */ +package com.fr.third.steadystate.css.parser; + +import org.w3c.css.sac.CSSParseException; +import org.w3c.css.sac.Condition; +import org.w3c.css.sac.LexicalUnit; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.Parser; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SelectorList; +import org.w3c.css.sac.SimpleSelector; + +/** + * @author David Schweinsberg + * @author waldbaer + * @author rbri + */ +@SuppressWarnings("all") public class SACParserCSS21 extends AbstractSACParser implements SACParserCSS21Constants { + + public SACParserCSS21() { + this((CharStream) null); + } + + public String getParserVersion() { + return "http://www.w3.org/TR/CSS21/"; + } + + protected String getGrammarUri() + { + return "http://www.w3.org/TR/CSS21/grammar.html"; + } + +// +// stylesheet +// : [ CHARSET_SYM STRING ';' ]? +// [S|CDO|CDC]* [ import [S|CDO|CDC]* ]* +// [ [ ruleset | media | page ] [S|CDO|CDC]* ]* +// ; +// + final public void styleSheet() throws ParseException { + try { +handleStartDocument(); + styleSheetRuleList(); + jj_consume_token(0); + } finally { +handleEndDocument(); + } +} + + final public void styleSheetRuleList() throws ParseException {boolean ruleFound = false; + label_1: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S: + case CDO: + case CDC:{ + ; + break; + } + default: + jj_la1[0] = jj_gen; + break label_1; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + jj_consume_token(S); + break; + } + case CDO:{ + jj_consume_token(CDO); + break; + } + case CDC:{ + jj_consume_token(CDC); + break; + } + default: + jj_la1[1] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case CHARSET_SYM:{ + charsetRule(); + label_2: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S: + case CDO: + case CDC:{ + ; + break; + } + default: + jj_la1[2] = jj_gen; + break label_2; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + jj_consume_token(S); + break; + } + case CDO:{ + jj_consume_token(CDO); + break; + } + case CDC:{ + jj_consume_token(CDC); + break; + } + default: + jj_la1[3] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + } + default: + jj_la1[4] = jj_gen; + ; + } + label_3: + while (true) { + ; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH: + case IMPORT_SYM: + case PAGE_SYM: + case MEDIA_SYM: + case ATKEYWORD:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IMPORT_SYM:{ + importRule(ruleFound); + break; + } + case IDENT: + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH: + case PAGE_SYM: + case MEDIA_SYM: + case ATKEYWORD:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH:{ + styleRule(); + break; + } + case MEDIA_SYM:{ + mediaRule(); + break; + } + case PAGE_SYM:{ + pageRule(); + break; + } + case ATKEYWORD:{ + unknownAtRule(); + break; + } + default: + jj_la1[5] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +ruleFound = true; + break; + } + default: + jj_la1[6] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + } + default: + jj_la1[7] = jj_gen; +ParseException e = generateParseException(); + invalidRule(); +Token t = getNextToken(); + + boolean charsetProcessed = false; + if (t.kind == CHARSET_SYM) { + t = getNextToken(); + if (t.kind == S) { + t = getNextToken(); + if (t.kind == STRING) { + t = getNextToken(); + if (t.kind == SEMICOLON) { + getNextToken(); + charsetProcessed = true; + } + } + } + CSSParseException cpe = toCSSParseException("misplacedCharsetRule", e); + getErrorHandler().error(cpe); + getErrorHandler().warning(createSkipWarning("ignoringRule", cpe)); + } + + if (!charsetProcessed) { + if (t.kind == EOF) { + {if ("" != null) return;} + } + + CSSParseException cpe = toCSSParseException("invalidRule", e); + getErrorHandler().error(cpe); + getErrorHandler().warning(createSkipWarning("ignoringRule", cpe)); + while (t.kind != RBRACE && t.kind != EOF ) { + t = getNextToken(); + } + if (t.kind == EOF) { + {if ("" != null) return;} + } + } + } + label_4: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S: + case CDO: + case CDC:{ + ; + break; + } + default: + jj_la1[8] = jj_gen; + break label_4; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + jj_consume_token(S); + break; + } + case CDO:{ + jj_consume_token(CDO); + break; + } + case CDC:{ + jj_consume_token(CDC); + break; + } + default: + jj_la1[9] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } +} + + void invalidRule() throws ParseException { + } + +// +// This is used by ASTStyleSheet.insertRule to parse a single rule +// + final public void styleSheetRuleSingle() throws ParseException { + label_5: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[10] = jj_gen; + break label_5; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case CHARSET_SYM:{ + charsetRule(); + break; + } + case IMPORT_SYM:{ + importRule(false); + break; + } + case IDENT: + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH:{ + styleRule(); + break; + } + case MEDIA_SYM:{ + mediaRule(); + break; + } + case PAGE_SYM:{ + pageRule(); + break; + } + case ATKEYWORD:{ + unknownAtRule(); + break; + } + default: + jj_la1[11] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_6: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[12] = jj_gen; + break label_6; + } + jj_consume_token(S); + } +} + + final public void charsetRule() throws ParseException {Token t; + Locator locator; + try { + jj_consume_token(CHARSET_SYM); +locator = createLocator(token); + jj_consume_token(S); + t = jj_consume_token(STRING); + jj_consume_token(SEMICOLON); +handleCharset(t.toString(), locator); + } catch (ParseException e) { +getErrorHandler().error(toCSSParseException("invalidCharsetRule", e)); + } +} + + final public void unknownAtRule() throws ParseException {String s; + Locator locator; + try { + jj_consume_token(ATKEYWORD); +locator = createLocator(token); + s = skip(); + handleIgnorableAtRule(s, locator); + } catch (ParseException e) { +getErrorHandler().error(toCSSParseException("invalidUnknownRule", e)); + } +} + +// +// import +// : IMPORT_SYM S* +// [STRING|URI] S* [ medium [ COMMA S* medium]* ]? ';' S* +// ; +// + final public void importRule(final boolean nonImportRuleFoundBefore) throws ParseException {Token t; + SACMediaListImpl ml = new SACMediaListImpl(); + Locator locator; + try { +ParseException e = null; + if (nonImportRuleFoundBefore) + { + e = generateParseException(); + } + jj_consume_token(IMPORT_SYM); +locator = createLocator(token); + label_7: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[13] = jj_gen; + break label_7; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case STRING:{ + t = jj_consume_token(STRING); + break; + } + case URI:{ + t = jj_consume_token(URI); + break; + } + default: + jj_la1[14] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_8: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[15] = jj_gen; + break label_8; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + mediaList(ml); + break; + } + default: + jj_la1[16] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); +if (nonImportRuleFoundBefore) + { + getErrorHandler().error(toCSSParseException("invalidImportRuleIgnored2", e)); + } + else + { + handleImportStyle(unescape(t.image, false), ml, null, locator); + } + } catch (CSSParseException e) { +getErrorHandler().error(e); + error_skipAtRule(); + } catch (ParseException e) { +getErrorHandler().error(toCSSParseException("invalidImportRule", e)); + error_skipAtRule(); + } +} + +// +// media +// : MEDIA_SYM S* medium [ COMMA S* medium ]* '{' S* ruleset* '}' S* +// ; +// + final public void mediaRule() throws ParseException {boolean start = false; + SACMediaListImpl ml = new SACMediaListImpl(); + Locator locator; + try { + jj_consume_token(MEDIA_SYM); +locator = createLocator(token); + label_9: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[17] = jj_gen; + break label_9; + } + jj_consume_token(S); + } + mediaList(ml); +start = true; + handleStartMedia(ml, locator); + jj_consume_token(LBRACE); + label_10: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[18] = jj_gen; + break label_10; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH: + case IMPORT_SYM: + case PAGE_SYM: + case ATKEYWORD:{ + mediaRuleList(); + break; + } + default: + jj_la1[19] = jj_gen; + ; + } + jj_consume_token(RBRACE); + } catch (CSSParseException e) { +getErrorHandler().error(e); + error_skipblock("ignoringRule", e); + } catch (ParseException e) { +CSSParseException cpe = toCSSParseException("invalidMediaRule", e); + getErrorHandler().error(cpe); + error_skipblock("ignoringRule", cpe); + } finally { +if (start) { + handleEndMedia(ml); + } + } +} + + final public void mediaList(SACMediaListImpl ml) throws ParseException {String s; + try { + s = medium(); +ml.setLocator(createLocator(token)); + label_11: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[20] = jj_gen; + break label_11; + } + jj_consume_token(COMMA); + label_12: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[21] = jj_gen; + break label_12; + } + jj_consume_token(S); + } +ml.add(s); + s = medium(); + } +ml.add(s); + } catch (ParseException e) { +throw toCSSParseException("invalidMediaList", e); + } +} + + final public void mediaRuleList() throws ParseException { + label_13: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH:{ + styleRule(); + break; + } + case PAGE_SYM:{ + pageRule(); + break; + } + case IMPORT_SYM:{ + importRule(true); + break; + } + case ATKEYWORD:{ + unknownAtRule(); + break; + } + default: + jj_la1[22] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_14: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[23] = jj_gen; + break label_14; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH: + case IMPORT_SYM: + case PAGE_SYM: + case ATKEYWORD:{ + ; + break; + } + default: + jj_la1[24] = jj_gen; + break label_13; + } + } +} + +// +// medium +// : IDENT S* +// ; +// + final public String medium() throws ParseException {Token t; + String medium; + t = jj_consume_token(IDENT); + label_15: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[25] = jj_gen; + break label_15; + } + jj_consume_token(S); + } +medium = unescape(t.image, false); + handleMedium(medium, createLocator(t)); + return medium; +} + +// +// page +// : PAGE_SYM S* pseudo_page? S* +// '{' S* declaration [ ';' S* declaration ]* '}' S* +// ; +// + final public void pageRule() throws ParseException {String s = null; + boolean start = false; + Locator locator; + try { + jj_consume_token(PAGE_SYM); +locator = createLocator(token); + label_16: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[26] = jj_gen; + break label_16; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COLON:{ + s = pseudoPage(); + label_17: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[27] = jj_gen; + break label_17; + } + jj_consume_token(S); + } + break; + } + default: + jj_la1[28] = jj_gen; + ; + } + jj_consume_token(LBRACE); + label_18: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[29] = jj_gen; + break label_18; + } + jj_consume_token(S); + } +start = true; + handleStartPage(null, s, locator); + styleDeclaration(); + jj_consume_token(RBRACE); + } catch (CSSParseException e) { +getErrorHandler().error(e); + error_skipblock("ignoringRule", e); + } catch (ParseException e) { +CSSParseException cpe = toCSSParseException("invalidPageRule", e); + getErrorHandler().error(cpe); + error_skipblock("ignoringRule", cpe); + } finally { +if (start) { + handleEndPage(null, s); + } + } +} + +// +// pseudoPage +// : ':' IDENT +// ; +// + final public String pseudoPage() throws ParseException {Token t; + jj_consume_token(COLON); + t = jj_consume_token(IDENT); +return ":" + unescape(t.image, false); +} + +// +// operator +// : '/' S* | COMMA S* | /* empty */ +// ; +// + final public LexicalUnit operator(LexicalUnit prev) throws ParseException { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SLASH:{ + jj_consume_token(SLASH); + label_19: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[30] = jj_gen; + break label_19; + } + jj_consume_token(S); + } +return new LexicalUnitImpl(prev, LexicalUnit.SAC_OPERATOR_SLASH); + } + case COMMA:{ + jj_consume_token(COMMA); + label_20: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[31] = jj_gen; + break label_20; + } + jj_consume_token(S); + } +return LexicalUnitImpl.createComma(prev); + } + default: + jj_la1[32] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +} + +// +// combinator +// : PLUS S* +// | GREATER S* +// | S +// ; +// + final public char combinator() throws ParseException {char c = ' '; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PLUS:{ + jj_consume_token(PLUS); +c='+'; + label_21: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[33] = jj_gen; + break label_21; + } + jj_consume_token(S); + } + break; + } + case GREATER:{ + jj_consume_token(GREATER); +c='>'; + label_22: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[34] = jj_gen; + break label_22; + } + jj_consume_token(S); + } + break; + } + case S:{ + jj_consume_token(S); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PLUS: + case GREATER:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PLUS:{ + jj_consume_token(PLUS); +c='+'; + break; + } + case GREATER:{ + jj_consume_token(GREATER); +c='>'; + break; + } + default: + jj_la1[35] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_23: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[36] = jj_gen; + break label_23; + } + jj_consume_token(S); + } + break; + } + default: + jj_la1[37] = jj_gen; + ; + } + break; + } + default: + jj_la1[38] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return c; +} + +// +// unary_operator +// : '-' | PLUS +// ; +// + final public char unaryOperator() throws ParseException { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case MINUS:{ + jj_consume_token(MINUS); +return '-'; + } + case PLUS:{ + jj_consume_token(PLUS); +return '+'; + } + default: + jj_la1[39] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +} + +// +// property +// : IDENT S* +// ; +// + final public String property() throws ParseException {Token t; + t = jj_consume_token(IDENT); + label_24: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[40] = jj_gen; + break label_24; + } + jj_consume_token(S); + } +return unescape(t.image, false); +} + +// +// ruleset +// : selector [ COMMA S* selector ]* +// '{' S* declaration [ ';' S* declaration ]* '}' S* +// ; +// + final public void styleRule() throws ParseException {SelectorList selList = null; + boolean start = false; + Token t; + try { +t = token; + selList = selectorList(); + jj_consume_token(LBRACE); + label_25: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[41] = jj_gen; + break label_25; + } + jj_consume_token(S); + } +start = true; + handleStartSelector(selList, createLocator(t.next)); + styleDeclaration(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case RBRACE:{ + jj_consume_token(RBRACE); + break; + } + case 0:{ + jj_consume_token(0); + break; + } + default: + jj_la1[42] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (CSSParseException e) { +getErrorHandler().error(e); + error_skipblock("ignoringRule", e); + } catch (ParseException e) { +CSSParseException cpe = toCSSParseException("invalidStyleRule", e); + getErrorHandler().error(cpe); + error_skipblock("ignoringFollowingDeclarations", cpe); + } finally { +if (start) { + handleEndSelector(selList); + } + } +} + + final public SelectorList parseSelectorsInternal() throws ParseException {SelectorList selectors; + label_26: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[43] = jj_gen; + break label_26; + } + jj_consume_token(S); + } + selectors = selectorList(); + jj_consume_token(0); +return selectors; +} + + final public SelectorList selectorList() throws ParseException {SelectorListImpl selList = new SelectorListImpl(); + Selector sel; + sel = selector(); +if (sel instanceof Locatable) { selList.setLocator(((Locatable) sel).getLocator()); } + label_27: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[44] = jj_gen; + break label_27; + } + jj_consume_token(COMMA); + label_28: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[45] = jj_gen; + break label_28; + } + jj_consume_token(S); + } +selList.add(sel); + sel = selector(); +if (sel instanceof Locatable) { selList.setLocator(((Locatable) sel).getLocator()); } + } +selList.add(sel); + return selList; +} + +// +// selector +// : simple_selector [ combinator simple_selector ]* +// ; +// + final public Selector selector() throws ParseException {Selector sel; + char comb; + try { + sel = simpleSelector(null, ' '); + label_29: + while (true) { + if (jj_2_1(2)) { + ; + } else { + break label_29; + } + comb = combinator(); + sel = simpleSelector(sel, comb); + } + label_30: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[46] = jj_gen; + break label_30; + } + jj_consume_token(S); + } +return sel; } catch (ParseException e) { +throw toCSSParseException("invalidSelector", e); + } +} + +// +// simple_selector +// : element_name [ HASH | class | attrib | pseudo ]* +// | [ HASH | class | attrib | pseudo ]+ +// ; +// + final public Selector simpleSelector(Selector sel, char comb) throws ParseException {SimpleSelector simpleSel = null; + Condition c = null; + SimpleSelector pseudoElementSel = null; + Object o = null; + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case ASTERISK:{ + simpleSel = elementName(); + label_31: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT: + case COLON: + case LSQUARE: + case HASH:{ + ; + break; + } + default: + jj_la1[47] = jj_gen; + break label_31; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case HASH:{ + c = hash(c, null != pseudoElementSel); + break; + } + case DOT:{ + c = _class(c, null != pseudoElementSel); + break; + } + case LSQUARE:{ + c = attrib(c, null != pseudoElementSel); + break; + } + case COLON:{ + o = pseudo(c, null != pseudoElementSel); +if (o instanceof Condition) + { c = (Condition) o; + } else { + pseudoElementSel = (SimpleSelector) o; + } + break; + } + default: + jj_la1[48] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + } + case DOT: + case COLON: + case LSQUARE: + case HASH:{ +simpleSel = ((com.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelectorFactory()).createSyntheticElementSelector(); + label_32: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case HASH:{ + c = hash(c, null != pseudoElementSel); + break; + } + case DOT:{ + c = _class(c, null != pseudoElementSel); + break; + } + case LSQUARE:{ + c = attrib(c, null != pseudoElementSel); + break; + } + case COLON:{ + o = pseudo(c, null != pseudoElementSel); +if (o instanceof Condition) + { c = (Condition) o; + } else { + pseudoElementSel = (SimpleSelector) o; + } + break; + } + default: + jj_la1[49] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT: + case COLON: + case LSQUARE: + case HASH:{ + ; + break; + } + default: + jj_la1[50] = jj_gen; + break label_32; + } + } + break; + } + default: + jj_la1[51] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +if (c != null) { + simpleSel = getSelectorFactory().createConditionalSelector(simpleSel, c); + } + + if (sel == null) { + sel = simpleSel; + } else { + switch (comb) { + case ' ': + sel = getSelectorFactory().createDescendantSelector(sel, simpleSel); + break; + case '+': + sel = getSelectorFactory().createDirectAdjacentSelector(sel.getSelectorType(), sel, simpleSel); + break; + case '>': + sel = getSelectorFactory().createChildSelector(sel, simpleSel); + break; + } + } + if (pseudoElementSel != null) + { + sel = getSelectorFactory().createDescendantSelector(sel, pseudoElementSel); + } + + return sel; } catch (ParseException e) { +throw toCSSParseException("invalidSimpleSelector", e); + } +} + +// +// class +// : '.' IDENT +// ; +// + final public Condition _class(Condition pred, boolean pseudoElementFound) throws ParseException {Token t; + Locator locator; + ParseException pe = null; + try { +if (pseudoElementFound) { pe = generateParseException(); } + jj_consume_token(DOT); +locator = createLocator(token); + t = jj_consume_token(IDENT); +if (pseudoElementFound) { throw pe;} + Condition c = getConditionFactory().createClassCondition(null, unescape(t.image, false), locator); + return (pred == null) ? c : getConditionFactory().createAndCondition(pred, c); } catch (ParseException e) { +throw toCSSParseException("invalidClassSelector", e); + } +} + +// +// element_name +// : IDENT | '*' +// ; +// + final public SimpleSelector elementName() throws ParseException {Token t; + SimpleSelector sel; + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + t = jj_consume_token(IDENT); +sel = getSelectorFactory().createElementSelector(null, unescape(t.image, false), createLocator(token)); + return sel; + } + case ASTERISK:{ + jj_consume_token(ASTERISK); +sel = getSelectorFactory().createElementSelector(null, null, createLocator(token)); + return sel; + } + default: + jj_la1[52] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (ParseException e) { +throw toCSSParseException("invalidElementName", e); + } +} + +// +// attrib +// : '[' S* IDENT S* [ [ '=' | INCLUDES | DASHMATCH ] S* +// [ IDENT | STRING ] S* ]? ']' +// ; +// + final public Condition attrib(Condition pred, boolean pseudoElementFound) throws ParseException {Token t; + String name = null; + String value = null; + int type = 0; + Locator locator; + try { + jj_consume_token(LSQUARE); +locator = createLocator(token); + label_33: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[53] = jj_gen; + break label_33; + } + jj_consume_token(S); + } +if (pseudoElementFound) { throw generateParseException();} + t = jj_consume_token(IDENT); +name = unescape(t.image, false); + label_34: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[54] = jj_gen; + break label_34; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INCLUDES: + case DASHMATCH: + case EQUALS:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case EQUALS:{ + jj_consume_token(EQUALS); +type = 1; + break; + } + case INCLUDES:{ + jj_consume_token(INCLUDES); +type = 2; + break; + } + case DASHMATCH:{ + jj_consume_token(DASHMATCH); +type = 3; + break; + } + default: + jj_la1[55] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_35: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[56] = jj_gen; + break label_35; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + t = jj_consume_token(IDENT); +value = unescape(t.image, false); + break; + } + case STRING:{ + t = jj_consume_token(STRING); +value = unescape(t.image, false); + break; + } + default: + jj_la1[57] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_36: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[58] = jj_gen; + break label_36; + } + jj_consume_token(S); + } + break; + } + default: + jj_la1[59] = jj_gen; + ; + } + jj_consume_token(RSQUARE); +Condition c = null; + switch (type) { + case 0: + c = getConditionFactory().createAttributeCondition(name, null, false, null); + break; + case 1: + c = getConditionFactory().createAttributeCondition(name, null, null != value, value); + break; + case 2: + c = getConditionFactory().createOneOfAttributeCondition(name, null, null != value, value); + break; + case 3: + c = getConditionFactory().createBeginHyphenAttributeCondition(name, null, null != value, value); + break; + } + if (c instanceof Locatable) { + ((Locatable) c).setLocator(locator); + } + return (pred == null) ? c : getConditionFactory().createAndCondition(pred, c); } catch (ParseException e) { +throw toCSSParseException("invalidAttrib", e); + } +} + +// +// pseudo +// : ':' [ IDENT +// | FUNCTION_LANG S* IDENT S* ')' +// | FUNCTION S* IDENT? S* ')' +// ] +// ; +// + final public Object pseudo(Condition pred, boolean pseudoElementFound) throws ParseException {Condition c = null; + Token t; + String function; + String arg = ""; + Locator locator; + try { + jj_consume_token(COLON); +locator = createLocator(token); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + t = jj_consume_token(IDENT); +String s = unescape(t.image, false); + if (pseudoElementFound) { throw toCSSParseException("duplicatePseudo", new String[] { s }, locator);} + if ("first-line".equals(s) + || "first-letter".equals(s) + || "before".equals(s) + || "after".equals(s)) + { + return getSelectorFactory().createPseudoElementSelector(null, s, locator, false); } + c = getConditionFactory().createPseudoClassCondition(null, s, locator, false); + {if ("" != null) return (pred == null) + ? c + : getConditionFactory().createAndCondition(pred, c);} + break; + } + case FUNCTION_LANG:{ + t = jj_consume_token(FUNCTION_LANG); +function = unescape(t.image, false); + label_37: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[60] = jj_gen; + break label_37; + } + jj_consume_token(S); + } + t = jj_consume_token(IDENT); +String lang = unescape(t.image, false); + label_38: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[61] = jj_gen; + break label_38; + } + jj_consume_token(S); + } + jj_consume_token(RROUND); +if (pseudoElementFound) { throw toCSSParseException("duplicatePseudo", new String[] { "lang(" + lang + ")" }, locator);} + c = getConditionFactory().createLangCondition(lang, locator); + {if ("" != null) return (pred == null) + ? c + : getConditionFactory().createAndCondition(pred, c);} + break; + } + case FUNCTION:{ + t = jj_consume_token(FUNCTION); +function = unescape(t.image, false); + label_39: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[62] = jj_gen; + break label_39; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + t = jj_consume_token(IDENT); +arg = unescape(t.image, false); + label_40: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[63] = jj_gen; + break label_40; + } + jj_consume_token(S); + } + break; + } + default: + jj_la1[64] = jj_gen; + ; + } + jj_consume_token(RROUND); +if (pseudoElementFound) { throw toCSSParseException("duplicatePseudo", new String[] { function + arg + ")" }, locator);} + c = getConditionFactory().createPseudoClassCondition(null, function + arg + ")", locator, false); + {if ("" != null) return (pred == null) + ? c + : getConditionFactory().createAndCondition(pred, c);} + break; + } + default: + jj_la1[65] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (ParseException e) { +throw toCSSParseException("invalidPseudo", e); + } +return null; +} + + final public Condition hash(Condition pred, boolean pseudoElementFound) throws ParseException {Token t; + ParseException pe = null; + try { +if (pseudoElementFound) { pe = generateParseException(); } + t = jj_consume_token(HASH); +if (pseudoElementFound) { throw pe;} + Condition c = getConditionFactory().createIdCondition(unescape(t.image.substring(1), false), createLocator(token)); + return (pred == null) ? c : getConditionFactory().createAndCondition(pred, c); } catch (ParseException e) { +throw toCSSParseException("invalidHash", e); + } +} + + final public void styleDeclaration() throws ParseException { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case ASTERISK:{ + declaration(); + break; + } + default: + jj_la1[66] = jj_gen; + ; + } + label_41: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SEMICOLON:{ + ; + break; + } + default: + jj_la1[67] = jj_gen; + break label_41; + } + jj_consume_token(SEMICOLON); + label_42: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[68] = jj_gen; + break label_42; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case ASTERISK:{ + declaration(); + break; + } + default: + jj_la1[69] = jj_gen; + ; + } + } +} + +// +// declaration +// : property ':' S* expr prio? +// | +// ; +// + final public void declaration() throws ParseException {String p; + LexicalUnit e; + Token t; + boolean priority = false; + Locator starHack = null; + Locator locator = null; + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ASTERISK:{ + jj_consume_token(ASTERISK); +starHack = createLocator(token); + break; + } + default: + jj_la1[70] = jj_gen; + ; + } + p = property(); +locator = createLocator(token); + jj_consume_token(COLON); + label_43: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[71] = jj_gen; + break label_43; + } + jj_consume_token(S); + } + e = expr(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IMPORTANT_SYM:{ + priority = prio(); + break; + } + default: + jj_la1[72] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case UNKNOWN:{ + t = jj_consume_token(UNKNOWN); +locator = createLocator(token); + CSSParseException cpe = toCSSParseException("invalidDeclarationInvalidChar", new String[] {t.image}, locator); + getErrorHandler().error(cpe); + error_skipdecl(); + break; + } + default: + jj_la1[73] = jj_gen; + ; + } +if (starHack != null) + { + if (isIeStarHackAccepted()) { + handleProperty("*" + p, e, priority, locator); + {if ("" != null) return;} + } + CSSParseException cpe = toCSSParseException("invalidDeclarationStarHack", new Object[0], starHack); + getErrorHandler().error(cpe); + {if ("" != null) return;} + } + handleProperty(p, e, priority, locator); + } catch (CSSParseException ex) { +getErrorHandler().error(ex); + error_skipdecl(); + } catch (ParseException ex) { +CSSParseException cpe = toCSSParseException("invalidDeclaration", ex); + getErrorHandler().error(cpe); + error_skipdecl(); + } +} + +// +// prio +// : IMPORTANT_SYM S* +// ; + final public boolean prio() throws ParseException { + jj_consume_token(IMPORTANT_SYM); + label_44: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[74] = jj_gen; + break label_44; + } + jj_consume_token(S); + } +return true; +} + +// +// expr +// : term [ operator term ]* +// ; + final public LexicalUnit expr() throws ParseException {LexicalUnit head; + LexicalUnit body; + try { + head = term(null); +body = head; + label_45: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case NUMBER: + case INHERIT: + case IDENT: + case STRING: + case SLASH: + case MINUS: + case PLUS: + case COMMA: + case HASH: + case EMS: + case EXS: + case LENGTH_PX: + case LENGTH_CM: + case LENGTH_MM: + case LENGTH_IN: + case LENGTH_PT: + case LENGTH_PC: + case ANGLE_DEG: + case ANGLE_RAD: + case ANGLE_GRAD: + case TIME_MS: + case TIME_S: + case FREQ_HZ: + case FREQ_KHZ: + case PERCENTAGE: + case DIMENSION: + case URI: + case FUNCTION: + case 90:{ + ; + break; + } + default: + jj_la1[75] = jj_gen; + break label_45; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SLASH: + case COMMA:{ + body = operator(body); + break; + } + default: + jj_la1[76] = jj_gen; + ; + } + body = term(body); + } +return head; } catch (ParseException ex) { +throw toCSSParseException("invalidExpr", ex); + } +} + +// +// term +// : unary_operator? +// [ NUMBER | PERCENTAGE | LENGTH | EMS | EXS | ANGLE | TIME | FREQ | function ] +// | STRING | IDENT | URI | hexcolor | DIMENSION +// S* +// ; +// + final public LexicalUnit term(LexicalUnit prev) throws ParseException {Token t; + char op = ' '; + LexicalUnit value = null; + Locator locator = null; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case MINUS: + case PLUS:{ + op = unaryOperator(); + break; + } + default: + jj_la1[77] = jj_gen; + ; + } +if (op != ' ') + { + locator = createLocator(token); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case NUMBER: + case EMS: + case EXS: + case LENGTH_PX: + case LENGTH_CM: + case LENGTH_MM: + case LENGTH_IN: + case LENGTH_PT: + case LENGTH_PC: + case ANGLE_DEG: + case ANGLE_RAD: + case ANGLE_GRAD: + case TIME_MS: + case TIME_S: + case FREQ_HZ: + case FREQ_KHZ: + case PERCENTAGE: + case FUNCTION:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case NUMBER:{ + t = jj_consume_token(NUMBER); +try + { + value = LexicalUnitImpl.createNumber(prev, intValue(op, t.image)); + } + catch (NumberFormatException e) + { + value = LexicalUnitImpl.createNumber(prev, floatValue(op, t.image)); + } + break; + } + case PERCENTAGE:{ + t = jj_consume_token(PERCENTAGE); +value = LexicalUnitImpl.createPercentage(prev, floatValue(op, t.image)); + break; + } + case LENGTH_PX:{ + t = jj_consume_token(LENGTH_PX); +value = LexicalUnitImpl.createPixel(prev, floatValue(op, t.image)); + break; + } + case LENGTH_CM:{ + t = jj_consume_token(LENGTH_CM); +value = LexicalUnitImpl.createCentimeter(prev, floatValue(op, t.image)); + break; + } + case LENGTH_MM:{ + t = jj_consume_token(LENGTH_MM); +value = LexicalUnitImpl.createMillimeter(prev, floatValue(op, t.image)); + break; + } + case LENGTH_IN:{ + t = jj_consume_token(LENGTH_IN); +value = LexicalUnitImpl.createInch(prev, floatValue(op, t.image)); + break; + } + case LENGTH_PT:{ + t = jj_consume_token(LENGTH_PT); +value = LexicalUnitImpl.createPoint(prev, floatValue(op, t.image)); + break; + } + case LENGTH_PC:{ + t = jj_consume_token(LENGTH_PC); +value = LexicalUnitImpl.createPica(prev, floatValue(op, t.image)); + break; + } + case EMS:{ + t = jj_consume_token(EMS); +value = LexicalUnitImpl.createEm(prev, floatValue(op, t.image)); + break; + } + case EXS:{ + t = jj_consume_token(EXS); +value = LexicalUnitImpl.createEx(prev, floatValue(op, t.image)); + break; + } + case ANGLE_DEG:{ + t = jj_consume_token(ANGLE_DEG); +value = LexicalUnitImpl.createDegree(prev, floatValue(op, t.image)); + break; + } + case ANGLE_RAD:{ + t = jj_consume_token(ANGLE_RAD); +value = LexicalUnitImpl.createRadian(prev, floatValue(op, t.image)); + break; + } + case ANGLE_GRAD:{ + t = jj_consume_token(ANGLE_GRAD); +value = LexicalUnitImpl.createGradian(prev, floatValue(op, t.image)); + break; + } + case TIME_MS:{ + t = jj_consume_token(TIME_MS); +value = LexicalUnitImpl.createMillisecond(prev, floatValue(op, t.image)); + break; + } + case TIME_S:{ + t = jj_consume_token(TIME_S); +value = LexicalUnitImpl.createSecond(prev, floatValue(op, t.image)); + break; + } + case FREQ_HZ:{ + t = jj_consume_token(FREQ_HZ); +value = LexicalUnitImpl.createHertz(prev, floatValue(op, t.image)); + break; + } + case FREQ_KHZ:{ + t = jj_consume_token(FREQ_KHZ); +value = LexicalUnitImpl.createKiloHertz(prev, floatValue(op, t.image)); + break; + } + case FUNCTION:{ + value = function(prev); + break; + } + default: + jj_la1[78] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + } + case STRING:{ + t = jj_consume_token(STRING); +value = LexicalUnitImpl.createString(prev, unescape(t.image, false), t.image); + break; + } + case 90:{ + t = jj_consume_token(90); +value = LexicalUnitImpl.createIdent(prev, skipUnit().trim()); + break; + } + case IDENT:{ + t = jj_consume_token(IDENT); +value = LexicalUnitImpl.createIdent(prev, unescape(t.image, false)); + break; + } + case URI:{ + t = jj_consume_token(URI); +value = LexicalUnitImpl.createURI(prev, unescape(t.image, true)); + break; + } + case HASH:{ + value = hexcolor(prev); + break; + } + case DIMENSION:{ + t = jj_consume_token(DIMENSION); +int n = getLastNumPos(t.image); + value = LexicalUnitImpl.createDimension( + prev, + floatValue(op, t.image.substring(0, n+1)), + t.image.substring(n+1)); + break; + } + case INHERIT:{ + t = jj_consume_token(INHERIT); +value = new LexicalUnitImpl(prev, LexicalUnit.SAC_INHERIT, t.image); + break; + } + default: + jj_la1[79] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +if (locator == null) + { + locator = createLocator(token); + } + label_46: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[80] = jj_gen; + break label_46; + } + jj_consume_token(S); + } +if (value instanceof Locatable) + { + ((Locatable) value).setLocator(locator); + } + return value; +} + +// +// function +// : FUNCTION S* expr ')' S* +// ; +// + final public LexicalUnit function(LexicalUnit prev) throws ParseException {Token t; + LexicalUnit params; + t = jj_consume_token(FUNCTION); + label_47: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[81] = jj_gen; + break label_47; + } + jj_consume_token(S); + } + params = expr(); + jj_consume_token(RROUND); +return functionInternal(prev, unescape(t.image, true), params); +} + +// +// hexcolor +// : HASH S* +// ; +// + final public LexicalUnit hexcolor(LexicalUnit prev) throws ParseException {Token t; + t = jj_consume_token(HASH); +return hexcolorInternal(prev, t); +} + + String skip() throws ParseException {StringBuilder sb = new StringBuilder(); + int nesting = 0; + Token t = getToken(0); + if (t.image != null) { + sb.append(t.image); + } + + do { + t = getNextToken(); + if (t.kind == EOF) { + break; + } + sb.append(t.image); + appendUnit(t, sb); + + if (t.kind == LBRACE) { + nesting++; + } + else if (t.kind == RBRACE) { + nesting--; + } + } + while ((t.kind != RBRACE && t.kind != SEMICOLON) || nesting > 0); + + return sb.toString(); + } + + String skipUnit() throws ParseException {StringBuilder sb = new StringBuilder(); + + Token t = token; + Token oldToken = null; + while (t.kind != SEMICOLON && t.kind != RBRACE && t.kind != EOF ) { + oldToken = t; + sb.append(oldToken.image); + appendUnit(t, sb); + + t = getNextToken(); + } + if (t.kind != EOF) { + token = oldToken; + } + + return sb.toString(); + } + + void appendUnit(Token t, StringBuilder sb) throws ParseException {if (t.kind == EMS) { + sb.append("ems"); + return; + } + if (t.kind == EXS) { + sb.append("ex"); + return; + } + if (t.kind == LENGTH_PX) { + sb.append("px"); + return; + } + if (t.kind == LENGTH_CM) { + sb.append("cm"); + return; + } + if (t.kind == LENGTH_MM) { + sb.append("mm"); + return; + } + if (t.kind == LENGTH_IN) { + sb.append("in"); + return; + } + if (t.kind == LENGTH_PT) { + sb.append("pt"); + return; + } + if (t.kind == LENGTH_PC) { + sb.append("pc"); + return; + } + if (t.kind == ANGLE_DEG) { + sb.append("deg"); + return; + } + if (t.kind == ANGLE_RAD) { + sb.append("rad"); + return; + } + if (t.kind == ANGLE_GRAD) { + sb.append("grad"); + return; + } + if (t.kind == TIME_MS) { + sb.append("ms"); + return; + } + if (t.kind == TIME_S) { + sb.append('s'); + return; + } + if (t.kind == FREQ_HZ) { + sb.append("hz"); + return; + } + if (t.kind == FREQ_KHZ) { + sb.append("khz"); + return; + } + if (t.kind == PERCENTAGE) { + sb.append('%'); + return; + } + } + + void error_skipblock(String msgKey, CSSParseException e) throws ParseException {if (msgKey != null) { + getErrorHandler().warning(createSkipWarning(msgKey, e)); + } + + Token t; + int nesting = 0; + do { + t = getNextToken(); + if (t.kind == LBRACE) { + nesting++; + } + else if (t.kind == RBRACE) { + nesting--; + } + } + while (t.kind != EOF && (t.kind != RBRACE || nesting > 0)); + } + + void error_skipdecl() throws ParseException {Token t = getToken(1); + if (t.kind == LBRACE) { + error_skipblock(null, null); + return; + } + if (t.kind == RBRACE) { + // next will be RBRACE so we are finished + return; + } + + Token oldToken = token; + while (t.kind != SEMICOLON && t.kind != RBRACE && t.kind != EOF) { + oldToken = t; + t = getNextToken(); + } + if (t.kind != EOF) { + token = oldToken; + } + } + + void error_skipAtRule() throws ParseException {Token t = null; + do { + t = getNextToken(); + } + while (t.kind != SEMICOLON && t.kind != EOF); + } + + 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_3R_53() + { + if (jj_3R_56()) return true; + return false; + } + + private boolean jj_3R_58() + { + if (jj_scan_token(PLUS)) return true; + return false; + } + + private boolean jj_3R_55() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_58()) { + jj_scanpos = xsp; + if (jj_3R_59()) return true; + } + return false; + } + + private boolean jj_3R_68() + { + if (jj_scan_token(LSQUARE)) return true; + return false; + } + + private boolean jj_3R_66() + { + if (jj_scan_token(HASH)) return true; + return false; + } + + private boolean jj_3R_52() + { + if (jj_scan_token(S)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_55()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_51() + { + if (jj_scan_token(GREATER)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_scan_token(1)) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_49() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_53()) { + jj_scanpos = xsp; + if (jj_3R_54()) return true; + } + return false; + } + + private boolean jj_3R_50() + { + 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_48() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_50()) { + jj_scanpos = xsp; + if (jj_3R_51()) { + jj_scanpos = xsp; + if (jj_3R_52()) return true; + } + } + return false; + } + + private boolean jj_3R_65() + { + if (jj_3R_69()) return true; + return false; + } + + private boolean jj_3R_64() + { + if (jj_3R_68()) return true; + return false; + } + + private boolean jj_3R_67() + { + if (jj_scan_token(DOT)) return true; + return false; + } + + private boolean jj_3R_63() + { + if (jj_3R_67()) return true; + return false; + } + + private boolean jj_3R_57() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_62()) { + jj_scanpos = xsp; + if (jj_3R_63()) { + jj_scanpos = xsp; + if (jj_3R_64()) { + jj_scanpos = xsp; + if (jj_3R_65()) return true; + } + } + } + return false; + } + + private boolean jj_3R_62() + { + if (jj_3R_66()) return true; + return false; + } + + private boolean jj_3R_61() + { + if (jj_scan_token(ASTERISK)) return true; + return false; + } + + private boolean jj_3R_69() + { + if (jj_scan_token(COLON)) return true; + return false; + } + + private boolean jj_3R_59() + { + if (jj_scan_token(GREATER)) return true; + return false; + } + + private boolean jj_3_1() + { + if (jj_3R_48()) return true; + if (jj_3R_49()) return true; + return false; + } + + private boolean jj_3R_54() + { + Token xsp; + if (jj_3R_57()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3R_57()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_60() + { + if (jj_scan_token(IDENT)) return true; + return false; + } + + private boolean jj_3R_56() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_60()) { + jj_scanpos = xsp; + if (jj_3R_61()) return true; + } + return false; + } + + /** Generated Token Manager. */ + public SACParserCSS21TokenManager 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[82]; + static private int[] jj_la1_0; + static private int[] jj_la1_1; + static private int[] jj_la1_2; + static { + jj_la1_init_0(); + jj_la1_init_1(); + jj_la1_init_2(); + } + private static void jj_la1_init_0() { + jj_la1_0 = new int[] {0x2,0x2,0x2,0x2,0x0,0x80000,0x80000,0x80000,0x2,0x2,0x2,0x80000,0x2,0x2,0x400000,0x2,0x80000,0x2,0x2,0x80000,0x0,0x2,0x80000,0x2,0x80000,0x2,0x2,0x2,0x0,0x2,0x2,0x2,0x0,0x2,0x2,0x0,0x2,0x0,0x2,0x0,0x2,0x2,0x1,0x2,0x0,0x2,0x2,0x0,0x0,0x0,0x0,0x80000,0x80000,0x2,0x2,0x0,0x2,0x480000,0x2,0x0,0x2,0x2,0x2,0x2,0x80000,0x80000,0x80000,0x0,0x2,0x80000,0x0,0x2,0x0,0x0,0x2,0x4e0000,0x0,0x0,0x20000,0x4e0000,0x2,0x2,}; + } + private static void jj_la1_init_1() { + jj_la1_1 = new int[] {0xc00,0xc00,0xc00,0xc00,0x0,0x42340000,0xc2340000,0xc2340000,0xc00,0xc00,0x0,0xc2340000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc2340000,0x20000000,0x0,0xc2340000,0x0,0xc2340000,0x0,0x0,0x0,0x100000,0x0,0x0,0x0,0x20400000,0x0,0x0,0x18000000,0x0,0x18000000,0x18000000,0x8800000,0x0,0x0,0x8000,0x0,0x20000000,0x0,0x0,0x42140000,0x42140000,0x42140000,0x42140000,0x42340000,0x200000,0x0,0x0,0x1003000,0x0,0x0,0x0,0x1003000,0x0,0x0,0x0,0x0,0x0,0x0,0x200000,0x80000,0x0,0x200000,0x200000,0x0,0x0,0x0,0x0,0x68c00000,0x20400000,0x8800000,0x0,0x40000000,0x0,0x0,}; + } + private static void jj_la1_init_2() { + jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x4,0x1000003,0x1000003,0x1000003,0x0,0x0,0x0,0x1000007,0x0,0x0,0x200000,0x0,0x0,0x0,0x0,0x1000001,0x0,0x0,0x1000001,0x0,0x1000001,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,0xc00000,0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x2000000,0x0,0x4bffff0,0x0,0x0,0x8ffff0,0x4bffff0,0x0,0x0,}; + } + final private JJCalls[] jj_2_rtns = new JJCalls[1]; + private boolean jj_rescan = false; + private int jj_gc = 0; + + /** Constructor with user supplied CharStream. */ + public SACParserCSS21(CharStream stream) { + token_source = new SACParserCSS21TokenManager(stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 82; 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 < 82; 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 SACParserCSS21(SACParserCSS21TokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 82; 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(SACParserCSS21TokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 82; 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(); + } + + @SuppressWarnings("serial") + 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_f() { + 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 jj_expentries = new java.util.ArrayList(); + 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]; + } + + for (int[] oldentry : jj_expentries) { + if (oldentry.length == jj_expentry.length) { + boolean isMatched = true; + + for (int i = 0; i < jj_expentry.length; i++) { + if (oldentry[i] != jj_expentry[i]) { + isMatched = false; + break; + } + + } + if (isMatched) { + jj_expentries.add(jj_expentry); + break; + } + } + } + + if (pos != 0) { + jj_lasttokens[(jj_endpos = pos) - 1] = kind; + } + } + } + + /** Generate ParseException. */ + public ParseException generateParseException() { + jj_expentries.clear(); + boolean[] la1tokens = new boolean[91]; + if (jj_kind >= 0) { + la1tokens[jj_kind] = true; + jj_kind = -1; + } + for (int i = 0; i < 82; i++) { + if (jj_la1[i] == jj_gen) { + for (int j = 0; j < 32; j++) { + if ((jj_la1_0[i] & (1< jj_gen) { + jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; + switch (i) { + case 0: jj_3_1(); 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; + } + +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS21Constants.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS21Constants.java new file mode 100644 index 000000000..de154cfe2 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS21Constants.java @@ -0,0 +1,286 @@ +/* Generated By:JavaCC: Do not edit this line. SACParserCSS21Constants.java */ +package com.fr.third.steadystate.css.parser; + + +/** + * Token literal values and constants. + * Generated by org.javacc.parser.OtherFilesGen#start() + */ +public interface SACParserCSS21Constants { + + /** End of File. */ + int EOF = 0; + /** RegularExpression Id. */ + int S = 1; + /** RegularExpression Id. */ + int W = 2; + /** RegularExpression Id. */ + int H = 6; + /** RegularExpression Id. */ + int HNUM = 7; + /** RegularExpression Id. */ + int NONASCII = 8; + /** RegularExpression Id. */ + int UNICODE = 9; + /** RegularExpression Id. */ + int ESCAPE = 10; + /** RegularExpression Id. */ + int NMSTART = 11; + /** RegularExpression Id. */ + int NMCHAR = 12; + /** RegularExpression Id. */ + int NL = 13; + /** RegularExpression Id. */ + int STRING1 = 14; + /** RegularExpression Id. */ + int STRING2 = 15; + /** RegularExpression Id. */ + int COMMENT_ = 16; + /** RegularExpression Id. */ + int NUMBER = 17; + /** RegularExpression Id. */ + int INHERIT = 18; + /** RegularExpression Id. */ + int IDENT = 19; + /** RegularExpression Id. */ + int NAME = 20; + /** RegularExpression Id. */ + int NUM = 21; + /** RegularExpression Id. */ + int STRING = 22; + /** RegularExpression Id. */ + int URL = 23; + /** RegularExpression Id. */ + int A_LETTER = 24; + /** RegularExpression Id. */ + int C_LETTER = 25; + /** RegularExpression Id. */ + int D_LETTER = 26; + /** RegularExpression Id. */ + int E_LETTER = 27; + /** RegularExpression Id. */ + int G_LETTER = 28; + /** RegularExpression Id. */ + int H_LETTER = 29; + /** RegularExpression Id. */ + int I_LETTER = 30; + /** RegularExpression Id. */ + int K_LETTER = 31; + /** RegularExpression Id. */ + int L_LETTER = 32; + /** RegularExpression Id. */ + int M_LETTER = 33; + /** RegularExpression Id. */ + int N_LETTER = 34; + /** RegularExpression Id. */ + int O_LETTER = 35; + /** RegularExpression Id. */ + int P_LETTER = 36; + /** RegularExpression Id. */ + int R_LETTER = 37; + /** RegularExpression Id. */ + int S_LETTER = 38; + /** RegularExpression Id. */ + int T_LETTER = 39; + /** RegularExpression Id. */ + int X_LETTER = 40; + /** RegularExpression Id. */ + int Z_LETTER = 41; + /** RegularExpression Id. */ + int CDO = 42; + /** RegularExpression Id. */ + int CDC = 43; + /** RegularExpression Id. */ + int INCLUDES = 44; + /** RegularExpression Id. */ + int DASHMATCH = 45; + /** RegularExpression Id. */ + int LBRACE = 46; + /** RegularExpression Id. */ + int RBRACE = 47; + /** RegularExpression Id. */ + int LROUND = 48; + /** RegularExpression Id. */ + int RROUND = 49; + /** RegularExpression Id. */ + int DOT = 50; + /** RegularExpression Id. */ + int SEMICOLON = 51; + /** RegularExpression Id. */ + int COLON = 52; + /** RegularExpression Id. */ + int ASTERISK = 53; + /** RegularExpression Id. */ + int SLASH = 54; + /** RegularExpression Id. */ + int MINUS = 55; + /** RegularExpression Id. */ + int EQUALS = 56; + /** RegularExpression Id. */ + int LSQUARE = 57; + /** RegularExpression Id. */ + int RSQUARE = 58; + /** RegularExpression Id. */ + int PLUS = 59; + /** RegularExpression Id. */ + int GREATER = 60; + /** RegularExpression Id. */ + int COMMA = 61; + /** RegularExpression Id. */ + int HASH = 62; + /** RegularExpression Id. */ + int IMPORT_SYM = 63; + /** RegularExpression Id. */ + int PAGE_SYM = 64; + /** RegularExpression Id. */ + int MEDIA_SYM = 65; + /** RegularExpression Id. */ + int CHARSET_SYM = 66; + /** RegularExpression Id. */ + int IMPORTANT_SYM = 67; + /** RegularExpression Id. */ + int EMS = 68; + /** RegularExpression Id. */ + int EXS = 69; + /** RegularExpression Id. */ + int LENGTH_PX = 70; + /** RegularExpression Id. */ + int LENGTH_CM = 71; + /** RegularExpression Id. */ + int LENGTH_MM = 72; + /** RegularExpression Id. */ + int LENGTH_IN = 73; + /** RegularExpression Id. */ + int LENGTH_PT = 74; + /** RegularExpression Id. */ + int LENGTH_PC = 75; + /** RegularExpression Id. */ + int ANGLE_DEG = 76; + /** RegularExpression Id. */ + int ANGLE_RAD = 77; + /** RegularExpression Id. */ + int ANGLE_GRAD = 78; + /** RegularExpression Id. */ + int TIME_MS = 79; + /** RegularExpression Id. */ + int TIME_S = 80; + /** RegularExpression Id. */ + int FREQ_HZ = 81; + /** RegularExpression Id. */ + int FREQ_KHZ = 82; + /** RegularExpression Id. */ + int PERCENTAGE = 83; + /** RegularExpression Id. */ + int DIMENSION = 84; + /** RegularExpression Id. */ + int URI = 85; + /** RegularExpression Id. */ + int FUNCTION_LANG = 86; + /** RegularExpression Id. */ + int FUNCTION = 87; + /** RegularExpression Id. */ + int ATKEYWORD = 88; + /** RegularExpression Id. */ + int UNKNOWN = 89; + + /** Lexical state. */ + int DEFAULT = 0; + /** Lexical state. */ + int COMMENT = 1; + + /** Literal token values. */ + String[] tokenImage = { + "", + "", + "", + "\"/*\"", + "\"*/\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"inherit\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"\"", + "\"~=\"", + "\"|=\"", + "", + "\"}\"", + "\"(\"", + "\")\"", + "\".\"", + "\";\"", + "\":\"", + "\"*\"", + "\"/\"", + "\"-\"", + "\"=\"", + "\"[\"", + "\"]\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"progid:\"", + }; + +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS21TokenManager.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS21TokenManager.java new file mode 100644 index 000000000..5f76d622d --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS21TokenManager.java @@ -0,0 +1,6654 @@ +/* SACParserCSS21TokenManager.java */ +/* Generated By:JavaCC: Do not edit this line. SACParserCSS21TokenManager.java */ +package com.fr.third.steadystate.css.parser; +import org.w3c.css.sac.CSSParseException; +import org.w3c.css.sac.Condition; +import org.w3c.css.sac.LexicalUnit; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.Parser; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SelectorList; +import org.w3c.css.sac.SimpleSelector; + +/** Token Manager. */ +@SuppressWarnings("all") public class SACParserCSS21TokenManager implements SACParserCSS21Constants { + + /** Debug output. */ + public java.io.PrintStream debugStream = System.out; + /** Set debug output. */ + public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } +private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1){ + switch (pos) + { + case 0: + if ((active0 & 0x4000000000000L) != 0L) + return 1199; + if ((active0 & 0x80080000000000L) != 0L) + return 763; + if ((active0 & 0x40000L) != 0L || (active1 & 0x4000000L) != 0L) + { + jjmatchedKind = 19; + jjmatchedPos = 0; + return 1200; + } + return -1; + case 1: + if ((active0 & 0x40000L) != 0L || (active1 & 0x4000000L) != 0L) + { + jjmatchedKind = 19; + jjmatchedPos = 1; + return 1200; + } + return -1; + case 2: + if ((active0 & 0x40000L) != 0L || (active1 & 0x4000000L) != 0L) + { + jjmatchedKind = 19; + jjmatchedPos = 2; + return 1200; + } + return -1; + case 3: + if ((active0 & 0x40000L) != 0L || (active1 & 0x4000000L) != 0L) + { + jjmatchedKind = 19; + jjmatchedPos = 3; + return 1200; + } + return -1; + case 4: + if ((active0 & 0x40000L) != 0L || (active1 & 0x4000000L) != 0L) + { + jjmatchedKind = 19; + jjmatchedPos = 4; + return 1200; + } + return -1; + case 5: + if ((active0 & 0x40000L) != 0L || (active1 & 0x4000000L) != 0L) + { + jjmatchedKind = 19; + jjmatchedPos = 5; + return 1200; + } + return -1; + default : + return -1; + } +} +private final int jjStartNfa_0(int pos, long active0, long active1){ + return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1); +} +private int jjStopAtPos(int pos, int kind) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + return pos + 1; +} +private int jjMoveStringLiteralDfa0_0(){ + switch(curChar) + { + case 40: + return jjStopAtPos(0, 48); + case 41: + return jjStopAtPos(0, 49); + case 42: + return jjStopAtPos(0, 53); + case 45: + { + jjmatchedKind = 55; + jjmatchedPos = 0; + } + return jjMoveStringLiteralDfa1_0(0x80000000000L, 0x0L); + case 46: + return jjStartNfaWithStates_0(0, 50, 1199); + case 47: + { + jjmatchedKind = 54; + jjmatchedPos = 0; + } + return jjMoveStringLiteralDfa1_0(0x8L, 0x0L); + case 58: + return jjStopAtPos(0, 52); + case 59: + return jjStopAtPos(0, 51); + case 60: + return jjMoveStringLiteralDfa1_0(0x40000000000L, 0x0L); + case 61: + return jjStopAtPos(0, 56); + case 91: + return jjStopAtPos(0, 57); + case 93: + return jjStopAtPos(0, 58); + case 73: + case 105: + return jjMoveStringLiteralDfa1_0(0x40000L, 0x0L); + case 80: + case 112: + return jjMoveStringLiteralDfa1_0(0x0L, 0x4000000L); + case 124: + return jjMoveStringLiteralDfa1_0(0x200000000000L, 0x0L); + case 125: + return jjStopAtPos(0, 47); + case 126: + return jjMoveStringLiteralDfa1_0(0x100000000000L, 0x0L); + default : + return jjMoveNfa_0(0, 0); + } +} +private int jjMoveStringLiteralDfa1_0(long active0, long active1){ + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(0, active0, active1); + return 1; + } + switch(curChar) + { + case 33: + return jjMoveStringLiteralDfa2_0(active0, 0x40000000000L, active1, 0L); + case 42: + if ((active0 & 0x8L) != 0L) + return jjStopAtPos(1, 3); + break; + case 45: + return jjMoveStringLiteralDfa2_0(active0, 0x80000000000L, active1, 0L); + case 61: + if ((active0 & 0x100000000000L) != 0L) + return jjStopAtPos(1, 44); + else if ((active0 & 0x200000000000L) != 0L) + return jjStopAtPos(1, 45); + break; + case 78: + case 110: + return jjMoveStringLiteralDfa2_0(active0, 0x40000L, active1, 0L); + case 82: + case 114: + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x4000000L); + default : + break; + } + return jjStartNfa_0(0, active0, active1); +} +private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1){ + if (((active0 &= old0) | (active1 &= old1)) == 0L) + return jjStartNfa_0(0, old0, old1); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(1, active0, active1); + return 2; + } + switch(curChar) + { + case 45: + return jjMoveStringLiteralDfa3_0(active0, 0x40000000000L, active1, 0L); + case 62: + if ((active0 & 0x80000000000L) != 0L) + return jjStopAtPos(2, 43); + break; + case 72: + case 104: + return jjMoveStringLiteralDfa3_0(active0, 0x40000L, active1, 0L); + case 79: + case 111: + return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x4000000L); + default : + break; + } + return jjStartNfa_0(1, active0, active1); +} +private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1){ + if (((active0 &= old0) | (active1 &= old1)) == 0L) + return jjStartNfa_0(1, old0, old1); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(2, active0, active1); + return 3; + } + switch(curChar) + { + case 45: + if ((active0 & 0x40000000000L) != 0L) + return jjStopAtPos(3, 42); + break; + case 69: + case 101: + return jjMoveStringLiteralDfa4_0(active0, 0x40000L, active1, 0L); + case 71: + case 103: + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x4000000L); + default : + break; + } + return jjStartNfa_0(2, active0, active1); +} +private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1){ + if (((active0 &= old0) | (active1 &= old1)) == 0L) + return jjStartNfa_0(2, old0, old1); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(3, active0, active1); + return 4; + } + switch(curChar) + { + case 73: + case 105: + return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x4000000L); + case 82: + case 114: + return jjMoveStringLiteralDfa5_0(active0, 0x40000L, active1, 0L); + default : + break; + } + return jjStartNfa_0(3, active0, active1); +} +private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1){ + if (((active0 &= old0) | (active1 &= old1)) == 0L) + return jjStartNfa_0(3, old0, old1); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(4, active0, active1); + return 5; + } + switch(curChar) + { + case 68: + case 100: + return jjMoveStringLiteralDfa6_0(active0, 0L, active1, 0x4000000L); + case 73: + case 105: + return jjMoveStringLiteralDfa6_0(active0, 0x40000L, active1, 0L); + default : + break; + } + return jjStartNfa_0(4, active0, active1); +} +private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long active1){ + if (((active0 &= old0) | (active1 &= old1)) == 0L) + return jjStartNfa_0(4, old0, old1); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(5, active0, active1); + return 6; + } + switch(curChar) + { + case 58: + if ((active1 & 0x4000000L) != 0L) + return jjStopAtPos(6, 90); + break; + case 84: + case 116: + if ((active0 & 0x40000L) != 0L) + return jjStartNfaWithStates_0(6, 18, 1200); + break; + default : + break; + } + return jjStartNfa_0(5, active0, active1); +} +private int jjStartNfaWithStates_0(int pos, int kind, int state) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return pos + 1; } + return jjMoveNfa_0(state, pos + 1); +} +static final long[] jjbitVec0 = { + 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL +}; +static final long[] jjbitVec2 = { + 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL +}; +private int jjMoveNfa_0(int startState, int curPos) +{ + int startsAt = 0; + jjnewStateCnt = 1199; + int i = 1; + jjstateSet[0] = startState; + int kind = 0x7fffffff; + for (;;) + { + if (++jjround == 0x7fffffff) + ReInitRounds(); + if (curChar < 64) + { + long l = 1L << curChar; + do + { + switch(jjstateSet[--i]) + { + case 1200: + if ((0x3ff200000000000L & l) != 0L) + { jjCheckNAddStates(0, 2); } + else if (curChar == 40) + { + if (kind > 87) + kind = 87; + } + if ((0x3ff200000000000L & l) != 0L) + { + if (kind > 19) + kind = 19; + { jjCheckNAddTwoStates(764, 765); } + } + break; + case 1199: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(3, 6); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(725, 726); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(7, 9); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(10, 12); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(13, 15); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(16, 18); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(19, 21); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(22, 24); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(25, 27); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(28, 30); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(31, 33); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(34, 36); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(37, 39); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(40, 42); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(43, 45); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(46, 48); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(49, 51); } + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 21) + kind = 21; + { jjCheckNAdd(301); } + } + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 17) + kind = 17; + { jjCheckNAdd(300); } + } + break; + case 0: + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 17) + kind = 17; + { jjCheckNAddStates(52, 142); } + } + else if ((0x100003600L & l) != 0L) + { + if (kind > 1) + kind = 1; + { jjCheckNAddStates(143, 152); } + } + else if (curChar == 45) + { jjAddStates(153, 156); } + else if (curChar == 46) + { jjCheckNAddStates(157, 175); } + else if (curChar == 33) + { jjCheckNAddStates(176, 179); } + else if (curChar == 35) + { jjCheckNAddTwoStates(49, 50); } + else if (curChar == 44) + { + if (kind > 61) + kind = 61; + } + else if (curChar == 62) + { + if (kind > 60) + kind = 60; + } + else if (curChar == 43) + { + if (kind > 59) + kind = 59; + } + else if (curChar == 39) + { jjCheckNAddStates(180, 182); } + else if (curChar == 34) + { jjCheckNAddStates(183, 185); } + break; + case 1: + if ((0xfffffffbffffcbffL & l) != 0L) + { jjCheckNAddStates(183, 185); } + break; + case 2: + if (curChar == 34 && kind > 22) + kind = 22; + break; + case 4: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(183, 185); } + break; + case 5: + if (curChar == 10) + { jjCheckNAddStates(183, 185); } + break; + case 6: + case 10: + if (curChar == 13) + { jjCheckNAdd(5); } + break; + case 7: + if ((0xfc00ffffffffcbffL & l) != 0L) + { jjCheckNAddStates(183, 185); } + break; + case 8: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(186, 195); } + break; + case 9: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(196, 200); } + break; + case 11: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(183, 185); } + break; + case 12: + case 14: + case 17: + case 21: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(9); } + break; + case 13: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 14; + break; + case 15: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 16; + break; + case 16: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 17; + break; + case 18: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 19; + break; + case 19: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 20; + break; + case 20: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 21; + break; + case 22: + if (curChar == 39) + { jjCheckNAddStates(180, 182); } + break; + case 23: + if ((0xffffff7fffffcbffL & l) != 0L) + { jjCheckNAddStates(180, 182); } + break; + case 24: + if (curChar == 39 && kind > 22) + kind = 22; + break; + case 26: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(180, 182); } + break; + case 27: + if (curChar == 10) + { jjCheckNAddStates(180, 182); } + break; + case 28: + case 32: + if (curChar == 13) + { jjCheckNAdd(27); } + break; + case 29: + if ((0xfc00ffffffffcbffL & l) != 0L) + { jjCheckNAddStates(180, 182); } + break; + case 30: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(201, 210); } + break; + case 31: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(211, 215); } + break; + case 33: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(180, 182); } + break; + case 34: + case 36: + case 39: + case 43: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(31); } + break; + case 35: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 36; + break; + case 37: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 38; + break; + case 38: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 39; + break; + case 40: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 41; + break; + case 41: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 42; + break; + case 42: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 43; + break; + case 45: + if (curChar == 43 && kind > 59) + kind = 59; + break; + case 46: + if (curChar == 62 && kind > 60) + kind = 60; + break; + case 47: + if (curChar == 44 && kind > 61) + kind = 61; + break; + case 48: + if (curChar == 35) + { jjCheckNAddTwoStates(49, 50); } + break; + case 49: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 62) + kind = 62; + { jjCheckNAddTwoStates(49, 50); } + break; + case 51: + if ((0xfc00ffffffffcbffL & l) == 0L) + break; + if (kind > 62) + kind = 62; + { jjCheckNAddTwoStates(49, 50); } + break; + case 52: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 62) + kind = 62; + { jjCheckNAddStates(216, 224); } + break; + case 53: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 62) + kind = 62; + { jjCheckNAddStates(225, 228); } + break; + case 54: + if (curChar != 10) + break; + if (kind > 62) + kind = 62; + { jjCheckNAddTwoStates(49, 50); } + break; + case 55: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 54; + break; + case 56: + if ((0x100003600L & l) == 0L) + break; + if (kind > 62) + kind = 62; + { jjCheckNAddTwoStates(49, 50); } + break; + case 57: + case 59: + case 62: + case 66: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(53); } + break; + case 58: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 59; + break; + case 60: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 61; + break; + case 61: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 62; + break; + case 63: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 64; + break; + case 64: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 65; + break; + case 65: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 66; + break; + case 67: + if (curChar == 33) + { jjCheckNAddStates(176, 179); } + break; + case 68: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(176, 179); } + break; + case 69: + if (curChar == 47) + jjstateSet[jjnewStateCnt++] = 70; + break; + case 70: + if (curChar == 42) + { jjCheckNAddTwoStates(71, 72); } + break; + case 71: + if ((0xfffffbffffffffffL & l) != 0L) + { jjCheckNAddTwoStates(71, 72); } + break; + case 72: + if (curChar == 42) + { jjCheckNAddStates(229, 231); } + break; + case 73: + if ((0xffff7bffffffffffL & l) != 0L) + { jjCheckNAddTwoStates(74, 75); } + break; + case 74: + if ((0xfffffbffffffffffL & l) != 0L) + { jjCheckNAddTwoStates(74, 75); } + break; + case 75: + if (curChar == 42) + { jjCheckNAddStates(232, 234); } + break; + case 76: + if (curChar == 47) + { jjCheckNAddStates(176, 179); } + break; + case 87: + if (curChar != 52) + break; + if (kind > 67) + kind = 67; + { jjAddStates(235, 236); } + break; + case 88: + if (curChar == 10 && kind > 67) + kind = 67; + break; + case 89: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 88; + break; + case 90: + if ((0x100003600L & l) != 0L && kind > 67) + kind = 67; + break; + case 91: + if (curChar == 53) + { jjCheckNAdd(87); } + break; + case 92: + if (curChar == 55) + { jjCheckNAdd(87); } + break; + case 93: + if (curChar == 48) + { jjCheckNAddStates(237, 241); } + break; + case 94: + if (curChar == 48) + { jjCheckNAddTwoStates(91, 92); } + break; + case 95: + if (curChar == 48) + { jjCheckNAddStates(242, 244); } + break; + case 96: + if (curChar == 48) + { jjCheckNAddStates(245, 248); } + break; + case 99: + if (curChar == 10) + { jjCheckNAddTwoStates(85, 86); } + break; + case 100: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 99; + break; + case 101: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(85, 86); } + break; + case 102: + if (curChar == 52) + { jjCheckNAdd(98); } + break; + case 103: + if (curChar == 54) + { jjCheckNAdd(98); } + break; + case 104: + if (curChar == 48) + { jjCheckNAddStates(249, 253); } + break; + case 105: + if (curChar == 48) + { jjCheckNAddTwoStates(102, 103); } + break; + case 106: + if (curChar == 48) + { jjCheckNAddStates(254, 256); } + break; + case 107: + if (curChar == 48) + { jjCheckNAddStates(257, 260); } + break; + case 109: + if (curChar == 49) + { jjCheckNAddStates(261, 264); } + break; + case 110: + if (curChar == 10) + { jjCheckNAddTwoStates(84, 97); } + break; + case 111: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 110; + break; + case 112: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(84, 97); } + break; + case 113: + if (curChar == 52) + { jjCheckNAdd(109); } + break; + case 114: + if (curChar == 54) + { jjCheckNAdd(109); } + break; + case 115: + if (curChar == 48) + { jjCheckNAddStates(265, 269); } + break; + case 116: + if (curChar == 48) + { jjCheckNAddTwoStates(113, 114); } + break; + case 117: + if (curChar == 48) + { jjCheckNAddStates(270, 272); } + break; + case 118: + if (curChar == 48) + { jjCheckNAddStates(273, 276); } + break; + case 120: + if (curChar == 52) + { jjCheckNAddStates(277, 280); } + break; + case 121: + if (curChar == 10) + { jjCheckNAddTwoStates(83, 108); } + break; + case 122: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 121; + break; + case 123: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(83, 108); } + break; + case 124: + if (curChar == 53) + { jjCheckNAdd(120); } + break; + case 125: + if (curChar == 55) + { jjCheckNAdd(120); } + break; + case 126: + if (curChar == 48) + { jjCheckNAddStates(281, 285); } + break; + case 127: + if (curChar == 48) + { jjCheckNAddTwoStates(124, 125); } + break; + case 128: + if (curChar == 48) + { jjCheckNAddStates(286, 288); } + break; + case 129: + if (curChar == 48) + { jjCheckNAddStates(289, 292); } + break; + case 131: + if (curChar == 50) + { jjCheckNAddStates(293, 296); } + break; + case 132: + if (curChar == 10) + { jjCheckNAddTwoStates(82, 119); } + break; + case 133: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 132; + break; + case 134: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(82, 119); } + break; + case 135: + if (curChar == 53) + { jjCheckNAdd(131); } + break; + case 136: + if (curChar == 55) + { jjCheckNAdd(131); } + break; + case 137: + if (curChar == 48) + { jjCheckNAddStates(297, 301); } + break; + case 138: + if (curChar == 48) + { jjCheckNAddTwoStates(135, 136); } + break; + case 139: + if (curChar == 48) + { jjCheckNAddStates(302, 304); } + break; + case 140: + if (curChar == 48) + { jjCheckNAddStates(305, 308); } + break; + case 142: + if (curChar == 49) + { jjCheckNAddStates(309, 312); } + break; + case 143: + if (curChar == 10) + { jjCheckNAddTwoStates(81, 130); } + break; + case 144: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 143; + break; + case 145: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(81, 130); } + break; + case 146: + if (curChar == 53) + { jjCheckNAdd(142); } + break; + case 147: + if (curChar == 55) + { jjCheckNAdd(142); } + break; + case 148: + if (curChar == 48) + { jjCheckNAddStates(313, 317); } + break; + case 149: + if (curChar == 48) + { jjCheckNAddTwoStates(146, 147); } + break; + case 150: + if (curChar == 48) + { jjCheckNAddStates(318, 320); } + break; + case 151: + if (curChar == 48) + { jjCheckNAddStates(321, 324); } + break; + case 153: + if (curChar == 48) + { jjCheckNAddStates(325, 328); } + break; + case 154: + if (curChar == 10) + { jjCheckNAddTwoStates(80, 141); } + break; + case 155: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 154; + break; + case 156: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(80, 141); } + break; + case 157: + if (curChar == 53) + { jjCheckNAdd(153); } + break; + case 158: + if (curChar == 55) + { jjCheckNAdd(153); } + break; + case 159: + if (curChar == 48) + { jjCheckNAddStates(329, 333); } + break; + case 160: + if (curChar == 48) + { jjCheckNAddTwoStates(157, 158); } + break; + case 161: + if (curChar == 48) + { jjCheckNAddStates(334, 336); } + break; + case 162: + if (curChar == 48) + { jjCheckNAddStates(337, 340); } + break; + case 165: + if (curChar == 10) + { jjCheckNAddTwoStates(79, 152); } + break; + case 166: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 165; + break; + case 167: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(79, 152); } + break; + case 168: + if (curChar == 52) + { jjCheckNAdd(164); } + break; + case 169: + if (curChar == 54) + { jjCheckNAdd(164); } + break; + case 170: + if (curChar == 48) + { jjCheckNAddStates(341, 345); } + break; + case 171: + if (curChar == 48) + { jjCheckNAddTwoStates(168, 169); } + break; + case 172: + if (curChar == 48) + { jjCheckNAddStates(346, 348); } + break; + case 173: + if (curChar == 48) + { jjCheckNAddStates(349, 352); } + break; + case 175: + if (curChar == 57) + { jjCheckNAddStates(353, 356); } + break; + case 176: + if (curChar == 10) + { jjCheckNAddTwoStates(78, 163); } + break; + case 177: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 176; + break; + case 178: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(78, 163); } + break; + case 179: + if (curChar == 52) + { jjCheckNAdd(175); } + break; + case 180: + if (curChar == 54) + { jjCheckNAdd(175); } + break; + case 181: + if (curChar == 48) + { jjCheckNAddStates(357, 361); } + break; + case 182: + if (curChar == 48) + { jjCheckNAddTwoStates(179, 180); } + break; + case 183: + if (curChar == 48) + { jjCheckNAddStates(362, 364); } + break; + case 184: + if (curChar == 48) + { jjCheckNAddStates(365, 368); } + break; + case 186: + if (curChar == 40) + { jjCheckNAddStates(369, 374); } + break; + case 187: + if ((0xfffffc7a00000000L & l) != 0L) + { jjCheckNAddStates(375, 378); } + break; + case 188: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(188, 189); } + break; + case 189: + if (curChar == 41 && kind > 85) + kind = 85; + break; + case 191: + if ((0xfc00ffffffffcbffL & l) != 0L) + { jjCheckNAddStates(375, 378); } + break; + case 192: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(379, 388); } + break; + case 193: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(389, 393); } + break; + case 194: + if (curChar == 10) + { jjCheckNAddStates(375, 378); } + break; + case 195: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 194; + break; + case 196: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(375, 378); } + break; + case 197: + case 199: + case 202: + case 206: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(193); } + break; + case 198: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 199; + break; + case 200: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 201; + break; + case 201: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 202; + break; + case 203: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 204; + break; + case 204: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 205; + break; + case 205: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 206; + break; + case 207: + if (curChar == 39) + { jjCheckNAddStates(394, 396); } + break; + case 208: + if ((0xffffff7fffffcbffL & l) != 0L) + { jjCheckNAddStates(394, 396); } + break; + case 209: + if (curChar == 39) + { jjCheckNAddTwoStates(188, 189); } + break; + case 211: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(394, 396); } + break; + case 212: + if (curChar == 10) + { jjCheckNAddStates(394, 396); } + break; + case 213: + case 217: + if (curChar == 13) + { jjCheckNAdd(212); } + break; + case 214: + if ((0xfc00ffffffffcbffL & l) != 0L) + { jjCheckNAddStates(394, 396); } + break; + case 215: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(397, 406); } + break; + case 216: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(407, 411); } + break; + case 218: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(394, 396); } + break; + case 219: + case 221: + case 224: + case 228: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(216); } + break; + case 220: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 221; + break; + case 222: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 223; + break; + case 223: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 224; + break; + case 225: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 226; + break; + case 226: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 227; + break; + case 227: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 228; + break; + case 229: + if (curChar == 34) + { jjCheckNAddStates(412, 414); } + break; + case 230: + if ((0xfffffffbffffcbffL & l) != 0L) + { jjCheckNAddStates(412, 414); } + break; + case 231: + if (curChar == 34) + { jjCheckNAddTwoStates(188, 189); } + break; + case 233: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(412, 414); } + break; + case 234: + if (curChar == 10) + { jjCheckNAddStates(412, 414); } + break; + case 235: + case 239: + if (curChar == 13) + { jjCheckNAdd(234); } + break; + case 236: + if ((0xfc00ffffffffcbffL & l) != 0L) + { jjCheckNAddStates(412, 414); } + break; + case 237: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(415, 424); } + break; + case 238: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(425, 429); } + break; + case 240: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(412, 414); } + break; + case 241: + case 243: + case 246: + case 250: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(238); } + break; + case 242: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 243; + break; + case 244: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 245; + break; + case 245: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 246; + break; + case 247: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 248; + break; + case 248: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 249; + break; + case 249: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 250; + break; + case 251: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(430, 436); } + break; + case 258: + if (curChar == 40 && kind > 86) + kind = 86; + break; + case 260: + if (curChar == 55) + { jjCheckNAddStates(437, 439); } + break; + case 261: + if (curChar == 10) + { jjCheckNAdd(258); } + break; + case 262: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 261; + break; + case 263: + if ((0x100003600L & l) != 0L) + { jjCheckNAdd(258); } + break; + case 264: + if (curChar == 52) + { jjCheckNAdd(260); } + break; + case 265: + if (curChar == 54) + { jjCheckNAdd(260); } + break; + case 266: + if (curChar == 48) + { jjCheckNAddStates(440, 444); } + break; + case 267: + if (curChar == 48) + { jjCheckNAddTwoStates(264, 265); } + break; + case 268: + if (curChar == 48) + { jjCheckNAddStates(445, 447); } + break; + case 269: + if (curChar == 48) + { jjCheckNAddStates(448, 451); } + break; + case 272: + if (curChar == 10) + { jjCheckNAddTwoStates(257, 259); } + break; + case 273: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 272; + break; + case 274: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(257, 259); } + break; + case 275: + if (curChar == 52) + { jjCheckNAdd(271); } + break; + case 276: + if (curChar == 54) + { jjCheckNAdd(271); } + break; + case 277: + if (curChar == 48) + { jjCheckNAddStates(452, 456); } + break; + case 278: + if (curChar == 48) + { jjCheckNAddTwoStates(275, 276); } + break; + case 279: + if (curChar == 48) + { jjCheckNAddStates(457, 459); } + break; + case 280: + if (curChar == 48) + { jjCheckNAddStates(460, 463); } + break; + case 282: + if (curChar == 49) + { jjCheckNAddStates(464, 467); } + break; + case 283: + if (curChar == 10) + { jjCheckNAddTwoStates(256, 270); } + break; + case 284: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 283; + break; + case 285: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(256, 270); } + break; + case 286: + if (curChar == 52) + { jjCheckNAdd(282); } + break; + case 287: + if (curChar == 54) + { jjCheckNAdd(282); } + break; + case 288: + if (curChar == 48) + { jjCheckNAddStates(468, 472); } + break; + case 289: + if (curChar == 48) + { jjCheckNAddTwoStates(286, 287); } + break; + case 290: + if (curChar == 48) + { jjCheckNAddStates(473, 475); } + break; + case 291: + if (curChar == 48) + { jjCheckNAddStates(476, 479); } + break; + case 292: + if ((0x100003600L & l) == 0L) + break; + if (kind > 1) + kind = 1; + { jjCheckNAddStates(143, 152); } + break; + case 293: + if ((0x100003600L & l) == 0L) + break; + if (kind > 1) + kind = 1; + { jjCheckNAdd(293); } + break; + case 294: + if ((0x100003600L & l) == 0L) + break; + if (kind > 2) + kind = 2; + { jjCheckNAdd(294); } + break; + case 295: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(295, 44); } + break; + case 296: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(296, 45); } + break; + case 297: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(297, 46); } + break; + case 298: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(298, 47); } + break; + case 299: + if (curChar == 46) + { jjCheckNAddStates(157, 175); } + break; + case 300: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 17) + kind = 17; + { jjCheckNAdd(300); } + break; + case 301: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 21) + kind = 21; + { jjCheckNAdd(301); } + break; + case 302: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(49, 51); } + break; + case 307: + if (curChar == 10 && kind > 68) + kind = 68; + break; + case 308: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 307; + break; + case 309: + if ((0x100003600L & l) != 0L && kind > 68) + kind = 68; + break; + case 310: + if (curChar == 52) + { jjCheckNAdd(306); } + break; + case 311: + if (curChar == 54) + { jjCheckNAdd(306); } + break; + case 312: + if (curChar == 48) + { jjCheckNAddStates(480, 484); } + break; + case 313: + if (curChar == 48) + { jjCheckNAddTwoStates(310, 311); } + break; + case 314: + if (curChar == 48) + { jjCheckNAddStates(485, 487); } + break; + case 315: + if (curChar == 48) + { jjCheckNAddStates(488, 491); } + break; + case 317: + if (curChar == 53) + { jjCheckNAddStates(492, 495); } + break; + case 318: + if (curChar == 10) + { jjCheckNAddTwoStates(304, 305); } + break; + case 319: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 318; + break; + case 320: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(304, 305); } + break; + case 321: + if (curChar == 52) + { jjCheckNAdd(317); } + break; + case 322: + if (curChar == 54) + { jjCheckNAdd(317); } + break; + case 323: + if (curChar == 48) + { jjCheckNAddStates(496, 500); } + break; + case 324: + if (curChar == 48) + { jjCheckNAddTwoStates(321, 322); } + break; + case 325: + if (curChar == 48) + { jjCheckNAddStates(501, 503); } + break; + case 326: + if (curChar == 48) + { jjCheckNAddStates(504, 507); } + break; + case 327: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(46, 48); } + break; + case 331: + if (curChar != 56) + break; + if (kind > 69) + kind = 69; + { jjAddStates(508, 509); } + break; + case 332: + if (curChar == 10 && kind > 69) + kind = 69; + break; + case 333: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 332; + break; + case 334: + if ((0x100003600L & l) != 0L && kind > 69) + kind = 69; + break; + case 335: + if (curChar == 53) + { jjCheckNAdd(331); } + break; + case 336: + if (curChar == 55) + { jjCheckNAdd(331); } + break; + case 337: + if (curChar == 48) + { jjCheckNAddStates(510, 514); } + break; + case 338: + if (curChar == 48) + { jjCheckNAddTwoStates(335, 336); } + break; + case 339: + if (curChar == 48) + { jjCheckNAddStates(515, 517); } + break; + case 340: + if (curChar == 48) + { jjCheckNAddStates(518, 521); } + break; + case 342: + if (curChar == 53) + { jjCheckNAddStates(522, 525); } + break; + case 343: + if (curChar == 10) + { jjCheckNAddTwoStates(329, 330); } + break; + case 344: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 343; + break; + case 345: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(329, 330); } + break; + case 346: + if (curChar == 52) + { jjCheckNAdd(342); } + break; + case 347: + if (curChar == 54) + { jjCheckNAdd(342); } + break; + case 348: + if (curChar == 48) + { jjCheckNAddStates(526, 530); } + break; + case 349: + if (curChar == 48) + { jjCheckNAddTwoStates(346, 347); } + break; + case 350: + if (curChar == 48) + { jjCheckNAddStates(531, 533); } + break; + case 351: + if (curChar == 48) + { jjCheckNAddStates(534, 537); } + break; + case 352: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(43, 45); } + break; + case 356: + if (curChar != 56) + break; + if (kind > 70) + kind = 70; + { jjAddStates(538, 539); } + break; + case 357: + if (curChar == 10 && kind > 70) + kind = 70; + break; + case 358: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 357; + break; + case 359: + if ((0x100003600L & l) != 0L && kind > 70) + kind = 70; + break; + case 360: + if (curChar == 53) + { jjCheckNAdd(356); } + break; + case 361: + if (curChar == 55) + { jjCheckNAdd(356); } + break; + case 362: + if (curChar == 48) + { jjCheckNAddStates(540, 544); } + break; + case 363: + if (curChar == 48) + { jjCheckNAddTwoStates(360, 361); } + break; + case 364: + if (curChar == 48) + { jjCheckNAddStates(545, 547); } + break; + case 365: + if (curChar == 48) + { jjCheckNAddStates(548, 551); } + break; + case 367: + if (curChar == 48) + { jjCheckNAddStates(552, 555); } + break; + case 368: + if (curChar == 10) + { jjCheckNAddTwoStates(354, 355); } + break; + case 369: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 368; + break; + case 370: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(354, 355); } + break; + case 371: + if (curChar == 53) + { jjCheckNAdd(367); } + break; + case 372: + if (curChar == 55) + { jjCheckNAdd(367); } + break; + case 373: + if (curChar == 48) + { jjCheckNAddStates(556, 560); } + break; + case 374: + if (curChar == 48) + { jjCheckNAddTwoStates(371, 372); } + break; + case 375: + if (curChar == 48) + { jjCheckNAddStates(561, 563); } + break; + case 376: + if (curChar == 48) + { jjCheckNAddStates(564, 567); } + break; + case 377: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(40, 42); } + break; + case 382: + if (curChar == 10 && kind > 71) + kind = 71; + break; + case 383: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 382; + break; + case 384: + if ((0x100003600L & l) != 0L && kind > 71) + kind = 71; + break; + case 385: + if (curChar == 52) + { jjCheckNAdd(381); } + break; + case 386: + if (curChar == 54) + { jjCheckNAdd(381); } + break; + case 387: + if (curChar == 48) + { jjCheckNAddStates(568, 572); } + break; + case 388: + if (curChar == 48) + { jjCheckNAddTwoStates(385, 386); } + break; + case 389: + if (curChar == 48) + { jjCheckNAddStates(573, 575); } + break; + case 390: + if (curChar == 48) + { jjCheckNAddStates(576, 579); } + break; + case 392: + if (curChar == 51) + { jjCheckNAddStates(580, 583); } + break; + case 393: + if (curChar == 10) + { jjCheckNAddTwoStates(379, 380); } + break; + case 394: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 393; + break; + case 395: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(379, 380); } + break; + case 396: + if (curChar == 52) + { jjCheckNAdd(392); } + break; + case 397: + if (curChar == 54) + { jjCheckNAdd(392); } + break; + case 398: + if (curChar == 48) + { jjCheckNAddStates(584, 588); } + break; + case 399: + if (curChar == 48) + { jjCheckNAddTwoStates(396, 397); } + break; + case 400: + if (curChar == 48) + { jjCheckNAddStates(589, 591); } + break; + case 401: + if (curChar == 48) + { jjCheckNAddStates(592, 595); } + break; + case 402: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(37, 39); } + break; + case 407: + if (curChar == 10 && kind > 72) + kind = 72; + break; + case 408: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 407; + break; + case 409: + if ((0x100003600L & l) != 0L && kind > 72) + kind = 72; + break; + case 410: + if (curChar == 52) + { jjCheckNAdd(406); } + break; + case 411: + if (curChar == 54) + { jjCheckNAdd(406); } + break; + case 412: + if (curChar == 48) + { jjCheckNAddStates(596, 600); } + break; + case 413: + if (curChar == 48) + { jjCheckNAddTwoStates(410, 411); } + break; + case 414: + if (curChar == 48) + { jjCheckNAddStates(601, 603); } + break; + case 415: + if (curChar == 48) + { jjCheckNAddStates(604, 607); } + break; + case 418: + if (curChar == 10) + { jjCheckNAddTwoStates(404, 405); } + break; + case 419: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 418; + break; + case 420: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(404, 405); } + break; + case 421: + if (curChar == 52) + { jjCheckNAdd(417); } + break; + case 422: + if (curChar == 54) + { jjCheckNAdd(417); } + break; + case 423: + if (curChar == 48) + { jjCheckNAddStates(608, 612); } + break; + case 424: + if (curChar == 48) + { jjCheckNAddTwoStates(421, 422); } + break; + case 425: + if (curChar == 48) + { jjCheckNAddStates(613, 615); } + break; + case 426: + if (curChar == 48) + { jjCheckNAddStates(616, 619); } + break; + case 427: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(34, 36); } + break; + case 432: + if (curChar == 10 && kind > 73) + kind = 73; + break; + case 433: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 432; + break; + case 434: + if ((0x100003600L & l) != 0L && kind > 73) + kind = 73; + break; + case 435: + if (curChar == 52) + { jjCheckNAdd(431); } + break; + case 436: + if (curChar == 54) + { jjCheckNAdd(431); } + break; + case 437: + if (curChar == 48) + { jjCheckNAddStates(620, 624); } + break; + case 438: + if (curChar == 48) + { jjCheckNAddTwoStates(435, 436); } + break; + case 439: + if (curChar == 48) + { jjCheckNAddStates(625, 627); } + break; + case 440: + if (curChar == 48) + { jjCheckNAddStates(628, 631); } + break; + case 442: + if (curChar == 57) + { jjCheckNAddStates(632, 635); } + break; + case 443: + if (curChar == 10) + { jjCheckNAddTwoStates(429, 430); } + break; + case 444: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 443; + break; + case 445: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(429, 430); } + break; + case 446: + if (curChar == 52) + { jjCheckNAdd(442); } + break; + case 447: + if (curChar == 54) + { jjCheckNAdd(442); } + break; + case 448: + if (curChar == 48) + { jjCheckNAddStates(636, 640); } + break; + case 449: + if (curChar == 48) + { jjCheckNAddTwoStates(446, 447); } + break; + case 450: + if (curChar == 48) + { jjCheckNAddStates(641, 643); } + break; + case 451: + if (curChar == 48) + { jjCheckNAddStates(644, 647); } + break; + case 452: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(31, 33); } + break; + case 456: + if (curChar != 52) + break; + if (kind > 74) + kind = 74; + { jjAddStates(648, 649); } + break; + case 457: + if (curChar == 10 && kind > 74) + kind = 74; + break; + case 458: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 457; + break; + case 459: + if ((0x100003600L & l) != 0L && kind > 74) + kind = 74; + break; + case 460: + if (curChar == 53) + { jjCheckNAdd(456); } + break; + case 461: + if (curChar == 55) + { jjCheckNAdd(456); } + break; + case 462: + if (curChar == 48) + { jjCheckNAddStates(650, 654); } + break; + case 463: + if (curChar == 48) + { jjCheckNAddTwoStates(460, 461); } + break; + case 464: + if (curChar == 48) + { jjCheckNAddStates(655, 657); } + break; + case 465: + if (curChar == 48) + { jjCheckNAddStates(658, 661); } + break; + case 467: + if (curChar == 48) + { jjCheckNAddStates(662, 665); } + break; + case 468: + if (curChar == 10) + { jjCheckNAddTwoStates(454, 455); } + break; + case 469: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 468; + break; + case 470: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(454, 455); } + break; + case 471: + if (curChar == 53) + { jjCheckNAdd(467); } + break; + case 472: + if (curChar == 55) + { jjCheckNAdd(467); } + break; + case 473: + if (curChar == 48) + { jjCheckNAddStates(666, 670); } + break; + case 474: + if (curChar == 48) + { jjCheckNAddTwoStates(471, 472); } + break; + case 475: + if (curChar == 48) + { jjCheckNAddStates(671, 673); } + break; + case 476: + if (curChar == 48) + { jjCheckNAddStates(674, 677); } + break; + case 477: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(28, 30); } + break; + case 481: + if (curChar != 51) + break; + if (kind > 75) + kind = 75; + { jjAddStates(678, 679); } + break; + case 482: + if (curChar == 10 && kind > 75) + kind = 75; + break; + case 483: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 482; + break; + case 484: + if ((0x100003600L & l) != 0L && kind > 75) + kind = 75; + break; + case 485: + if (curChar == 52) + { jjCheckNAdd(481); } + break; + case 486: + if (curChar == 54) + { jjCheckNAdd(481); } + break; + case 487: + if (curChar == 48) + { jjCheckNAddStates(680, 684); } + break; + case 488: + if (curChar == 48) + { jjCheckNAddTwoStates(485, 486); } + break; + case 489: + if (curChar == 48) + { jjCheckNAddStates(685, 687); } + break; + case 490: + if (curChar == 48) + { jjCheckNAddStates(688, 691); } + break; + case 492: + if (curChar == 48) + { jjCheckNAddStates(692, 695); } + break; + case 493: + if (curChar == 10) + { jjCheckNAddTwoStates(479, 480); } + break; + case 494: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 493; + break; + case 495: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(479, 480); } + break; + case 496: + if (curChar == 53) + { jjCheckNAdd(492); } + break; + case 497: + if (curChar == 55) + { jjCheckNAdd(492); } + break; + case 498: + if (curChar == 48) + { jjCheckNAddStates(696, 700); } + break; + case 499: + if (curChar == 48) + { jjCheckNAddTwoStates(496, 497); } + break; + case 500: + if (curChar == 48) + { jjCheckNAddStates(701, 703); } + break; + case 501: + if (curChar == 48) + { jjCheckNAddStates(704, 707); } + break; + case 502: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(25, 27); } + break; + case 507: + if (curChar != 55) + break; + if (kind > 76) + kind = 76; + { jjAddStates(708, 709); } + break; + case 508: + if (curChar == 10 && kind > 76) + kind = 76; + break; + case 509: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 508; + break; + case 510: + if ((0x100003600L & l) != 0L && kind > 76) + kind = 76; + break; + case 511: + if (curChar == 52) + { jjCheckNAdd(507); } + break; + case 512: + if (curChar == 54) + { jjCheckNAdd(507); } + break; + case 513: + if (curChar == 48) + { jjCheckNAddStates(710, 714); } + break; + case 514: + if (curChar == 48) + { jjCheckNAddTwoStates(511, 512); } + break; + case 515: + if (curChar == 48) + { jjCheckNAddStates(715, 717); } + break; + case 516: + if (curChar == 48) + { jjCheckNAddStates(718, 721); } + break; + case 518: + if (curChar == 53) + { jjCheckNAddStates(722, 725); } + break; + case 519: + if (curChar == 10) + { jjCheckNAddTwoStates(505, 506); } + break; + case 520: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 519; + break; + case 521: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(505, 506); } + break; + case 522: + if (curChar == 52) + { jjCheckNAdd(518); } + break; + case 523: + if (curChar == 54) + { jjCheckNAdd(518); } + break; + case 524: + if (curChar == 48) + { jjCheckNAddStates(726, 730); } + break; + case 525: + if (curChar == 48) + { jjCheckNAddTwoStates(522, 523); } + break; + case 526: + if (curChar == 48) + { jjCheckNAddStates(731, 733); } + break; + case 527: + if (curChar == 48) + { jjCheckNAddStates(734, 737); } + break; + case 529: + if (curChar == 52) + { jjCheckNAddStates(738, 741); } + break; + case 530: + if (curChar == 10) + { jjCheckNAddTwoStates(504, 517); } + break; + case 531: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 530; + break; + case 532: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(504, 517); } + break; + case 533: + if (curChar == 52) + { jjCheckNAdd(529); } + break; + case 534: + if (curChar == 54) + { jjCheckNAdd(529); } + break; + case 535: + if (curChar == 48) + { jjCheckNAddStates(742, 746); } + break; + case 536: + if (curChar == 48) + { jjCheckNAddTwoStates(533, 534); } + break; + case 537: + if (curChar == 48) + { jjCheckNAddStates(747, 749); } + break; + case 538: + if (curChar == 48) + { jjCheckNAddStates(750, 753); } + break; + case 539: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(22, 24); } + break; + case 544: + if (curChar != 52) + break; + if (kind > 77) + kind = 77; + { jjAddStates(754, 755); } + break; + case 545: + if (curChar == 10 && kind > 77) + kind = 77; + break; + case 546: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 545; + break; + case 547: + if ((0x100003600L & l) != 0L && kind > 77) + kind = 77; + break; + case 548: + if (curChar == 52) + { jjCheckNAdd(544); } + break; + case 549: + if (curChar == 54) + { jjCheckNAdd(544); } + break; + case 550: + if (curChar == 48) + { jjCheckNAddStates(756, 760); } + break; + case 551: + if (curChar == 48) + { jjCheckNAddTwoStates(548, 549); } + break; + case 552: + if (curChar == 48) + { jjCheckNAddStates(761, 763); } + break; + case 553: + if (curChar == 48) + { jjCheckNAddStates(764, 767); } + break; + case 555: + if (curChar == 49) + { jjCheckNAddStates(768, 771); } + break; + case 556: + if (curChar == 10) + { jjCheckNAddTwoStates(542, 543); } + break; + case 557: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 556; + break; + case 558: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(542, 543); } + break; + case 559: + if (curChar == 52) + { jjCheckNAdd(555); } + break; + case 560: + if (curChar == 54) + { jjCheckNAdd(555); } + break; + case 561: + if (curChar == 48) + { jjCheckNAddStates(772, 776); } + break; + case 562: + if (curChar == 48) + { jjCheckNAddTwoStates(559, 560); } + break; + case 563: + if (curChar == 48) + { jjCheckNAddStates(777, 779); } + break; + case 564: + if (curChar == 48) + { jjCheckNAddStates(780, 783); } + break; + case 566: + if (curChar == 50) + { jjCheckNAddStates(784, 787); } + break; + case 567: + if (curChar == 10) + { jjCheckNAddTwoStates(541, 554); } + break; + case 568: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 567; + break; + case 569: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(541, 554); } + break; + case 570: + if (curChar == 53) + { jjCheckNAdd(566); } + break; + case 571: + if (curChar == 55) + { jjCheckNAdd(566); } + break; + case 572: + if (curChar == 48) + { jjCheckNAddStates(788, 792); } + break; + case 573: + if (curChar == 48) + { jjCheckNAddTwoStates(570, 571); } + break; + case 574: + if (curChar == 48) + { jjCheckNAddStates(793, 795); } + break; + case 575: + if (curChar == 48) + { jjCheckNAddStates(796, 799); } + break; + case 576: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(19, 21); } + break; + case 582: + if (curChar != 52) + break; + if (kind > 78) + kind = 78; + { jjAddStates(800, 801); } + break; + case 583: + if (curChar == 10 && kind > 78) + kind = 78; + break; + case 584: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 583; + break; + case 585: + if ((0x100003600L & l) != 0L && kind > 78) + kind = 78; + break; + case 586: + if (curChar == 52) + { jjCheckNAdd(582); } + break; + case 587: + if (curChar == 54) + { jjCheckNAdd(582); } + break; + case 588: + if (curChar == 48) + { jjCheckNAddStates(802, 806); } + break; + case 589: + if (curChar == 48) + { jjCheckNAddTwoStates(586, 587); } + break; + case 590: + if (curChar == 48) + { jjCheckNAddStates(807, 809); } + break; + case 591: + if (curChar == 48) + { jjCheckNAddStates(810, 813); } + break; + case 593: + if (curChar == 49) + { jjCheckNAddStates(814, 817); } + break; + case 594: + if (curChar == 10) + { jjCheckNAddTwoStates(580, 581); } + break; + case 595: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 594; + break; + case 596: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(580, 581); } + break; + case 597: + if (curChar == 52) + { jjCheckNAdd(593); } + break; + case 598: + if (curChar == 54) + { jjCheckNAdd(593); } + break; + case 599: + if (curChar == 48) + { jjCheckNAddStates(818, 822); } + break; + case 600: + if (curChar == 48) + { jjCheckNAddTwoStates(597, 598); } + break; + case 601: + if (curChar == 48) + { jjCheckNAddStates(823, 825); } + break; + case 602: + if (curChar == 48) + { jjCheckNAddStates(826, 829); } + break; + case 604: + if (curChar == 50) + { jjCheckNAddStates(830, 833); } + break; + case 605: + if (curChar == 10) + { jjCheckNAddTwoStates(579, 592); } + break; + case 606: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 605; + break; + case 607: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(579, 592); } + break; + case 608: + if (curChar == 53) + { jjCheckNAdd(604); } + break; + case 609: + if (curChar == 55) + { jjCheckNAdd(604); } + break; + case 610: + if (curChar == 48) + { jjCheckNAddStates(834, 838); } + break; + case 611: + if (curChar == 48) + { jjCheckNAddTwoStates(608, 609); } + break; + case 612: + if (curChar == 48) + { jjCheckNAddStates(839, 841); } + break; + case 613: + if (curChar == 48) + { jjCheckNAddStates(842, 845); } + break; + case 615: + if (curChar == 55) + { jjCheckNAddStates(846, 849); } + break; + case 616: + if (curChar == 10) + { jjCheckNAddTwoStates(578, 603); } + break; + case 617: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 616; + break; + case 618: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(578, 603); } + break; + case 619: + if (curChar == 52) + { jjCheckNAdd(615); } + break; + case 620: + if (curChar == 54) + { jjCheckNAdd(615); } + break; + case 621: + if (curChar == 48) + { jjCheckNAddStates(850, 854); } + break; + case 622: + if (curChar == 48) + { jjCheckNAddTwoStates(619, 620); } + break; + case 623: + if (curChar == 48) + { jjCheckNAddStates(855, 857); } + break; + case 624: + if (curChar == 48) + { jjCheckNAddStates(858, 861); } + break; + case 625: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(16, 18); } + break; + case 629: + if (curChar != 51) + break; + if (kind > 79) + kind = 79; + { jjAddStates(862, 863); } + break; + case 630: + if (curChar == 10 && kind > 79) + kind = 79; + break; + case 631: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 630; + break; + case 632: + if ((0x100003600L & l) != 0L && kind > 79) + kind = 79; + break; + case 633: + if (curChar == 53) + { jjCheckNAdd(629); } + break; + case 634: + if (curChar == 55) + { jjCheckNAdd(629); } + break; + case 635: + if (curChar == 48) + { jjCheckNAddStates(864, 868); } + break; + case 636: + if (curChar == 48) + { jjCheckNAddTwoStates(633, 634); } + break; + case 637: + if (curChar == 48) + { jjCheckNAddStates(869, 871); } + break; + case 638: + if (curChar == 48) + { jjCheckNAddStates(872, 875); } + break; + case 641: + if (curChar == 10) + { jjCheckNAddTwoStates(627, 628); } + break; + case 642: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 641; + break; + case 643: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(627, 628); } + break; + case 644: + if (curChar == 52) + { jjCheckNAdd(640); } + break; + case 645: + if (curChar == 54) + { jjCheckNAdd(640); } + break; + case 646: + if (curChar == 48) + { jjCheckNAddStates(876, 880); } + break; + case 647: + if (curChar == 48) + { jjCheckNAddTwoStates(644, 645); } + break; + case 648: + if (curChar == 48) + { jjCheckNAddStates(881, 883); } + break; + case 649: + if (curChar == 48) + { jjCheckNAddStates(884, 887); } + break; + case 650: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(13, 15); } + break; + case 653: + if (curChar != 51) + break; + if (kind > 80) + kind = 80; + { jjAddStates(888, 889); } + break; + case 654: + if (curChar == 10 && kind > 80) + kind = 80; + break; + case 655: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 654; + break; + case 656: + if ((0x100003600L & l) != 0L && kind > 80) + kind = 80; + break; + case 657: + if (curChar == 53) + { jjCheckNAdd(653); } + break; + case 658: + if (curChar == 55) + { jjCheckNAdd(653); } + break; + case 659: + if (curChar == 48) + { jjCheckNAddStates(890, 894); } + break; + case 660: + if (curChar == 48) + { jjCheckNAddTwoStates(657, 658); } + break; + case 661: + if (curChar == 48) + { jjCheckNAddStates(895, 897); } + break; + case 662: + if (curChar == 48) + { jjCheckNAddStates(898, 901); } + break; + case 663: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(10, 12); } + break; + case 668: + if (curChar == 10 && kind > 81) + kind = 81; + break; + case 669: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 668; + break; + case 670: + if ((0x100003600L & l) != 0L && kind > 81) + kind = 81; + break; + case 671: + if (curChar == 53) + { jjCheckNAdd(667); } + break; + case 672: + if (curChar == 55) + { jjCheckNAdd(667); } + break; + case 673: + if (curChar == 48) + { jjCheckNAddStates(902, 906); } + break; + case 674: + if (curChar == 48) + { jjCheckNAddTwoStates(671, 672); } + break; + case 675: + if (curChar == 48) + { jjCheckNAddStates(907, 909); } + break; + case 676: + if (curChar == 48) + { jjCheckNAddStates(910, 913); } + break; + case 678: + if (curChar == 56) + { jjCheckNAddStates(914, 917); } + break; + case 679: + if (curChar == 10) + { jjCheckNAddTwoStates(665, 666); } + break; + case 680: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 679; + break; + case 681: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(665, 666); } + break; + case 682: + if (curChar == 52) + { jjCheckNAdd(678); } + break; + case 683: + if (curChar == 54) + { jjCheckNAdd(678); } + break; + case 684: + if (curChar == 48) + { jjCheckNAddStates(918, 922); } + break; + case 685: + if (curChar == 48) + { jjCheckNAddTwoStates(682, 683); } + break; + case 686: + if (curChar == 48) + { jjCheckNAddStates(923, 925); } + break; + case 687: + if (curChar == 48) + { jjCheckNAddStates(926, 929); } + break; + case 688: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(7, 9); } + break; + case 694: + if (curChar == 10 && kind > 82) + kind = 82; + break; + case 695: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 694; + break; + case 696: + if ((0x100003600L & l) != 0L && kind > 82) + kind = 82; + break; + case 697: + if (curChar == 53) + { jjCheckNAdd(693); } + break; + case 698: + if (curChar == 55) + { jjCheckNAdd(693); } + break; + case 699: + if (curChar == 48) + { jjCheckNAddStates(930, 934); } + break; + case 700: + if (curChar == 48) + { jjCheckNAddTwoStates(697, 698); } + break; + case 701: + if (curChar == 48) + { jjCheckNAddStates(935, 937); } + break; + case 702: + if (curChar == 48) + { jjCheckNAddStates(938, 941); } + break; + case 704: + if (curChar == 56) + { jjCheckNAddStates(942, 945); } + break; + case 705: + if (curChar == 10) + { jjCheckNAddTwoStates(691, 692); } + break; + case 706: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 705; + break; + case 707: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(691, 692); } + break; + case 708: + if (curChar == 52) + { jjCheckNAdd(704); } + break; + case 709: + if (curChar == 54) + { jjCheckNAdd(704); } + break; + case 710: + if (curChar == 48) + { jjCheckNAddStates(946, 950); } + break; + case 711: + if (curChar == 48) + { jjCheckNAddTwoStates(708, 709); } + break; + case 712: + if (curChar == 48) + { jjCheckNAddStates(951, 953); } + break; + case 713: + if (curChar == 48) + { jjCheckNAddStates(954, 957); } + break; + case 716: + if (curChar == 10) + { jjCheckNAddTwoStates(690, 703); } + break; + case 717: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 716; + break; + case 718: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(690, 703); } + break; + case 719: + if (curChar == 52) + { jjCheckNAdd(715); } + break; + case 720: + if (curChar == 54) + { jjCheckNAdd(715); } + break; + case 721: + if (curChar == 48) + { jjCheckNAddStates(958, 962); } + break; + case 722: + if (curChar == 48) + { jjCheckNAddTwoStates(719, 720); } + break; + case 723: + if (curChar == 48) + { jjCheckNAddStates(963, 965); } + break; + case 724: + if (curChar == 48) + { jjCheckNAddStates(966, 969); } + break; + case 725: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(725, 726); } + break; + case 726: + if (curChar == 37 && kind > 83) + kind = 83; + break; + case 727: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(3, 6); } + break; + case 728: + if (curChar == 45) + { jjCheckNAddTwoStates(729, 748); } + break; + case 730: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 84) + kind = 84; + { jjCheckNAddTwoStates(730, 731); } + break; + case 732: + if ((0xfc00ffffffffcbffL & l) == 0L) + break; + if (kind > 84) + kind = 84; + { jjCheckNAddTwoStates(730, 731); } + break; + case 733: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 84) + kind = 84; + { jjCheckNAddStates(970, 978); } + break; + case 734: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 84) + kind = 84; + { jjCheckNAddStates(979, 982); } + break; + case 735: + if (curChar != 10) + break; + if (kind > 84) + kind = 84; + { jjCheckNAddTwoStates(730, 731); } + break; + case 736: + case 751: + if (curChar == 13) + { jjCheckNAdd(735); } + break; + case 737: + if ((0x100003600L & l) == 0L) + break; + if (kind > 84) + kind = 84; + { jjCheckNAddTwoStates(730, 731); } + break; + case 738: + case 740: + case 743: + case 747: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(734); } + break; + case 739: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 740; + break; + case 741: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 742; + break; + case 742: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 743; + break; + case 744: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 745; + break; + case 745: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 746; + break; + case 746: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 747; + break; + case 749: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 84) + kind = 84; + { jjCheckNAddStates(983, 991); } + break; + case 750: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 84) + kind = 84; + { jjCheckNAddStates(992, 995); } + break; + case 752: + case 754: + case 757: + case 761: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(750); } + break; + case 753: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 754; + break; + case 755: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 756; + break; + case 756: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 757; + break; + case 758: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 759; + break; + case 759: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 760; + break; + case 760: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 761; + break; + case 762: + if (curChar == 45) + { jjAddStates(153, 156); } + break; + case 764: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddTwoStates(764, 765); } + break; + case 766: + if ((0xfc00ffffffffcbffL & l) == 0L) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddTwoStates(764, 765); } + break; + case 767: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddStates(996, 1004); } + break; + case 768: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddStates(1005, 1008); } + break; + case 769: + if (curChar != 10) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddTwoStates(764, 765); } + break; + case 770: + case 819: + if (curChar == 13) + { jjCheckNAdd(769); } + break; + case 771: + if ((0x100003600L & l) == 0L) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddTwoStates(764, 765); } + break; + case 772: + case 774: + case 777: + case 781: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(768); } + break; + case 773: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 774; + break; + case 775: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 776; + break; + case 776: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 777; + break; + case 778: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 779; + break; + case 779: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 780; + break; + case 780: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 781; + break; + case 783: + if ((0x3ff200000000000L & l) != 0L) + { jjCheckNAddStates(0, 2); } + break; + case 784: + if (curChar == 40 && kind > 87) + kind = 87; + break; + case 786: + if ((0xfc00ffffffffcbffL & l) != 0L) + { jjCheckNAddStates(0, 2); } + break; + case 787: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1009, 1018); } + break; + case 788: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1019, 1023); } + break; + case 789: + if (curChar == 10) + { jjCheckNAddStates(0, 2); } + break; + case 790: + case 805: + if (curChar == 13) + { jjCheckNAdd(789); } + break; + case 791: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(0, 2); } + break; + case 792: + case 794: + case 797: + case 801: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(788); } + break; + case 793: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 794; + break; + case 795: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 796; + break; + case 796: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 797; + break; + case 798: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 799; + break; + case 799: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 800; + break; + case 800: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 801; + break; + case 803: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1024, 1033); } + break; + case 804: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1034, 1038); } + break; + case 806: + case 808: + case 811: + case 815: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(804); } + break; + case 807: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 808; + break; + case 809: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 810; + break; + case 810: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 811; + break; + case 812: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 813; + break; + case 813: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 814; + break; + case 814: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 815; + break; + case 817: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddStates(1039, 1047); } + break; + case 818: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddStates(1048, 1051); } + break; + case 820: + case 822: + case 825: + case 829: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(818); } + break; + case 821: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 822; + break; + case 823: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 824; + break; + case 824: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 825; + break; + case 826: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 827; + break; + case 827: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 828; + break; + case 828: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 829; + break; + case 839: + if (curChar != 52) + break; + if (kind > 63) + kind = 63; + { jjAddStates(1052, 1053); } + break; + case 840: + if (curChar == 10 && kind > 63) + kind = 63; + break; + case 841: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 840; + break; + case 842: + if ((0x100003600L & l) != 0L && kind > 63) + kind = 63; + break; + case 843: + if (curChar == 53) + { jjCheckNAdd(839); } + break; + case 844: + if (curChar == 55) + { jjCheckNAdd(839); } + break; + case 845: + if (curChar == 48) + { jjCheckNAddStates(1054, 1058); } + break; + case 846: + if (curChar == 48) + { jjCheckNAddTwoStates(843, 844); } + break; + case 847: + if (curChar == 48) + { jjCheckNAddStates(1059, 1061); } + break; + case 848: + if (curChar == 48) + { jjCheckNAddStates(1062, 1065); } + break; + case 850: + if (curChar == 50) + { jjCheckNAddStates(1066, 1069); } + break; + case 851: + if (curChar == 10) + { jjCheckNAddTwoStates(837, 838); } + break; + case 852: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 851; + break; + case 853: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(837, 838); } + break; + case 854: + if (curChar == 53) + { jjCheckNAdd(850); } + break; + case 855: + if (curChar == 55) + { jjCheckNAdd(850); } + break; + case 856: + if (curChar == 48) + { jjCheckNAddStates(1070, 1074); } + break; + case 857: + if (curChar == 48) + { jjCheckNAddTwoStates(854, 855); } + break; + case 858: + if (curChar == 48) + { jjCheckNAddStates(1075, 1077); } + break; + case 859: + if (curChar == 48) + { jjCheckNAddStates(1078, 1081); } + break; + case 861: + if (curChar == 49) + { jjCheckNAddStates(1082, 1085); } + break; + case 862: + if (curChar == 10) + { jjCheckNAddTwoStates(836, 849); } + break; + case 863: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 862; + break; + case 864: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(836, 849); } + break; + case 865: + if (curChar == 53) + { jjCheckNAdd(861); } + break; + case 866: + if (curChar == 55) + { jjCheckNAdd(861); } + break; + case 867: + if (curChar == 48) + { jjCheckNAddStates(1086, 1090); } + break; + case 868: + if (curChar == 48) + { jjCheckNAddTwoStates(865, 866); } + break; + case 869: + if (curChar == 48) + { jjCheckNAddStates(1091, 1093); } + break; + case 870: + if (curChar == 48) + { jjCheckNAddStates(1094, 1097); } + break; + case 872: + if (curChar == 48) + { jjCheckNAddStates(1098, 1101); } + break; + case 873: + if (curChar == 10) + { jjCheckNAddTwoStates(835, 860); } + break; + case 874: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 873; + break; + case 875: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(835, 860); } + break; + case 876: + if (curChar == 53) + { jjCheckNAdd(872); } + break; + case 877: + if (curChar == 55) + { jjCheckNAdd(872); } + break; + case 878: + if (curChar == 48) + { jjCheckNAddStates(1102, 1106); } + break; + case 879: + if (curChar == 48) + { jjCheckNAddTwoStates(876, 877); } + break; + case 880: + if (curChar == 48) + { jjCheckNAddStates(1107, 1109); } + break; + case 881: + if (curChar == 48) + { jjCheckNAddStates(1110, 1113); } + break; + case 884: + if (curChar == 10) + { jjCheckNAddTwoStates(834, 871); } + break; + case 885: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 884; + break; + case 886: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(834, 871); } + break; + case 887: + if (curChar == 52) + { jjCheckNAdd(883); } + break; + case 888: + if (curChar == 54) + { jjCheckNAdd(883); } + break; + case 889: + if (curChar == 48) + { jjCheckNAddStates(1114, 1118); } + break; + case 890: + if (curChar == 48) + { jjCheckNAddTwoStates(887, 888); } + break; + case 891: + if (curChar == 48) + { jjCheckNAddStates(1119, 1121); } + break; + case 892: + if (curChar == 48) + { jjCheckNAddStates(1122, 1125); } + break; + case 898: + if (curChar != 53) + break; + if (kind > 64) + kind = 64; + { jjAddStates(1126, 1127); } + break; + case 899: + if (curChar == 10 && kind > 64) + kind = 64; + break; + case 900: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 899; + break; + case 901: + if ((0x100003600L & l) != 0L && kind > 64) + kind = 64; + break; + case 902: + if (curChar == 52) + { jjCheckNAdd(898); } + break; + case 903: + if (curChar == 54) + { jjCheckNAdd(898); } + break; + case 904: + if (curChar == 48) + { jjCheckNAddStates(1128, 1132); } + break; + case 905: + if (curChar == 48) + { jjCheckNAddTwoStates(902, 903); } + break; + case 906: + if (curChar == 48) + { jjCheckNAddStates(1133, 1135); } + break; + case 907: + if (curChar == 48) + { jjCheckNAddStates(1136, 1139); } + break; + case 909: + if (curChar == 55) + { jjCheckNAddStates(1140, 1143); } + break; + case 910: + if (curChar == 10) + { jjCheckNAddTwoStates(896, 897); } + break; + case 911: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 910; + break; + case 912: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(896, 897); } + break; + case 913: + if (curChar == 52) + { jjCheckNAdd(909); } + break; + case 914: + if (curChar == 54) + { jjCheckNAdd(909); } + break; + case 915: + if (curChar == 48) + { jjCheckNAddStates(1144, 1148); } + break; + case 916: + if (curChar == 48) + { jjCheckNAddTwoStates(913, 914); } + break; + case 917: + if (curChar == 48) + { jjCheckNAddStates(1149, 1151); } + break; + case 918: + if (curChar == 48) + { jjCheckNAddStates(1152, 1155); } + break; + case 920: + if (curChar == 49) + { jjCheckNAddStates(1156, 1159); } + break; + case 921: + if (curChar == 10) + { jjCheckNAddTwoStates(895, 908); } + break; + case 922: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 921; + break; + case 923: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(895, 908); } + break; + case 924: + if (curChar == 52) + { jjCheckNAdd(920); } + break; + case 925: + if (curChar == 54) + { jjCheckNAdd(920); } + break; + case 926: + if (curChar == 48) + { jjCheckNAddStates(1160, 1164); } + break; + case 927: + if (curChar == 48) + { jjCheckNAddTwoStates(924, 925); } + break; + case 928: + if (curChar == 48) + { jjCheckNAddStates(1165, 1167); } + break; + case 929: + if (curChar == 48) + { jjCheckNAddStates(1168, 1171); } + break; + case 936: + if (curChar != 49) + break; + if (kind > 65) + kind = 65; + { jjAddStates(1172, 1173); } + break; + case 937: + if (curChar == 10 && kind > 65) + kind = 65; + break; + case 938: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 937; + break; + case 939: + if ((0x100003600L & l) != 0L && kind > 65) + kind = 65; + break; + case 940: + if (curChar == 52) + { jjCheckNAdd(936); } + break; + case 941: + if (curChar == 54) + { jjCheckNAdd(936); } + break; + case 942: + if (curChar == 48) + { jjCheckNAddStates(1174, 1178); } + break; + case 943: + if (curChar == 48) + { jjCheckNAddTwoStates(940, 941); } + break; + case 944: + if (curChar == 48) + { jjCheckNAddStates(1179, 1181); } + break; + case 945: + if (curChar == 48) + { jjCheckNAddStates(1182, 1185); } + break; + case 947: + if (curChar == 57) + { jjCheckNAddStates(1186, 1189); } + break; + case 948: + if (curChar == 10) + { jjCheckNAddTwoStates(934, 935); } + break; + case 949: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 948; + break; + case 950: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(934, 935); } + break; + case 951: + if (curChar == 52) + { jjCheckNAdd(947); } + break; + case 952: + if (curChar == 54) + { jjCheckNAdd(947); } + break; + case 953: + if (curChar == 48) + { jjCheckNAddStates(1190, 1194); } + break; + case 954: + if (curChar == 48) + { jjCheckNAddTwoStates(951, 952); } + break; + case 955: + if (curChar == 48) + { jjCheckNAddStates(1195, 1197); } + break; + case 956: + if (curChar == 48) + { jjCheckNAddStates(1198, 1201); } + break; + case 958: + if (curChar == 52) + { jjCheckNAddStates(1202, 1205); } + break; + case 959: + if (curChar == 10) + { jjCheckNAddTwoStates(933, 946); } + break; + case 960: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 959; + break; + case 961: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(933, 946); } + break; + case 962: + if (curChar == 52) + { jjCheckNAdd(958); } + break; + case 963: + if (curChar == 54) + { jjCheckNAdd(958); } + break; + case 964: + if (curChar == 48) + { jjCheckNAddStates(1206, 1210); } + break; + case 965: + if (curChar == 48) + { jjCheckNAddTwoStates(962, 963); } + break; + case 966: + if (curChar == 48) + { jjCheckNAddStates(1211, 1213); } + break; + case 967: + if (curChar == 48) + { jjCheckNAddStates(1214, 1217); } + break; + case 969: + if (curChar == 53) + { jjCheckNAddStates(1218, 1221); } + break; + case 970: + if (curChar == 10) + { jjCheckNAddTwoStates(932, 957); } + break; + case 971: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 970; + break; + case 972: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(932, 957); } + break; + case 973: + if (curChar == 52) + { jjCheckNAdd(969); } + break; + case 974: + if (curChar == 54) + { jjCheckNAdd(969); } + break; + case 975: + if (curChar == 48) + { jjCheckNAddStates(1222, 1226); } + break; + case 976: + if (curChar == 48) + { jjCheckNAddTwoStates(973, 974); } + break; + case 977: + if (curChar == 48) + { jjCheckNAddStates(1227, 1229); } + break; + case 978: + if (curChar == 48) + { jjCheckNAddStates(1230, 1233); } + break; + case 987: + if (curChar != 52) + break; + if (kind > 66) + kind = 66; + { jjAddStates(1234, 1235); } + break; + case 988: + if (curChar == 10 && kind > 66) + kind = 66; + break; + case 989: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 988; + break; + case 990: + if ((0x100003600L & l) != 0L && kind > 66) + kind = 66; + break; + case 991: + if (curChar == 53) + { jjCheckNAdd(987); } + break; + case 992: + if (curChar == 55) + { jjCheckNAdd(987); } + break; + case 993: + if (curChar == 48) + { jjCheckNAddStates(1236, 1240); } + break; + case 994: + if (curChar == 48) + { jjCheckNAddTwoStates(991, 992); } + break; + case 995: + if (curChar == 48) + { jjCheckNAddStates(1241, 1243); } + break; + case 996: + if (curChar == 48) + { jjCheckNAddStates(1244, 1247); } + break; + case 998: + if (curChar == 53) + { jjCheckNAddStates(1248, 1251); } + break; + case 999: + if (curChar == 10) + { jjCheckNAddTwoStates(985, 986); } + break; + case 1000: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 999; + break; + case 1001: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(985, 986); } + break; + case 1002: + if (curChar == 52) + { jjCheckNAdd(998); } + break; + case 1003: + if (curChar == 54) + { jjCheckNAdd(998); } + break; + case 1004: + if (curChar == 48) + { jjCheckNAddStates(1252, 1256); } + break; + case 1005: + if (curChar == 48) + { jjCheckNAddTwoStates(1002, 1003); } + break; + case 1006: + if (curChar == 48) + { jjCheckNAddStates(1257, 1259); } + break; + case 1007: + if (curChar == 48) + { jjCheckNAddStates(1260, 1263); } + break; + case 1009: + if (curChar == 51) + { jjCheckNAddStates(1264, 1267); } + break; + case 1010: + if (curChar == 10) + { jjCheckNAddTwoStates(984, 997); } + break; + case 1011: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1010; + break; + case 1012: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(984, 997); } + break; + case 1013: + if (curChar == 53) + { jjCheckNAdd(1009); } + break; + case 1014: + if (curChar == 55) + { jjCheckNAdd(1009); } + break; + case 1015: + if (curChar == 48) + { jjCheckNAddStates(1268, 1272); } + break; + case 1016: + if (curChar == 48) + { jjCheckNAddTwoStates(1013, 1014); } + break; + case 1017: + if (curChar == 48) + { jjCheckNAddStates(1273, 1275); } + break; + case 1018: + if (curChar == 48) + { jjCheckNAddStates(1276, 1279); } + break; + case 1020: + if (curChar == 50) + { jjCheckNAddStates(1280, 1283); } + break; + case 1021: + if (curChar == 10) + { jjCheckNAddTwoStates(983, 1008); } + break; + case 1022: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1021; + break; + case 1023: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(983, 1008); } + break; + case 1024: + if (curChar == 53) + { jjCheckNAdd(1020); } + break; + case 1025: + if (curChar == 55) + { jjCheckNAdd(1020); } + break; + case 1026: + if (curChar == 48) + { jjCheckNAddStates(1284, 1288); } + break; + case 1027: + if (curChar == 48) + { jjCheckNAddTwoStates(1024, 1025); } + break; + case 1028: + if (curChar == 48) + { jjCheckNAddStates(1289, 1291); } + break; + case 1029: + if (curChar == 48) + { jjCheckNAddStates(1292, 1295); } + break; + case 1031: + if (curChar == 49) + { jjCheckNAddStates(1296, 1299); } + break; + case 1032: + if (curChar == 10) + { jjCheckNAddTwoStates(982, 1019); } + break; + case 1033: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1032; + break; + case 1034: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(982, 1019); } + break; + case 1035: + if (curChar == 52) + { jjCheckNAdd(1031); } + break; + case 1036: + if (curChar == 54) + { jjCheckNAdd(1031); } + break; + case 1037: + if (curChar == 48) + { jjCheckNAddStates(1300, 1304); } + break; + case 1038: + if (curChar == 48) + { jjCheckNAddTwoStates(1035, 1036); } + break; + case 1039: + if (curChar == 48) + { jjCheckNAddStates(1305, 1307); } + break; + case 1040: + if (curChar == 48) + { jjCheckNAddStates(1308, 1311); } + break; + case 1042: + if (curChar == 56) + { jjCheckNAddStates(1312, 1315); } + break; + case 1043: + if (curChar == 10) + { jjCheckNAddTwoStates(981, 1030); } + break; + case 1044: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1043; + break; + case 1045: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(981, 1030); } + break; + case 1046: + if (curChar == 52) + { jjCheckNAdd(1042); } + break; + case 1047: + if (curChar == 54) + { jjCheckNAdd(1042); } + break; + case 1048: + if (curChar == 48) + { jjCheckNAddStates(1316, 1320); } + break; + case 1049: + if (curChar == 48) + { jjCheckNAddTwoStates(1046, 1047); } + break; + case 1050: + if (curChar == 48) + { jjCheckNAddStates(1321, 1323); } + break; + case 1051: + if (curChar == 48) + { jjCheckNAddStates(1324, 1327); } + break; + case 1053: + if (curChar == 51) + { jjCheckNAddStates(1328, 1331); } + break; + case 1054: + if (curChar == 10) + { jjCheckNAddTwoStates(980, 1041); } + break; + case 1055: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1054; + break; + case 1056: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(980, 1041); } + break; + case 1057: + if (curChar == 52) + { jjCheckNAdd(1053); } + break; + case 1058: + if (curChar == 54) + { jjCheckNAdd(1053); } + break; + case 1059: + if (curChar == 48) + { jjCheckNAddStates(1332, 1336); } + break; + case 1060: + if (curChar == 48) + { jjCheckNAddTwoStates(1057, 1058); } + break; + case 1061: + if (curChar == 48) + { jjCheckNAddStates(1337, 1339); } + break; + case 1062: + if (curChar == 48) + { jjCheckNAddStates(1340, 1343); } + break; + case 1063: + if (curChar == 45) + { jjAddStates(1344, 1345); } + break; + case 1065: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 88) + kind = 88; + { jjCheckNAddTwoStates(1065, 1066); } + break; + case 1067: + if ((0xfc00ffffffffcbffL & l) == 0L) + break; + if (kind > 88) + kind = 88; + { jjCheckNAddTwoStates(1065, 1066); } + break; + case 1068: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 88) + kind = 88; + { jjCheckNAddStates(1346, 1354); } + break; + case 1069: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 88) + kind = 88; + { jjCheckNAddStates(1355, 1358); } + break; + case 1070: + if (curChar != 10) + break; + if (kind > 88) + kind = 88; + { jjCheckNAddTwoStates(1065, 1066); } + break; + case 1071: + case 1086: + if (curChar == 13) + { jjCheckNAdd(1070); } + break; + case 1072: + if ((0x100003600L & l) == 0L) + break; + if (kind > 88) + kind = 88; + { jjCheckNAddTwoStates(1065, 1066); } + break; + case 1073: + case 1075: + case 1078: + case 1082: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(1069); } + break; + case 1074: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1075; + break; + case 1076: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1077; + break; + case 1077: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1078; + break; + case 1079: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1080; + break; + case 1080: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1081; + break; + case 1081: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1082; + break; + case 1084: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 88) + kind = 88; + { jjCheckNAddStates(1359, 1367); } + break; + case 1085: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 88) + kind = 88; + { jjCheckNAddStates(1368, 1371); } + break; + case 1087: + case 1089: + case 1092: + case 1096: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(1085); } + break; + case 1088: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1089; + break; + case 1090: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1091; + break; + case 1091: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1092; + break; + case 1093: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1094; + break; + case 1094: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1095; + break; + case 1095: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1096; + break; + case 1099: + if (curChar == 10) + { jjCheckNAddTwoStates(931, 968); } + break; + case 1100: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1099; + break; + case 1101: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(931, 968); } + break; + case 1102: + if (curChar == 52) + { jjCheckNAdd(1098); } + break; + case 1103: + if (curChar == 54) + { jjCheckNAdd(1098); } + break; + case 1104: + if (curChar == 48) + { jjCheckNAddStates(1372, 1376); } + break; + case 1105: + if (curChar == 48) + { jjCheckNAddTwoStates(1102, 1103); } + break; + case 1106: + if (curChar == 48) + { jjCheckNAddStates(1377, 1379); } + break; + case 1107: + if (curChar == 48) + { jjCheckNAddStates(1380, 1383); } + break; + case 1109: + if (curChar == 48) + { jjCheckNAddStates(1384, 1387); } + break; + case 1110: + if (curChar == 10) + { jjCheckNAddTwoStates(894, 919); } + break; + case 1111: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1110; + break; + case 1112: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(894, 919); } + break; + case 1113: + if (curChar == 53) + { jjCheckNAdd(1109); } + break; + case 1114: + if (curChar == 55) + { jjCheckNAdd(1109); } + break; + case 1115: + if (curChar == 48) + { jjCheckNAddStates(1388, 1392); } + break; + case 1116: + if (curChar == 48) + { jjCheckNAddTwoStates(1113, 1114); } + break; + case 1117: + if (curChar == 48) + { jjCheckNAddStates(1393, 1395); } + break; + case 1118: + if (curChar == 48) + { jjCheckNAddStates(1396, 1399); } + break; + case 1120: + if (curChar == 57) + { jjCheckNAddStates(1400, 1403); } + break; + case 1121: + if (curChar == 10) + { jjCheckNAddTwoStates(833, 882); } + break; + case 1122: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1121; + break; + case 1123: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(833, 882); } + break; + case 1124: + if (curChar == 52) + { jjCheckNAdd(1120); } + break; + case 1125: + if (curChar == 54) + { jjCheckNAdd(1120); } + break; + case 1126: + if (curChar == 48) + { jjCheckNAddStates(1404, 1408); } + break; + case 1127: + if (curChar == 48) + { jjCheckNAddTwoStates(1124, 1125); } + break; + case 1128: + if (curChar == 48) + { jjCheckNAddStates(1409, 1411); } + break; + case 1129: + if (curChar == 48) + { jjCheckNAddStates(1412, 1415); } + break; + case 1132: + if (curChar == 10) + { jjCheckNAddTwoStates(255, 281); } + break; + case 1133: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1132; + break; + case 1134: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(255, 281); } + break; + case 1135: + if (curChar == 52) + { jjCheckNAdd(1131); } + break; + case 1136: + if (curChar == 54) + { jjCheckNAdd(1131); } + break; + case 1137: + if (curChar == 48) + { jjCheckNAddStates(1416, 1420); } + break; + case 1138: + if (curChar == 48) + { jjCheckNAddTwoStates(1135, 1136); } + break; + case 1139: + if (curChar == 48) + { jjCheckNAddStates(1421, 1423); } + break; + case 1140: + if (curChar == 48) + { jjCheckNAddStates(1424, 1427); } + break; + case 1141: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 17) + kind = 17; + { jjCheckNAddStates(52, 142); } + break; + case 1142: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 17) + kind = 17; + { jjCheckNAdd(1142); } + break; + case 1143: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1143, 1144); } + break; + case 1144: + if (curChar == 46) + { jjCheckNAdd(300); } + break; + case 1145: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 21) + kind = 21; + { jjCheckNAdd(1145); } + break; + case 1146: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1146, 1147); } + break; + case 1147: + if (curChar == 46) + { jjCheckNAdd(301); } + break; + case 1148: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1428, 1430); } + break; + case 1149: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1149, 1150); } + break; + case 1150: + if (curChar == 46) + { jjCheckNAdd(302); } + break; + case 1151: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1431, 1433); } + break; + case 1152: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1152, 1153); } + break; + case 1153: + if (curChar == 46) + { jjCheckNAdd(327); } + break; + case 1154: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1434, 1436); } + break; + case 1155: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1155, 1156); } + break; + case 1156: + if (curChar == 46) + { jjCheckNAdd(352); } + break; + case 1157: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1437, 1439); } + break; + case 1158: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1158, 1159); } + break; + case 1159: + if (curChar == 46) + { jjCheckNAdd(377); } + break; + case 1160: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1440, 1442); } + break; + case 1161: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1161, 1162); } + break; + case 1162: + if (curChar == 46) + { jjCheckNAdd(402); } + break; + case 1163: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1443, 1445); } + break; + case 1164: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1164, 1165); } + break; + case 1165: + if (curChar == 46) + { jjCheckNAdd(427); } + break; + case 1166: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1446, 1448); } + break; + case 1167: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1167, 1168); } + break; + case 1168: + if (curChar == 46) + { jjCheckNAdd(452); } + break; + case 1169: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1449, 1451); } + break; + case 1170: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1170, 1171); } + break; + case 1171: + if (curChar == 46) + { jjCheckNAdd(477); } + break; + case 1172: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1452, 1454); } + break; + case 1173: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1173, 1174); } + break; + case 1174: + if (curChar == 46) + { jjCheckNAdd(502); } + break; + case 1175: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1455, 1457); } + break; + case 1176: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1176, 1177); } + break; + case 1177: + if (curChar == 46) + { jjCheckNAdd(539); } + break; + case 1178: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1458, 1460); } + break; + case 1179: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1179, 1180); } + break; + case 1180: + if (curChar == 46) + { jjCheckNAdd(576); } + break; + case 1181: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1461, 1463); } + break; + case 1182: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1182, 1183); } + break; + case 1183: + if (curChar == 46) + { jjCheckNAdd(625); } + break; + case 1184: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1464, 1466); } + break; + case 1185: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1185, 1186); } + break; + case 1186: + if (curChar == 46) + { jjCheckNAdd(650); } + break; + case 1187: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1467, 1469); } + break; + case 1188: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1188, 1189); } + break; + case 1189: + if (curChar == 46) + { jjCheckNAdd(663); } + break; + case 1190: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1470, 1472); } + break; + case 1191: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1191, 1192); } + break; + case 1192: + if (curChar == 46) + { jjCheckNAdd(688); } + break; + case 1193: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1193, 726); } + break; + case 1194: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1194, 1195); } + break; + case 1195: + if (curChar == 46) + { jjCheckNAdd(725); } + break; + case 1196: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1473, 1476); } + break; + case 1197: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1197, 1198); } + break; + case 1198: + if (curChar == 46) + { jjCheckNAdd(727); } + break; + default : break; + } + } while(i != startsAt); + } + else if (curChar < 128) + { + long l = 1L << (curChar & 077); + do + { + switch(jjstateSet[--i]) + { + case 763: + if ((0x7fffffe87fffffeL & l) != 0L) + { jjCheckNAddStates(0, 2); } + else if (curChar == 92) + { jjCheckNAddTwoStates(766, 817); } + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 19) + kind = 19; + { jjCheckNAddTwoStates(764, 765); } + } + else if (curChar == 92) + { jjCheckNAddTwoStates(786, 803); } + break; + case 1200: + if ((0x7fffffe87fffffeL & l) != 0L) + { jjCheckNAddStates(0, 2); } + else if (curChar == 92) + { jjCheckNAddTwoStates(766, 767); } + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 19) + kind = 19; + { jjCheckNAddTwoStates(764, 765); } + } + else if (curChar == 92) + { jjCheckNAddTwoStates(786, 787); } + break; + case 0: + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 19) + kind = 19; + { jjCheckNAddStates(1477, 1481); } + } + else if (curChar == 92) + { jjCheckNAddStates(1482, 1489); } + else if (curChar == 64) + { jjCheckNAddStates(1490, 1500); } + else if (curChar == 123) + { + if (kind > 46) + kind = 46; + } + if ((0x100000001000L & l) != 0L) + { jjCheckNAddTwoStates(255, 281); } + else if ((0x20000000200000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 252; + break; + case 1: + if ((0xffffffffefffffffL & l) != 0L) + { jjCheckNAddStates(183, 185); } + break; + case 3: + if (curChar == 92) + { jjAddStates(1501, 1504); } + break; + case 7: + if ((0xffffff81ffffff81L & l) != 0L) + { jjCheckNAddStates(183, 185); } + break; + case 8: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(186, 195); } + break; + case 9: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(196, 200); } + break; + case 12: + case 14: + case 17: + case 21: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(9); } + break; + case 13: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 14; + break; + case 15: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 16; + break; + case 16: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 17; + break; + case 18: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 19; + break; + case 19: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 20; + break; + case 20: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 21; + break; + case 23: + if ((0xffffffffefffffffL & l) != 0L) + { jjCheckNAddStates(180, 182); } + break; + case 25: + if (curChar == 92) + { jjAddStates(1505, 1508); } + break; + case 29: + if ((0xffffff81ffffff81L & l) != 0L) + { jjCheckNAddStates(180, 182); } + break; + case 30: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(201, 210); } + break; + case 31: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(211, 215); } + break; + case 34: + case 36: + case 39: + case 43: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(31); } + break; + case 35: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 36; + break; + case 37: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 38; + break; + case 38: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 39; + break; + case 40: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 41; + break; + case 41: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 42; + break; + case 42: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 43; + break; + case 44: + if (curChar == 123 && kind > 46) + kind = 46; + break; + case 49: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 62) + kind = 62; + { jjCheckNAddTwoStates(49, 50); } + break; + case 50: + if (curChar == 92) + { jjAddStates(1509, 1510); } + break; + case 51: + if ((0xffffff81ffffff81L & l) == 0L) + break; + if (kind > 62) + kind = 62; + { jjCheckNAddTwoStates(49, 50); } + break; + case 52: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 62) + kind = 62; + { jjCheckNAddStates(216, 224); } + break; + case 53: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 62) + kind = 62; + { jjCheckNAddStates(225, 228); } + break; + case 57: + case 59: + case 62: + case 66: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(53); } + break; + case 58: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 59; + break; + case 60: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 61; + break; + case 61: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 62; + break; + case 63: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 64; + break; + case 64: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 65; + break; + case 65: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 66; + break; + case 71: + { jjAddStates(1511, 1512); } + break; + case 73: + case 74: + { jjCheckNAddTwoStates(74, 75); } + break; + case 77: + if ((0x20000000200L & l) != 0L) + { jjCheckNAddTwoStates(78, 163); } + break; + case 78: + if ((0x200000002000L & l) != 0L) + { jjCheckNAddTwoStates(79, 152); } + break; + case 79: + if ((0x1000000010000L & l) != 0L) + { jjCheckNAddTwoStates(80, 141); } + break; + case 80: + if ((0x800000008000L & l) != 0L) + { jjCheckNAddTwoStates(81, 130); } + break; + case 81: + if ((0x4000000040000L & l) != 0L) + { jjCheckNAddTwoStates(82, 119); } + break; + case 82: + if ((0x10000000100000L & l) != 0L) + { jjAddStates(1513, 1514); } + break; + case 83: + if ((0x200000002L & l) != 0L) + { jjCheckNAddTwoStates(84, 97); } + break; + case 84: + if ((0x400000004000L & l) != 0L) + { jjCheckNAddTwoStates(85, 86); } + break; + case 85: + if ((0x10000000100000L & l) != 0L && kind > 67) + kind = 67; + break; + case 86: + if (curChar == 92) + { jjCheckNAddStates(1515, 1518); } + break; + case 97: + if (curChar == 92) + { jjCheckNAddStates(1519, 1522); } + break; + case 98: + if ((0x2000000020L & l) != 0L) + { jjCheckNAddStates(1523, 1526); } + break; + case 108: + if (curChar == 92) + { jjAddStates(1527, 1529); } + break; + case 119: + if (curChar == 92) + { jjCheckNAddStates(1530, 1533); } + break; + case 130: + if (curChar == 92) + { jjCheckNAddStates(1534, 1537); } + break; + case 141: + if (curChar == 92) + { jjCheckNAddStates(1538, 1541); } + break; + case 152: + if (curChar == 92) + { jjCheckNAddStates(1542, 1545); } + break; + case 163: + if (curChar == 92) + { jjCheckNAddStates(1546, 1549); } + break; + case 164: + if ((0x1000000010L & l) != 0L) + { jjCheckNAddStates(1550, 1553); } + break; + case 174: + if (curChar == 92) + { jjAddStates(1554, 1557); } + break; + case 185: + if ((0x100000001000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 186; + break; + case 187: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(375, 378); } + break; + case 190: + if (curChar == 92) + { jjAddStates(1558, 1559); } + break; + case 191: + if ((0xffffff81ffffff81L & l) != 0L) + { jjCheckNAddStates(375, 378); } + break; + case 192: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(379, 388); } + break; + case 193: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(389, 393); } + break; + case 197: + case 199: + case 202: + case 206: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(193); } + break; + case 198: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 199; + break; + case 200: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 201; + break; + case 201: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 202; + break; + case 203: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 204; + break; + case 204: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 205; + break; + case 205: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 206; + break; + case 208: + if ((0xffffffffefffffffL & l) != 0L) + { jjCheckNAddStates(394, 396); } + break; + case 210: + if (curChar == 92) + { jjAddStates(1560, 1563); } + break; + case 214: + if ((0xffffff81ffffff81L & l) != 0L) + { jjCheckNAddStates(394, 396); } + break; + case 215: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(397, 406); } + break; + case 216: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(407, 411); } + break; + case 219: + case 221: + case 224: + case 228: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(216); } + break; + case 220: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 221; + break; + case 222: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 223; + break; + case 223: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 224; + break; + case 225: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 226; + break; + case 226: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 227; + break; + case 227: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 228; + break; + case 230: + if ((0xffffffffefffffffL & l) != 0L) + { jjCheckNAddStates(412, 414); } + break; + case 232: + if (curChar == 92) + { jjAddStates(1564, 1567); } + break; + case 236: + if ((0xffffff81ffffff81L & l) != 0L) + { jjCheckNAddStates(412, 414); } + break; + case 237: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(415, 424); } + break; + case 238: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(425, 429); } + break; + case 241: + case 243: + case 246: + case 250: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(238); } + break; + case 242: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 243; + break; + case 244: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 245; + break; + case 245: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 246; + break; + case 247: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 248; + break; + case 248: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 249; + break; + case 249: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 250; + break; + case 252: + if ((0x4000000040000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 185; + break; + case 253: + if ((0x20000000200000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 252; + break; + case 254: + if ((0x100000001000L & l) != 0L) + { jjCheckNAddTwoStates(255, 281); } + break; + case 255: + if ((0x200000002L & l) != 0L) + { jjCheckNAddTwoStates(256, 270); } + break; + case 256: + if ((0x400000004000L & l) != 0L) + { jjCheckNAddTwoStates(257, 259); } + break; + case 257: + if ((0x8000000080L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 258; + break; + case 259: + if (curChar == 92) + { jjCheckNAddStates(1568, 1571); } + break; + case 270: + if (curChar == 92) + { jjCheckNAddStates(1572, 1575); } + break; + case 271: + if ((0x2000000020L & l) != 0L) + { jjCheckNAddStates(1576, 1579); } + break; + case 281: + if (curChar == 92) + { jjAddStates(1580, 1582); } + break; + case 303: + if ((0x2000000020L & l) != 0L) + { jjCheckNAddTwoStates(304, 305); } + break; + case 304: + if ((0x200000002000L & l) != 0L && kind > 68) + kind = 68; + break; + case 305: + if (curChar == 92) + { jjCheckNAddStates(1583, 1586); } + break; + case 306: + if ((0x1000000010L & l) == 0L) + break; + if (kind > 68) + kind = 68; + { jjAddStates(1587, 1588); } + break; + case 316: + if (curChar == 92) + { jjAddStates(1589, 1591); } + break; + case 328: + if ((0x2000000020L & l) != 0L) + { jjCheckNAddTwoStates(329, 330); } + break; + case 329: + if ((0x100000001000000L & l) != 0L && kind > 69) + kind = 69; + break; + case 330: + if (curChar == 92) + { jjCheckNAddStates(1592, 1595); } + break; + case 341: + if (curChar == 92) + { jjAddStates(1596, 1598); } + break; + case 353: + if ((0x1000000010000L & l) != 0L) + { jjCheckNAddTwoStates(354, 355); } + break; + case 354: + if ((0x100000001000000L & l) != 0L && kind > 70) + kind = 70; + break; + case 355: + if (curChar == 92) + { jjCheckNAddStates(1599, 1602); } + break; + case 366: + if (curChar == 92) + { jjAddStates(1603, 1606); } + break; + case 378: + if ((0x800000008L & l) != 0L) + { jjCheckNAddTwoStates(379, 380); } + break; + case 379: + if ((0x200000002000L & l) != 0L && kind > 71) + kind = 71; + break; + case 380: + if (curChar == 92) + { jjCheckNAddStates(1607, 1610); } + break; + case 381: + if ((0x1000000010L & l) == 0L) + break; + if (kind > 71) + kind = 71; + { jjAddStates(1611, 1612); } + break; + case 391: + if (curChar == 92) + { jjAddStates(1613, 1615); } + break; + case 403: + if ((0x200000002000L & l) != 0L) + { jjCheckNAddTwoStates(404, 405); } + break; + case 404: + if ((0x200000002000L & l) != 0L && kind > 72) + kind = 72; + break; + case 405: + if (curChar == 92) + { jjCheckNAddStates(1616, 1619); } + break; + case 406: + if ((0x1000000010L & l) == 0L) + break; + if (kind > 72) + kind = 72; + { jjAddStates(1620, 1621); } + break; + case 416: + if (curChar == 92) + { jjAddStates(1622, 1625); } + break; + case 417: + if ((0x1000000010L & l) != 0L) + { jjCheckNAddStates(1626, 1629); } + break; + case 428: + if ((0x20000000200L & l) != 0L) + { jjCheckNAddTwoStates(429, 430); } + break; + case 429: + if ((0x400000004000L & l) != 0L && kind > 73) + kind = 73; + break; + case 430: + if (curChar == 92) + { jjCheckNAddStates(1630, 1633); } + break; + case 431: + if ((0x2000000020L & l) == 0L) + break; + if (kind > 73) + kind = 73; + { jjAddStates(1634, 1635); } + break; + case 441: + if (curChar == 92) + { jjAddStates(1636, 1639); } + break; + case 453: + if ((0x1000000010000L & l) != 0L) + { jjCheckNAddTwoStates(454, 455); } + break; + case 454: + if ((0x10000000100000L & l) != 0L && kind > 74) + kind = 74; + break; + case 455: + if (curChar == 92) + { jjCheckNAddStates(1640, 1643); } + break; + case 466: + if (curChar == 92) + { jjAddStates(1644, 1647); } + break; + case 478: + if ((0x1000000010000L & l) != 0L) + { jjAddStates(1648, 1649); } + break; + case 479: + if ((0x800000008L & l) != 0L && kind > 75) + kind = 75; + break; + case 480: + if (curChar == 92) + { jjAddStates(1650, 1652); } + break; + case 491: + if (curChar == 92) + { jjAddStates(1653, 1656); } + break; + case 503: + if ((0x1000000010L & l) != 0L) + { jjAddStates(1657, 1658); } + break; + case 504: + if ((0x2000000020L & l) != 0L) + { jjCheckNAddTwoStates(505, 506); } + break; + case 505: + if ((0x8000000080L & l) != 0L && kind > 76) + kind = 76; + break; + case 506: + if (curChar == 92) + { jjCheckNAddStates(1659, 1662); } + break; + case 517: + if (curChar == 92) + { jjAddStates(1663, 1665); } + break; + case 528: + if (curChar == 92) + { jjAddStates(1666, 1668); } + break; + case 540: + if ((0x4000000040000L & l) != 0L) + { jjAddStates(1669, 1670); } + break; + case 541: + if ((0x200000002L & l) != 0L) + { jjAddStates(1671, 1672); } + break; + case 542: + if ((0x1000000010L & l) != 0L && kind > 77) + kind = 77; + break; + case 543: + if (curChar == 92) + { jjAddStates(1673, 1675); } + break; + case 554: + if (curChar == 92) + { jjAddStates(1676, 1678); } + break; + case 565: + if (curChar == 92) + { jjAddStates(1679, 1682); } + break; + case 577: + if ((0x8000000080L & l) != 0L) + { jjCheckNAddTwoStates(578, 603); } + break; + case 578: + if ((0x4000000040000L & l) != 0L) + { jjAddStates(1683, 1684); } + break; + case 579: + if ((0x200000002L & l) != 0L) + { jjAddStates(1685, 1686); } + break; + case 580: + if ((0x1000000010L & l) != 0L && kind > 78) + kind = 78; + break; + case 581: + if (curChar == 92) + { jjAddStates(1687, 1689); } + break; + case 592: + if (curChar == 92) + { jjAddStates(1690, 1692); } + break; + case 603: + if (curChar == 92) + { jjCheckNAddStates(1693, 1696); } + break; + case 614: + if (curChar == 92) + { jjAddStates(1697, 1700); } + break; + case 626: + if ((0x200000002000L & l) != 0L) + { jjCheckNAddTwoStates(627, 628); } + break; + case 627: + if ((0x8000000080000L & l) != 0L && kind > 79) + kind = 79; + break; + case 628: + if (curChar == 92) + { jjCheckNAddStates(1701, 1704); } + break; + case 639: + if (curChar == 92) + { jjAddStates(1705, 1708); } + break; + case 640: + if ((0x1000000010L & l) != 0L) + { jjCheckNAddStates(1709, 1712); } + break; + case 651: + if ((0x8000000080000L & l) != 0L && kind > 80) + kind = 80; + break; + case 652: + if (curChar == 92) + { jjAddStates(1713, 1716); } + break; + case 664: + if ((0x10000000100L & l) != 0L) + { jjCheckNAddTwoStates(665, 666); } + break; + case 665: + if ((0x400000004000000L & l) != 0L && kind > 81) + kind = 81; + break; + case 666: + if (curChar == 92) + { jjCheckNAddStates(1717, 1720); } + break; + case 667: + if ((0x200000002L & l) == 0L) + break; + if (kind > 81) + kind = 81; + { jjAddStates(1721, 1722); } + break; + case 677: + if (curChar == 92) + { jjAddStates(1723, 1726); } + break; + case 689: + if ((0x80000000800L & l) != 0L) + { jjCheckNAddTwoStates(690, 703); } + break; + case 690: + if ((0x10000000100L & l) != 0L) + { jjCheckNAddTwoStates(691, 692); } + break; + case 691: + if ((0x400000004000000L & l) != 0L && kind > 82) + kind = 82; + break; + case 692: + if (curChar == 92) + { jjCheckNAddStates(1727, 1730); } + break; + case 693: + if ((0x200000002L & l) == 0L) + break; + if (kind > 82) + kind = 82; + { jjAddStates(1731, 1732); } + break; + case 703: + if (curChar == 92) + { jjCheckNAddStates(1733, 1736); } + break; + case 714: + if (curChar == 92) + { jjAddStates(1737, 1740); } + break; + case 715: + if ((0x400000004L & l) != 0L) + { jjCheckNAddStates(1741, 1744); } + break; + case 729: + case 730: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 84) + kind = 84; + { jjCheckNAddTwoStates(730, 731); } + break; + case 731: + if (curChar == 92) + { jjCheckNAddTwoStates(732, 733); } + break; + case 732: + if ((0xffffff81ffffff81L & l) == 0L) + break; + if (kind > 84) + kind = 84; + { jjCheckNAddTwoStates(730, 731); } + break; + case 733: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 84) + kind = 84; + { jjCheckNAddStates(970, 978); } + break; + case 734: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 84) + kind = 84; + { jjCheckNAddStates(979, 982); } + break; + case 738: + case 740: + case 743: + case 747: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(734); } + break; + case 739: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 740; + break; + case 741: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 742; + break; + case 742: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 743; + break; + case 744: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 745; + break; + case 745: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 746; + break; + case 746: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 747; + break; + case 748: + if (curChar == 92) + { jjCheckNAddTwoStates(732, 749); } + break; + case 749: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 84) + kind = 84; + { jjCheckNAddStates(983, 991); } + break; + case 750: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 84) + kind = 84; + { jjCheckNAddStates(992, 995); } + break; + case 752: + case 754: + case 757: + case 761: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(750); } + break; + case 753: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 754; + break; + case 755: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 756; + break; + case 756: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 757; + break; + case 758: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 759; + break; + case 759: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 760; + break; + case 760: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 761; + break; + case 764: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddTwoStates(764, 765); } + break; + case 765: + if (curChar == 92) + { jjCheckNAddTwoStates(766, 767); } + break; + case 766: + if ((0xffffff81ffffff81L & l) == 0L) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddTwoStates(764, 765); } + break; + case 767: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddStates(996, 1004); } + break; + case 768: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddStates(1005, 1008); } + break; + case 772: + case 774: + case 777: + case 781: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(768); } + break; + case 773: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 774; + break; + case 775: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 776; + break; + case 776: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 777; + break; + case 778: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 779; + break; + case 779: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 780; + break; + case 780: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 781; + break; + case 782: + if ((0x7fffffe87fffffeL & l) != 0L) + { jjCheckNAddStates(0, 2); } + break; + case 783: + if ((0x7fffffe87fffffeL & l) != 0L) + { jjCheckNAddStates(0, 2); } + break; + case 785: + if (curChar == 92) + { jjCheckNAddTwoStates(786, 787); } + break; + case 786: + if ((0xffffff81ffffff81L & l) != 0L) + { jjCheckNAddStates(0, 2); } + break; + case 787: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(1009, 1018); } + break; + case 788: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(1019, 1023); } + break; + case 792: + case 794: + case 797: + case 801: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(788); } + break; + case 793: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 794; + break; + case 795: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 796; + break; + case 796: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 797; + break; + case 798: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 799; + break; + case 799: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 800; + break; + case 800: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 801; + break; + case 802: + if (curChar == 92) + { jjCheckNAddTwoStates(786, 803); } + break; + case 803: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(1024, 1033); } + break; + case 804: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(1034, 1038); } + break; + case 806: + case 808: + case 811: + case 815: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(804); } + break; + case 807: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 808; + break; + case 809: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 810; + break; + case 810: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 811; + break; + case 812: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 813; + break; + case 813: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 814; + break; + case 814: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 815; + break; + case 816: + if (curChar == 92) + { jjCheckNAddTwoStates(766, 817); } + break; + case 817: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddStates(1039, 1047); } + break; + case 818: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddStates(1048, 1051); } + break; + case 820: + case 822: + case 825: + case 829: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(818); } + break; + case 821: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 822; + break; + case 823: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 824; + break; + case 824: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 825; + break; + case 826: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 827; + break; + case 827: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 828; + break; + case 828: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 829; + break; + case 830: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddStates(1477, 1481); } + break; + case 831: + if (curChar == 64) + { jjCheckNAddStates(1490, 1500); } + break; + case 832: + if ((0x20000000200L & l) != 0L) + { jjCheckNAddTwoStates(833, 882); } + break; + case 833: + if ((0x200000002000L & l) != 0L) + { jjCheckNAddTwoStates(834, 871); } + break; + case 834: + if ((0x1000000010000L & l) != 0L) + { jjCheckNAddTwoStates(835, 860); } + break; + case 835: + if ((0x800000008000L & l) != 0L) + { jjCheckNAddTwoStates(836, 849); } + break; + case 836: + if ((0x4000000040000L & l) != 0L) + { jjCheckNAddTwoStates(837, 838); } + break; + case 837: + if ((0x10000000100000L & l) != 0L && kind > 63) + kind = 63; + break; + case 838: + if (curChar == 92) + { jjCheckNAddStates(1745, 1748); } + break; + case 849: + if (curChar == 92) + { jjCheckNAddStates(1749, 1752); } + break; + case 860: + if (curChar == 92) + { jjCheckNAddStates(1753, 1756); } + break; + case 871: + if (curChar == 92) + { jjCheckNAddStates(1757, 1760); } + break; + case 882: + if (curChar == 92) + { jjCheckNAddStates(1761, 1764); } + break; + case 883: + if ((0x1000000010L & l) != 0L) + { jjCheckNAddStates(1765, 1768); } + break; + case 893: + if ((0x1000000010000L & l) != 0L) + { jjAddStates(1769, 1770); } + break; + case 894: + if ((0x200000002L & l) != 0L) + { jjCheckNAddTwoStates(895, 908); } + break; + case 895: + if ((0x8000000080L & l) != 0L) + { jjAddStates(1771, 1772); } + break; + case 896: + if ((0x2000000020L & l) != 0L && kind > 64) + kind = 64; + break; + case 897: + if (curChar == 92) + { jjAddStates(1773, 1775); } + break; + case 908: + if (curChar == 92) + { jjCheckNAddStates(1776, 1779); } + break; + case 919: + if (curChar == 92) + { jjAddStates(1780, 1782); } + break; + case 930: + if ((0x200000002000L & l) != 0L) + { jjCheckNAddTwoStates(931, 968); } + break; + case 931: + if ((0x2000000020L & l) != 0L) + { jjAddStates(1783, 1784); } + break; + case 932: + if ((0x1000000010L & l) != 0L) + { jjCheckNAddTwoStates(933, 946); } + break; + case 933: + if ((0x20000000200L & l) != 0L) + { jjAddStates(1785, 1786); } + break; + case 934: + if ((0x200000002L & l) != 0L && kind > 65) + kind = 65; + break; + case 935: + if (curChar == 92) + { jjAddStates(1787, 1789); } + break; + case 946: + if (curChar == 92) + { jjCheckNAddStates(1790, 1793); } + break; + case 957: + if (curChar == 92) + { jjAddStates(1794, 1796); } + break; + case 968: + if (curChar == 92) + { jjAddStates(1797, 1799); } + break; + case 979: + if ((0x800000008L & l) != 0L) + { jjCheckNAddTwoStates(980, 1041); } + break; + case 980: + if ((0x10000000100L & l) != 0L) + { jjAddStates(1800, 1801); } + break; + case 981: + if ((0x200000002L & l) != 0L) + { jjCheckNAddTwoStates(982, 1019); } + break; + case 982: + if ((0x4000000040000L & l) != 0L) + { jjCheckNAddTwoStates(983, 1008); } + break; + case 983: + if ((0x8000000080000L & l) != 0L) + { jjAddStates(1802, 1803); } + break; + case 984: + if ((0x2000000020L & l) != 0L) + { jjCheckNAddTwoStates(985, 986); } + break; + case 985: + if ((0x10000000100000L & l) != 0L && kind > 66) + kind = 66; + break; + case 986: + if (curChar == 92) + { jjCheckNAddStates(1804, 1807); } + break; + case 997: + if (curChar == 92) + { jjAddStates(1808, 1810); } + break; + case 1008: + if (curChar == 92) + { jjCheckNAddStates(1811, 1814); } + break; + case 1019: + if (curChar == 92) + { jjCheckNAddStates(1815, 1818); } + break; + case 1030: + if (curChar == 92) + { jjAddStates(1819, 1821); } + break; + case 1041: + if (curChar == 92) + { jjCheckNAddStates(1822, 1825); } + break; + case 1052: + if (curChar == 92) + { jjAddStates(1826, 1828); } + break; + case 1064: + case 1065: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 88) + kind = 88; + { jjCheckNAddTwoStates(1065, 1066); } + break; + case 1066: + if (curChar == 92) + { jjCheckNAddTwoStates(1067, 1068); } + break; + case 1067: + if ((0xffffff81ffffff81L & l) == 0L) + break; + if (kind > 88) + kind = 88; + { jjCheckNAddTwoStates(1065, 1066); } + break; + case 1068: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 88) + kind = 88; + { jjCheckNAddStates(1346, 1354); } + break; + case 1069: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 88) + kind = 88; + { jjCheckNAddStates(1355, 1358); } + break; + case 1073: + case 1075: + case 1078: + case 1082: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(1069); } + break; + case 1074: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1075; + break; + case 1076: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1077; + break; + case 1077: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1078; + break; + case 1079: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1080; + break; + case 1080: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1081; + break; + case 1081: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1082; + break; + case 1083: + if (curChar == 92) + { jjCheckNAddTwoStates(1067, 1084); } + break; + case 1084: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 88) + kind = 88; + { jjCheckNAddStates(1359, 1367); } + break; + case 1085: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 88) + kind = 88; + { jjCheckNAddStates(1368, 1371); } + break; + case 1087: + case 1089: + case 1092: + case 1096: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(1085); } + break; + case 1088: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1089; + break; + case 1090: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1091; + break; + case 1091: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1092; + break; + case 1093: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1094; + break; + case 1094: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1095; + break; + case 1095: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1096; + break; + case 1097: + if (curChar == 92) + { jjCheckNAddStates(1829, 1832); } + break; + case 1098: + if ((0x1000000010L & l) != 0L) + { jjCheckNAddStates(1833, 1836); } + break; + case 1108: + if (curChar == 92) + { jjCheckNAddStates(1837, 1840); } + break; + case 1119: + if (curChar == 92) + { jjCheckNAddStates(1841, 1844); } + break; + case 1130: + if (curChar == 92) + { jjCheckNAddStates(1482, 1489); } + break; + case 1131: + if ((0x800000008L & l) != 0L) + { jjCheckNAddStates(1845, 1848); } + break; + default : break; + } + } while(i != startsAt); + } + else + { + int hiByte = (curChar >> 8); + int i1 = hiByte >> 6; + long l1 = 1L << (hiByte & 077); + int i2 = (curChar & 0xff) >> 6; + long l2 = 1L << (curChar & 077); + do + { + switch(jjstateSet[--i]) + { + case 763: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { + if (kind > 19) + kind = 19; + { jjCheckNAddTwoStates(764, 765); } + } + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(0, 2); } + break; + case 1200: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { + if (kind > 19) + kind = 19; + { jjCheckNAddTwoStates(764, 765); } + } + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(0, 2); } + break; + case 0: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddStates(1477, 1481); } + break; + case 1: + case 7: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(183, 185); } + break; + case 23: + case 29: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(180, 182); } + break; + case 49: + case 51: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 62) + kind = 62; + { jjCheckNAddTwoStates(49, 50); } + break; + case 71: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjAddStates(1511, 1512); } + break; + case 73: + case 74: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddTwoStates(74, 75); } + break; + case 187: + case 191: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(375, 378); } + break; + case 208: + case 214: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(394, 396); } + break; + case 230: + case 236: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(412, 414); } + break; + case 729: + case 730: + case 732: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 84) + kind = 84; + { jjCheckNAddTwoStates(730, 731); } + break; + case 764: + case 766: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 19) + kind = 19; + { jjCheckNAddTwoStates(764, 765); } + break; + case 782: + case 786: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(0, 2); } + break; + case 783: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(0, 2); } + break; + case 1064: + case 1065: + case 1067: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 88) + kind = 88; + { jjCheckNAddTwoStates(1065, 1066); } + break; + default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break; + } + } while(i != startsAt); + } + if (kind != 0x7fffffff) + { + jjmatchedKind = kind; + jjmatchedPos = curPos; + kind = 0x7fffffff; + } + ++curPos; + if ((i = jjnewStateCnt) == (startsAt = 1199 - (jjnewStateCnt = startsAt))) + return curPos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return curPos; } + } +} +private int jjMoveStringLiteralDfa0_1(){ + switch(curChar) + { + case 42: + return jjMoveStringLiteralDfa1_1(0x10L); + default : + return 1; + } +} +private int jjMoveStringLiteralDfa1_1(long active0){ + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + return 1; + } + switch(curChar) + { + case 47: + if ((active0 & 0x10L) != 0L) + return jjStopAtPos(1, 4); + break; + default : + return 2; + } + return 2; +} + +/** Token literal values. */ +public static final String[] jjstrLiteralImages = { +"", 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, "\74\41\55\55", "\55\55\76", "\176\75", "\174\75", null, "\175", "\50", "\51", +"\56", "\73", "\72", "\52", "\57", "\55", "\75", "\133", "\135", 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, }; +protected Token jjFillToken() +{ + final Token t; + final String curTokenImage; + final int beginLine; + final int endLine; + final int beginColumn; + final int endColumn; + if (jjmatchedPos < 0) + { + if (image == null) + curTokenImage = ""; + else + curTokenImage = image.toString(); + beginLine = endLine = input_stream.getEndLine(); + beginColumn = endColumn = input_stream.getEndColumn(); + } + else + { + String im = jjstrLiteralImages[jjmatchedKind]; + curTokenImage = (im == null) ? input_stream.GetImage() : im; + beginLine = input_stream.getBeginLine(); + beginColumn = input_stream.getBeginColumn(); + endLine = input_stream.getEndLine(); + endColumn = input_stream.getEndColumn(); + } + t = Token.newToken(jjmatchedKind); + t.kind = jjmatchedKind; + t.image = curTokenImage; + + t.beginLine = beginLine; + t.endLine = endLine; + t.beginColumn = beginColumn; + t.endColumn = endColumn; + + return t; +} +static final int[] jjnextStates = { + 783, 784, 785, 727, 728, 729, 748, 688, 689, 714, 663, 664, 677, 650, 651, 652, + 625, 626, 639, 576, 577, 614, 539, 540, 565, 502, 503, 528, 477, 478, 491, 452, + 453, 466, 427, 428, 441, 402, 403, 416, 377, 378, 391, 352, 353, 366, 327, 328, + 341, 302, 303, 316, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 303, 316, 1151, + 1152, 1153, 328, 341, 1154, 1155, 1156, 353, 1157, 1158, 1159, 378, 391, 1160, 1161, 1162, + 403, 1163, 1164, 1165, 428, 1166, 1167, 1168, 453, 1169, 1170, 1171, 478, 1172, 1173, 1174, + 503, 528, 1175, 1176, 1177, 540, 1178, 1179, 1180, 577, 1181, 1182, 1183, 626, 1184, 1185, + 1186, 651, 1187, 1188, 1189, 664, 1190, 1191, 1192, 689, 1193, 1194, 1195, 726, 1196, 1197, + 1198, 728, 729, 748, 714, 677, 652, 639, 614, 565, 491, 466, 441, 416, 366, 293, + 294, 295, 44, 296, 45, 297, 46, 298, 47, 763, 782, 802, 816, 300, 301, 302, + 327, 352, 377, 402, 427, 452, 477, 502, 539, 576, 625, 650, 663, 688, 725, 727, + 68, 69, 77, 174, 23, 24, 25, 1, 2, 3, 1, 9, 12, 13, 15, 18, + 10, 11, 2, 3, 1, 10, 11, 2, 3, 23, 31, 34, 35, 37, 40, 32, + 33, 24, 25, 23, 32, 33, 24, 25, 49, 53, 57, 58, 60, 63, 55, 56, + 50, 49, 55, 56, 50, 72, 73, 76, 73, 75, 76, 89, 90, 94, 91, 92, + 95, 96, 94, 91, 92, 94, 91, 92, 95, 105, 102, 103, 106, 107, 105, 102, + 103, 105, 102, 103, 106, 111, 112, 84, 97, 116, 113, 114, 117, 118, 116, 113, + 114, 116, 113, 114, 117, 122, 123, 83, 108, 127, 124, 125, 128, 129, 127, 124, + 125, 127, 124, 125, 128, 133, 134, 82, 119, 138, 135, 136, 139, 140, 138, 135, + 136, 138, 135, 136, 139, 144, 145, 81, 130, 149, 146, 147, 150, 151, 149, 146, + 147, 149, 146, 147, 150, 155, 156, 80, 141, 160, 157, 158, 161, 162, 160, 157, + 158, 160, 157, 158, 161, 171, 168, 169, 172, 173, 171, 168, 169, 171, 168, 169, + 172, 177, 178, 78, 163, 182, 179, 180, 183, 184, 182, 179, 180, 182, 179, 180, + 183, 187, 207, 229, 189, 190, 251, 187, 188, 189, 190, 187, 193, 197, 198, 200, + 203, 195, 189, 190, 196, 187, 195, 189, 190, 196, 208, 209, 210, 208, 216, 219, + 220, 222, 225, 217, 218, 209, 210, 208, 217, 218, 209, 210, 230, 231, 232, 230, + 238, 241, 242, 244, 247, 239, 240, 231, 232, 230, 239, 240, 231, 232, 187, 207, + 229, 188, 189, 190, 251, 262, 263, 258, 267, 264, 265, 268, 269, 267, 264, 265, + 267, 264, 265, 268, 278, 275, 276, 279, 280, 278, 275, 276, 278, 275, 276, 279, + 284, 285, 256, 270, 289, 286, 287, 290, 291, 289, 286, 287, 289, 286, 287, 290, + 313, 310, 311, 314, 315, 313, 310, 311, 313, 310, 311, 314, 319, 320, 304, 305, + 324, 321, 322, 325, 326, 324, 321, 322, 324, 321, 322, 325, 333, 334, 338, 335, + 336, 339, 340, 338, 335, 336, 338, 335, 336, 339, 344, 345, 329, 330, 349, 346, + 347, 350, 351, 349, 346, 347, 349, 346, 347, 350, 358, 359, 363, 360, 361, 364, + 365, 363, 360, 361, 363, 360, 361, 364, 369, 370, 354, 355, 374, 371, 372, 375, + 376, 374, 371, 372, 374, 371, 372, 375, 388, 385, 386, 389, 390, 388, 385, 386, + 388, 385, 386, 389, 394, 395, 379, 380, 399, 396, 397, 400, 401, 399, 396, 397, + 399, 396, 397, 400, 413, 410, 411, 414, 415, 413, 410, 411, 413, 410, 411, 414, + 424, 421, 422, 425, 426, 424, 421, 422, 424, 421, 422, 425, 438, 435, 436, 439, + 440, 438, 435, 436, 438, 435, 436, 439, 444, 445, 429, 430, 449, 446, 447, 450, + 451, 449, 446, 447, 449, 446, 447, 450, 458, 459, 463, 460, 461, 464, 465, 463, + 460, 461, 463, 460, 461, 464, 469, 470, 454, 455, 474, 471, 472, 475, 476, 474, + 471, 472, 474, 471, 472, 475, 483, 484, 488, 485, 486, 489, 490, 488, 485, 486, + 488, 485, 486, 489, 494, 495, 479, 480, 499, 496, 497, 500, 501, 499, 496, 497, + 499, 496, 497, 500, 509, 510, 514, 511, 512, 515, 516, 514, 511, 512, 514, 511, + 512, 515, 520, 521, 505, 506, 525, 522, 523, 526, 527, 525, 522, 523, 525, 522, + 523, 526, 531, 532, 504, 517, 536, 533, 534, 537, 538, 536, 533, 534, 536, 533, + 534, 537, 546, 547, 551, 548, 549, 552, 553, 551, 548, 549, 551, 548, 549, 552, + 557, 558, 542, 543, 562, 559, 560, 563, 564, 562, 559, 560, 562, 559, 560, 563, + 568, 569, 541, 554, 573, 570, 571, 574, 575, 573, 570, 571, 573, 570, 571, 574, + 584, 585, 589, 586, 587, 590, 591, 589, 586, 587, 589, 586, 587, 590, 595, 596, + 580, 581, 600, 597, 598, 601, 602, 600, 597, 598, 600, 597, 598, 601, 606, 607, + 579, 592, 611, 608, 609, 612, 613, 611, 608, 609, 611, 608, 609, 612, 617, 618, + 578, 603, 622, 619, 620, 623, 624, 622, 619, 620, 622, 619, 620, 623, 631, 632, + 636, 633, 634, 637, 638, 636, 633, 634, 636, 633, 634, 637, 647, 644, 645, 648, + 649, 647, 644, 645, 647, 644, 645, 648, 655, 656, 660, 657, 658, 661, 662, 660, + 657, 658, 660, 657, 658, 661, 674, 671, 672, 675, 676, 674, 671, 672, 674, 671, + 672, 675, 680, 681, 665, 666, 685, 682, 683, 686, 687, 685, 682, 683, 685, 682, + 683, 686, 700, 697, 698, 701, 702, 700, 697, 698, 700, 697, 698, 701, 706, 707, + 691, 692, 711, 708, 709, 712, 713, 711, 708, 709, 711, 708, 709, 712, 722, 719, + 720, 723, 724, 722, 719, 720, 722, 719, 720, 723, 730, 734, 738, 739, 741, 744, + 736, 737, 731, 730, 736, 737, 731, 750, 752, 753, 755, 758, 751, 737, 730, 731, + 751, 737, 730, 731, 764, 768, 772, 773, 775, 778, 770, 771, 765, 764, 770, 771, + 765, 783, 788, 792, 793, 795, 798, 790, 791, 784, 785, 783, 790, 791, 784, 785, + 804, 806, 807, 809, 812, 805, 791, 783, 784, 785, 805, 791, 783, 784, 785, 818, + 820, 821, 823, 826, 819, 771, 764, 765, 819, 771, 764, 765, 841, 842, 846, 843, + 844, 847, 848, 846, 843, 844, 846, 843, 844, 847, 852, 853, 837, 838, 857, 854, + 855, 858, 859, 857, 854, 855, 857, 854, 855, 858, 863, 864, 836, 849, 868, 865, + 866, 869, 870, 868, 865, 866, 868, 865, 866, 869, 874, 875, 835, 860, 879, 876, + 877, 880, 881, 879, 876, 877, 879, 876, 877, 880, 890, 887, 888, 891, 892, 890, + 887, 888, 890, 887, 888, 891, 900, 901, 905, 902, 903, 906, 907, 905, 902, 903, + 905, 902, 903, 906, 911, 912, 896, 897, 916, 913, 914, 917, 918, 916, 913, 914, + 916, 913, 914, 917, 922, 923, 895, 908, 927, 924, 925, 928, 929, 927, 924, 925, + 927, 924, 925, 928, 938, 939, 943, 940, 941, 944, 945, 943, 940, 941, 943, 940, + 941, 944, 949, 950, 934, 935, 954, 951, 952, 955, 956, 954, 951, 952, 954, 951, + 952, 955, 960, 961, 933, 946, 965, 962, 963, 966, 967, 965, 962, 963, 965, 962, + 963, 966, 971, 972, 932, 957, 976, 973, 974, 977, 978, 976, 973, 974, 976, 973, + 974, 977, 989, 990, 994, 991, 992, 995, 996, 994, 991, 992, 994, 991, 992, 995, + 1000, 1001, 985, 986, 1005, 1002, 1003, 1006, 1007, 1005, 1002, 1003, 1005, 1002, 1003, 1006, + 1011, 1012, 984, 997, 1016, 1013, 1014, 1017, 1018, 1016, 1013, 1014, 1016, 1013, 1014, 1017, + 1022, 1023, 983, 1008, 1027, 1024, 1025, 1028, 1029, 1027, 1024, 1025, 1027, 1024, 1025, 1028, + 1033, 1034, 982, 1019, 1038, 1035, 1036, 1039, 1040, 1038, 1035, 1036, 1038, 1035, 1036, 1039, + 1044, 1045, 981, 1030, 1049, 1046, 1047, 1050, 1051, 1049, 1046, 1047, 1049, 1046, 1047, 1050, + 1055, 1056, 980, 1041, 1060, 1057, 1058, 1061, 1062, 1060, 1057, 1058, 1060, 1057, 1058, 1061, + 1064, 1083, 1065, 1069, 1073, 1074, 1076, 1079, 1071, 1072, 1066, 1065, 1071, 1072, 1066, 1085, + 1087, 1088, 1090, 1093, 1086, 1072, 1065, 1066, 1086, 1072, 1065, 1066, 1105, 1102, 1103, 1106, + 1107, 1105, 1102, 1103, 1105, 1102, 1103, 1106, 1111, 1112, 894, 919, 1116, 1113, 1114, 1117, + 1118, 1116, 1113, 1114, 1116, 1113, 1114, 1117, 1122, 1123, 833, 882, 1127, 1124, 1125, 1128, + 1129, 1127, 1124, 1125, 1127, 1124, 1125, 1128, 1138, 1135, 1136, 1139, 1140, 1138, 1135, 1136, + 1138, 1135, 1136, 1139, 1148, 303, 316, 1151, 328, 341, 1154, 353, 366, 1157, 378, 391, + 1160, 403, 416, 1163, 428, 441, 1166, 453, 466, 1169, 478, 491, 1172, 503, 528, 1175, + 540, 565, 1178, 577, 614, 1181, 626, 639, 1184, 651, 652, 1187, 664, 677, 1190, 689, + 714, 1196, 728, 729, 748, 764, 783, 784, 785, 765, 766, 1135, 1136, 254, 786, 803, + 1137, 817, 832, 893, 930, 979, 1052, 1063, 1064, 1083, 1097, 1108, 1119, 4, 6, 7, + 8, 26, 28, 29, 30, 51, 52, 71, 72, 83, 108, 91, 92, 85, 93, 102, + 103, 84, 104, 100, 101, 85, 86, 113, 114, 115, 124, 125, 82, 126, 135, 136, + 81, 137, 146, 147, 80, 148, 157, 158, 79, 159, 168, 169, 78, 170, 166, 167, + 79, 152, 179, 180, 77, 181, 191, 192, 211, 213, 214, 215, 233, 235, 236, 237, + 264, 265, 257, 266, 275, 276, 256, 277, 273, 274, 257, 259, 286, 287, 288, 310, + 311, 304, 312, 308, 309, 321, 322, 323, 335, 336, 329, 337, 346, 347, 348, 360, + 361, 354, 362, 371, 372, 353, 373, 385, 386, 379, 387, 383, 384, 396, 397, 398, + 410, 411, 404, 412, 408, 409, 421, 422, 403, 423, 419, 420, 404, 405, 435, 436, + 429, 437, 433, 434, 446, 447, 428, 448, 460, 461, 454, 462, 471, 472, 453, 473, + 479, 480, 485, 486, 487, 496, 497, 478, 498, 504, 517, 511, 512, 505, 513, 522, + 523, 524, 533, 534, 535, 541, 554, 542, 543, 548, 549, 550, 559, 560, 561, 570, + 571, 540, 572, 579, 592, 580, 581, 586, 587, 588, 597, 598, 599, 608, 609, 578, + 610, 619, 620, 577, 621, 633, 634, 627, 635, 644, 645, 626, 646, 642, 643, 627, + 628, 657, 658, 651, 659, 671, 672, 665, 673, 669, 670, 682, 683, 664, 684, 697, + 698, 691, 699, 695, 696, 708, 709, 690, 710, 719, 720, 689, 721, 717, 718, 690, + 703, 843, 844, 837, 845, 854, 855, 836, 856, 865, 866, 835, 867, 876, 877, 834, + 878, 887, 888, 833, 889, 885, 886, 834, 871, 894, 919, 896, 897, 902, 903, 904, + 913, 914, 895, 915, 924, 925, 926, 932, 957, 934, 935, 940, 941, 942, 951, 952, + 933, 953, 962, 963, 964, 973, 974, 975, 981, 1030, 984, 997, 991, 992, 985, 993, + 1002, 1003, 1004, 1013, 1014, 983, 1015, 1024, 1025, 982, 1026, 1035, 1036, 1037, 1046, 1047, + 980, 1048, 1057, 1058, 1059, 1102, 1103, 930, 1104, 1100, 1101, 931, 968, 1113, 1114, 893, + 1115, 1124, 1125, 832, 1126, 1133, 1134, 255, 281, +}; +private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) +{ + switch(hiByte) + { + case 0: + return ((jjbitVec2[i2] & l2) != 0L); + default : + if ((jjbitVec0[i1] & l1) != 0L) + return true; + return false; + } +} + +int curLexState = 0; +int defaultLexState = 0; +int jjnewStateCnt; +int jjround; +int jjmatchedPos; +int jjmatchedKind; + +/** Get the next Token. */ +public Token getNextToken() +{ + Token matchedToken; + int curPos = 0; + + EOFLoop : + for (;;) + { + try + { + curChar = input_stream.BeginToken(); + } + catch(Exception e) + { + jjmatchedKind = 0; + jjmatchedPos = -1; + matchedToken = jjFillToken(); + return matchedToken; + } + image = jjimage; + image.setLength(0); + jjimageLen = 0; + + for (;;) + { + switch(curLexState) + { + case 0: + jjmatchedKind = 2; + jjmatchedPos = -1; + curPos = 0; + curPos = jjMoveStringLiteralDfa0_0(); + if (jjmatchedPos < 0 || (jjmatchedPos == 0 && jjmatchedKind > 89)) + { + jjmatchedKind = 89; + jjmatchedPos = 0; + } + break; + case 1: + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_1(); + if (jjmatchedPos == 0 && jjmatchedKind > 5) + { + jjmatchedKind = 5; + } + break; + } + if (jjmatchedKind != 0x7fffffff) + { + if (jjmatchedPos + 1 < curPos) + input_stream.backup(curPos - jjmatchedPos - 1); + if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + matchedToken = jjFillToken(); + TokenLexicalActions(matchedToken); + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + return matchedToken; + } + else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + continue EOFLoop; + } + jjimageLen += jjmatchedPos + 1; + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + curPos = 0; + jjmatchedKind = 0x7fffffff; + try { + curChar = input_stream.readChar(); + continue; + } + catch (java.io.IOException e1) { } + } + int error_line = input_stream.getEndLine(); + int error_column = input_stream.getEndColumn(); + String error_after = null; + boolean EOFSeen = false; + try { input_stream.readChar(); input_stream.backup(1); } + catch (java.io.IOException e1) { + EOFSeen = true; + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + if (curChar == '\n' || curChar == '\r') { + error_line++; + error_column = 0; + } + else + error_column++; + } + if (!EOFSeen) { + input_stream.backup(1); + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + } + throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); + } + } +} + +void SkipLexicalActions(Token matchedToken) +{ + switch(jjmatchedKind) + { + default : + break; + } +} +void MoreLexicalActions() +{ + jjimageLen += (lengthOfMatch = jjmatchedPos + 1); + switch(jjmatchedKind) + { + default : + break; + } +} +void TokenLexicalActions(Token matchedToken) +{ + switch(jjmatchedKind) + { + case 22 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 1, 1); + break; + case 68 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 69 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 70 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 71 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 72 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 73 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 74 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 75 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 76 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 3); + break; + case 77 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 3); + break; + case 78 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 4); + break; + case 79 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 80 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 1); + break; + case 81 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 82 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 3); + break; + case 83 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 1); + break; + case 85 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimUrl(image); + break; + default : + break; + } +} +private void jjCheckNAdd(int state) +{ + if (jjrounds[state] != jjround) + { + jjstateSet[jjnewStateCnt++] = state; + jjrounds[state] = jjround; + } +} +private void jjAddStates(int start, int end) +{ + do { + jjstateSet[jjnewStateCnt++] = jjnextStates[start]; + } while (start++ != end); +} +private void jjCheckNAddTwoStates(int state1, int state2) +{ + jjCheckNAdd(state1); + jjCheckNAdd(state2); +} + +private void jjCheckNAddStates(int start, int end) +{ + do { + jjCheckNAdd(jjnextStates[start]); + } while (start++ != end); +} + + /** Constructor. */ + public SACParserCSS21TokenManager(CharStream stream){ + + + input_stream = stream; + } + + /** Constructor. */ + public SACParserCSS21TokenManager (CharStream stream, int lexState){ + ReInit(stream); + SwitchTo(lexState); + } + + /** Reinitialise parser. */ + + public void ReInit(CharStream stream) + { + + + jjmatchedPos = + jjnewStateCnt = + 0; + curLexState = defaultLexState; + input_stream = stream; + ReInitRounds(); + } + + private void ReInitRounds() + { + int i; + jjround = 0x80000001; + for (i = 1199; i-- > 0;) + jjrounds[i] = 0x80000000; + } + + /** Reinitialise parser. */ + public void ReInit(CharStream stream, int lexState) + + { + ReInit(stream); + SwitchTo(lexState); + } + + /** Switch to specified lex state. */ + public void SwitchTo(int lexState) + { + if (lexState >= 2 || lexState < 0) + throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); + else + curLexState = lexState; + } + + +/** Lexer state names. */ +public static final String[] lexStateNames = { + "DEFAULT", + "COMMENT", +}; + +/** Lex State array. */ +public static final int[] jjnewLexState = { + -1, -1, -1, 1, 0, -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 = { + 0xfffffc00006e0007L, 0x7ffffffL, +}; +static final long[] jjtoSkip = { + 0x10L, 0x0L, +}; +static final long[] jjtoSpecial = { + 0x0L, 0x0L, +}; +static final long[] jjtoMore = { + 0x28L, 0x0L, +}; + protected CharStream input_stream; + + private final int[] jjrounds = new int[1199]; + private final int[] jjstateSet = new int[2 * 1199]; + private final StringBuilder jjimage = new StringBuilder(); + private StringBuilder image = jjimage; + private int jjimageLen; + private int lengthOfMatch; + protected int curChar; +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS2Constants.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS2Constants.java new file mode 100644 index 000000000..dbead9fdd --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS2Constants.java @@ -0,0 +1,255 @@ +/* Generated By:JavaCC: Do not edit this line. SACParserCSS2Constants.java */ +package com.fr.third.steadystate.css.parser; + + +/** + * Token literal values and constants. + * Generated by org.javacc.parser.OtherFilesGen#start() + */ +public interface SACParserCSS2Constants { + + /** End of File. */ + int EOF = 0; + /** RegularExpression Id. */ + int S = 1; + /** RegularExpression Id. */ + int W = 2; + /** RegularExpression Id. */ + int LBRACE = 6; + /** RegularExpression Id. */ + int RBRACE = 7; + /** RegularExpression Id. */ + int COMMA = 8; + /** RegularExpression Id. */ + int DOT = 9; + /** RegularExpression Id. */ + int SEMICOLON = 10; + /** RegularExpression Id. */ + int COLON = 11; + /** RegularExpression Id. */ + int ASTERISK = 12; + /** RegularExpression Id. */ + int SLASH = 13; + /** RegularExpression Id. */ + int PLUS = 14; + /** RegularExpression Id. */ + int MINUS = 15; + /** RegularExpression Id. */ + int EQUALS = 16; + /** RegularExpression Id. */ + int GT = 17; + /** RegularExpression Id. */ + int LSQUARE = 18; + /** RegularExpression Id. */ + int RSQUARE = 19; + /** RegularExpression Id. */ + int HASH = 20; + /** RegularExpression Id. */ + int STRING = 21; + /** RegularExpression Id. */ + int RROUND = 22; + /** RegularExpression Id. */ + int URL = 23; + /** RegularExpression Id. */ + int URI = 24; + /** RegularExpression Id. */ + int CDO = 25; + /** RegularExpression Id. */ + int CDC = 26; + /** RegularExpression Id. */ + int INCLUDES = 27; + /** RegularExpression Id. */ + int DASHMATCH = 28; + /** RegularExpression Id. */ + int IMPORT_SYM = 29; + /** RegularExpression Id. */ + int PAGE_SYM = 30; + /** RegularExpression Id. */ + int MEDIA_SYM = 31; + /** RegularExpression Id. */ + int FONT_FACE_SYM = 32; + /** RegularExpression Id. */ + int CHARSET_SYM = 33; + /** RegularExpression Id. */ + int ATKEYWORD = 34; + /** RegularExpression Id. */ + int IMPORTANT_SYM = 35; + /** RegularExpression Id. */ + int INHERIT = 36; + /** RegularExpression Id. */ + int EMS = 37; + /** RegularExpression Id. */ + int EXS = 38; + /** RegularExpression Id. */ + int LENGTH_PX = 39; + /** RegularExpression Id. */ + int LENGTH_CM = 40; + /** RegularExpression Id. */ + int LENGTH_MM = 41; + /** RegularExpression Id. */ + int LENGTH_IN = 42; + /** RegularExpression Id. */ + int LENGTH_PT = 43; + /** RegularExpression Id. */ + int LENGTH_PC = 44; + /** RegularExpression Id. */ + int ANGLE_DEG = 45; + /** RegularExpression Id. */ + int ANGLE_RAD = 46; + /** RegularExpression Id. */ + int ANGLE_GRAD = 47; + /** RegularExpression Id. */ + int TIME_MS = 48; + /** RegularExpression Id. */ + int TIME_S = 49; + /** RegularExpression Id. */ + int FREQ_HZ = 50; + /** RegularExpression Id. */ + int FREQ_KHZ = 51; + /** RegularExpression Id. */ + int PERCENTAGE = 52; + /** RegularExpression Id. */ + int DIMEN = 53; + /** RegularExpression Id. */ + int NUMBER = 54; + /** RegularExpression Id. */ + int RGB = 55; + /** RegularExpression Id. */ + int FUNCTION_LANG = 56; + /** RegularExpression Id. */ + int FUNCTION = 57; + /** RegularExpression Id. */ + int IDENT = 58; + /** RegularExpression Id. */ + int NAME = 59; + /** RegularExpression Id. */ + int NUM = 60; + /** RegularExpression Id. */ + int UNICODERANGE = 61; + /** RegularExpression Id. */ + int RANGE = 62; + /** RegularExpression Id. */ + int Q16 = 63; + /** RegularExpression Id. */ + int Q15 = 64; + /** RegularExpression Id. */ + int Q14 = 65; + /** RegularExpression Id. */ + int Q13 = 66; + /** RegularExpression Id. */ + int Q12 = 67; + /** RegularExpression Id. */ + int Q11 = 68; + /** RegularExpression Id. */ + int NMSTART = 69; + /** RegularExpression Id. */ + int NMCHAR = 70; + /** RegularExpression Id. */ + int STRING1 = 71; + /** RegularExpression Id. */ + int STRING2 = 72; + /** RegularExpression Id. */ + int NONASCII = 73; + /** RegularExpression Id. */ + int ESCAPE = 74; + /** RegularExpression Id. */ + int NL = 75; + /** RegularExpression Id. */ + int UNICODE = 76; + /** RegularExpression Id. */ + int HNUM = 77; + /** RegularExpression Id. */ + int H = 78; + /** RegularExpression Id. */ + int UNKNOWN = 79; + + /** Lexical state. */ + int DEFAULT = 0; + /** Lexical state. */ + int COMMENT = 1; + + /** Literal token values. */ + String[] tokenImage = { + "", + "", + "", + "\"/*\"", + "\"*/\"", + "", + "\"{\"", + "\"}\"", + "\",\"", + "\".\"", + "\";\"", + "\":\"", + "\"*\"", + "\"/\"", + "\"+\"", + "\"-\"", + "\"=\"", + "\">\"", + "\"[\"", + "\"]\"", + "", + "", + "\")\"", + "", + "", + "\"\"", + "\"~=\"", + "\"|=\"", + "\"@import\"", + "\"@page\"", + "\"@media\"", + "\"@font-face\"", + "\"@charset\"", + "", + "", + "\"inherit\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"rgb(\"", + "\"lang(\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"?\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + }; + +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS2TokenManager.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS2TokenManager.java new file mode 100644 index 000000000..69505242c --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS2TokenManager.java @@ -0,0 +1,3685 @@ +/* SACParserCSS2TokenManager.java */ +/* Generated By:JavaCC: Do not edit this line. SACParserCSS2TokenManager.java */ +package com.fr.third.steadystate.css.parser; +import org.w3c.css.sac.CSSParseException; +import org.w3c.css.sac.Condition; +import org.w3c.css.sac.LexicalUnit; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.Parser; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SelectorList; +import org.w3c.css.sac.SimpleSelector; + +/** Token Manager. */ +@SuppressWarnings("all") public class SACParserCSS2TokenManager implements SACParserCSS2Constants { + + /** Debug output. */ + public java.io.PrintStream debugStream = System.out; + /** Set debug output. */ + public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } +private final int jjStopStringLiteralDfa_0(int pos, long active0){ + switch (pos) + { + case 0: + if ((active0 & 0x180001000000000L) != 0L) + { + jjmatchedKind = 58; + jjmatchedPos = 0; + return 428; + } + if ((active0 & 0x3e0000000L) != 0L) + return 60; + if ((active0 & 0x200L) != 0L) + return 429; + return -1; + case 1: + if ((active0 & 0x180001000000000L) != 0L) + { + jjmatchedKind = 58; + jjmatchedPos = 1; + return 428; + } + if ((active0 & 0x3e0000000L) != 0L) + { + jjmatchedKind = 34; + jjmatchedPos = 1; + return 430; + } + return -1; + case 2: + if ((active0 & 0x180001000000000L) != 0L) + { + jjmatchedKind = 58; + jjmatchedPos = 2; + return 428; + } + if ((active0 & 0x3e0000000L) != 0L) + { + jjmatchedKind = 34; + jjmatchedPos = 2; + return 430; + } + return -1; + case 3: + if ((active0 & 0x100001000000000L) != 0L) + { + jjmatchedKind = 58; + jjmatchedPos = 3; + return 428; + } + if ((active0 & 0x3e0000000L) != 0L) + { + jjmatchedKind = 34; + jjmatchedPos = 3; + return 430; + } + return -1; + case 4: + if ((active0 & 0x40000000L) != 0L) + return 430; + if ((active0 & 0x1000000000L) != 0L) + { + jjmatchedKind = 58; + jjmatchedPos = 4; + return 428; + } + if ((active0 & 0x3a0000000L) != 0L) + { + jjmatchedKind = 34; + jjmatchedPos = 4; + return 430; + } + return -1; + case 5: + if ((active0 & 0x1000000000L) != 0L) + { + jjmatchedKind = 58; + jjmatchedPos = 5; + return 428; + } + if ((active0 & 0x320000000L) != 0L) + { + jjmatchedKind = 34; + jjmatchedPos = 5; + return 430; + } + if ((active0 & 0x80000000L) != 0L) + return 430; + return -1; + case 6: + if ((active0 & 0x300000000L) != 0L) + { + jjmatchedKind = 34; + jjmatchedPos = 6; + return 430; + } + if ((active0 & 0x1000000000L) != 0L) + return 428; + if ((active0 & 0x20000000L) != 0L) + return 430; + return -1; + case 7: + if ((active0 & 0x200000000L) != 0L) + return 430; + if ((active0 & 0x100000000L) != 0L) + { + jjmatchedKind = 34; + jjmatchedPos = 7; + return 430; + } + return -1; + case 8: + if ((active0 & 0x100000000L) != 0L) + { + jjmatchedKind = 34; + jjmatchedPos = 8; + return 430; + } + return -1; + default : + return -1; + } +} +private final int jjStartNfa_0(int pos, long active0){ + return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1); +} +private int jjStopAtPos(int pos, int kind) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + return pos + 1; +} +private int jjMoveStringLiteralDfa0_0(){ + switch(curChar) + { + case 41: + return jjStopAtPos(0, 22); + case 42: + return jjStopAtPos(0, 12); + case 43: + return jjStopAtPos(0, 14); + case 44: + return jjStopAtPos(0, 8); + case 45: + { + jjmatchedKind = 15; + jjmatchedPos = 0; + } + return jjMoveStringLiteralDfa1_0(0x4000000L); + case 46: + return jjStartNfaWithStates_0(0, 9, 429); + case 47: + { + jjmatchedKind = 13; + jjmatchedPos = 0; + } + return jjMoveStringLiteralDfa1_0(0x8L); + case 58: + return jjStopAtPos(0, 11); + case 59: + return jjStopAtPos(0, 10); + case 60: + return jjMoveStringLiteralDfa1_0(0x2000000L); + case 61: + return jjStopAtPos(0, 16); + case 62: + return jjStopAtPos(0, 17); + case 64: + return jjMoveStringLiteralDfa1_0(0x3e0000000L); + case 91: + return jjStopAtPos(0, 18); + case 93: + return jjStopAtPos(0, 19); + case 73: + case 105: + return jjMoveStringLiteralDfa1_0(0x1000000000L); + case 76: + case 108: + return jjMoveStringLiteralDfa1_0(0x100000000000000L); + case 82: + case 114: + return jjMoveStringLiteralDfa1_0(0x80000000000000L); + case 123: + return jjStopAtPos(0, 6); + case 124: + return jjMoveStringLiteralDfa1_0(0x10000000L); + case 125: + return jjStopAtPos(0, 7); + case 126: + return jjMoveStringLiteralDfa1_0(0x8000000L); + default : + return jjMoveNfa_0(0, 0); + } +} +private int jjMoveStringLiteralDfa1_0(long active0){ + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(0, active0); + return 1; + } + switch(curChar) + { + case 33: + return jjMoveStringLiteralDfa2_0(active0, 0x2000000L); + case 42: + if ((active0 & 0x8L) != 0L) + return jjStopAtPos(1, 3); + break; + case 45: + return jjMoveStringLiteralDfa2_0(active0, 0x4000000L); + case 61: + if ((active0 & 0x8000000L) != 0L) + return jjStopAtPos(1, 27); + else if ((active0 & 0x10000000L) != 0L) + return jjStopAtPos(1, 28); + break; + case 65: + case 97: + return jjMoveStringLiteralDfa2_0(active0, 0x100000000000000L); + case 67: + case 99: + return jjMoveStringLiteralDfa2_0(active0, 0x200000000L); + case 70: + case 102: + return jjMoveStringLiteralDfa2_0(active0, 0x100000000L); + case 71: + case 103: + return jjMoveStringLiteralDfa2_0(active0, 0x80000000000000L); + case 73: + case 105: + return jjMoveStringLiteralDfa2_0(active0, 0x20000000L); + case 77: + case 109: + return jjMoveStringLiteralDfa2_0(active0, 0x80000000L); + case 78: + case 110: + return jjMoveStringLiteralDfa2_0(active0, 0x1000000000L); + case 80: + case 112: + return jjMoveStringLiteralDfa2_0(active0, 0x40000000L); + default : + break; + } + return jjStartNfa_0(0, active0); +} +private int jjMoveStringLiteralDfa2_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(0, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(1, active0); + return 2; + } + switch(curChar) + { + case 45: + return jjMoveStringLiteralDfa3_0(active0, 0x2000000L); + case 62: + if ((active0 & 0x4000000L) != 0L) + return jjStopAtPos(2, 26); + break; + case 65: + case 97: + return jjMoveStringLiteralDfa3_0(active0, 0x40000000L); + case 66: + case 98: + return jjMoveStringLiteralDfa3_0(active0, 0x80000000000000L); + case 69: + case 101: + return jjMoveStringLiteralDfa3_0(active0, 0x80000000L); + case 72: + case 104: + return jjMoveStringLiteralDfa3_0(active0, 0x1200000000L); + case 77: + case 109: + return jjMoveStringLiteralDfa3_0(active0, 0x20000000L); + case 78: + case 110: + return jjMoveStringLiteralDfa3_0(active0, 0x100000000000000L); + case 79: + case 111: + return jjMoveStringLiteralDfa3_0(active0, 0x100000000L); + default : + break; + } + return jjStartNfa_0(1, active0); +} +private int jjMoveStringLiteralDfa3_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(1, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(2, active0); + return 3; + } + switch(curChar) + { + case 40: + if ((active0 & 0x80000000000000L) != 0L) + return jjStopAtPos(3, 55); + break; + case 45: + if ((active0 & 0x2000000L) != 0L) + return jjStopAtPos(3, 25); + break; + case 65: + case 97: + return jjMoveStringLiteralDfa4_0(active0, 0x200000000L); + case 68: + case 100: + return jjMoveStringLiteralDfa4_0(active0, 0x80000000L); + case 69: + case 101: + return jjMoveStringLiteralDfa4_0(active0, 0x1000000000L); + case 71: + case 103: + return jjMoveStringLiteralDfa4_0(active0, 0x100000040000000L); + case 78: + case 110: + return jjMoveStringLiteralDfa4_0(active0, 0x100000000L); + case 80: + case 112: + return jjMoveStringLiteralDfa4_0(active0, 0x20000000L); + default : + break; + } + return jjStartNfa_0(2, active0); +} +private int jjMoveStringLiteralDfa4_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(2, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(3, active0); + return 4; + } + switch(curChar) + { + case 40: + if ((active0 & 0x100000000000000L) != 0L) + return jjStopAtPos(4, 56); + break; + case 69: + case 101: + if ((active0 & 0x40000000L) != 0L) + return jjStartNfaWithStates_0(4, 30, 430); + break; + case 73: + case 105: + return jjMoveStringLiteralDfa5_0(active0, 0x80000000L); + case 79: + case 111: + return jjMoveStringLiteralDfa5_0(active0, 0x20000000L); + case 82: + case 114: + return jjMoveStringLiteralDfa5_0(active0, 0x1200000000L); + case 84: + case 116: + return jjMoveStringLiteralDfa5_0(active0, 0x100000000L); + default : + break; + } + return jjStartNfa_0(3, active0); +} +private int jjMoveStringLiteralDfa5_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(3, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(4, active0); + return 5; + } + switch(curChar) + { + case 45: + return jjMoveStringLiteralDfa6_0(active0, 0x100000000L); + case 65: + case 97: + if ((active0 & 0x80000000L) != 0L) + return jjStartNfaWithStates_0(5, 31, 430); + break; + case 73: + case 105: + return jjMoveStringLiteralDfa6_0(active0, 0x1000000000L); + case 82: + case 114: + return jjMoveStringLiteralDfa6_0(active0, 0x20000000L); + case 83: + case 115: + return jjMoveStringLiteralDfa6_0(active0, 0x200000000L); + default : + break; + } + return jjStartNfa_0(4, active0); +} +private int jjMoveStringLiteralDfa6_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(4, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(5, active0); + return 6; + } + switch(curChar) + { + case 69: + case 101: + return jjMoveStringLiteralDfa7_0(active0, 0x200000000L); + case 70: + case 102: + return jjMoveStringLiteralDfa7_0(active0, 0x100000000L); + case 84: + case 116: + if ((active0 & 0x20000000L) != 0L) + return jjStartNfaWithStates_0(6, 29, 430); + else if ((active0 & 0x1000000000L) != 0L) + return jjStartNfaWithStates_0(6, 36, 428); + break; + default : + break; + } + return jjStartNfa_0(5, active0); +} +private int jjMoveStringLiteralDfa7_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(5, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(6, active0); + return 7; + } + switch(curChar) + { + case 65: + case 97: + return jjMoveStringLiteralDfa8_0(active0, 0x100000000L); + case 84: + case 116: + if ((active0 & 0x200000000L) != 0L) + return jjStartNfaWithStates_0(7, 33, 430); + break; + default : + break; + } + return jjStartNfa_0(6, active0); +} +private int jjMoveStringLiteralDfa8_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(6, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(7, active0); + return 8; + } + switch(curChar) + { + case 67: + case 99: + return jjMoveStringLiteralDfa9_0(active0, 0x100000000L); + default : + break; + } + return jjStartNfa_0(7, active0); +} +private int jjMoveStringLiteralDfa9_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(7, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(8, active0); + return 9; + } + switch(curChar) + { + case 69: + case 101: + if ((active0 & 0x100000000L) != 0L) + return jjStartNfaWithStates_0(9, 32, 430); + break; + default : + break; + } + return jjStartNfa_0(8, active0); +} +private int jjStartNfaWithStates_0(int pos, int kind, int state) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return pos + 1; } + return jjMoveNfa_0(state, pos + 1); +} +static final long[] jjbitVec0 = { + 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL +}; +static final long[] jjbitVec2 = { + 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL +}; +private int jjMoveNfa_0(int startState, int curPos) +{ + int startsAt = 0; + jjnewStateCnt = 428; + int i = 1; + jjstateSet[0] = startState; + int kind = 0x7fffffff; + for (;;) + { + if (++jjround == 0x7fffffff) + ReInitRounds(); + if (curChar < 64) + { + long l = 1L << curChar; + do + { + switch(jjstateSet[--i]) + { + case 430: + case 61: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 34) + kind = 34; + { jjCheckNAddTwoStates(61, 62); } + break; + case 0: + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 54) + kind = 54; + { jjCheckNAddStates(0, 74); } + } + else if ((0x100003600L & l) != 0L) + { + if (kind > 1) + kind = 1; + { jjCheckNAddTwoStates(102, 103); } + } + else if (curChar == 46) + { jjCheckNAddStates(75, 93); } + else if (curChar == 33) + { jjCheckNAddTwoStates(91, 100); } + else if (curChar == 39) + { jjCheckNAddStates(94, 96); } + else if (curChar == 34) + { jjCheckNAddStates(97, 99); } + else if (curChar == 35) + { jjCheckNAddTwoStates(1, 2); } + break; + case 429: + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 60) + kind = 60; + { jjCheckNAdd(310); } + } + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 54) + kind = 54; + { jjCheckNAdd(309); } + } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(100, 102); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(276, 277); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(272, 275); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(269, 271); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(267, 268); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(264, 266); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(259, 263); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(255, 258); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(251, 254); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(248, 250); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(245, 247); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(242, 244); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(239, 241); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(236, 238); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(233, 235); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(230, 232); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(227, 229); } + break; + case 428: + if ((0x3ff200000000000L & l) != 0L) + { + if (kind > 58) + kind = 58; + { jjCheckNAddTwoStates(329, 330); } + } + else if (curChar == 40) + { + if (kind > 57) + kind = 57; + } + if ((0x3ff200000000000L & l) != 0L) + { jjCheckNAddStates(103, 105); } + break; + case 1: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 20) + kind = 20; + { jjCheckNAddTwoStates(1, 2); } + break; + case 3: + if ((0xffffffff00000000L & l) == 0L) + break; + if (kind > 20) + kind = 20; + { jjCheckNAddTwoStates(1, 2); } + break; + case 4: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 20) + kind = 20; + { jjCheckNAddStates(106, 113); } + break; + case 5: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 20) + kind = 20; + { jjCheckNAddStates(114, 116); } + break; + case 6: + if ((0x100003600L & l) == 0L) + break; + if (kind > 20) + kind = 20; + { jjCheckNAddTwoStates(1, 2); } + break; + case 7: + case 9: + case 12: + case 16: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(5); } + break; + case 8: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 9; + break; + case 10: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 11; + break; + case 11: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 12; + break; + case 13: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 14; + break; + case 14: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 15; + break; + case 15: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 16; + break; + case 17: + if (curChar == 34) + { jjCheckNAddStates(97, 99); } + break; + case 18: + if ((0xfffffffb00000200L & l) != 0L) + { jjCheckNAddStates(97, 99); } + break; + case 19: + if (curChar == 34 && kind > 21) + kind = 21; + break; + case 21: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(97, 99); } + break; + case 22: + if (curChar == 10) + { jjCheckNAddStates(97, 99); } + break; + case 23: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 22; + break; + case 24: + if ((0xffffffff00000000L & l) != 0L) + { jjCheckNAddStates(97, 99); } + break; + case 25: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(117, 125); } + break; + case 26: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(126, 129); } + break; + case 27: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(97, 99); } + break; + case 28: + case 30: + case 33: + case 37: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(26); } + break; + case 29: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 30; + break; + case 31: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 32; + break; + case 32: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 33; + break; + case 34: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 35; + break; + case 35: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 36; + break; + case 36: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 37; + break; + case 38: + if (curChar == 39) + { jjCheckNAddStates(94, 96); } + break; + case 39: + if ((0xffffff7f00000200L & l) != 0L) + { jjCheckNAddStates(94, 96); } + break; + case 40: + if (curChar == 39 && kind > 21) + kind = 21; + break; + case 42: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(94, 96); } + break; + case 43: + if (curChar == 10) + { jjCheckNAddStates(94, 96); } + break; + case 44: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 43; + break; + case 45: + if ((0xffffffff00000000L & l) != 0L) + { jjCheckNAddStates(94, 96); } + break; + case 46: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(130, 138); } + break; + case 47: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(139, 142); } + break; + case 48: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(94, 96); } + break; + case 49: + case 51: + case 54: + case 58: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(47); } + break; + case 50: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 51; + break; + case 52: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 53; + break; + case 53: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 54; + break; + case 55: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 56; + break; + case 56: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 57; + break; + case 57: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 58; + break; + case 63: + if ((0xffffffff00000000L & l) == 0L) + break; + if (kind > 34) + kind = 34; + { jjCheckNAddTwoStates(61, 62); } + break; + case 64: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 34) + kind = 34; + { jjCheckNAddStates(143, 150); } + break; + case 65: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 34) + kind = 34; + { jjCheckNAddStates(151, 153); } + break; + case 66: + if ((0x100003600L & l) == 0L) + break; + if (kind > 34) + kind = 34; + { jjCheckNAddTwoStates(61, 62); } + break; + case 67: + case 69: + case 72: + case 76: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(65); } + break; + case 68: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 69; + break; + case 70: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 71; + break; + case 71: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 72; + break; + case 73: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 74; + break; + case 74: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 75; + break; + case 75: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 76; + break; + case 78: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 34) + kind = 34; + { jjCheckNAddStates(154, 161); } + break; + case 79: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 34) + kind = 34; + { jjCheckNAddStates(162, 164); } + break; + case 80: + case 82: + case 85: + case 89: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(79); } + break; + case 81: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 82; + break; + case 83: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 84; + break; + case 84: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 85; + break; + case 86: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 87; + break; + case 87: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 88; + break; + case 88: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 89; + break; + case 90: + if (curChar == 33) + { jjCheckNAddTwoStates(91, 100); } + break; + case 91: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(91, 100); } + break; + case 101: + if ((0x100003600L & l) == 0L) + break; + if (kind > 1) + kind = 1; + { jjCheckNAddTwoStates(102, 103); } + break; + case 102: + if ((0x100003600L & l) == 0L) + break; + if (kind > 1) + kind = 1; + { jjCheckNAdd(102); } + break; + case 103: + if ((0x100003600L & l) == 0L) + break; + if (kind > 2) + kind = 2; + { jjCheckNAdd(103); } + break; + case 105: + if (curChar == 40) + { jjCheckNAddStates(165, 170); } + break; + case 106: + if ((0xfffffc7a00000000L & l) != 0L) + { jjCheckNAddStates(171, 174); } + break; + case 107: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(107, 108); } + break; + case 108: + if (curChar == 41 && kind > 24) + kind = 24; + break; + case 110: + if ((0xffffffff00000000L & l) != 0L) + { jjCheckNAddStates(171, 174); } + break; + case 111: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(175, 183); } + break; + case 112: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(184, 187); } + break; + case 113: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(171, 174); } + break; + case 114: + case 116: + case 119: + case 123: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(112); } + break; + case 115: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 116; + break; + case 117: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 118; + break; + case 118: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 119; + break; + case 120: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 121; + break; + case 121: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 122; + break; + case 122: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 123; + break; + case 124: + if (curChar == 39) + { jjCheckNAddStates(188, 190); } + break; + case 125: + if ((0xffffff7f00000200L & l) != 0L) + { jjCheckNAddStates(188, 190); } + break; + case 126: + if (curChar == 39) + { jjCheckNAddTwoStates(107, 108); } + break; + case 128: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(188, 190); } + break; + case 129: + if (curChar == 10) + { jjCheckNAddStates(188, 190); } + break; + case 130: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 129; + break; + case 131: + if ((0xffffffff00000000L & l) != 0L) + { jjCheckNAddStates(188, 190); } + break; + case 132: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(191, 199); } + break; + case 133: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(200, 203); } + break; + case 134: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(188, 190); } + break; + case 135: + case 137: + case 140: + case 144: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(133); } + break; + case 136: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 137; + break; + case 138: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 139; + break; + case 139: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 140; + break; + case 141: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 142; + break; + case 142: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 143; + break; + case 143: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 144; + break; + case 145: + if (curChar == 34) + { jjCheckNAddStates(204, 206); } + break; + case 146: + if ((0xfffffffb00000200L & l) != 0L) + { jjCheckNAddStates(204, 206); } + break; + case 147: + if (curChar == 34) + { jjCheckNAddTwoStates(107, 108); } + break; + case 149: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(204, 206); } + break; + case 150: + if (curChar == 10) + { jjCheckNAddStates(204, 206); } + break; + case 151: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 150; + break; + case 152: + if ((0xffffffff00000000L & l) != 0L) + { jjCheckNAddStates(204, 206); } + break; + case 153: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(207, 215); } + break; + case 154: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(216, 219); } + break; + case 155: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(204, 206); } + break; + case 156: + case 158: + case 161: + case 165: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(154); } + break; + case 157: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 158; + break; + case 159: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 160; + break; + case 160: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 161; + break; + case 162: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 163; + break; + case 163: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 164; + break; + case 164: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 165; + break; + case 166: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(220, 226); } + break; + case 169: + if (curChar == 43) + { jjCheckNAddStates(227, 229); } + break; + case 170: + case 199: + if (curChar == 63 && kind > 61) + kind = 61; + break; + case 171: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 61) + kind = 61; + { jjCheckNAddStates(230, 238); } + break; + case 172: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(173); } + break; + case 173: + if (curChar == 45) + jjstateSet[jjnewStateCnt++] = 174; + break; + case 174: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 61) + kind = 61; + { jjCheckNAddStates(239, 243); } + break; + case 175: + if ((0x3ff000000000000L & l) != 0L && kind > 61) + kind = 61; + break; + case 176: + case 178: + case 181: + case 185: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(175); } + break; + case 177: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 178; + break; + case 179: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 180; + break; + case 180: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 181; + break; + case 182: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 183; + break; + case 183: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 184; + break; + case 184: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 185; + break; + case 186: + case 188: + case 191: + case 195: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(172); } + break; + case 187: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 188; + break; + case 189: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 190; + break; + case 190: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 191; + break; + case 192: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 193; + break; + case 193: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 194; + break; + case 194: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 195; + break; + case 196: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 61) + kind = 61; + { jjCheckNAddStates(244, 246); } + break; + case 197: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 61) + kind = 61; + { jjCheckNAddStates(247, 249); } + break; + case 198: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 61) + kind = 61; + { jjCheckNAddStates(250, 252); } + break; + case 200: + case 203: + case 205: + case 206: + case 209: + case 210: + case 212: + case 216: + case 220: + case 223: + case 225: + if (curChar == 63) + { jjCheckNAdd(199); } + break; + case 201: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 61) + kind = 61; + { jjCheckNAddTwoStates(170, 175); } + break; + case 202: + if (curChar == 63) + { jjCheckNAddTwoStates(199, 203); } + break; + case 204: + if (curChar == 63) + { jjCheckNAddStates(253, 255); } + break; + case 207: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 206; + break; + case 208: + if (curChar == 63) + { jjCheckNAddStates(256, 259); } + break; + case 211: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 210; + break; + case 213: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 212; + break; + case 214: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 213; + break; + case 215: + if (curChar == 63) + { jjCheckNAddStates(260, 264); } + break; + case 217: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 216; + break; + case 218: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 217; + break; + case 219: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 218; + break; + case 221: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 220; + break; + case 222: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 221; + break; + case 224: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 223; + break; + case 226: + if (curChar == 46) + { jjCheckNAddStates(75, 93); } + break; + case 227: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(227, 229); } + break; + case 230: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(230, 232); } + break; + case 233: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(233, 235); } + break; + case 236: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(236, 238); } + break; + case 239: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(239, 241); } + break; + case 242: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(242, 244); } + break; + case 245: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(245, 247); } + break; + case 248: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(248, 250); } + break; + case 251: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(251, 254); } + break; + case 255: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(255, 258); } + break; + case 259: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(259, 263); } + break; + case 264: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(264, 266); } + break; + case 267: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(267, 268); } + break; + case 269: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(269, 271); } + break; + case 272: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(272, 275); } + break; + case 276: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(276, 277); } + break; + case 277: + if (curChar == 37 && kind > 52) + kind = 52; + break; + case 278: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(100, 102); } + break; + case 280: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 53) + kind = 53; + { jjCheckNAddTwoStates(280, 281); } + break; + case 282: + if ((0xffffffff00000000L & l) == 0L) + break; + if (kind > 53) + kind = 53; + { jjCheckNAddTwoStates(280, 281); } + break; + case 283: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 53) + kind = 53; + { jjCheckNAddStates(265, 272); } + break; + case 284: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 53) + kind = 53; + { jjCheckNAddStates(273, 275); } + break; + case 285: + if ((0x100003600L & l) == 0L) + break; + if (kind > 53) + kind = 53; + { jjCheckNAddTwoStates(280, 281); } + break; + case 286: + case 288: + case 291: + case 295: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(284); } + break; + case 287: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 288; + break; + case 289: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 290; + break; + case 290: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 291; + break; + case 292: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 293; + break; + case 293: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 294; + break; + case 294: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 295; + break; + case 297: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 53) + kind = 53; + { jjCheckNAddStates(276, 283); } + break; + case 298: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 53) + kind = 53; + { jjCheckNAddStates(284, 286); } + break; + case 299: + case 301: + case 304: + case 308: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(298); } + break; + case 300: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 301; + break; + case 302: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 303; + break; + case 303: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 304; + break; + case 305: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 306; + break; + case 306: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 307; + break; + case 307: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 308; + break; + case 309: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 54) + kind = 54; + { jjCheckNAdd(309); } + break; + case 310: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 60) + kind = 60; + { jjCheckNAdd(310); } + break; + case 312: + if ((0x3ff200000000000L & l) != 0L) + { jjCheckNAddStates(103, 105); } + break; + case 313: + if (curChar == 40 && kind > 57) + kind = 57; + break; + case 315: + if ((0xffffffff00000000L & l) != 0L) + { jjCheckNAddStates(103, 105); } + break; + case 316: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(287, 295); } + break; + case 317: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(296, 299); } + break; + case 318: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(103, 105); } + break; + case 319: + case 321: + case 324: + case 328: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(317); } + break; + case 320: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 321; + break; + case 322: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 323; + break; + case 323: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 324; + break; + case 325: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 326; + break; + case 326: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 327; + break; + case 327: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 328; + break; + case 329: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 58) + kind = 58; + { jjCheckNAddTwoStates(329, 330); } + break; + case 331: + if ((0xffffffff00000000L & l) == 0L) + break; + if (kind > 58) + kind = 58; + { jjCheckNAddTwoStates(329, 330); } + break; + case 332: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 58) + kind = 58; + { jjCheckNAddStates(300, 307); } + break; + case 333: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 58) + kind = 58; + { jjCheckNAddStates(308, 310); } + break; + case 334: + if ((0x100003600L & l) == 0L) + break; + if (kind > 58) + kind = 58; + { jjCheckNAddTwoStates(329, 330); } + break; + case 335: + case 337: + case 340: + case 344: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(333); } + break; + case 336: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 337; + break; + case 338: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 339; + break; + case 339: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 340; + break; + case 341: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 342; + break; + case 342: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 343; + break; + case 343: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 344; + break; + case 345: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 54) + kind = 54; + { jjCheckNAddStates(0, 74); } + break; + case 346: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(346, 229); } + break; + case 347: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(347, 348); } + break; + case 348: + if (curChar == 46) + { jjCheckNAdd(227); } + break; + case 349: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(349, 232); } + break; + case 350: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(350, 351); } + break; + case 351: + if (curChar == 46) + { jjCheckNAdd(230); } + break; + case 352: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(352, 235); } + break; + case 353: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(353, 354); } + break; + case 354: + if (curChar == 46) + { jjCheckNAdd(233); } + break; + case 355: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(355, 238); } + break; + case 356: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(356, 357); } + break; + case 357: + if (curChar == 46) + { jjCheckNAdd(236); } + break; + case 358: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(358, 241); } + break; + case 359: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(359, 360); } + break; + case 360: + if (curChar == 46) + { jjCheckNAdd(239); } + break; + case 361: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(361, 244); } + break; + case 362: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(362, 363); } + break; + case 363: + if (curChar == 46) + { jjCheckNAdd(242); } + break; + case 364: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(364, 247); } + break; + case 365: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(365, 366); } + break; + case 366: + if (curChar == 46) + { jjCheckNAdd(245); } + break; + case 367: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(367, 250); } + break; + case 368: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(368, 369); } + break; + case 369: + if (curChar == 46) + { jjCheckNAdd(248); } + break; + case 370: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(370, 254); } + break; + case 371: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(371, 372); } + break; + case 372: + if (curChar == 46) + { jjCheckNAdd(251); } + break; + case 373: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(373, 258); } + break; + case 374: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(374, 375); } + break; + case 375: + if (curChar == 46) + { jjCheckNAdd(255); } + break; + case 376: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(376, 263); } + break; + case 377: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(377, 378); } + break; + case 378: + if (curChar == 46) + { jjCheckNAdd(259); } + break; + case 379: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(379, 266); } + break; + case 380: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(380, 381); } + break; + case 381: + if (curChar == 46) + { jjCheckNAdd(264); } + break; + case 382: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(382, 268); } + break; + case 383: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(383, 384); } + break; + case 384: + if (curChar == 46) + { jjCheckNAdd(267); } + break; + case 385: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(385, 271); } + break; + case 386: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(386, 387); } + break; + case 387: + if (curChar == 46) + { jjCheckNAdd(269); } + break; + case 388: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(388, 275); } + break; + case 389: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(389, 390); } + break; + case 390: + if (curChar == 46) + { jjCheckNAdd(272); } + break; + case 391: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(391, 277); } + break; + case 392: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(392, 393); } + break; + case 393: + if (curChar == 46) + { jjCheckNAdd(276); } + break; + case 394: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(311, 313); } + break; + case 395: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(395, 396); } + break; + case 396: + if (curChar == 46) + { jjCheckNAdd(278); } + break; + case 397: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 54) + kind = 54; + { jjCheckNAdd(397); } + break; + case 398: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(398, 399); } + break; + case 399: + if (curChar == 46) + { jjCheckNAdd(309); } + break; + case 400: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 60) + kind = 60; + { jjCheckNAdd(400); } + break; + case 401: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(401, 402); } + break; + case 402: + if (curChar == 46) + { jjCheckNAdd(310); } + break; + case 404: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 58) + kind = 58; + { jjCheckNAddStates(314, 321); } + break; + case 405: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 58) + kind = 58; + { jjCheckNAddStates(322, 324); } + break; + case 406: + case 408: + case 411: + case 415: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(405); } + break; + case 407: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 408; + break; + case 409: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 410; + break; + case 410: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 411; + break; + case 412: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 413; + break; + case 413: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 414; + break; + case 414: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 415; + break; + case 416: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(325, 333); } + break; + case 417: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(334, 337); } + break; + case 418: + case 420: + case 423: + case 427: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(417); } + break; + case 419: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 420; + break; + case 421: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 422; + break; + case 422: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 423; + break; + case 424: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 425; + break; + case 425: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 426; + break; + case 426: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 427; + break; + default : break; + } + } while(i != startsAt); + } + else if (curChar < 128) + { + long l = 1L << (curChar & 077); + do + { + switch(jjstateSet[--i]) + { + case 60: + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 34) + kind = 34; + { jjCheckNAddTwoStates(61, 62); } + } + else if (curChar == 92) + { jjCheckNAddTwoStates(63, 78); } + break; + case 430: + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 34) + kind = 34; + { jjCheckNAddTwoStates(61, 62); } + } + else if (curChar == 92) + { jjCheckNAddTwoStates(63, 64); } + break; + case 0: + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 58) + kind = 58; + { jjCheckNAddStates(338, 342); } + } + else if (curChar == 92) + { jjCheckNAddStates(343, 346); } + else if (curChar == 64) + { jjAddStates(347, 348); } + if ((0x20000000200000L & l) != 0L) + { jjAddStates(349, 350); } + break; + case 428: + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 58) + kind = 58; + { jjCheckNAddTwoStates(329, 330); } + } + else if (curChar == 92) + { jjCheckNAddTwoStates(315, 316); } + if ((0x7fffffe87fffffeL & l) != 0L) + { jjCheckNAddStates(103, 105); } + else if (curChar == 92) + { jjCheckNAddTwoStates(331, 332); } + break; + case 1: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 20) + kind = 20; + { jjCheckNAddTwoStates(1, 2); } + break; + case 2: + if (curChar == 92) + { jjAddStates(351, 352); } + break; + case 3: + if ((0x7fffffffffffffffL & l) == 0L) + break; + if (kind > 20) + kind = 20; + { jjCheckNAddTwoStates(1, 2); } + break; + case 4: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 20) + kind = 20; + { jjCheckNAddStates(106, 113); } + break; + case 5: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 20) + kind = 20; + { jjCheckNAddStates(114, 116); } + break; + case 7: + case 9: + case 12: + case 16: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(5); } + break; + case 8: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 9; + break; + case 10: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 11; + break; + case 11: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 12; + break; + case 13: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 14; + break; + case 14: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 15; + break; + case 15: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 16; + break; + case 18: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(97, 99); } + break; + case 20: + if (curChar == 92) + { jjAddStates(353, 356); } + break; + case 24: + if ((0x7fffffffffffffffL & l) != 0L) + { jjCheckNAddStates(97, 99); } + break; + case 25: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(117, 125); } + break; + case 26: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(126, 129); } + break; + case 28: + case 30: + case 33: + case 37: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(26); } + break; + case 29: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 30; + break; + case 31: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 32; + break; + case 32: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 33; + break; + case 34: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 35; + break; + case 35: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 36; + break; + case 36: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 37; + break; + case 39: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(94, 96); } + break; + case 41: + if (curChar == 92) + { jjAddStates(357, 360); } + break; + case 45: + if ((0x7fffffffffffffffL & l) != 0L) + { jjCheckNAddStates(94, 96); } + break; + case 46: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(130, 138); } + break; + case 47: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(139, 142); } + break; + case 49: + case 51: + case 54: + case 58: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(47); } + break; + case 50: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 51; + break; + case 52: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 53; + break; + case 53: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 54; + break; + case 55: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 56; + break; + case 56: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 57; + break; + case 57: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 58; + break; + case 59: + if (curChar == 64) + { jjAddStates(347, 348); } + break; + case 61: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 34) + kind = 34; + { jjCheckNAddTwoStates(61, 62); } + break; + case 62: + if (curChar == 92) + { jjCheckNAddTwoStates(63, 64); } + break; + case 63: + if ((0x7fffffffffffffffL & l) == 0L) + break; + if (kind > 34) + kind = 34; + { jjCheckNAddTwoStates(61, 62); } + break; + case 64: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 34) + kind = 34; + { jjCheckNAddStates(143, 150); } + break; + case 65: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 34) + kind = 34; + { jjCheckNAddStates(151, 153); } + break; + case 67: + case 69: + case 72: + case 76: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(65); } + break; + case 68: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 69; + break; + case 70: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 71; + break; + case 71: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 72; + break; + case 73: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 74; + break; + case 74: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 75; + break; + case 75: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 76; + break; + case 77: + if (curChar == 92) + { jjCheckNAddTwoStates(63, 78); } + break; + case 78: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 34) + kind = 34; + { jjCheckNAddStates(154, 161); } + break; + case 79: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 34) + kind = 34; + { jjCheckNAddStates(162, 164); } + break; + case 80: + case 82: + case 85: + case 89: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(79); } + break; + case 81: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 82; + break; + case 83: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 84; + break; + case 84: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 85; + break; + case 86: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 87; + break; + case 87: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 88; + break; + case 88: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 89; + break; + case 92: + if ((0x10000000100000L & l) != 0L && kind > 35) + kind = 35; + break; + case 93: + if ((0x400000004000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 92; + break; + case 94: + if ((0x200000002L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 93; + break; + case 95: + if ((0x10000000100000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 94; + break; + case 96: + if ((0x4000000040000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 95; + break; + case 97: + if ((0x800000008000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 96; + break; + case 98: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 97; + break; + case 99: + if ((0x200000002000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 98; + break; + case 100: + if ((0x20000000200L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 99; + break; + case 104: + if ((0x20000000200000L & l) != 0L) + { jjAddStates(349, 350); } + break; + case 106: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(171, 174); } + break; + case 109: + if (curChar == 92) + { jjAddStates(361, 362); } + break; + case 110: + if ((0x7fffffffffffffffL & l) != 0L) + { jjCheckNAddStates(171, 174); } + break; + case 111: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(175, 183); } + break; + case 112: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(184, 187); } + break; + case 114: + case 116: + case 119: + case 123: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(112); } + break; + case 115: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 116; + break; + case 117: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 118; + break; + case 118: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 119; + break; + case 120: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 121; + break; + case 121: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 122; + break; + case 122: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 123; + break; + case 125: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(188, 190); } + break; + case 127: + if (curChar == 92) + { jjAddStates(363, 366); } + break; + case 131: + if ((0x7fffffffffffffffL & l) != 0L) + { jjCheckNAddStates(188, 190); } + break; + case 132: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(191, 199); } + break; + case 133: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(200, 203); } + break; + case 135: + case 137: + case 140: + case 144: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(133); } + break; + case 136: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 137; + break; + case 138: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 139; + break; + case 139: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 140; + break; + case 141: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 142; + break; + case 142: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 143; + break; + case 143: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 144; + break; + case 146: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(204, 206); } + break; + case 148: + if (curChar == 92) + { jjAddStates(367, 370); } + break; + case 152: + if ((0x7fffffffffffffffL & l) != 0L) + { jjCheckNAddStates(204, 206); } + break; + case 153: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(207, 215); } + break; + case 154: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(216, 219); } + break; + case 156: + case 158: + case 161: + case 165: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(154); } + break; + case 157: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 158; + break; + case 159: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 160; + break; + case 160: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 161; + break; + case 162: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 163; + break; + case 163: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 164; + break; + case 164: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 165; + break; + case 167: + if ((0x100000001000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 105; + break; + case 168: + if ((0x4000000040000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 167; + break; + case 171: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 61) + kind = 61; + { jjCheckNAddStates(230, 238); } + break; + case 172: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(173); } + break; + case 174: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 61) + kind = 61; + { jjCheckNAddStates(239, 243); } + break; + case 175: + if ((0x7e0000007eL & l) != 0L && kind > 61) + kind = 61; + break; + case 176: + case 178: + case 181: + case 185: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(175); } + break; + case 177: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 178; + break; + case 179: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 180; + break; + case 180: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 181; + break; + case 182: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 183; + break; + case 183: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 184; + break; + case 184: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 185; + break; + case 186: + case 188: + case 191: + case 195: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(172); } + break; + case 187: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 188; + break; + case 189: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 190; + break; + case 190: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 191; + break; + case 192: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 193; + break; + case 193: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 194; + break; + case 194: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 195; + break; + case 196: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 61) + kind = 61; + { jjCheckNAddStates(244, 246); } + break; + case 197: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 61) + kind = 61; + { jjCheckNAddStates(247, 249); } + break; + case 198: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 61) + kind = 61; + { jjCheckNAddStates(250, 252); } + break; + case 201: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 61) + kind = 61; + { jjCheckNAddTwoStates(170, 175); } + break; + case 228: + if ((0x200000002000L & l) != 0L && kind > 37) + kind = 37; + break; + case 229: + if ((0x2000000020L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 228; + break; + case 231: + if ((0x100000001000000L & l) != 0L && kind > 38) + kind = 38; + break; + case 232: + if ((0x2000000020L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 231; + break; + case 234: + if ((0x100000001000000L & l) != 0L && kind > 39) + kind = 39; + break; + case 235: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 234; + break; + case 237: + if ((0x200000002000L & l) != 0L && kind > 40) + kind = 40; + break; + case 238: + if ((0x800000008L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 237; + break; + case 240: + if ((0x200000002000L & l) != 0L && kind > 41) + kind = 41; + break; + case 241: + if ((0x200000002000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 240; + break; + case 243: + if ((0x400000004000L & l) != 0L && kind > 42) + kind = 42; + break; + case 244: + if ((0x20000000200L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 243; + break; + case 246: + if ((0x10000000100000L & l) != 0L && kind > 43) + kind = 43; + break; + case 247: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 246; + break; + case 249: + if ((0x800000008L & l) != 0L && kind > 44) + kind = 44; + break; + case 250: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 249; + break; + case 252: + if ((0x8000000080L & l) != 0L && kind > 45) + kind = 45; + break; + case 253: + if ((0x2000000020L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 252; + break; + case 254: + if ((0x1000000010L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 253; + break; + case 256: + if ((0x1000000010L & l) != 0L && kind > 46) + kind = 46; + break; + case 257: + if ((0x200000002L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 256; + break; + case 258: + if ((0x4000000040000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 257; + break; + case 260: + if ((0x1000000010L & l) != 0L && kind > 47) + kind = 47; + break; + case 261: + if ((0x200000002L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 260; + break; + case 262: + if ((0x4000000040000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 261; + break; + case 263: + if ((0x8000000080L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 262; + break; + case 265: + if ((0x8000000080000L & l) != 0L && kind > 48) + kind = 48; + break; + case 266: + if ((0x200000002000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 265; + break; + case 268: + if ((0x8000000080000L & l) != 0L && kind > 49) + kind = 49; + break; + case 270: + if ((0x400000004000000L & l) != 0L && kind > 50) + kind = 50; + break; + case 271: + if ((0x10000000100L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 270; + break; + case 273: + if ((0x400000004000000L & l) != 0L && kind > 51) + kind = 51; + break; + case 274: + if ((0x10000000100L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 273; + break; + case 275: + if ((0x80000000800L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 274; + break; + case 279: + case 280: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 53) + kind = 53; + { jjCheckNAddTwoStates(280, 281); } + break; + case 281: + if (curChar == 92) + { jjCheckNAddTwoStates(282, 283); } + break; + case 282: + if ((0x7fffffffffffffffL & l) == 0L) + break; + if (kind > 53) + kind = 53; + { jjCheckNAddTwoStates(280, 281); } + break; + case 283: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 53) + kind = 53; + { jjCheckNAddStates(265, 272); } + break; + case 284: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 53) + kind = 53; + { jjCheckNAddStates(273, 275); } + break; + case 286: + case 288: + case 291: + case 295: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(284); } + break; + case 287: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 288; + break; + case 289: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 290; + break; + case 290: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 291; + break; + case 292: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 293; + break; + case 293: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 294; + break; + case 294: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 295; + break; + case 296: + if (curChar == 92) + { jjCheckNAddTwoStates(282, 297); } + break; + case 297: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 53) + kind = 53; + { jjCheckNAddStates(276, 283); } + break; + case 298: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 53) + kind = 53; + { jjCheckNAddStates(284, 286); } + break; + case 299: + case 301: + case 304: + case 308: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(298); } + break; + case 300: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 301; + break; + case 302: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 303; + break; + case 303: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 304; + break; + case 305: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 306; + break; + case 306: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 307; + break; + case 307: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 308; + break; + case 311: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 58) + kind = 58; + { jjCheckNAddStates(338, 342); } + break; + case 312: + if ((0x7fffffe87fffffeL & l) != 0L) + { jjCheckNAddStates(103, 105); } + break; + case 314: + if (curChar == 92) + { jjCheckNAddTwoStates(315, 316); } + break; + case 315: + if ((0x7fffffffffffffffL & l) != 0L) + { jjCheckNAddStates(103, 105); } + break; + case 316: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(287, 295); } + break; + case 317: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(296, 299); } + break; + case 319: + case 321: + case 324: + case 328: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(317); } + break; + case 320: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 321; + break; + case 322: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 323; + break; + case 323: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 324; + break; + case 325: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 326; + break; + case 326: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 327; + break; + case 327: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 328; + break; + case 329: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 58) + kind = 58; + { jjCheckNAddTwoStates(329, 330); } + break; + case 330: + if (curChar == 92) + { jjCheckNAddTwoStates(331, 332); } + break; + case 331: + if ((0x7fffffffffffffffL & l) == 0L) + break; + if (kind > 58) + kind = 58; + { jjCheckNAddTwoStates(329, 330); } + break; + case 332: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 58) + kind = 58; + { jjCheckNAddStates(300, 307); } + break; + case 333: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 58) + kind = 58; + { jjCheckNAddStates(308, 310); } + break; + case 335: + case 337: + case 340: + case 344: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(333); } + break; + case 336: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 337; + break; + case 338: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 339; + break; + case 339: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 340; + break; + case 341: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 342; + break; + case 342: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 343; + break; + case 343: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 344; + break; + case 403: + if (curChar == 92) + { jjCheckNAddStates(343, 346); } + break; + case 404: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 58) + kind = 58; + { jjCheckNAddStates(314, 321); } + break; + case 405: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 58) + kind = 58; + { jjCheckNAddStates(322, 324); } + break; + case 406: + case 408: + case 411: + case 415: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(405); } + break; + case 407: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 408; + break; + case 409: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 410; + break; + case 410: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 411; + break; + case 412: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 413; + break; + case 413: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 414; + break; + case 414: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 415; + break; + case 416: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(325, 333); } + break; + case 417: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(334, 337); } + break; + case 418: + case 420: + case 423: + case 427: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(417); } + break; + case 419: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 420; + break; + case 421: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 422; + break; + case 422: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 423; + break; + case 424: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 425; + break; + case 425: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 426; + break; + case 426: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 427; + break; + default : break; + } + } while(i != startsAt); + } + else + { + int hiByte = (curChar >> 8); + int i1 = hiByte >> 6; + long l1 = 1L << (hiByte & 077); + int i2 = (curChar & 0xff) >> 6; + long l2 = 1L << (curChar & 077); + do + { + switch(jjstateSet[--i]) + { + case 60: + case 63: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 34) + kind = 34; + { jjCheckNAddTwoStates(61, 62); } + break; + case 430: + case 61: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 34) + kind = 34; + { jjCheckNAddTwoStates(61, 62); } + break; + case 0: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 58) + kind = 58; + { jjCheckNAddStates(338, 342); } + break; + case 428: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(103, 105); } + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { + if (kind > 58) + kind = 58; + { jjCheckNAddTwoStates(329, 330); } + } + break; + case 1: + case 3: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 20) + kind = 20; + { jjCheckNAddTwoStates(1, 2); } + break; + case 18: + case 24: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(97, 99); } + break; + case 39: + case 45: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(94, 96); } + break; + case 106: + case 110: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(171, 174); } + break; + case 125: + case 131: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(188, 190); } + break; + case 146: + case 152: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(204, 206); } + break; + case 279: + case 280: + case 282: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 53) + kind = 53; + { jjCheckNAddTwoStates(280, 281); } + break; + case 312: + case 315: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(103, 105); } + break; + case 329: + case 331: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 58) + kind = 58; + { jjCheckNAddTwoStates(329, 330); } + break; + default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break; + } + } while(i != startsAt); + } + if (kind != 0x7fffffff) + { + jjmatchedKind = kind; + jjmatchedPos = curPos; + kind = 0x7fffffff; + } + ++curPos; + if ((i = jjnewStateCnt) == (startsAt = 428 - (jjnewStateCnt = startsAt))) + return curPos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return curPos; } + } +} +private int jjMoveStringLiteralDfa0_1(){ + switch(curChar) + { + case 42: + return jjMoveStringLiteralDfa1_1(0x10L); + default : + return 1; + } +} +private int jjMoveStringLiteralDfa1_1(long active0){ + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + return 1; + } + switch(curChar) + { + case 47: + if ((active0 & 0x10L) != 0L) + return jjStopAtPos(1, 4); + break; + default : + return 2; + } + return 2; +} + +/** Token literal values. */ +public static final String[] jjstrLiteralImages = { +"", null, null, null, null, null, "\173", "\175", "\54", "\56", "\73", "\72", +"\52", "\57", "\53", "\55", "\75", "\76", "\133", "\135", null, null, "\51", null, +null, "\74\41\55\55", "\55\55\76", "\176\75", "\174\75", 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, }; +protected Token jjFillToken() +{ + final Token t; + final String curTokenImage; + final int beginLine; + final int endLine; + final int beginColumn; + final int endColumn; + if (jjmatchedPos < 0) + { + if (image == null) + curTokenImage = ""; + else + curTokenImage = image.toString(); + beginLine = endLine = input_stream.getEndLine(); + beginColumn = endColumn = input_stream.getEndColumn(); + } + else + { + String im = jjstrLiteralImages[jjmatchedKind]; + curTokenImage = (im == null) ? input_stream.GetImage() : im; + beginLine = input_stream.getBeginLine(); + beginColumn = input_stream.getBeginColumn(); + endLine = input_stream.getEndLine(); + endColumn = input_stream.getEndColumn(); + } + t = Token.newToken(jjmatchedKind); + t.kind = jjmatchedKind; + t.image = curTokenImage; + + t.beginLine = beginLine; + t.endLine = endLine; + t.beginColumn = beginColumn; + t.endColumn = endColumn; + + return t; +} +static final int[] jjnextStates = { + 346, 347, 348, 229, 349, 350, 351, 232, 352, 353, 354, 235, 355, 356, 357, 238, + 358, 359, 360, 241, 361, 362, 363, 244, 364, 365, 366, 247, 367, 368, 369, 250, + 370, 371, 372, 254, 373, 374, 375, 258, 376, 377, 378, 263, 379, 380, 381, 266, + 382, 383, 384, 268, 385, 386, 387, 271, 388, 389, 390, 275, 391, 392, 393, 277, + 394, 395, 396, 279, 397, 398, 399, 400, 401, 402, 296, 227, 230, 233, 236, 239, + 242, 245, 248, 251, 255, 259, 264, 267, 269, 272, 276, 278, 309, 310, 39, 40, + 41, 18, 19, 20, 278, 279, 296, 312, 313, 314, 1, 5, 7, 8, 10, 13, + 6, 2, 1, 6, 2, 18, 26, 28, 29, 31, 34, 27, 19, 20, 18, 27, + 19, 20, 39, 47, 49, 50, 52, 55, 48, 40, 41, 39, 48, 40, 41, 61, + 65, 67, 68, 70, 73, 66, 62, 61, 66, 62, 79, 80, 81, 83, 86, 66, + 61, 62, 66, 61, 62, 106, 124, 145, 108, 109, 166, 106, 107, 108, 109, 106, + 112, 114, 115, 117, 120, 108, 109, 113, 106, 108, 109, 113, 125, 126, 127, 125, + 133, 135, 136, 138, 141, 134, 126, 127, 125, 134, 126, 127, 146, 147, 148, 146, + 154, 156, 157, 159, 162, 155, 147, 148, 146, 155, 147, 148, 106, 124, 145, 107, + 108, 109, 166, 170, 171, 215, 172, 186, 187, 189, 192, 173, 170, 196, 208, 175, + 176, 177, 179, 182, 170, 197, 204, 170, 198, 202, 170, 200, 201, 199, 205, 207, + 199, 209, 211, 214, 219, 222, 224, 225, 199, 280, 284, 286, 287, 289, 292, 285, + 281, 280, 285, 281, 298, 299, 300, 302, 305, 285, 280, 281, 285, 280, 281, 312, + 317, 319, 320, 322, 325, 318, 313, 314, 312, 318, 313, 314, 329, 333, 335, 336, + 338, 341, 334, 330, 329, 334, 330, 394, 279, 296, 405, 406, 407, 409, 412, 334, + 329, 330, 334, 329, 330, 417, 418, 419, 421, 424, 318, 312, 313, 314, 318, 312, + 313, 314, 312, 313, 329, 330, 314, 315, 331, 404, 416, 60, 77, 168, 169, 3, + 4, 21, 23, 24, 25, 42, 44, 45, 46, 110, 111, 128, 130, 131, 132, 149, + 151, 152, 153, +}; +private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) +{ + switch(hiByte) + { + case 0: + return ((jjbitVec2[i2] & l2) != 0L); + default : + if ((jjbitVec0[i1] & l1) != 0L) + return true; + return false; + } +} + +int curLexState = 0; +int defaultLexState = 0; +int jjnewStateCnt; +int jjround; +int jjmatchedPos; +int jjmatchedKind; + +/** Get the next Token. */ +public Token getNextToken() +{ + Token matchedToken; + int curPos = 0; + + EOFLoop : + for (;;) + { + try + { + curChar = input_stream.BeginToken(); + } + catch(Exception e) + { + jjmatchedKind = 0; + jjmatchedPos = -1; + matchedToken = jjFillToken(); + return matchedToken; + } + image = jjimage; + image.setLength(0); + jjimageLen = 0; + + for (;;) + { + switch(curLexState) + { + case 0: + jjmatchedKind = 2; + jjmatchedPos = -1; + curPos = 0; + curPos = jjMoveStringLiteralDfa0_0(); + if (jjmatchedPos < 0 || (jjmatchedPos == 0 && jjmatchedKind > 79)) + { + jjmatchedKind = 79; + jjmatchedPos = 0; + } + break; + case 1: + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_1(); + if (jjmatchedPos == 0 && jjmatchedKind > 5) + { + jjmatchedKind = 5; + } + break; + } + if (jjmatchedKind != 0x7fffffff) + { + if (jjmatchedPos + 1 < curPos) + input_stream.backup(curPos - jjmatchedPos - 1); + if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + matchedToken = jjFillToken(); + TokenLexicalActions(matchedToken); + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + return matchedToken; + } + else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + continue EOFLoop; + } + jjimageLen += jjmatchedPos + 1; + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + curPos = 0; + jjmatchedKind = 0x7fffffff; + try { + curChar = input_stream.readChar(); + continue; + } + catch (java.io.IOException e1) { } + } + int error_line = input_stream.getEndLine(); + int error_column = input_stream.getEndColumn(); + String error_after = null; + boolean EOFSeen = false; + try { input_stream.readChar(); input_stream.backup(1); } + catch (java.io.IOException e1) { + EOFSeen = true; + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + if (curChar == '\n' || curChar == '\r') { + error_line++; + error_column = 0; + } + else + error_column++; + } + if (!EOFSeen) { + input_stream.backup(1); + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + } + throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); + } + } +} + +void SkipLexicalActions(Token matchedToken) +{ + switch(jjmatchedKind) + { + default : + break; + } +} +void MoreLexicalActions() +{ + jjimageLen += (lengthOfMatch = jjmatchedPos + 1); + switch(jjmatchedKind) + { + default : + break; + } +} +void TokenLexicalActions(Token matchedToken) +{ + switch(jjmatchedKind) + { + case 21 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 1, 1); + break; + case 24 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimUrl(image); + break; + case 37 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 38 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 39 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 40 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 41 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 42 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 43 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 44 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 45 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 3); + break; + case 46 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 3); + break; + case 47 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 4); + break; + case 48 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 49 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 1); + break; + case 50 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 51 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 3); + break; + case 52 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 1); + break; + default : + break; + } +} +private void jjCheckNAdd(int state) +{ + if (jjrounds[state] != jjround) + { + jjstateSet[jjnewStateCnt++] = state; + jjrounds[state] = jjround; + } +} +private void jjAddStates(int start, int end) +{ + do { + jjstateSet[jjnewStateCnt++] = jjnextStates[start]; + } while (start++ != end); +} +private void jjCheckNAddTwoStates(int state1, int state2) +{ + jjCheckNAdd(state1); + jjCheckNAdd(state2); +} + +private void jjCheckNAddStates(int start, int end) +{ + do { + jjCheckNAdd(jjnextStates[start]); + } while (start++ != end); +} + + /** Constructor. */ + public SACParserCSS2TokenManager(CharStream stream){ + + + input_stream = stream; + } + + /** Constructor. */ + public SACParserCSS2TokenManager (CharStream stream, int lexState){ + ReInit(stream); + SwitchTo(lexState); + } + + /** Reinitialise parser. */ + + public void ReInit(CharStream stream) + { + + + jjmatchedPos = + jjnewStateCnt = + 0; + curLexState = defaultLexState; + input_stream = stream; + ReInitRounds(); + } + + private void ReInitRounds() + { + int i; + jjround = 0x80000001; + for (i = 428; i-- > 0;) + jjrounds[i] = 0x80000000; + } + + /** Reinitialise parser. */ + public void ReInit(CharStream stream, int lexState) + + { + ReInit(stream); + SwitchTo(lexState); + } + + /** Switch to specified lex state. */ + public void SwitchTo(int lexState) + { + if (lexState >= 2 || lexState < 0) + throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); + else + curLexState = lexState; + } + + +/** Lexer state names. */ +public static final String[] lexStateNames = { + "DEFAULT", + "COMMENT", +}; + +/** Lex State array. */ +public static final int[] jjnewLexState = { + -1, -1, -1, 1, 0, -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 = { + 0x37ffffffff7fffc7L, 0x8000L, +}; +static final long[] jjtoSkip = { + 0x10L, 0x0L, +}; +static final long[] jjtoSpecial = { + 0x0L, 0x0L, +}; +static final long[] jjtoMore = { + 0x28L, 0x0L, +}; + protected CharStream input_stream; + + private final int[] jjrounds = new int[428]; + private final int[] jjstateSet = new int[2 * 428]; + private final StringBuilder jjimage = new StringBuilder(); + private StringBuilder image = jjimage; + private int jjimageLen; + private int lengthOfMatch; + protected int curChar; +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS3.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS3.java new file mode 100644 index 000000000..01f16243b --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS3.java @@ -0,0 +1,3420 @@ +/* SACParserCSS3.java */ +/* Generated By:JavaCC: Do not edit this line. SACParserCSS3.java */ +package com.fr.third.steadystate.css.parser; + +import java.util.LinkedList; +import java.util.Locale; + +import com.fr.third.steadystate.css.dom.CSSValueImpl; +import com.fr.third.steadystate.css.dom.Property; +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.media.MediaQuery; +import com.fr.third.steadystate.css.util.LangUtils; +import org.w3c.css.sac.CSSParseException; +import org.w3c.css.sac.Condition; +import org.w3c.css.sac.LexicalUnit; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.Parser; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SelectorList; +import org.w3c.css.sac.SimpleSelector; + +/** + * @author David Schweinsberg + * @author waldbaer + * @author Ahmed Ashour + * @author rbri + */ +@SuppressWarnings("all") public class SACParserCSS3 extends AbstractSACParser implements SACParserCSS3Constants { + + public SACParserCSS3() { + this((CharStream) null); + } + + public String getParserVersion() { + return "http://www.w3.org/Style/CSS/"; + } + + protected String getGrammarUri() + { + return "http://www.w3.org/TR/WD-css3-syntax-20030813"; + } + +// +// stylesheet +// : [ CHARSET_SYM STRING ';' ]? +// [S|CDO|CDC]* [ import [S|CDO|CDC]* ]* +// [ [ ruleset | media | page | font_face ] [S|CDO|CDC]* ]* +// ; +// + final public void styleSheet() throws ParseException { + try { +handleStartDocument(); + styleSheetRuleList(); + jj_consume_token(0); + } finally { +handleEndDocument(); + } +} + + final public void styleSheetRuleList() throws ParseException {boolean ruleFound = false; + label_1: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S: + case CDO: + case CDC:{ + ; + break; + } + default: + jj_la1[0] = jj_gen; + break label_1; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + jj_consume_token(S); + break; + } + case CDO:{ + jj_consume_token(CDO); + break; + } + case CDC:{ + jj_consume_token(CDC); + break; + } + default: + jj_la1[1] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case CHARSET_SYM:{ + charsetRule(); + label_2: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S: + case CDO: + case CDC:{ + ; + break; + } + default: + jj_la1[2] = jj_gen; + break label_2; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + jj_consume_token(S); + break; + } + case CDO:{ + jj_consume_token(CDO); + break; + } + case CDC:{ + jj_consume_token(CDC); + break; + } + default: + jj_la1[3] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + } + default: + jj_la1[4] = jj_gen; + ; + } + label_3: + while (true) { + ; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH: + case IMPORT_SYM: + case PAGE_SYM: + case MEDIA_SYM: + case FONT_FACE_SYM: + case ATKEYWORD:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IMPORT_SYM:{ + importRule(ruleFound); + break; + } + case IDENT: + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH: + case PAGE_SYM: + case MEDIA_SYM: + case FONT_FACE_SYM: + case ATKEYWORD:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH:{ + styleRule(); + break; + } + case MEDIA_SYM:{ + mediaRule(); + break; + } + case PAGE_SYM:{ + pageRule(); + break; + } + case FONT_FACE_SYM:{ + fontFaceRule(); + break; + } + case ATKEYWORD:{ + unknownAtRule(); + break; + } + default: + jj_la1[5] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +ruleFound = true; + break; + } + default: + jj_la1[6] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + } + default: + jj_la1[7] = jj_gen; +ParseException e = generateParseException(); + invalidRule(); +Token t = getNextToken(); + + boolean charsetProcessed = false; + if (t.kind == CHARSET_SYM) { + t = getNextToken(); + if (t.kind == S) { + t = getNextToken(); + if (t.kind == STRING) { + t = getNextToken(); + if (t.kind == SEMICOLON) { + getNextToken(); + charsetProcessed = true; + } + } + } + CSSParseException cpe = toCSSParseException("misplacedCharsetRule", e); + getErrorHandler().error(cpe); + getErrorHandler().warning(createSkipWarning("ignoringRule", cpe)); + } + + if (!charsetProcessed) { + if (t.kind == EOF) { + {if ("" != null) return;} + } + + CSSParseException cpe = toCSSParseException("invalidRule", e); + getErrorHandler().error(cpe); + getErrorHandler().warning(createSkipWarning("ignoringRule", cpe)); + while (t.kind != RBRACE && t.kind != EOF ) { + t = getNextToken(); + } + if (t.kind == EOF) { + {if ("" != null) return;} + } + } + } + label_4: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S: + case CDO: + case CDC:{ + ; + break; + } + default: + jj_la1[8] = jj_gen; + break label_4; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + jj_consume_token(S); + break; + } + case CDO:{ + jj_consume_token(CDO); + break; + } + case CDC:{ + jj_consume_token(CDC); + break; + } + default: + jj_la1[9] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } +} + + void invalidRule() throws ParseException { + } + +// +// This is used by ASTStyleSheet.insertRule to parse a single rule +// + final public void styleSheetRuleSingle() throws ParseException { + label_5: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[10] = jj_gen; + break label_5; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case CHARSET_SYM:{ + charsetRule(); + break; + } + case IMPORT_SYM:{ + importRule(false); + break; + } + case IDENT: + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH:{ + styleRule(); + break; + } + case MEDIA_SYM:{ + mediaRule(); + break; + } + case PAGE_SYM:{ + pageRule(); + break; + } + case FONT_FACE_SYM:{ + fontFaceRule(); + break; + } + case ATKEYWORD:{ + unknownAtRule(); + break; + } + default: + jj_la1[11] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_6: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[12] = jj_gen; + break label_6; + } + jj_consume_token(S); + } +} + + final public void charsetRule() throws ParseException {Token t; + Locator locator; + try { + jj_consume_token(CHARSET_SYM); +locator = createLocator(token); + jj_consume_token(S); + t = jj_consume_token(STRING); + jj_consume_token(SEMICOLON); +handleCharset(t.toString(), locator); + } catch (ParseException e) { +getErrorHandler().error(toCSSParseException("invalidCharsetRule", e)); + } +} + + final public void unknownAtRule() throws ParseException {String s; + Locator locator; + try { + jj_consume_token(ATKEYWORD); +locator = createLocator(token); + s = skip(); + handleIgnorableAtRule(s, locator); + } catch (ParseException e) { +getErrorHandler().error(toCSSParseException("invalidUnknownRule", generateParseException())); + } +} + +// +// import +// : IMPORT_SYM S* +// [STRING|URI] S* [ medium [ COMMA S* medium]* ]? ';' S* +// ; +// + final public void importRule(final boolean nonImportRuleFoundBefore) throws ParseException {Token t; + SACMediaListImpl ml = new SACMediaListImpl(); + Locator locator; + try { +ParseException e = null; + if (nonImportRuleFoundBefore) + { + e = generateParseException(); + } + jj_consume_token(IMPORT_SYM); +locator = createLocator(token); + label_7: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[13] = jj_gen; + break label_7; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case STRING:{ + t = jj_consume_token(STRING); + break; + } + case URI:{ + t = jj_consume_token(URI); + break; + } + default: + jj_la1[14] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_8: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[15] = jj_gen; + break label_8; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case NOT: + case ONLY: + case IDENT: + case LROUND:{ + mediaList(ml); + break; + } + default: + jj_la1[16] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); +if (nonImportRuleFoundBefore) + { + getErrorHandler().error(toCSSParseException("invalidImportRuleIgnored2", e)); + } + else + { + handleImportStyle(unescape(t.image, false), ml, null, locator); + } + } catch (CSSParseException e) { +getErrorHandler().error(e); + error_skipAtRule(); + } catch (ParseException e) { +getErrorHandler().error(toCSSParseException("invalidImportRule", e)); + error_skipAtRule(); + } +} + +// +// media +// : MEDIA_SYM S* medium [ COMMA S* medium ]* '{' S* ruleset* '}' S* +// ; +// + final public void mediaRule() throws ParseException {boolean start = false; + SACMediaListImpl ml = new SACMediaListImpl(); + Locator locator; + try { + jj_consume_token(MEDIA_SYM); +locator = createLocator(token); + label_9: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[17] = jj_gen; + break label_9; + } + jj_consume_token(S); + } + mediaList(ml); +start = true; + handleStartMedia(ml, locator); + jj_consume_token(LBRACE); + label_10: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[18] = jj_gen; + break label_10; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH: + case IMPORT_SYM: + case PAGE_SYM: + case MEDIA_SYM: + case ATKEYWORD:{ + mediaRuleList(); + break; + } + default: + jj_la1[19] = jj_gen; + ; + } + jj_consume_token(RBRACE); + } catch (CSSParseException e) { +getErrorHandler().error(e); + error_skipblock("ignoringRule", e); + } catch (ParseException e) { +CSSParseException cpe = toCSSParseException("invalidMediaRule", e); + getErrorHandler().error(cpe); + error_skipblock("ignoringRule", cpe); + } finally { +if (start) { + handleEndMedia(ml); + } + } +} + + final public void mediaList(SACMediaListImpl ml) throws ParseException {MediaQuery mq; + try { + mq = mediaQuery(); +ml.setLocator(createLocator(token)); + label_11: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[20] = jj_gen; + break label_11; + } + jj_consume_token(COMMA); + label_12: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[21] = jj_gen; + break label_12; + } + jj_consume_token(S); + } +ml.add(mq); + mq = mediaQuery(); + } +ml.add(mq); + } catch (ParseException e) { +throw toCSSParseException("invalidMediaList", e); + } +} + +// +// media_query +// : [ONLY | NOT]? S* media_type S* [ AND S* expression ]* +// | expression [ AND S* expression ]* +// ; +// + final public MediaQuery mediaQuery() throws ParseException {String s; + MediaQuery mq; + Property p; + boolean only = false; + boolean not = false; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case NOT: + case ONLY: + case IDENT:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case NOT: + case ONLY:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ONLY:{ + jj_consume_token(ONLY); +only = true; + break; + } + case NOT:{ + jj_consume_token(NOT); +not = true; + break; + } + default: + jj_la1[22] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_13: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[23] = jj_gen; + break label_13; + } + jj_consume_token(S); + } + break; + } + default: + jj_la1[24] = jj_gen; + ; + } + s = medium(); +mq = new MediaQuery(s, only, not); mq.setLocator(createLocator(token)); + label_14: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case AND:{ + ; + break; + } + default: + jj_la1[25] = jj_gen; + break label_14; + } + jj_consume_token(AND); + label_15: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[26] = jj_gen; + break label_15; + } + jj_consume_token(S); + } + p = mediaExpression(); +mq.addMediaProperty(p); + } + break; + } + case LROUND:{ + p = mediaExpression(); +s = "all"; + handleMedium(s, null); + mq = new MediaQuery(s, only, not); + mq.setLocator(createLocator(token)); + mq.addMediaProperty(p); + label_16: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case AND:{ + ; + break; + } + default: + jj_la1[27] = jj_gen; + break label_16; + } + jj_consume_token(AND); + label_17: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[28] = jj_gen; + break label_17; + } + jj_consume_token(S); + } + p = mediaExpression(); +mq.addMediaProperty(p); + } + break; + } + default: + jj_la1[29] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return mq; +} + +// +// expression +// : '(' S* media_feature S* [ ':' S* expr ]? ')' S* +// ; +// + final public Property mediaExpression() throws ParseException {String p; + LexicalUnit e = null; + Property prop; + jj_consume_token(LROUND); + label_18: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[30] = jj_gen; + break label_18; + } + jj_consume_token(S); + } + p = property(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COLON:{ + jj_consume_token(COLON); + label_19: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[31] = jj_gen; + break label_19; + } + jj_consume_token(S); + } + e = expr(); + break; + } + default: + jj_la1[32] = jj_gen; + ; + } + jj_consume_token(RROUND); + label_20: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[33] = jj_gen; + break label_20; + } + jj_consume_token(S); + } +if(e==null) + { + prop = new Property(p, null, false); + } + else + { + prop = new Property(p, new CSSValueImpl(e), false); + } + return prop; +} + + final public void mediaRuleList() throws ParseException { + label_21: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH:{ + styleRule(); + break; + } + case MEDIA_SYM:{ + mediaRule(); + break; + } + case PAGE_SYM:{ + pageRule(); + break; + } + case IMPORT_SYM:{ + importRule(true); + break; + } + case ATKEYWORD:{ + unknownAtRule(); + break; + } + default: + jj_la1[34] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_22: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[35] = jj_gen; + break label_22; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case DOT: + case COLON: + case ASTERISK: + case LSQUARE: + case HASH: + case IMPORT_SYM: + case PAGE_SYM: + case MEDIA_SYM: + case ATKEYWORD:{ + ; + break; + } + default: + jj_la1[36] = jj_gen; + break label_21; + } + } +} + +// +// medium +// : IDENT S* +// ; +// + final public String medium() throws ParseException {Token t; + String medium; + t = jj_consume_token(IDENT); + label_23: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[37] = jj_gen; + break label_23; + } + jj_consume_token(S); + } +medium = unescape(t.image, false); + handleMedium(medium, createLocator(t)); + return medium; +} + +// +// page +// : PAGE_SYM S* pseudo_page? S* +// '{' S* declaration [ ';' S* declaration ]* '}' S* +// ; +// + final public void pageRule() throws ParseException {String sel = null; + boolean start = false; + Locator locator; + try { + jj_consume_token(PAGE_SYM); +locator = createLocator(token); + label_24: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[38] = jj_gen; + break label_24; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case COLON:{ + sel = pageSelectorList(); + break; + } + default: + jj_la1[39] = jj_gen; + ; + } + jj_consume_token(LBRACE); + label_25: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[40] = jj_gen; + break label_25; + } + jj_consume_token(S); + } +start = true; + handleStartPage(null, sel, locator); + styleDeclaration(); + jj_consume_token(RBRACE); + } catch (CSSParseException e) { +getErrorHandler().error(e); + error_skipblock("ignoringRule", e); + } catch (ParseException e) { +CSSParseException cpe = toCSSParseException("invalidPageRule", e); + getErrorHandler().error(cpe); + error_skipblock("ignoringRule", cpe); + } finally { +if (start) { + handleEndPage(null, sel); + } + } +} + +// +// pageSelectorList +// : [ pageSelector S* [ ',' pageSelector S* ]* ]? +// ; +// + final public String pageSelectorList() throws ParseException {String sel; + LinkedList selectors = new LinkedList(); + sel = pageSelector(); +selectors.add(sel); + label_26: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[41] = jj_gen; + break label_26; + } + jj_consume_token(COMMA); + label_27: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[42] = jj_gen; + break label_27; + } + jj_consume_token(S); + } + sel = pageSelector(); +selectors.add(sel); + } +return LangUtils.join(selectors, ", "); +} + +// +// pageSelector +// : pseudoPage+ | IDENT pseudoPage* +// ; +// + final public String pageSelector() throws ParseException {StringBuilder pseudos = new StringBuilder(); + String pseudo; + Token ident; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COLON:{ + pseudo = pseudoPage(); +pseudos.append(pseudo); + break; + } + case IDENT:{ + ident = jj_consume_token(IDENT); +pseudos.append(unescape(ident.image, false)); + break; + } + default: + jj_la1[43] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_28: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COLON:{ + ; + break; + } + default: + jj_la1[44] = jj_gen; + break label_28; + } + pseudo = pseudoPage(); +pseudos.append(pseudo); + } + label_29: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[45] = jj_gen; + break label_29; + } + jj_consume_token(S); + } +return pseudos.toString(); +} + +// +// pseudoPage +// : ':' IDENT +// ; +// + final public String pseudoPage() throws ParseException {Token t; + jj_consume_token(COLON); + t = jj_consume_token(IDENT); +return ":" + unescape(t.image, false); +} + +// +// font_face +// : FONT_FACE_SYM S* +// '{' S* declaration [ ';' S* declaration ]* '}' S* +// ; +// + final public void fontFaceRule() throws ParseException {boolean start = false; + Locator locator; + try { + jj_consume_token(FONT_FACE_SYM); +locator = createLocator(token); + label_30: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[46] = jj_gen; + break label_30; + } + jj_consume_token(S); + } + jj_consume_token(LBRACE); + label_31: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[47] = jj_gen; + break label_31; + } + jj_consume_token(S); + } +start = true; handleStartFontFace(locator); + styleDeclaration(); + jj_consume_token(RBRACE); + } catch (ParseException e) { +throw toCSSParseException("invalidFontFaceRule", e); + } finally { +if (start) { + handleEndFontFace(); + } + } +} + +// +// operator +// : '/' S* | COMMA S* | /* empty */ +// ; +// + final public LexicalUnit operator(LexicalUnit prev) throws ParseException { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SLASH:{ + jj_consume_token(SLASH); + label_32: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[48] = jj_gen; + break label_32; + } + jj_consume_token(S); + } +return new LexicalUnitImpl(prev, LexicalUnit.SAC_OPERATOR_SLASH); + } + case COMMA:{ + jj_consume_token(COMMA); + label_33: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[49] = jj_gen; + break label_33; + } + jj_consume_token(S); + } +return LexicalUnitImpl.createComma(prev); + } + default: + jj_la1[50] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +} + +// +// combinator +// : PLUS S* +// | GREATER S* +// | S +// ; +// + final public char combinator() throws ParseException {char c = ' '; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PLUS:{ + jj_consume_token(PLUS); +c='+'; + label_34: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[51] = jj_gen; + break label_34; + } + jj_consume_token(S); + } + break; + } + case GREATER:{ + jj_consume_token(GREATER); +c='>'; + label_35: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[52] = jj_gen; + break label_35; + } + jj_consume_token(S); + } + break; + } + case TILDE:{ + jj_consume_token(TILDE); +c='~'; + label_36: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[53] = jj_gen; + break label_36; + } + jj_consume_token(S); + } + break; + } + case S:{ + jj_consume_token(S); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PLUS: + case GREATER: + case TILDE:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PLUS:{ + jj_consume_token(PLUS); +c='+'; + break; + } + case GREATER:{ + jj_consume_token(GREATER); +c='>'; + break; + } + case TILDE:{ + jj_consume_token(TILDE); +c='~'; + break; + } + default: + jj_la1[54] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_37: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[55] = jj_gen; + break label_37; + } + jj_consume_token(S); + } + break; + } + default: + jj_la1[56] = jj_gen; + ; + } + break; + } + default: + jj_la1[57] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +return c; +} + +// +// unary_operator +// : '-' | PLUS +// ; +// + final public char unaryOperator() throws ParseException { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case MINUS:{ + jj_consume_token(MINUS); +return '-'; + } + case PLUS:{ + jj_consume_token(PLUS); +return '+'; + } + default: + jj_la1[58] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +} + +// +// property +// : IDENT S* +// ; +// + final public String property() throws ParseException {Token t; + t = jj_consume_token(IDENT); + label_38: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[59] = jj_gen; + break label_38; + } + jj_consume_token(S); + } +return unescape(t.image, false); +} + +// +// ruleset +// : selector [ COMMA S* selector ]* +// '{' S* declaration [ ';' S* declaration ]* '}' S* +// ; +// + final public void styleRule() throws ParseException {SelectorList selList = null; + boolean start = false; + Token t; + try { +t = token; + selList = selectorList(); + jj_consume_token(LBRACE); + label_39: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[60] = jj_gen; + break label_39; + } + jj_consume_token(S); + } +start = true; + handleStartSelector(selList, createLocator(t.next)); + styleDeclaration(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case RBRACE:{ + jj_consume_token(RBRACE); + break; + } + case 0:{ + jj_consume_token(0); + break; + } + default: + jj_la1[61] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (CSSParseException e) { +getErrorHandler().error(e); + error_skipblock("ignoringRule", e); + } catch (ParseException e) { +CSSParseException cpe = toCSSParseException("invalidStyleRule", e); + getErrorHandler().error(cpe); + error_skipblock("ignoringFollowingDeclarations", cpe); + } finally { +if (start) { + handleEndSelector(selList); + } + } +} + + final public SelectorList parseSelectorsInternal() throws ParseException {SelectorList selectors; + label_40: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[62] = jj_gen; + break label_40; + } + jj_consume_token(S); + } + selectors = selectorList(); + jj_consume_token(0); +return selectors; +} + + final public SelectorList selectorList() throws ParseException {SelectorListImpl selList = new SelectorListImpl(); + Selector sel; + sel = selector(); +if (sel instanceof Locatable) { selList.setLocator(((Locatable) sel).getLocator()); } + label_41: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[63] = jj_gen; + break label_41; + } + jj_consume_token(COMMA); + label_42: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[64] = jj_gen; + break label_42; + } + jj_consume_token(S); + } +selList.add(sel); + sel = selector(); +if (sel instanceof Locatable) { selList.setLocator(((Locatable) sel).getLocator()); } + } +selList.add(sel); + return selList; +} + +// +// selector +// : simple_selector_sequence [ combinator simple_selector_sequence ]* +// ; +// + final public Selector selector() throws ParseException {Selector sel; + char comb; + try { + sel = simpleSelector(null, ' '); + label_43: + while (true) { + if (jj_2_1(2)) { + ; + } else { + break label_43; + } + comb = combinator(); + sel = simpleSelector(sel, comb); + } + label_44: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[65] = jj_gen; + break label_44; + } + jj_consume_token(S); + } +return sel; } catch (ParseException e) { +throw toCSSParseException("invalidSelector", e); + } +} + +// +// simple_selector +// : element_name [ HASH | class | attrib | pseudo ]* +// | [ HASH | class | attrib | pseudo ]+ +// ; +// + final public Selector simpleSelector(Selector sel, char comb) throws ParseException {SimpleSelector simpleSel = null; + Condition c = null; + SimpleSelector pseudoElementSel = null; + Object o = null; + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case ASTERISK:{ + simpleSel = elementName(); + label_45: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT: + case COLON: + case LSQUARE: + case HASH:{ + ; + break; + } + default: + jj_la1[66] = jj_gen; + break label_45; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case HASH:{ + c = hash(c, null != pseudoElementSel); + break; + } + case DOT:{ + c = _class(c, null != pseudoElementSel); + break; + } + case LSQUARE:{ + c = attrib(c, null != pseudoElementSel); + break; + } + case COLON:{ + o = pseudo(c, null != pseudoElementSel); +if (o instanceof Condition) + { c = (Condition) o; + } else { + pseudoElementSel = (SimpleSelector) o; + } + break; + } + default: + jj_la1[67] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + } + case DOT: + case COLON: + case LSQUARE: + case HASH:{ +simpleSel = getSelectorFactory().createSyntheticElementSelector(); + label_46: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case HASH:{ + c = hash(c, null != pseudoElementSel); + break; + } + case DOT:{ + c = _class(c, null != pseudoElementSel); + break; + } + case LSQUARE:{ + c = attrib(c, null != pseudoElementSel); + break; + } + case COLON:{ + o = pseudo(c, null != pseudoElementSel); +if (o instanceof Condition) + { c = (Condition) o; + } else { + pseudoElementSel = (SimpleSelector) o; + } + break; + } + default: + jj_la1[68] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT: + case COLON: + case LSQUARE: + case HASH:{ + ; + break; + } + default: + jj_la1[69] = jj_gen; + break label_46; + } + } + break; + } + default: + jj_la1[70] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +if (c != null) { + simpleSel = getSelectorFactory().createConditionalSelector(simpleSel, c); + } + + if (sel == null) { + sel = simpleSel; + } else { + switch (comb) { + case ' ': + sel = getSelectorFactory().createDescendantSelector(sel, simpleSel); + break; + case '+': + sel = getSelectorFactory().createDirectAdjacentSelector(sel.getSelectorType(), sel, simpleSel); + break; + case '>': + sel = getSelectorFactory().createChildSelector(sel, simpleSel); + break; + case '~': + sel = getSelectorFactory().createGeneralAdjacentSelector(sel.getSelectorType(), sel, simpleSel); + break; + } + } + if (pseudoElementSel != null) + { + sel = getSelectorFactory().createDescendantSelector(sel, pseudoElementSel); + } + + return sel; } catch (ParseException e) { +throw toCSSParseException("invalidSimpleSelector", e); + } +} + +// +// class +// : '.' IDENT +// ; +// + final public Condition _class(Condition pred, boolean pseudoElementFound) throws ParseException {Token t; + Locator locator; + ParseException pe = null; + try { +if (pseudoElementFound) { pe = generateParseException(); } + jj_consume_token(DOT); +locator = createLocator(token); + t = jj_consume_token(IDENT); +if (pseudoElementFound) { throw pe;} + Condition c = getConditionFactory().createClassCondition(null, unescape(t.image, false), locator); + return (pred == null) ? c : getConditionFactory().createAndCondition(pred, c); } catch (ParseException e) { +throw toCSSParseException("invalidClassSelector", e); + } +} + +// +// element_name +// : IDENT | '*' +// ; +// + final public SimpleSelector elementName() throws ParseException {Token t; + SimpleSelector sel; + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + t = jj_consume_token(IDENT); +return getSelectorFactory().createElementSelector(null, unescape(t.image, false), createLocator(token)); + } + case ASTERISK:{ + jj_consume_token(ASTERISK); +return getSelectorFactory().createElementSelector(null, null, createLocator(token)); + } + default: + jj_la1[71] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (ParseException e) { +throw toCSSParseException("invalidElementName", e); + } +} + +// +// attrib +// : '[' S* IDENT S* [ [ '=' | INCLUDES | DASHMATCH | PREFIXMATCH | SUFFIXMATCH | SUBSTRINGMATCH ] S* +// [ IDENT | STRING ] S* ]? ']' +// ; +// + final public Condition attrib(Condition pred, boolean pseudoElementFound) throws ParseException {Token t; + String name = null; + String value = null; + int type = 0; + Locator locator; + try { + jj_consume_token(LSQUARE); +locator = createLocator(token); + label_47: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[72] = jj_gen; + break label_47; + } + jj_consume_token(S); + } +if (pseudoElementFound) { throw generateParseException();} + t = jj_consume_token(IDENT); +name = unescape(t.image, false); + label_48: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[73] = jj_gen; + break label_48; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INCLUDES: + case DASHMATCH: + case PREFIXMATCH: + case SUFFIXMATCH: + case SUBSTRINGMATCH: + case EQUALS:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PREFIXMATCH:{ + jj_consume_token(PREFIXMATCH); +type = 4; + break; + } + case SUFFIXMATCH:{ + jj_consume_token(SUFFIXMATCH); +type = 5; + break; + } + case SUBSTRINGMATCH:{ + jj_consume_token(SUBSTRINGMATCH); +type = 6; + break; + } + case EQUALS:{ + jj_consume_token(EQUALS); +type = 1; + break; + } + case INCLUDES:{ + jj_consume_token(INCLUDES); +type = 2; + break; + } + case DASHMATCH:{ + jj_consume_token(DASHMATCH); +type = 3; + break; + } + default: + jj_la1[74] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_49: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[75] = jj_gen; + break label_49; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + t = jj_consume_token(IDENT); +value = unescape(t.image, false); + break; + } + case STRING:{ + t = jj_consume_token(STRING); +value = unescape(t.image, false); + break; + } + default: + jj_la1[76] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_50: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[77] = jj_gen; + break label_50; + } + jj_consume_token(S); + } + break; + } + default: + jj_la1[78] = jj_gen; + ; + } + jj_consume_token(RSQUARE); +Condition c = null; + switch (type) { + case 0: + c = getConditionFactory().createAttributeCondition(name, null, false, null); + break; + case 1: + c = getConditionFactory().createAttributeCondition(name, null, null != value, value); + break; + case 2: + c = getConditionFactory().createOneOfAttributeCondition(name, null, null != value, value); + break; + case 3: + c = getConditionFactory().createBeginHyphenAttributeCondition(name, null, null != value, value); + break; + case 4: + c = ((com.steadystate.css.parser.selectors.ConditionFactoryImpl) getConditionFactory()) + .createPrefixAttributeCondition(name, null, null != value, value); + break; + case 5: + c = ((com.steadystate.css.parser.selectors.ConditionFactoryImpl) getConditionFactory()) + .createSuffixAttributeCondition(name, null, null != value, value); + break; + case 6: + c = ((com.steadystate.css.parser.selectors.ConditionFactoryImpl) getConditionFactory()) + .createSubstringAttributeCondition(name, null, null != value, value); + break; + } + if (c instanceof Locatable) { + ((Locatable) c).setLocator(locator); + } + return (pred == null) ? c : getConditionFactory().createAndCondition(pred, c); } catch (ParseException e) { +throw toCSSParseException("invalidAttrib", e); + } +} + +// +// pseudo +// : ':' (':')? +// [ IDENT +// | FUNCTION_NOT S* selector() S* ')' +// | FUNCTION_LANG S* IDENT S* ')' +// | FUNCTION S* ((PLUS | MINUS | DIMENSION | NUMBER | STRING | IDENT)? S*)+ ')' +// ] +// ; +// + final public Object pseudo(Condition pred, boolean pseudoElementFound) throws ParseException {Condition c = null; + Token t; + String function; + Selector sel; + boolean doubleColon = false; + Locator locator; + try { + jj_consume_token(COLON); +locator = createLocator(token); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COLON:{ + jj_consume_token(COLON); +doubleColon = true; + break; + } + default: + jj_la1[79] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + t = jj_consume_token(IDENT); +String s = unescape(t.image, false); + if (pseudoElementFound) { throw toCSSParseException("duplicatePseudo", new String[] { s }, locator);} + if ("first-line".equals(s) + || "first-letter".equals(s) + || "before".equals(s) + || "after".equals(s)) + { + return getSelectorFactory().createPseudoElementSelector(null, s, locator, doubleColon); } + c = getConditionFactory().createPseudoClassCondition(null, s, locator, doubleColon); + {if ("" != null) return (pred == null) + ? c + : getConditionFactory().createAndCondition(pred, c);} + break; + } + case FUNCTION_NOT:{ + t = jj_consume_token(FUNCTION_NOT); +function = unescape(t.image, false); + label_51: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[80] = jj_gen; + break label_51; + } + jj_consume_token(S); + } + sel = negation_arg(); +String arg = ((CSSFormatable)sel).getCssText(null); + if ("".equals(arg)) { arg = "*"; } + label_52: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[81] = jj_gen; + break label_52; + } + jj_consume_token(S); + } + jj_consume_token(RROUND); +if (pseudoElementFound) { throw toCSSParseException("duplicatePseudo", new String[] { function + arg + ")" }, locator);} + c = getConditionFactory().createPseudoClassCondition(null, function + arg + ")", locator, doubleColon); + {if ("" != null) return (pred == null) + ? c + : getConditionFactory().createAndCondition(pred, c);} + break; + } + case FUNCTION_LANG:{ + t = jj_consume_token(FUNCTION_LANG); +function = unescape(t.image, false); + label_53: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[82] = jj_gen; + break label_53; + } + jj_consume_token(S); + } + t = jj_consume_token(IDENT); +String lang = unescape(t.image, false); + label_54: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[83] = jj_gen; + break label_54; + } + jj_consume_token(S); + } + jj_consume_token(RROUND); +if (pseudoElementFound) { throw toCSSParseException("duplicatePseudo", new String[] { "lang(" + lang + ")" }, locator);} + c = getConditionFactory().createLangCondition(lang, locator); + {if ("" != null) return (pred == null) + ? c + : getConditionFactory().createAndCondition(pred, c);} + break; + } + case FUNCTION:{ + t = jj_consume_token(FUNCTION); +function = unescape(t.image, false); StringBuilder args = new StringBuilder(); + label_55: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[84] = jj_gen; + break label_55; + } + jj_consume_token(S); + } + label_56: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case PLUS:{ + t = jj_consume_token(PLUS); + break; + } + case MINUS:{ + t = jj_consume_token(MINUS); + break; + } + case DIMENSION:{ + t = jj_consume_token(DIMENSION); + break; + } + case NUMBER:{ + t = jj_consume_token(NUMBER); + break; + } + case STRING:{ + t = jj_consume_token(STRING); + break; + } + case IDENT:{ + t = jj_consume_token(IDENT); + break; + } + default: + jj_la1[85] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +args.append(unescape(t.image, false)); + label_57: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[86] = jj_gen; + break label_57; + } + t = jj_consume_token(S); +args.append(unescape(t.image, false)); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case NUMBER: + case IDENT: + case STRING: + case MINUS: + case PLUS: + case DIMENSION:{ + ; + break; + } + default: + jj_la1[87] = jj_gen; + break label_56; + } + } + jj_consume_token(RROUND); +if (pseudoElementFound) { throw toCSSParseException("duplicatePseudo", new String[] { function + args.toString().trim() + ")" }, locator);} + c = getConditionFactory().createPseudoClassCondition(null, function + args.toString().trim() + ")", locator, doubleColon); + {if ("" != null) return (pred == null) + ? c + : getConditionFactory().createAndCondition(pred, c);} + break; + } + default: + jj_la1[88] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (ParseException e) { +throw toCSSParseException("invalidPseudo", e); + } +return null; +} + + final public Condition hash(Condition pred, boolean pseudoElementFound) throws ParseException {Token t; + ParseException pe = null; + try { +if (pseudoElementFound) { pe = generateParseException(); } + t = jj_consume_token(HASH); +if (pseudoElementFound) { throw pe;} + Condition c = getConditionFactory().createIdCondition(unescape(t.image.substring(1), false), createLocator(token)); + return (pred == null) ? c : getConditionFactory().createAndCondition(pred, c); } catch (ParseException e) { +throw toCSSParseException("invalidHash", e); + } +} + + final public void styleDeclaration() throws ParseException { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case ASTERISK:{ + declaration(); + break; + } + default: + jj_la1[89] = jj_gen; + ; + } + label_58: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SEMICOLON:{ + ; + break; + } + default: + jj_la1[90] = jj_gen; + break label_58; + } + jj_consume_token(SEMICOLON); + label_59: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[91] = jj_gen; + break label_59; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case ASTERISK:{ + declaration(); + break; + } + default: + jj_la1[92] = jj_gen; + ; + } + } +} + +// +// declaration +// : property ':' S* expr prio? +// | +// ; +// + final public void declaration() throws ParseException {String p; + LexicalUnit e; + Token t; + boolean priority = false; + Locator starHack = null; + Locator locator = null; + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ASTERISK:{ + jj_consume_token(ASTERISK); +starHack = createLocator(token); + break; + } + default: + jj_la1[93] = jj_gen; + ; + } + p = property(); +locator = createLocator(token); + jj_consume_token(COLON); + label_60: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[94] = jj_gen; + break label_60; + } + jj_consume_token(S); + } + e = expr(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IMPORTANT_SYM:{ + priority = prio(); + break; + } + default: + jj_la1[95] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case UNKNOWN:{ + t = jj_consume_token(UNKNOWN); +locator = createLocator(token); + CSSParseException cpe = toCSSParseException("invalidDeclarationInvalidChar", new String[] {t.image}, locator); + getErrorHandler().error(cpe); + error_skipdecl(); + break; + } + default: + jj_la1[96] = jj_gen; + ; + } +if (starHack != null) + { + if (isIeStarHackAccepted()) { + handleProperty("*" + p, e, priority, locator); + {if ("" != null) return;} + } + CSSParseException cpe = toCSSParseException("invalidDeclarationStarHack", new Object[0], starHack); + getErrorHandler().error(cpe); + {if ("" != null) return;} + } + handleProperty(p, e, priority, locator); + } catch (CSSParseException ex) { +getErrorHandler().error(ex); + error_skipdecl(); + } catch (ParseException ex) { +CSSParseException cpe = toCSSParseException("invalidDeclaration", ex); + getErrorHandler().error(cpe); + error_skipdecl(); + } +} + +// +// prio +// : IMPORTANT_SYM S* +// ; + final public boolean prio() throws ParseException { + jj_consume_token(IMPORTANT_SYM); + label_61: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[97] = jj_gen; + break label_61; + } + jj_consume_token(S); + } +return true; +} + +// +// expr +// : term [ operator term ]* +// ; + final public LexicalUnit expr() throws ParseException {LexicalUnit head; + LexicalUnit body; + try { + head = term(null); +body = head; + label_62: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case NUMBER: + case INHERIT: + case IDENT: + case STRING: + case SLASH: + case MINUS: + case PLUS: + case COMMA: + case HASH: + case EMS: + case EXS: + case LENGTH_PX: + case LENGTH_CM: + case LENGTH_MM: + case LENGTH_IN: + case LENGTH_PT: + case LENGTH_PC: + case ANGLE_DEG: + case ANGLE_RAD: + case ANGLE_GRAD: + case TIME_MS: + case TIME_S: + case FREQ_HZ: + case FREQ_KHZ: + case RESOLUTION_DPI: + case RESOLUTION_DPCM: + case PERCENTAGE: + case DIMENSION: + case UNICODE_RANGE: + case URI: + case FUNCTION: + case 106:{ + ; + break; + } + default: + jj_la1[98] = jj_gen; + break label_62; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SLASH: + case COMMA:{ + body = operator(body); + break; + } + default: + jj_la1[99] = jj_gen; + ; + } + body = term(body); + } +return head; } catch (ParseException ex) { +throw toCSSParseException("invalidExpr", ex); + } +} + +// +// term +// : unary_operator? +// [ NUMBER | PERCENTAGE | LENGTH | EMS | EXS | ANGLE | TIME | FREQ | function ] +// | STRING | IDENT | URI | hexcolor | DIMENSION +// S* +// ; +// + final public LexicalUnit term(LexicalUnit prev) throws ParseException {Token t; + char op = ' '; + LexicalUnit value = null; + Locator locator = null; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case MINUS: + case PLUS:{ + op = unaryOperator(); + break; + } + default: + jj_la1[100] = jj_gen; + ; + } +if (op != ' ') + { + locator = createLocator(token); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case NUMBER: + case EMS: + case EXS: + case LENGTH_PX: + case LENGTH_CM: + case LENGTH_MM: + case LENGTH_IN: + case LENGTH_PT: + case LENGTH_PC: + case ANGLE_DEG: + case ANGLE_RAD: + case ANGLE_GRAD: + case TIME_MS: + case TIME_S: + case FREQ_HZ: + case FREQ_KHZ: + case RESOLUTION_DPI: + case RESOLUTION_DPCM: + case PERCENTAGE: + case FUNCTION:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case NUMBER:{ + t = jj_consume_token(NUMBER); +try + { + value = LexicalUnitImpl.createNumber(prev, intValue(op, t.image)); + } + catch (NumberFormatException e) + { + value = LexicalUnitImpl.createNumber(prev, floatValue(op, t.image)); + } + break; + } + case PERCENTAGE:{ + t = jj_consume_token(PERCENTAGE); +value = LexicalUnitImpl.createPercentage(prev, floatValue(op, t.image)); + break; + } + case LENGTH_PX:{ + t = jj_consume_token(LENGTH_PX); +value = LexicalUnitImpl.createPixel(prev, floatValue(op, t.image)); + break; + } + case LENGTH_CM:{ + t = jj_consume_token(LENGTH_CM); +value = LexicalUnitImpl.createCentimeter(prev, floatValue(op, t.image)); + break; + } + case LENGTH_MM:{ + t = jj_consume_token(LENGTH_MM); +value = LexicalUnitImpl.createMillimeter(prev, floatValue(op, t.image)); + break; + } + case LENGTH_IN:{ + t = jj_consume_token(LENGTH_IN); +value = LexicalUnitImpl.createInch(prev, floatValue(op, t.image)); + break; + } + case LENGTH_PT:{ + t = jj_consume_token(LENGTH_PT); +value = LexicalUnitImpl.createPoint(prev, floatValue(op, t.image)); + break; + } + case LENGTH_PC:{ + t = jj_consume_token(LENGTH_PC); +value = LexicalUnitImpl.createPica(prev, floatValue(op, t.image)); + break; + } + case EMS:{ + t = jj_consume_token(EMS); +value = LexicalUnitImpl.createEm(prev, floatValue(op, t.image)); + break; + } + case EXS:{ + t = jj_consume_token(EXS); +value = LexicalUnitImpl.createEx(prev, floatValue(op, t.image)); + break; + } + case ANGLE_DEG:{ + t = jj_consume_token(ANGLE_DEG); +value = LexicalUnitImpl.createDegree(prev, floatValue(op, t.image)); + break; + } + case ANGLE_RAD:{ + t = jj_consume_token(ANGLE_RAD); +value = LexicalUnitImpl.createRadian(prev, floatValue(op, t.image)); + break; + } + case ANGLE_GRAD:{ + t = jj_consume_token(ANGLE_GRAD); +value = LexicalUnitImpl.createGradian(prev, floatValue(op, t.image)); + break; + } + case TIME_MS:{ + t = jj_consume_token(TIME_MS); +value = LexicalUnitImpl.createMillisecond(prev, floatValue(op, t.image)); + break; + } + case TIME_S:{ + t = jj_consume_token(TIME_S); +value = LexicalUnitImpl.createSecond(prev, floatValue(op, t.image)); + break; + } + case FREQ_HZ:{ + t = jj_consume_token(FREQ_HZ); +value = LexicalUnitImpl.createHertz(prev, floatValue(op, t.image)); + break; + } + case FREQ_KHZ:{ + t = jj_consume_token(FREQ_KHZ); +value = LexicalUnitImpl.createKiloHertz(prev, floatValue(op, t.image)); + break; + } + case RESOLUTION_DPI:{ + t = jj_consume_token(RESOLUTION_DPI); +value = LexicalUnitImpl.createDimension(prev, floatValue(op, t.image), "dpi"); + break; + } + case RESOLUTION_DPCM:{ + t = jj_consume_token(RESOLUTION_DPCM); +value = LexicalUnitImpl.createDimension(prev, floatValue(op, t.image), "dpcm"); + break; + } + case FUNCTION:{ + value = function(prev); + break; + } + default: + jj_la1[101] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + } + case STRING:{ + t = jj_consume_token(STRING); +value = LexicalUnitImpl.createString(prev, unescape(t.image, false), t.image); + break; + } + case 106:{ + t = jj_consume_token(106); +value = LexicalUnitImpl.createIdent(prev, skipUnit().trim()); + break; + } + case IDENT:{ + t = jj_consume_token(IDENT); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COLON:{ + jj_consume_token(COLON); +throw toCSSParseException("invalidExprColon", new String[]{ unescape(t.image, false) }, createLocator(token)); + } + default: + jj_la1[102] = jj_gen; + ; + } +value = LexicalUnitImpl.createIdent(prev, unescape(t.image, false)); + break; + } + case URI:{ + t = jj_consume_token(URI); +value = LexicalUnitImpl.createURI(prev, unescape(t.image, true)); + break; + } + case UNICODE_RANGE:{ + value = unicodeRange(prev); + break; + } + case HASH:{ + value = hexcolor(prev); + break; + } + case DIMENSION:{ + t = jj_consume_token(DIMENSION); +int n = getLastNumPos(t.image); + value = LexicalUnitImpl.createDimension( + prev, + floatValue(op, t.image.substring(0, n+1)), + t.image.substring(n+1)); + break; + } + case INHERIT:{ + t = jj_consume_token(INHERIT); +value = new LexicalUnitImpl(prev, LexicalUnit.SAC_INHERIT, t.image); + break; + } + default: + jj_la1[103] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +if (locator == null) + { + locator = createLocator(token); + } + label_63: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[104] = jj_gen; + break label_63; + } + jj_consume_token(S); + } +if (value instanceof Locatable) + { + ((Locatable) value).setLocator(locator); + } + return value; +} + +// +// function +// : FUNCTION S* ((EQUALS | COMMA | (unaryOperator? NUMBER) | STRING | IDENT | URI)? S*)+ ')' S* +// ; +// + final public LexicalUnit function(LexicalUnit prev) throws ParseException {Token t; + LexicalUnit param = null; + LexicalUnit body = null; + String funct = ""; + t = jj_consume_token(FUNCTION); +funct = funct + unescape(t.image, false); + label_64: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[105] = jj_gen; + break label_64; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case NUMBER: + case INHERIT: + case IDENT: + case STRING: + case MINUS: + case PLUS: + case HASH: + case EMS: + case EXS: + case LENGTH_PX: + case LENGTH_CM: + case LENGTH_MM: + case LENGTH_IN: + case LENGTH_PT: + case LENGTH_PC: + case ANGLE_DEG: + case ANGLE_RAD: + case ANGLE_GRAD: + case TIME_MS: + case TIME_S: + case FREQ_HZ: + case FREQ_KHZ: + case RESOLUTION_DPI: + case RESOLUTION_DPCM: + case PERCENTAGE: + case DIMENSION: + case UNICODE_RANGE: + case URI: + case FUNCTION: + case 106:{ + param = term(null); +body = param; + label_65: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case NUMBER: + case INHERIT: + case IDENT: + case STRING: + case MINUS: + case EQUALS: + case PLUS: + case COMMA: + case HASH: + case EMS: + case EXS: + case LENGTH_PX: + case LENGTH_CM: + case LENGTH_MM: + case LENGTH_IN: + case LENGTH_PT: + case LENGTH_PC: + case ANGLE_DEG: + case ANGLE_RAD: + case ANGLE_GRAD: + case TIME_MS: + case TIME_S: + case FREQ_HZ: + case FREQ_KHZ: + case RESOLUTION_DPI: + case RESOLUTION_DPCM: + case PERCENTAGE: + case DIMENSION: + case UNICODE_RANGE: + case URI: + case FUNCTION: + case 106:{ + ; + break; + } + default: + jj_la1[106] = jj_gen; + break label_65; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case EQUALS: + case COMMA:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + t = jj_consume_token(COMMA); +body = LexicalUnitImpl.createComma(body); + break; + } + case EQUALS:{ + t = jj_consume_token(EQUALS); +body = LexicalUnitImpl.createIdent(body, t.image); + break; + } + default: + jj_la1[107] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_66: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[108] = jj_gen; + break label_66; + } + jj_consume_token(S); + } + break; + } + default: + jj_la1[109] = jj_gen; + ; + } + body = term(body); + } + break; + } + default: + jj_la1[110] = jj_gen; + ; + } + jj_consume_token(RROUND); +return functionInternal(prev, funct, param); +} + +// +// negation_arg +// : type_selector | universal | HASH | class | attrib | pseudo +// ; +// + final public Selector negation_arg() throws ParseException {Selector negationArg = null; + Condition c = null; + SimpleSelector simpleSel = null; + SimpleSelector pseudoElementSel = null; + Object o; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT: + case ASTERISK:{ + simpleSel = elementName(); + break; + } + case HASH:{ + c = hash(null, false); + break; + } + case DOT:{ + c = _class(null, false); + break; + } + case LSQUARE:{ + c = attrib(null, false); + break; + } + case COLON:{ + o = pseudo(null, false); +if (o instanceof Condition) + { c = (Condition) o; + } else { + pseudoElementSel = (SimpleSelector) o; + negationArg = getSelectorFactory().createDescendantSelector(null, pseudoElementSel); + } + break; + } + default: + jj_la1[111] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +if (negationArg != null) { + return negationArg; } + + if (simpleSel != null) { + return simpleSel; } + + simpleSel = getSelectorFactory().createConditionalSelector(simpleSel, c); + return simpleSel; +} + +// +// unicodeRange +// + final public LexicalUnit unicodeRange(LexicalUnit prev) throws ParseException {Token t; + StringBuilder range = new StringBuilder(); + t = jj_consume_token(UNICODE_RANGE); +range.append(unescape(t.image, false)); +return LexicalUnitImpl.createIdent(prev, range.toString().toUpperCase(Locale.ROOT)); +} + +// +// hexcolor +// : HASH S* +// ; +// + final public LexicalUnit hexcolor(LexicalUnit prev) throws ParseException {Token t; + t = jj_consume_token(HASH); +return hexcolorInternal(prev, t); +} + + String skip() throws ParseException {StringBuilder sb = new StringBuilder(); + int nesting = 0; + Token t = getToken(0); + if (t.image != null) { + sb.append(t.image); + } + + do { + t = getNextToken(); + if (t.kind == EOF) { + break; + } + sb.append(t.image); + appendUnit(t, sb); + + if (t.kind == LBRACE) { + nesting++; + } + else if (t.kind == RBRACE) { + nesting--; + } + } + while ((t.kind != RBRACE && t.kind != SEMICOLON) || nesting > 0); + + return sb.toString(); + } + + String skipUnit() throws ParseException {StringBuilder sb = new StringBuilder(); + + Token t = token; + Token oldToken = null; + while (t.kind != SEMICOLON && t.kind != RBRACE && t.kind != EOF ) { + oldToken = t; + sb.append(oldToken.image); + appendUnit(t, sb); + + t = getNextToken(); + } + if (t.kind != EOF) { + token = oldToken; + } + + return sb.toString(); + } + + void appendUnit(Token t, StringBuilder sb) throws ParseException {if (t.kind == EMS) { + sb.append("ems"); + return; + } + if (t.kind == EXS) { + sb.append("ex"); + return; + } + if (t.kind == LENGTH_PX) { + sb.append("px"); + return; + } + if (t.kind == LENGTH_CM) { + sb.append("cm"); + return; + } + if (t.kind == LENGTH_MM) { + sb.append("mm"); + return; + } + if (t.kind == LENGTH_IN) { + sb.append("in"); + return; + } + if (t.kind == LENGTH_PT) { + sb.append("pt"); + return; + } + if (t.kind == LENGTH_PC) { + sb.append("pc"); + return; + } + if (t.kind == ANGLE_DEG) { + sb.append("deg"); + return; + } + if (t.kind == ANGLE_RAD) { + sb.append("rad"); + return; + } + if (t.kind == ANGLE_GRAD) { + sb.append("grad"); + return; + } + if (t.kind == TIME_MS) { + sb.append("ms"); + return; + } + if (t.kind == TIME_S) { + sb.append('s'); + return; + } + if (t.kind == FREQ_HZ) { + sb.append("hz"); + return; + } + if (t.kind == FREQ_KHZ) { + sb.append("khz"); + return; + } + if (t.kind == RESOLUTION_DPI) { + sb.append("dpi"); + return; + } + if (t.kind == RESOLUTION_DPCM) { + sb.append("dpcm"); + return; + } + if (t.kind == PERCENTAGE) { + sb.append('%'); + return; + } + } + + void error_skipblock(String msgKey, CSSParseException e) throws ParseException {if (msgKey != null) { + getErrorHandler().warning(createSkipWarning(msgKey, e)); + } + + Token t; + int nesting = 0; + do { + t = getNextToken(); + if (t.kind == LBRACE) { + nesting++; + } + else if (t.kind == RBRACE) { + nesting--; + } + } + while (t.kind != EOF && (t.kind != RBRACE || nesting > 0)); + } + + void error_skipdecl() throws ParseException {Token t = getToken(1); + if (t.kind == LBRACE) { + error_skipblock(null, null); + return; + } + if (t.kind == RBRACE) { + // next will be RBRACE so we are finished + return; + } + + Token oldToken = token; + while (t.kind != SEMICOLON && t.kind != RBRACE && t.kind != EOF) { + oldToken = t; + t = getNextToken(); + } + if (t.kind != EOF) { + token = oldToken; + } + } + + void error_skipAtRule() throws ParseException {Token t = null; + do { + t = getNextToken(); + } + while (t.kind != SEMICOLON && t.kind != EOF); + } + + 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_3R_79() + { + if (jj_scan_token(GREATER)) return true; + return false; + } + + private boolean jj_3_1() + { + if (jj_3R_67()) return true; + if (jj_3R_68()) return true; + return false; + } + + private boolean jj_3R_81() + { + if (jj_scan_token(IDENT)) return true; + return false; + } + + private boolean jj_3R_74() + { + Token xsp; + if (jj_3R_77()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3R_77()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_76() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_81()) { + jj_scanpos = xsp; + if (jj_3R_82()) return true; + } + return false; + } + + private boolean jj_3R_73() + { + if (jj_3R_76()) return true; + return false; + } + + private boolean jj_3R_78() + { + if (jj_scan_token(PLUS)) return true; + return false; + } + + private boolean jj_3R_89() + { + if (jj_scan_token(LSQUARE)) return true; + return false; + } + + private boolean jj_3R_75() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_78()) { + jj_scanpos = xsp; + if (jj_3R_79()) { + jj_scanpos = xsp; + if (jj_3R_80()) return true; + } + } + return false; + } + + private boolean jj_3R_90() + { + if (jj_scan_token(COLON)) return true; + return false; + } + + private boolean jj_3R_80() + { + if (jj_scan_token(TILDE)) return true; + return false; + } + + private boolean jj_3R_87() + { + if (jj_scan_token(HASH)) return true; + return false; + } + + private boolean jj_3R_72() + { + if (jj_scan_token(S)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_75()) jj_scanpos = xsp; + return false; + } + + private boolean jj_3R_71() + { + if (jj_scan_token(TILDE)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_scan_token(1)) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_70() + { + if (jj_scan_token(GREATER)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_scan_token(1)) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_68() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_73()) { + jj_scanpos = xsp; + if (jj_3R_74()) return true; + } + return false; + } + + private boolean jj_3R_69() + { + 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_67() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_69()) { + jj_scanpos = xsp; + if (jj_3R_70()) { + jj_scanpos = xsp; + if (jj_3R_71()) { + jj_scanpos = xsp; + if (jj_3R_72()) return true; + } + } + } + return false; + } + + private boolean jj_3R_88() + { + if (jj_scan_token(DOT)) return true; + return false; + } + + private boolean jj_3R_86() + { + if (jj_3R_90()) return true; + return false; + } + + private boolean jj_3R_85() + { + if (jj_3R_89()) return true; + return false; + } + + private boolean jj_3R_84() + { + if (jj_3R_88()) return true; + return false; + } + + private boolean jj_3R_82() + { + if (jj_scan_token(ASTERISK)) return true; + return false; + } + + private boolean jj_3R_83() + { + if (jj_3R_87()) return true; + return false; + } + + private boolean jj_3R_77() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_83()) { + jj_scanpos = xsp; + if (jj_3R_84()) { + jj_scanpos = xsp; + if (jj_3R_85()) { + jj_scanpos = xsp; + if (jj_3R_86()) return true; + } + } + } + return false; + } + + /** Generated Token Manager. */ + public SACParserCSS3TokenManager 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[112]; + 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[] {0x2,0x2,0x2,0x2,0x0,0x400000,0x400000,0x400000,0x2,0x2,0x2,0x400000,0x2,0x2,0x2000000,0x2,0x4c0000,0x2,0x2,0x400000,0x0,0x2,0xc0000,0x2,0xc0000,0x20000,0x2,0x20000,0x2,0x4c0000,0x2,0x2,0x0,0x2,0x400000,0x2,0x400000,0x2,0x2,0x400000,0x2,0x0,0x2,0x400000,0x0,0x2,0x2,0x2,0x2,0x2,0x0,0x2,0x2,0x2,0x0,0x2,0x0,0x2,0x0,0x2,0x2,0x1,0x2,0x0,0x2,0x2,0x0,0x0,0x0,0x0,0x400000,0x400000,0x2,0x2,0x0,0x2,0x2400000,0x2,0x0,0x0,0x2,0x2,0x2,0x2,0x2,0x2500000,0x2,0x2500000,0x400000,0x400000,0x0,0x2,0x400000,0x0,0x2,0x0,0x0,0x2,0x2700000,0x0,0x0,0x100000,0x0,0x2700000,0x2,0x2,0x2700000,0x0,0x2,0x0,0x2700000,0x400000,}; + } + private static void jj_la1_init_1() { + jj_la1_1 = new int[] {0x30000,0x30000,0x30000,0x30000,0x0,0x68000000,0x68000000,0x68000000,0x30000,0x30000,0x0,0x68000000,0x0,0x0,0x0,0x0,0x2000000,0x0,0x0,0x68000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2000000,0x0,0x0,0x20000000,0x0,0x68000000,0x0,0x68000000,0x0,0x0,0x20000000,0x0,0x0,0x0,0x20000000,0x20000000,0x0,0x0,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0x0,0x0,0x0,0x0,0x28000000,0x28000000,0x28000000,0x28000000,0x68000000,0x40000000,0x0,0x0,0x7c0000,0x0,0x0,0x0,0x7c0000,0x20000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40000000,0x10000000,0x0,0x40000000,0x40000000,0x0,0x0,0x0,0x0,0x80000000,0x80000000,0x0,0x0,0x20000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x68000000,}; + } + private static void jj_la1_init_2() { + jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x2000,0x1d04,0x1f04,0x1f04,0x0,0x0,0x0,0x3f04,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf04,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf04,0x0,0xf04,0x0,0x0,0x0,0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x0,0x0,0x70,0x0,0x70,0x70,0x11,0x0,0x0,0x0,0x0,0x80,0x0,0x0,0x104,0x104,0x104,0x104,0x104,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x11,0x0,0x11,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4000,0x0,0x0,0xffff8191,0x80,0x11,0xffff8000,0x0,0xffff8100,0x0,0x0,0xffff8193,0x82,0x0,0x82,0xffff8111,0x104,}; + } + private static void jj_la1_init_3() { + jj_la1_3 = new int[] {0x0,0x0,0x0,0x0,0x0,0x100,0x100,0x100,0x0,0x0,0x0,0x100,0x0,0x0,0x10,0x0,0x0,0x0,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x0,0x100,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x2,0xe0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x200,0x0,0x49b,0x0,0x0,0x81,0x0,0x49b,0x0,0x0,0x49b,0x0,0x0,0x0,0x49b,0x0,}; + } + final private JJCalls[] jj_2_rtns = new JJCalls[1]; + private boolean jj_rescan = false; + private int jj_gc = 0; + + /** Constructor with user supplied CharStream. */ + public SACParserCSS3(CharStream stream) { + token_source = new SACParserCSS3TokenManager(stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 112; 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 < 112; 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 SACParserCSS3(SACParserCSS3TokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 112; 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(SACParserCSS3TokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 112; 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(); + } + + @SuppressWarnings("serial") + 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_f() { + 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 jj_expentries = new java.util.ArrayList(); + 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]; + } + + for (int[] oldentry : jj_expentries) { + if (oldentry.length == jj_expentry.length) { + boolean isMatched = true; + + for (int i = 0; i < jj_expentry.length; i++) { + if (oldentry[i] != jj_expentry[i]) { + isMatched = false; + break; + } + + } + if (isMatched) { + jj_expentries.add(jj_expentry); + break; + } + } + } + + if (pos != 0) { + jj_lasttokens[(jj_endpos = pos) - 1] = kind; + } + } + } + + /** Generate ParseException. */ + public ParseException generateParseException() { + jj_expentries.clear(); + boolean[] la1tokens = new boolean[107]; + if (jj_kind >= 0) { + la1tokens[jj_kind] = true; + jj_kind = -1; + } + for (int i = 0; i < 112; i++) { + if (jj_la1[i] == jj_gen) { + for (int j = 0; j < 32; j++) { + if ((jj_la1_0[i] & (1< jj_gen) { + jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; + switch (i) { + case 0: jj_3_1(); 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; + } + +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS3Constants.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS3Constants.java new file mode 100644 index 000000000..a7b7ad8e8 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS3Constants.java @@ -0,0 +1,334 @@ +/* Generated By:JavaCC: Do not edit this line. SACParserCSS3Constants.java */ +package com.fr.third.steadystate.css.parser; + + +/** + * Token literal values and constants. + * Generated by org.javacc.parser.OtherFilesGen#start() + */ +public interface SACParserCSS3Constants { + + /** End of File. */ + int EOF = 0; + /** RegularExpression Id. */ + int S = 1; + /** RegularExpression Id. */ + int W = 2; + /** RegularExpression Id. */ + int H = 6; + /** RegularExpression Id. */ + int HNUM = 7; + /** RegularExpression Id. */ + int NONASCII = 8; + /** RegularExpression Id. */ + int UNICODE = 9; + /** RegularExpression Id. */ + int ESCAPE = 10; + /** RegularExpression Id. */ + int NMSTART = 11; + /** RegularExpression Id. */ + int NMCHAR = 12; + /** RegularExpression Id. */ + int NL = 13; + /** RegularExpression Id. */ + int STRING1 = 14; + /** RegularExpression Id. */ + int STRING2 = 15; + /** RegularExpression Id. */ + int COMMENT_ = 16; + /** RegularExpression Id. */ + int AND = 17; + /** RegularExpression Id. */ + int NOT = 18; + /** RegularExpression Id. */ + int ONLY = 19; + /** RegularExpression Id. */ + int NUMBER = 20; + /** RegularExpression Id. */ + int INHERIT = 21; + /** RegularExpression Id. */ + int IDENT = 22; + /** RegularExpression Id. */ + int NAME = 23; + /** RegularExpression Id. */ + int NUM = 24; + /** RegularExpression Id. */ + int STRING = 25; + /** RegularExpression Id. */ + int URL = 26; + /** RegularExpression Id. */ + int A_LETTER = 27; + /** RegularExpression Id. */ + int C_LETTER = 28; + /** RegularExpression Id. */ + int D_LETTER = 29; + /** RegularExpression Id. */ + int E_LETTER = 30; + /** RegularExpression Id. */ + int F_LETTER = 31; + /** RegularExpression Id. */ + int G_LETTER = 32; + /** RegularExpression Id. */ + int H_LETTER = 33; + /** RegularExpression Id. */ + int I_LETTER = 34; + /** RegularExpression Id. */ + int K_LETTER = 35; + /** RegularExpression Id. */ + int L_LETTER = 36; + /** RegularExpression Id. */ + int M_LETTER = 37; + /** RegularExpression Id. */ + int N_LETTER = 38; + /** RegularExpression Id. */ + int O_LETTER = 39; + /** RegularExpression Id. */ + int P_LETTER = 40; + /** RegularExpression Id. */ + int R_LETTER = 41; + /** RegularExpression Id. */ + int S_LETTER = 42; + /** RegularExpression Id. */ + int T_LETTER = 43; + /** RegularExpression Id. */ + int U_LETTER = 44; + /** RegularExpression Id. */ + int V_LETTER = 45; + /** RegularExpression Id. */ + int X_LETTER = 46; + /** RegularExpression Id. */ + int Z_LETTER = 47; + /** RegularExpression Id. */ + int CDO = 48; + /** RegularExpression Id. */ + int CDC = 49; + /** RegularExpression Id. */ + int INCLUDES = 50; + /** RegularExpression Id. */ + int DASHMATCH = 51; + /** RegularExpression Id. */ + int PREFIXMATCH = 52; + /** RegularExpression Id. */ + int SUFFIXMATCH = 53; + /** RegularExpression Id. */ + int SUBSTRINGMATCH = 54; + /** RegularExpression Id. */ + int LBRACE = 55; + /** RegularExpression Id. */ + int RBRACE = 56; + /** RegularExpression Id. */ + int LROUND = 57; + /** RegularExpression Id. */ + int RROUND = 58; + /** RegularExpression Id. */ + int DOT = 59; + /** RegularExpression Id. */ + int SEMICOLON = 60; + /** RegularExpression Id. */ + int COLON = 61; + /** RegularExpression Id. */ + int ASTERISK = 62; + /** RegularExpression Id. */ + int SLASH = 63; + /** RegularExpression Id. */ + int MINUS = 64; + /** RegularExpression Id. */ + int EQUALS = 65; + /** RegularExpression Id. */ + int LSQUARE = 66; + /** RegularExpression Id. */ + int RSQUARE = 67; + /** RegularExpression Id. */ + int PLUS = 68; + /** RegularExpression Id. */ + int GREATER = 69; + /** RegularExpression Id. */ + int TILDE = 70; + /** RegularExpression Id. */ + int COMMA = 71; + /** RegularExpression Id. */ + int HASH = 72; + /** RegularExpression Id. */ + int IMPORT_SYM = 73; + /** RegularExpression Id. */ + int PAGE_SYM = 74; + /** RegularExpression Id. */ + int MEDIA_SYM = 75; + /** RegularExpression Id. */ + int FONT_FACE_SYM = 76; + /** RegularExpression Id. */ + int CHARSET_SYM = 77; + /** RegularExpression Id. */ + int IMPORTANT_SYM = 78; + /** RegularExpression Id. */ + int EMS = 79; + /** RegularExpression Id. */ + int EXS = 80; + /** RegularExpression Id. */ + int LENGTH_PX = 81; + /** RegularExpression Id. */ + int LENGTH_CM = 82; + /** RegularExpression Id. */ + int LENGTH_MM = 83; + /** RegularExpression Id. */ + int LENGTH_IN = 84; + /** RegularExpression Id. */ + int LENGTH_PT = 85; + /** RegularExpression Id. */ + int LENGTH_PC = 86; + /** RegularExpression Id. */ + int ANGLE_DEG = 87; + /** RegularExpression Id. */ + int ANGLE_RAD = 88; + /** RegularExpression Id. */ + int ANGLE_GRAD = 89; + /** RegularExpression Id. */ + int TIME_MS = 90; + /** RegularExpression Id. */ + int TIME_S = 91; + /** RegularExpression Id. */ + int FREQ_HZ = 92; + /** RegularExpression Id. */ + int FREQ_KHZ = 93; + /** RegularExpression Id. */ + int RESOLUTION_DPI = 94; + /** RegularExpression Id. */ + int RESOLUTION_DPCM = 95; + /** RegularExpression Id. */ + int PERCENTAGE = 96; + /** RegularExpression Id. */ + int DIMENSION = 97; + /** RegularExpression Id. */ + int H_PLACEHOLDER = 98; + /** RegularExpression Id. */ + int UNICODE_RANGE = 99; + /** RegularExpression Id. */ + int URI = 100; + /** RegularExpression Id. */ + int FUNCTION_NOT = 101; + /** RegularExpression Id. */ + int FUNCTION_LANG = 102; + /** RegularExpression Id. */ + int FUNCTION = 103; + /** RegularExpression Id. */ + int ATKEYWORD = 104; + /** RegularExpression Id. */ + int UNKNOWN = 105; + + /** Lexical state. */ + int DEFAULT = 0; + /** Lexical state. */ + int COMMENT = 1; + + /** Literal token values. */ + String[] tokenImage = { + "", + "", + "", + "\"/*\"", + "\"*/\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"and\"", + "\"not\"", + "\"only\"", + "", + "\"inherit\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"\"", + "\"~=\"", + "\"|=\"", + "\"^=\"", + "\"$=\"", + "\"*=\"", + "", + "\"}\"", + "\"(\"", + "\")\"", + "\".\"", + "\";\"", + "\":\"", + "\"*\"", + "\"/\"", + "\"-\"", + "\"=\"", + "\"[\"", + "\"]\"", + "", + "", + "\"~\"", + "", + "
true
false
CSSValueImpl
CSSPrimitiveValue
CSSValueList
setCssText
ownerNode
href
The parser must resolve the URI fully before passing it to the + * application.