From ea06b09e192b634cd3793d7db095872ed9aead8e Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 15 Mar 2018 10:17:04 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-6935=20=E9=82=AE=E4=BB=B6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=BB=93=E6=9E=9C=E6=8A=A5=E8=A1=A8html,cssparser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.third_step6.gradle | 3 + fine-cssparser/lib/sac-1.3.jar | Bin 0 -> 15808 bytes .../css/dom/AbstractCSSRuleImpl.java | 99 + .../css/dom/CSSCharsetRuleImpl.java | 145 + .../css/dom/CSSFontFaceRuleImpl.java | 141 + .../css/dom/CSSImportRuleImpl.java | 171 + .../steadystate/css/dom/CSSMediaRuleImpl.java | 250 + .../steadystate/css/dom/CSSOMObject.java | 26 + .../steadystate/css/dom/CSSOMObjectImpl.java | 76 + .../steadystate/css/dom/CSSPageRuleImpl.java | 172 + .../steadystate/css/dom/CSSRuleListImpl.java | 141 + .../css/dom/CSSStyleDeclarationImpl.java | 1374 +++ .../steadystate/css/dom/CSSStyleRuleImpl.java | 196 + .../css/dom/CSSStyleSheetImpl.java | 411 + .../css/dom/CSSStyleSheetListImpl.java | 126 + .../css/dom/CSSUnknownRuleImpl.java | 140 + .../steadystate/css/dom/CSSValueImpl.java | 431 + .../steadystate/css/dom/CounterImpl.java | 144 + .../steadystate/css/dom/DOMExceptionImpl.java | 80 + .../steadystate/css/dom/MediaListImpl.java | 210 + .../third/steadystate/css/dom/Property.java | 165 + .../steadystate/css/dom/RGBColorImpl.java | 178 + .../third/steadystate/css/dom/RectImpl.java | 219 + .../steadystate/css/format/CSSFormat.java | 84 + .../steadystate/css/format/CSSFormatable.java | 33 + .../css/parser/AbstractSACParser.java | 800 ++ .../steadystate/css/parser/CSSOMParser.java | 506 ++ .../steadystate/css/parser/CharStream.java | 120 + .../steadystate/css/parser/CssCharStream.java | 365 + .../css/parser/ExceptionResource.java | 55 + .../steadystate/css/parser/HandlerBase.java | 162 + .../css/parser/LexicalUnitImpl.java | 780 ++ .../steadystate/css/parser/Locatable.java | 30 + .../steadystate/css/parser/LocatableImpl.java | 36 + .../steadystate/css/parser/LocatorImpl.java | 146 + .../css/parser/ParseException.java | 193 + .../steadystate/css/parser/ParserUtils.java | 63 + .../css/parser/SACMediaListImpl.java | 71 + .../steadystate/css/parser/SACParser.java | 30 + .../steadystate/css/parser/SACParserCSS1.java | 1657 ++++ .../css/parser/SACParserCSS1Constants.java | 216 + .../css/parser/SACParserCSS1TokenManager.java | 3217 +++++++ .../steadystate/css/parser/SACParserCSS2.java | 2782 ++++++ .../css/parser/SACParserCSS21.java | 2659 ++++++ .../css/parser/SACParserCSS21Constants.java | 286 + .../parser/SACParserCSS21TokenManager.java | 6654 ++++++++++++++ .../css/parser/SACParserCSS2Constants.java | 255 + .../css/parser/SACParserCSS2TokenManager.java | 3685 ++++++++ .../steadystate/css/parser/SACParserCSS3.java | 3420 ++++++++ .../css/parser/SACParserCSS3Constants.java | 334 + .../css/parser/SACParserCSS3TokenManager.java | 7647 +++++++++++++++++ .../parser/SACParserCSSmobileOKBasic1.java | 1859 ++++ .../SACParserCSSmobileOKBasic1Constants.java | 219 + ...ACParserCSSmobileOKBasic1TokenManager.java | 2950 +++++++ .../css/parser/SACParserMessages.properties | 39 + .../parser/SACParserMessages_de.properties | 39 + .../parser/SACParserMessages_en.properties | 40 + .../css/parser/SelectorListImpl.java | 81 + .../third/steadystate/css/parser/Token.java | 132 + .../steadystate/css/parser/TokenMgrError.java | 147 + .../css/parser/media/MediaQuery.java | 101 + .../parser/selectors/AndConditionImpl.java | 94 + .../selectors/AttributeConditionImpl.java | 92 + .../BeginHyphenAttributeConditionImpl.java | 94 + .../selectors/CharacterDataSelectorImpl.java | 69 + .../parser/selectors/ChildSelectorImpl.java | 94 + .../parser/selectors/ClassConditionImpl.java | 80 + .../selectors/ConditionFactoryImpl.java | 164 + .../selectors/ConditionalSelectorImpl.java | 102 + .../selectors/DescendantSelectorImpl.java | 95 + .../selectors/DirectAdjacentSelectorImpl.java | 104 + .../parser/selectors/ElementSelectorImpl.java | 72 + .../GeneralAdjacentSelectorImpl.java | 106 + .../css/parser/selectors/IdConditionImpl.java | 80 + .../parser/selectors/LangConditionImpl.java | 74 + .../OneOfAttributeConditionImpl.java | 93 + .../PrefixAttributeConditionImpl.java | 91 + .../selectors/PseudoClassConditionImpl.java | 86 + .../selectors/PseudoElementSelectorImpl.java | 76 + .../parser/selectors/SelectorFactoryImpl.java | 139 + .../SubstringAttributeConditionImpl.java | 91 + .../SuffixAttributeConditionImpl.java | 91 + .../SyntheticElementSelectorImpl.java | 48 + .../css/sac/ConditionFactoryAdapter.java | 119 + .../css/sac/ConditionFactoryExt.java | 40 + .../css/sac/DocumentHandlerAdapter.java | 169 + .../css/sac/DocumentHandlerExt.java | 128 + .../css/sac/SelectorFactoryAdapter.java | 124 + .../css/sac/SelectorFactoryExt.java | 44 + .../css/userdata/UserDataConstants.java | 25 + .../third/steadystate/css/util/LangUtils.java | 66 + .../fr/third/steadystate/css/util/Output.java | 145 + .../util/ThrowCssExceptionErrorHandler.java | 57 + 93 files changed, 49743 insertions(+) create mode 100644 fine-cssparser/lib/sac-1.3.jar create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/AbstractCSSRuleImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSCharsetRuleImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSFontFaceRuleImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSImportRuleImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSMediaRuleImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSOMObject.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSOMObjectImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSPageRuleImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSRuleListImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSStyleDeclarationImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSStyleRuleImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSStyleSheetImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSStyleSheetListImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSUnknownRuleImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/CSSValueImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/CounterImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/DOMExceptionImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/MediaListImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/Property.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/RGBColorImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/dom/RectImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/format/CSSFormat.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/format/CSSFormatable.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/AbstractSACParser.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/CSSOMParser.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/CharStream.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/CssCharStream.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/ExceptionResource.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/HandlerBase.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/LexicalUnitImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/Locatable.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/LocatableImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/LocatorImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/ParseException.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/ParserUtils.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACMediaListImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParser.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS1.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS1Constants.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS1TokenManager.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS2.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS21.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS21Constants.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS21TokenManager.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS2Constants.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS2TokenManager.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS3.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS3Constants.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS3TokenManager.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSSmobileOKBasic1.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSSmobileOKBasic1Constants.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSSmobileOKBasic1TokenManager.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserMessages.properties create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserMessages_de.properties create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserMessages_en.properties create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/SelectorListImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/Token.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/TokenMgrError.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/media/MediaQuery.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/AndConditionImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/AttributeConditionImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/BeginHyphenAttributeConditionImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/CharacterDataSelectorImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ChildSelectorImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ClassConditionImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ConditionFactoryImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ConditionalSelectorImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/DescendantSelectorImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/DirectAdjacentSelectorImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ElementSelectorImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/GeneralAdjacentSelectorImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/IdConditionImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/LangConditionImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/OneOfAttributeConditionImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/PrefixAttributeConditionImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/PseudoClassConditionImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/PseudoElementSelectorImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/SelectorFactoryImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/SubstringAttributeConditionImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/SuffixAttributeConditionImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/SyntheticElementSelectorImpl.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/sac/ConditionFactoryAdapter.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/sac/ConditionFactoryExt.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/sac/DocumentHandlerAdapter.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/sac/DocumentHandlerExt.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/sac/SelectorFactoryAdapter.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/sac/SelectorFactoryExt.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/userdata/UserDataConstants.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/util/LangUtils.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/util/Output.java create mode 100644 fine-cssparser/src/com/fr/third/steadystate/css/util/ThrowCssExceptionErrorHandler.java 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 0000000000000000000000000000000000000000..39b92b1d89c53bcaf82aeda2e4fe97ad534125f9 GIT binary patch literal 15808 zcmaib1z1%}_dea-Dcvm~-QC?FARge*T}pR{q%;E3-O}ADf^;Y$B_${V|HJkEK0eOn ze*gVE!v>z2ckeZ`X3fmI-mR(t4TA)6cgbcr^ZxbA-#-vRcO@xJF%~&xX*N|*H5|}C z5Fp4krjI1WBrHidixsH+Zf-Ii*TxC--H!z z?p=<@LJ>u8R*|^~eX!xF2$l;oUEG+H7dCA8Rl=Ufe&ErF$s)hkIFgLH8Z}@itkxng z&ocV;9b>#jSKa5Y0VvFDzIAZLpF~cO#-S8(&pMv_^AlJvyH?*BSmgJn6f${Q0v$iv}QTDsvQOIh>C| ztX!U|v|fR(G5nKUOG#Yp6b>FyQgIY{y~B(63M81urRFiH=!6zNm?{Kf$#7p2G&g3= z=KgP$xGSi>Crs~t7#nU!#zmM1*Cld(m_hsLsf;;L?4K|7le`9P+G7G}+Jx=*>0OR>XRJq1S6WN>MzGJ(1Y=cT!Q&WVOg3W6A8Z2 zj+fv>&Uv_&CGg-VIPeLHHlD8-5HDRh{AhHyC|}90J@S&P+_QbYOXl{wU`$D}=uEq) zd}RhrKxQ>6inYT$<9$nQav@a>62fXt|XSs|CZ0%787}qbFTB8mbMMOiotF&G(KpCv*#8W1Mwo!Z`A%7?8SD{nIGho^vRAaf1dW#a9`p1vs^46`FJ^7dA`ax zewi@45qJV&gb_ShmezyJUxw-k372rhXnJ`jo~-H`G<+$xRPu>9VZf|GZo_6xUH^KE z99sAf^?iI;`4a0;#K>ZJpQX;cg5?jQF^_78YuR-(-pry2+oI-g&Ew@UH;0bVnP-UE zz4u!}7SPGv3S=gjS2hX>q$(V<$Afhza}+Dzo_RBN8+JL(v@t?(`vGEx6Vkj+gsxlF z5bmc4634qXj7^={)JC6J%El+BwNJLLSWm7?bx*pOv!AeJ1a3)J#WhdHqM16gJ{@!k ztm@P2;~34UqjP7DniL_~i>hDG!Q+bThIVoO!Td2#)4IK{pe%{ozf*C9Vf?IaJZG=? zwTQl5_wMn^RxDi5tMmP51bsdvF)~53a$Gkuya;d~Pu_dD8@L(x3jQPt&bEKiLWmA8 z#^q{v&G!2A9et`~*O?!Cfukfu>~A#^IE|EmY|qa=X!dkH>;!9!Jm1hQ0v*oMD$F^M zBRNs*dkBO#t6$ZHOmQ#6sola=-e~cnY*t1&llD`EwD#AE{F28O3E&zF@%f@?KJ`)% z)kEj?=D;Oe4q=D!=_ZBqbKm4kBVH0G>aYWT@t2TP0`xjuRhRoT{fEVii2>Q0gJdv` zK4*Qjydkk+-|Ce)Q=cau?(8$>nC=*(2GXX85x`!jD!6#ORSxjkLH9p8Q(Ij-;tc8{ zgS#oeC6qdO=P+DPGV$We5WRi=zMxz);^a5)__Dp~7xE5{nTZ$L!^SJPpN3*2L}W8F z;XemO&Xg+e3b3M|cFyh!fnS=+W;Qq#d3mqHd658&# zTebcyZeyTTi(z5{M;5eN-Icqw>_3Z}l9;lbw3LP>tCF;msU6T9;OxSp4RCS>+S~Dy zbFi|bB1t#_OkDskS;Rf>{_&LcDLK8kjj5USOM7=aa(PoXQx-*_ovR1ACcxB|0Tl@q z>Hf)ZV9P2D=*jj@7Jsd%f8Gte2EyMp+&RtuM=g~9s%7Tv{6A`9fYo$1{e$~wJ=X{I z3}c#{$_%L16G#XM`bTPuxwtq1U%0veB<$^80$o7;!fIw?>g)`NQL^q9#RysDD6aO= zM2Fq2rxV(F;&nzH9DspC^ewm1)u=~)RKBMAwjAEqPeeY$Qmra9EyaB+Ew<;_9UUFI z4w?(P4oVPnq1sKOdFrP&9B? zg8+`yFAw7KA996+u-M*fZNrD|N2OafG_x=-hP-rcA!-fuDD(3+@8l4YkRoTogbIrhNyrtW)~T(I zb-{nn?R5ddI$rWM-G117el&pnq=A4Fg-|>M)ATI^@m@(oJj29-l?GPw-q@5TVaE|o zitCs)h3AzphB@mS`rV95)znmL8m%&9sZ^P*gm3D)8uf#$_&j2|*Ie$FbI*V#&%>T> zzUR`J#=`TZgM|^F$b`??#(sSU`CjbZxJ7hq7yLtmIZ9Y8BSFS;LPJ21J!WZl#WS4E%0_T+-N za}9{B`!jL6eO#2xn|>VRwE%lvF z)ghVu>$W*&*7ZCYIL4ju?#4p+s9}42oXRGFMbeJ_2@moaZyR~OoY0S+8;{=AEGU?- z8wpz}uKhC>B25SAa{6gf74R#Op{k@J7a!+{jnC<@T{nJyV-}^6k|gzdmt`e_0wtnI z5iKmXT`roGY!Ob+K#R< z>eUKw40oemp;>w3k$ow;AtAcZNW~kId`&%Vwfb-z?K()~D?#H&^RJHk_c)r`Je;B4 zFar%JF~5r&`BLziw11lO?z|-p52h zeTC*1qTnzEvwzVEQQ9a^dVv4X>J1_i*(#95#;_0&wExR{r9tt@-pTV%P|8ePRqkfT z=~p?Pz`>Q05*6cEQN&&j4(C{xrXk{xRQw*%8~OAbNgCZ{ zE$ZwE+w>vALG@Sl(chwy6tYudXqZO?ggS#P`5QyY7cv}_3Y_9F;ua0nfi!4*sd4vwRkjKs(+Q@UTcv4r4p6iAOm$} zyz6`%Vh8eXA;>~oS`Vf6?x|?7C2!7_ejZ+Ao@V|$JU9{&@$HKB6bz$`_>4fAip|buLJ>i2 z7wjkyC1A=N;=mL13X57n{PlJ8ujfjKrCtoh^X7VNEOI+q+8V)QQ3*=#vnqvDL>Tg& z`I4Ei_|-$~K9|_p7hh?Op$lXElJYdCGFE+7`#IY1CUFg)4>6Onc>m=|>0-1|b`FmI z4}vc@p4HNY>4Yjn-1%xnL%zSNinR7?a!;|Lq|9P>*PQg&7MZYqho`X|7G^A0oYzzU zO5i`dP1A9|2v*!UA%QWapHg3)lBa)>rbM4od`m5*@b+4~mbt#S&^tU$dj`E)`qD+w zd5fbz3rXfn4XdxSCP#_6ngLTJ+c!Ceh!jJNAOdL)ydDI8GfNrf5DJt~2a%A{rv5kO z-|SuA6{=Vj0#l=0d$Q_Ek|InO7M>XC%CwX}c{Xhpq9^|eFLEdkK*Lg>igPfo7?Z&_ zs^$9Obq+VptBHi4bA@WyGJXt_9*$xt2=1?mrQ!LzX0UYNmZM(1-Qe9^DQrSF+o7w( zgeOGj>Z9lnRB}x9=7ng7@0D!|N!ttx+l(q~k~duZLKfG~fAJfM1BvVyQ!Y011hMgT z{1xR4%`o7Wb!FiTKo`{Z}?A+#k`N!e0?cznbwl8%06``FU6 zE>b=D8@OAT8R-q=OmR93N{O;i zn%;{rB1&bm%xxo`>JT*zQK9oAs8)zdQFJaxy|Yf_?|D%ZI+#2=32C%P7iZU5N1ndE zH@|M69X~p71TthO&t#-^Q;rwLckzXfE7Va>)kxw~tEhC#=22ph!DMyX>=j=xJri(i zwAH`v+-sPFc}iNjXNTg}up}zV1%QW)_5bn)Ac-d?gu(d(_!kdX-G z#iU7i!{X}e&clq4(M7Dvr#Hr#HcfVM83m1wIq8HWWH2$WM&5W2@-XkUlb$W9m9->( zav;${Wh$akn{z;dMI|ca9(`A|PEbQ6k2Qu7Z-vAh!(%V5n}gH!**!CTe=?hbe;p&3 zh8%qp zlI+8f_r>F7ljteb)bl>#C-BiPcv4%kiS+^Cj0%pB@EmaYD}pJUdN7DpFCj;8>-85U zeii-lEUI%)b%?ZbSIeKqIt*U;nft@GS6tiC_m_Gzvy`*EWH%a_4X0_!vWKE?`VC#~ z&XVdGTw$KqXs0BG36=-Ae*f~%V;A{r4dueLt@^B~h z*AYMzLvlMI)lyTHxvr{aTD-EV4y#wbY7jqT8w+bZ@=M-LdNA3VOgKI}jASIhGz7bQYj_WX4I_o4MM8mR4C)yO%bA zzfXA42}8;~>=+>fII{RTfK>(|Otd)Yfvl2bqVt`8nU|W(dCi4a6^0;E23TzCxtK>}zaUkS>-T=M`cfDl zYZb2UJ?k4kO5F|Ke8(U}QdKOIa1BS8S2R#x6HxJ_#TiwE3Y-RLJcEl{pWjBs5V+}; z`KXnrFQ?MOkY1@EzEPb`zeK4_TSDI7^I?wGU|Rg4>cHJAd4;>^QaK^=Stm*cT0SwZ zAh=dSgI9yVLX(Ptl5rM0;N5LmcR_5_+FAtXY#T?Q@6wOBw2`61A26qCqF;0IK0-H~ zGK%!L5SKfCJzW%7CJrcnt-gBNep3j9L7*k~e*4CYhrRfk;hAImt3JLgNg~Z2FaSQ<~ccW)z8cwcZEgls%x}|&b%i#s(N=W zH~^K$##G7%a5tn6J=rLF3@Jbqv{}-cd76t?VQmokR%+xEtUnI5P$!q6B%!Zrsk`+Q z^qJ~ZQ&?x;R|nzo0dLSP;&I#J%K%Pp59`WUWQ^<8PEV;ypB8`g1HYuoBo3S_gh?MVtglP@a7jMmKKp;Ek! zRh}Ca?Ji^M13m}d@Ui-vq}4*|qIGpauUX`Hs#fjVs46IaVug^qMNvYq7rpdFCYSYGCW%Q%3pU8v{BQ`iz< z;{f9H{^H5*yUfG%JQW(W)P{p5{$m8se_GwGw@wevQmz_C_E=&#LOn9@{#JbrRtE#q z^1(0MXN6xVqQv(Gk;^GzlZ76H8KjUt<*YlYJnMV*w#c6LhJMp1Om*_GCv*ALM27R> z*s^g)$7>0!E8aoM&<})V07vva5@JFd^Z0IUJhTYM`K|f&rU|tdx*kN5{@(p@%sMdy z>aMQLgmzqkvJG%;F&`_X=<*dC=vGD=CZ(-H>YWOTUFHM?z6-4qOdzZh&shb%KJH5K zCN3Iu*mn|Kqj%OUawvjZNQoxjVv0IOT{kEQJq+i?_54yjSS3Ho%JHFhAFFnejDqjS zNzn#Hk2%T@aZJ~?Pvj_zjA3OTv9;jd7i4H)qUE1z11;p&&+5M^*oIb53x}qMhRS#f z_G2ex+V9xc7X0iMAjFD1Hs?3deY@Z_%NO5HLp7r*gwtP_Xj>%aB6!RX?MWC?!_>Xq z&KBJag+<6jNgUSXgjgd?r-|RMJk0qCEwq35i9`jH?JGgFlXe5U=K;E;lFRyES8;lV zZ~bKI*qz}Bc*ojlyb|C%xPP8OIc`&WKC_#AZ!l74c8Xn|8|Lw0lMWK^2)S?XtX_=n z9cP<6+K=$(gIImRYEDTTSa#D%1p4ngsKvImDIEP@*8akdG>-Sukj*w*e{~M^oAarN z!@*`yz8_8>WxVa1Uuel{c_gwz(FSMr;^(>>KL%$rMIHtmCWI+9e~>RVfzB`#k9eS* zor9~3hP|tk8Q{-p+%-W7bcDePS=}9|%S6LN!u=xAH=!P+rq&hP6z4}FrUWr{;KENB znuzyaBU->W=mydkk~Sb58C!?8!e#Hd4y!A}aodbzM2h3-it{SpcJp>tbM}vwHW@69 zrb4lSx)4DWif!jaWN}ucG)yPCK>&qLP3o8lYhWo-g6)Kss^JQIcB=HU4R3$RQ8Vgx z3sm{9(Z=T5F(udn<&Z_LWFiCG4l_;$Yo0RmXjmkqPgFCUEUQ0m@Xn>Bm>TqIg|^;< zQoD^q=&Khkkn7dh&u3+mqWZ8+w|(&xN8|t6ut(sL`p-HN1oBIBlx=cJyPU1X z#Xxzvo`n~M`H(_WGOlCz#_Clv5dghnj$QhnmT8YzrX^1mL~yo1x9codv5;*Jo*F?h zVg*dlQ^X*AY9D`2f>Q>)-cGG;&X6be4a0rY5VvA?*nqwg(k@1oo4Tl0)|6G23~h$# z4142)Y^CBMCFU$fRz7Q$IVRr{+BfMNos`7APkI-AuIRfl(%YE`dmo3tps73g8pv*P zWO9(8o(|;gwTf8@$m>9#@|_dJ4CKx{{RKP4wj0HHM9$Ch&R9*Q-@SZzhcwT9HzVRe zKWU1r=(V)tPE^#5;u$`_g~Kzr%=jte;;)w#wNHN$Pp$4M_PS*zO^FmGdAKM`-%|g= z&m2Oq4cdX4YK~QnTxbYuDBw9ICfpa(2ztfpv7zA$@z8%$-vvk|g8a4*RHz>DUqw?p zi+^wne{;X~*6&;~9UUF!#5j5Rk(6OU)Nd3;ej?1~)YX@K zfXFO_q9-hulD%A+o zf4ka{pm5ZTpKvQ0G<0$9VU>gu^z-&hUbt`&;5BxfA?ioXLW%0tW!*F!IbH9y|3E?&W^e|KdCJushY7%ns}e+xC)+& z+2?NTqI>Omn7>ZSbs25}B-iTAQZ9S1D;RklG9yW8T{6Diwvm@=uOj&hJ5HMnmd`9!ogc8&Au4=W|6Wbm=c`J$Cm;^s%*D0KOru=(PVyj&EbR@ z0$%}^uz5sAUTq!1Ol7r{v?D-qz7P<}jAs-uuLiVAT-0rPCtA{^y=k@Q*;Gz!sQo^% zian0BC?K}-h4u)@X<@J^pxijeczs-_XZ7Q%z-Ng$9_>R$xtVTTN~^Uy{B?Y8q-7j1 zxh^5=*ZlUWY#Fj=!Ax|mseV_VsJ>k`HLzn@>3q5hr#JPM*9Sj^-*JHvRS* zNo-+s@^iFGLaUX~;rcD}?ztoJdh3TYb7j~-s`7TP#bvR|G|dIlI+plg5$zerhMyuI z`u*15w!YiUPg8Pw{Z45uimVFtHA7b5xCFKh7AuxY*Gwn!|Z$9!;ZQy!W!2}H?F=zZ-joQ z+8A&MzeN0vc|7o4V?$+4C0ry>gzg6FCgGCFBjwWil6b>@-J*B33-9=e4R(sDn4y1Z z?^PA`%@ZHx{Z8%|_&>t-zN7aFlVF58NWO;XAQuiY#_D*%c^UjW{yN{6!MK*^*Jt*L zM&?fwRG&UhWb5T+ccfa3oL$W}l}9ZMwEVEYg?u<^m)WAKOFi%KLwDFb6IGoyWYl`6i4SbqP}mn1&;7uFC1Fk*bCw&tvw?rC&(e2 zaJT&qIY1GB-jl`3;q=Py7%VhdDRBKo=PrUQe2nH%23VN70NucouCCGdF?Y60&cVT9 z=1lW2shX{I38rOgE+mzB#%okuh2{k4Zo%u<^}-+9mq1`RdW=(hf0CBgX{w9 z1%+s8*(86k{)HDX(84Ha%AanJZ2tvNP{697$H>x=#!Vp?Sv%KS9fSCelvwNYFH~k{ zEvD`-?puA{<8Uktnfye}6DNh#QMcIxFyfQ+Frt_g;_sEhh|$Tj9=c~p&cL%;&>8Cn zw62gm;+}tzbANkhlEz;o0ckClO|UxsRlDo~q|+KghAxacH3p`T180R+l(^w%v`OR5 zPWbO?Vb#zKTvB1OLmpY%LebfD_D5`$ljs6fyIm#l)-WO5JpM1aHeeWM*Rq7wMK~x= zG#om#>DZl4Mm%`l=Zv2>hU@mY#dy` z4s=`LiEsyNcGulL`wmCPYLty+Jz)8*uR=(~Kh4grC9=ZxcXLzQfCQ%QFsd|xd2Q6` z7XtBL+xUd~pJ6)!z9p zMTDsh_})lq1e9LH5t=DRV|g*O5CU8K9T6)W6-(RAj32nbMY@Y~Y>g+}DH9Hi4C-s! zcAOaU7PNO)Rh$GM5G4=lP8Nk^Y zXlEg3=j`I-YIc{C0iVa95C!4`Ex5gC^>uX(bb**4IuKV317`z0V*rzqgU%iQng>~= zGZu>{7y%FO1GK%nc~<2Wv~4~CLN8RfXg0<+ElJ|05`mJ%;+qymy%NS0JqM{IHpGBf zCR`kfA)A9bJ^TU+#UJBVn?fSCjAVx85~ii2iPG?UTO_?PA6pDp@bs;Y3Uu^uxG_Uk zZVKD zbEko{X`X3!a*wV7tTzabK|vVSZm>KHMhHG{zXo;kwqtDpvv8AI71TzgBd1*pr-;SX z8yc05S3WAHCM_=ePe|kSx6F!SBi~)}gf0YlVX17d0q;J$Yn=9}cGL-!!L%EHGDf7!6=t;N(Z*0X4#b zp=pBy5A&X0QVq65|08T~spA@?2YoNERXlQEqy3F9p7qx0-ZeA{Z%7Z+KK>ensTSuG zM;alKv!s{xvXO7sa*;4psS-U(KkxRB9ojDK6rfE?=sx9BT#-@t+@R~?AnLBcgf8gr z_@*nO72%BctFb39P?du+xFU!oK67slt#28@mBduwDq=uf8i{B1r}YSxX7mBSs-fk< z$mw7TKZ@PWG5#+NM^|pI62zeMvK%~~EFwjbmuZr^9C#|0toZ{zLsCIM%ld+iPeT$J zf})wH(CP6wjuMVn``%*?pVyVnNWXP4IQV|RC*@EgQ}-dy?tDSc>&JYKDsYY0Gs5`A z!mCmvcViW7o?VwE<%}k1QqxboOVUeaAHJ=J2YBWe#H!U|Y3_JANp6~F#?i6r3W^B= z9pgQQH-H-neVo03NQ>}o<}AABRUYvkLmPk%+(?~pCcH|_a)VZ}R^Tz7Nz5UfTTSiC z*o#+Sq6dt^^uZ?35ZZ#c2Acmdgbx_2a?K&-FYFjBwcJ-#N6^y_a%AN2F?_jpqOu4W zY0Z>N%EgQ2E=x7b%pLvy=xgsVVz3fSB25V}86sDiI=sHtoc=z!gz2e*7vP>R=~98( zQ>2`o$B^sg#z%~nh>8bNAl9{VQY_vqL!PFox95$bdsdQd8py7F4^~!n=i`wPH96VI zG8GBdLTx}~wg^Fc6Y7j<3fxN3xgAtuXh=|M#}e1E!0+X2DBfzs&HD+Aw$nGDp*JM! zo9~fKIiXw8OIcADDU@48um2(^;DE^^#rh@r2k}w)G}MtX3^6Gq!wh}8=1j!C^vW%Y zIgm_#cR8vxF(6l6`jSgcAFZrNxGEt@ian@G6k`OZhyr)p=C#3v$9Irv!-1 zZI}aG-opFu%PFhOMs!VKwuZBw*R_Oj2Jb!KBV?M1Q%J)HI7@il5%T>eO03B=U-yN zd&*KjuV*q9H00g?7MuQ-q20$OKuk4Sz@0)X6e%F`u%;)6lw?^+R+hvgVBvQ$Mo^Hp zHxE2nXXw-9E?$ojnu}$c3onr@gz7FzX)G!l>JX#8Hb)EbRD2pSt{Ao;X0}Kxg6P(x zx{sgaOY6#-%??5wRb=KGNTaYAHHma7vQT=qJrkO;~ZfKceeU5qm{9PD2$`m=?8@a8q){Cdv>5c9P zXAZl$-*UHdm3iCFvyFcrFNcXj<_fwvzAff`rS1lV@k1A9;7U6x+;VJVhnd=iTh%uy zn@Uqa7*oFJqRBNxt@{XM)F}As<0VmKKQ`4X?RfbHNH!vQ8qD31(AUX=ZF@*Hl2VE0 zc4qNS3sXPT;3lKQE_%9zH*s?)N~-(Z_Xw{E;R`{)l;{(>QCL52bjpe7brciUyt+;2 zL{IsmeL;NVhrxSw1cLZAsGBlDg&I`AmuC&2t%D8VVJ{g)3V`<2p!FC#%pWN{B!ajT zZ^=Kon~uFyD{-)QaLbto39U01LqQCZYAlM&>rRGPRNenE*UgbdvLMy09U%X_C`OV|i6#Hx0tAdeG0%O@ff*i_jJ6?vvZo0%EA#r*rIjvCK?S zptuDIg#+=2r+@4d6Oaj@>rSJ3cl}3``={9-uYc^5lRwqTLASf3(|?*h`~c;@pZ%Bu z_z#F5=(Y^^Um*Xb2mWsaaGma*lK0Pb_x3vQ|EKG{w->wxh=cn3x@+P2cZ)wd-+ym) zr}X`E-L=a8uU3C_zyIFy|9bUL{|hb=+F$ArKvW}m5B?)(2M!0GG`WYn28qhS;T}n$fCGXjEbalP z$sYj(PhWt;fm5mXaG{{x!$02dzll|FC~&^=9?BN9Ujv8wKZXyC6#)kYCkpRDT({BO1n90{EKxkthVaY5j3_pekCI4n5Dat{l`_z3L(pKt+x z062ef{{RG#$^rbn|H)>6 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\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"\"", + "\"~=\"", + "\"|=\"", + "\"^=\"", + "\"$=\"", + "\"*=\"", + "", + "\"}\"", + "\"(\"", + "\")\"", + "\".\"", + "\";\"", + "\":\"", + "\"*\"", + "\"/\"", + "\"-\"", + "\"=\"", + "\"[\"", + "\"]\"", + "", + "", + "\"~\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"progid:\"", + }; + +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS3TokenManager.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS3TokenManager.java new file mode 100644 index 000000000..f9e161ec5 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS3TokenManager.java @@ -0,0 +1,7647 @@ +/* SACParserCSS3TokenManager.java */ +/* Generated By:JavaCC: Do not edit this line. SACParserCSS3TokenManager.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 SACParserCSS3TokenManager implements SACParserCSS3Constants { + + /** 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 & 0x800000000000000L) != 0L) + return 1361; + if ((active0 & 0x40000L) != 0L) + { + jjmatchedKind = 22; + jjmatchedPos = 0; + return 1362; + } + if ((active0 & 0x2a0000L) != 0L || (active1 & 0x40000000000L) != 0L) + { + jjmatchedKind = 22; + jjmatchedPos = 0; + return 1363; + } + if ((active0 & 0x2000000000000L) != 0L || (active1 & 0x1L) != 0L) + return 729; + return -1; + case 1: + if ((active0 & 0x40000L) != 0L) + { + jjmatchedKind = 22; + jjmatchedPos = 1; + return 1364; + } + if ((active0 & 0x2a0000L) != 0L || (active1 & 0x40000000000L) != 0L) + { + jjmatchedKind = 22; + jjmatchedPos = 1; + return 1363; + } + return -1; + case 2: + if ((active0 & 0x20000L) != 0L) + return 1363; + if ((active0 & 0x40000L) != 0L) + return 1365; + if ((active0 & 0x280000L) != 0L || (active1 & 0x40000000000L) != 0L) + { + jjmatchedKind = 22; + jjmatchedPos = 2; + return 1363; + } + return -1; + case 3: + if ((active0 & 0x80000L) != 0L) + return 1363; + if ((active0 & 0x200000L) != 0L || (active1 & 0x40000000000L) != 0L) + { + jjmatchedKind = 22; + jjmatchedPos = 3; + return 1363; + } + return -1; + case 4: + if ((active0 & 0x200000L) != 0L || (active1 & 0x40000000000L) != 0L) + { + jjmatchedKind = 22; + jjmatchedPos = 4; + return 1363; + } + return -1; + case 5: + if ((active0 & 0x200000L) != 0L || (active1 & 0x40000000000L) != 0L) + { + jjmatchedKind = 22; + jjmatchedPos = 5; + return 1363; + } + 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 36: + return jjMoveStringLiteralDfa1_0(0x20000000000000L, 0x0L); + case 40: + return jjStopAtPos(0, 57); + case 41: + return jjStopAtPos(0, 58); + case 42: + { + jjmatchedKind = 62; + jjmatchedPos = 0; + } + return jjMoveStringLiteralDfa1_0(0x40000000000000L, 0x0L); + case 45: + { + jjmatchedKind = 64; + jjmatchedPos = 0; + } + return jjMoveStringLiteralDfa1_0(0x2000000000000L, 0x0L); + case 46: + return jjStartNfaWithStates_0(0, 59, 1361); + case 47: + { + jjmatchedKind = 63; + jjmatchedPos = 0; + } + return jjMoveStringLiteralDfa1_0(0x8L, 0x0L); + case 58: + return jjStopAtPos(0, 61); + case 59: + return jjStopAtPos(0, 60); + case 60: + return jjMoveStringLiteralDfa1_0(0x1000000000000L, 0x0L); + case 61: + return jjStopAtPos(0, 65); + case 91: + return jjStopAtPos(0, 66); + case 93: + return jjStopAtPos(0, 67); + case 94: + return jjMoveStringLiteralDfa1_0(0x10000000000000L, 0x0L); + case 65: + case 97: + return jjMoveStringLiteralDfa1_0(0x20000L, 0x0L); + case 73: + case 105: + return jjMoveStringLiteralDfa1_0(0x200000L, 0x0L); + case 78: + case 110: + return jjMoveStringLiteralDfa1_0(0x40000L, 0x0L); + case 79: + case 111: + return jjMoveStringLiteralDfa1_0(0x80000L, 0x0L); + case 80: + case 112: + return jjMoveStringLiteralDfa1_0(0x0L, 0x40000000000L); + case 124: + return jjMoveStringLiteralDfa1_0(0x8000000000000L, 0x0L); + case 125: + return jjStopAtPos(0, 56); + case 126: + { + jjmatchedKind = 70; + jjmatchedPos = 0; + } + return jjMoveStringLiteralDfa1_0(0x4000000000000L, 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, 0x1000000000000L, active1, 0L); + case 42: + if ((active0 & 0x8L) != 0L) + return jjStopAtPos(1, 3); + break; + case 45: + return jjMoveStringLiteralDfa2_0(active0, 0x2000000000000L, active1, 0L); + case 61: + if ((active0 & 0x4000000000000L) != 0L) + return jjStopAtPos(1, 50); + else if ((active0 & 0x8000000000000L) != 0L) + return jjStopAtPos(1, 51); + else if ((active0 & 0x10000000000000L) != 0L) + return jjStopAtPos(1, 52); + else if ((active0 & 0x20000000000000L) != 0L) + return jjStopAtPos(1, 53); + else if ((active0 & 0x40000000000000L) != 0L) + return jjStopAtPos(1, 54); + break; + case 78: + case 110: + return jjMoveStringLiteralDfa2_0(active0, 0x2a0000L, active1, 0L); + case 79: + case 111: + return jjMoveStringLiteralDfa2_0(active0, 0x40000L, active1, 0L); + case 82: + case 114: + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x40000000000L); + 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, 0x1000000000000L, active1, 0L); + case 62: + if ((active0 & 0x2000000000000L) != 0L) + return jjStopAtPos(2, 49); + break; + case 68: + case 100: + if ((active0 & 0x20000L) != 0L) + return jjStartNfaWithStates_0(2, 17, 1363); + break; + case 72: + case 104: + return jjMoveStringLiteralDfa3_0(active0, 0x200000L, active1, 0L); + case 76: + case 108: + return jjMoveStringLiteralDfa3_0(active0, 0x80000L, active1, 0L); + case 79: + case 111: + return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x40000000000L); + case 84: + case 116: + if ((active0 & 0x40000L) != 0L) + return jjStartNfaWithStates_0(2, 18, 1365); + break; + 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 & 0x1000000000000L) != 0L) + return jjStopAtPos(3, 48); + break; + case 69: + case 101: + return jjMoveStringLiteralDfa4_0(active0, 0x200000L, active1, 0L); + case 71: + case 103: + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x40000000000L); + case 89: + case 121: + if ((active0 & 0x80000L) != 0L) + return jjStartNfaWithStates_0(3, 19, 1363); + break; + 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, 0x40000000000L); + case 82: + case 114: + return jjMoveStringLiteralDfa5_0(active0, 0x200000L, 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, 0x40000000000L); + case 73: + case 105: + return jjMoveStringLiteralDfa6_0(active0, 0x200000L, 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 & 0x40000000000L) != 0L) + return jjStopAtPos(6, 106); + break; + case 84: + case 116: + if ((active0 & 0x200000L) != 0L) + return jjStartNfaWithStates_0(6, 21, 1363); + 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 = 1361; + 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 1364: + if ((0x3ff200000000000L & l) != 0L) + { jjCheckNAddStates(0, 2); } + else if (curChar == 40) + { + if (kind > 103) + kind = 103; + } + if ((0x3ff200000000000L & l) != 0L) + { + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + } + break; + case 1362: + if ((0x3ff200000000000L & l) != 0L) + { jjCheckNAddStates(0, 2); } + else if (curChar == 40) + { + if (kind > 103) + kind = 103; + } + if ((0x3ff200000000000L & l) != 0L) + { + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + } + break; + case 1363: + if ((0x3ff200000000000L & l) != 0L) + { jjCheckNAddStates(0, 2); } + else if (curChar == 40) + { + if (kind > 103) + kind = 103; + } + if ((0x3ff200000000000L & l) != 0L) + { + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + } + break; + case 1365: + if ((0x3ff200000000000L & l) != 0L) + { jjCheckNAddStates(0, 2); } + else if (curChar == 40) + { + if (kind > 103) + kind = 103; + } + if ((0x3ff200000000000L & l) != 0L) + { + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + } + else if (curChar == 40) + { + if (kind > 101) + kind = 101; + } + break; + case 1361: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(3, 6); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(691, 692); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(686, 690); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(682, 685); } + 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 > 24) + kind = 24; + { jjCheckNAdd(258); } + } + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 20) + kind = 20; + { jjCheckNAdd(257); } + } + break; + case 0: + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 20) + kind = 20; + { jjCheckNAddStates(52, 150); } + } + else if ((0x100003600L & l) != 0L) + { + if (kind > 1) + kind = 1; + { jjCheckNAddStates(151, 160); } + } + else if (curChar == 45) + { jjAddStates(161, 164); } + else if (curChar == 46) + { jjCheckNAddStates(165, 185); } + else if (curChar == 33) + { jjCheckNAddStates(186, 189); } + else if (curChar == 35) + { jjCheckNAddTwoStates(49, 50); } + else if (curChar == 44) + { + if (kind > 71) + kind = 71; + } + else if (curChar == 62) + { + if (kind > 69) + kind = 69; + } + else if (curChar == 43) + { + if (kind > 68) + kind = 68; + } + else if (curChar == 39) + { jjCheckNAddStates(190, 192); } + else if (curChar == 34) + { jjCheckNAddStates(193, 195); } + break; + case 1: + if ((0xfffffffbffffcbffL & l) != 0L) + { jjCheckNAddStates(193, 195); } + break; + case 2: + if (curChar == 34 && kind > 25) + kind = 25; + break; + case 4: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(193, 195); } + break; + case 5: + if (curChar == 10) + { jjCheckNAddStates(193, 195); } + break; + case 6: + case 10: + if (curChar == 13) + { jjCheckNAdd(5); } + break; + case 7: + if ((0xfc00ffffffffcbffL & l) != 0L) + { jjCheckNAddStates(193, 195); } + break; + case 8: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(196, 205); } + break; + case 9: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(206, 210); } + break; + case 11: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(193, 195); } + 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(190, 192); } + break; + case 23: + if ((0xffffff7fffffcbffL & l) != 0L) + { jjCheckNAddStates(190, 192); } + break; + case 24: + if (curChar == 39 && kind > 25) + kind = 25; + break; + case 26: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(190, 192); } + break; + case 27: + if (curChar == 10) + { jjCheckNAddStates(190, 192); } + break; + case 28: + case 32: + if (curChar == 13) + { jjCheckNAdd(27); } + break; + case 29: + if ((0xfc00ffffffffcbffL & l) != 0L) + { jjCheckNAddStates(190, 192); } + break; + case 30: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(211, 220); } + break; + case 31: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(221, 225); } + break; + case 33: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(190, 192); } + 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 > 68) + kind = 68; + break; + case 46: + if (curChar == 62 && kind > 69) + kind = 69; + break; + case 47: + if (curChar == 44 && kind > 71) + kind = 71; + break; + case 48: + if (curChar == 35) + { jjCheckNAddTwoStates(49, 50); } + break; + case 49: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 72) + kind = 72; + { jjCheckNAddTwoStates(49, 50); } + break; + case 51: + if ((0xfc00ffffffffcbffL & l) == 0L) + break; + if (kind > 72) + kind = 72; + { jjCheckNAddTwoStates(49, 50); } + break; + case 52: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 72) + kind = 72; + { jjCheckNAddStates(226, 234); } + break; + case 53: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 72) + kind = 72; + { jjCheckNAddStates(235, 238); } + break; + case 54: + if (curChar != 10) + break; + if (kind > 72) + kind = 72; + { jjCheckNAddTwoStates(49, 50); } + break; + case 55: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 54; + break; + case 56: + if ((0x100003600L & l) == 0L) + break; + if (kind > 72) + kind = 72; + { 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(186, 189); } + break; + case 68: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(186, 189); } + 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(239, 241); } + 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(242, 244); } + break; + case 76: + if (curChar == 47) + { jjCheckNAddStates(186, 189); } + break; + case 87: + if (curChar != 52) + break; + if (kind > 78) + kind = 78; + { jjAddStates(245, 246); } + break; + case 88: + if (curChar == 10 && kind > 78) + kind = 78; + break; + case 89: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 88; + break; + case 90: + if ((0x100003600L & l) != 0L && kind > 78) + kind = 78; + break; + case 91: + if (curChar == 53) + { jjCheckNAdd(87); } + break; + case 92: + if (curChar == 55) + { jjCheckNAdd(87); } + break; + case 93: + if (curChar == 48) + { jjCheckNAddStates(247, 251); } + break; + case 94: + if (curChar == 48) + { jjCheckNAddTwoStates(91, 92); } + break; + case 95: + if (curChar == 48) + { jjCheckNAddStates(252, 254); } + break; + case 96: + if (curChar == 48) + { jjCheckNAddStates(255, 258); } + 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(259, 263); } + break; + case 105: + if (curChar == 48) + { jjCheckNAddTwoStates(102, 103); } + break; + case 106: + if (curChar == 48) + { jjCheckNAddStates(264, 266); } + break; + case 107: + if (curChar == 48) + { jjCheckNAddStates(267, 270); } + break; + case 109: + if (curChar == 49) + { jjCheckNAddStates(271, 274); } + 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(275, 279); } + break; + case 116: + if (curChar == 48) + { jjCheckNAddTwoStates(113, 114); } + break; + case 117: + if (curChar == 48) + { jjCheckNAddStates(280, 282); } + break; + case 118: + if (curChar == 48) + { jjCheckNAddStates(283, 286); } + break; + case 120: + if (curChar == 52) + { jjCheckNAddStates(287, 290); } + 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(291, 295); } + break; + case 127: + if (curChar == 48) + { jjCheckNAddTwoStates(124, 125); } + break; + case 128: + if (curChar == 48) + { jjCheckNAddStates(296, 298); } + break; + case 129: + if (curChar == 48) + { jjCheckNAddStates(299, 302); } + break; + case 131: + if (curChar == 50) + { jjCheckNAddStates(303, 306); } + 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(307, 311); } + break; + case 138: + if (curChar == 48) + { jjCheckNAddTwoStates(135, 136); } + break; + case 139: + if (curChar == 48) + { jjCheckNAddStates(312, 314); } + break; + case 140: + if (curChar == 48) + { jjCheckNAddStates(315, 318); } + break; + case 142: + if (curChar == 49) + { jjCheckNAddStates(319, 322); } + 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(323, 327); } + break; + case 149: + if (curChar == 48) + { jjCheckNAddTwoStates(146, 147); } + break; + case 150: + if (curChar == 48) + { jjCheckNAddStates(328, 330); } + break; + case 151: + if (curChar == 48) + { jjCheckNAddStates(331, 334); } + break; + case 153: + if (curChar == 48) + { jjCheckNAddStates(335, 338); } + 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(339, 343); } + break; + case 160: + if (curChar == 48) + { jjCheckNAddTwoStates(157, 158); } + break; + case 161: + if (curChar == 48) + { jjCheckNAddStates(344, 346); } + break; + case 162: + if (curChar == 48) + { jjCheckNAddStates(347, 350); } + 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(351, 355); } + break; + case 171: + if (curChar == 48) + { jjCheckNAddTwoStates(168, 169); } + break; + case 172: + if (curChar == 48) + { jjCheckNAddStates(356, 358); } + break; + case 173: + if (curChar == 48) + { jjCheckNAddStates(359, 362); } + break; + case 175: + if (curChar == 57) + { jjCheckNAddStates(363, 366); } + 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(367, 371); } + break; + case 182: + if (curChar == 48) + { jjCheckNAddTwoStates(179, 180); } + break; + case 183: + if (curChar == 48) + { jjCheckNAddStates(372, 374); } + break; + case 184: + if (curChar == 48) + { jjCheckNAddStates(375, 378); } + break; + case 188: + if (curChar == 40 && kind > 101) + kind = 101; + break; + case 190: + if (curChar == 52) + { jjCheckNAddStates(379, 381); } + break; + case 191: + if (curChar == 10) + { jjCheckNAdd(188); } + break; + case 192: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 191; + break; + case 193: + if ((0x100003600L & l) != 0L) + { jjCheckNAdd(188); } + break; + case 194: + if (curChar == 53) + { jjCheckNAdd(190); } + break; + case 195: + if (curChar == 55) + { jjCheckNAdd(190); } + break; + case 196: + if (curChar == 48) + { jjCheckNAddStates(382, 386); } + break; + case 197: + if (curChar == 48) + { jjCheckNAddTwoStates(194, 195); } + break; + case 198: + if (curChar == 48) + { jjCheckNAddStates(387, 389); } + break; + case 199: + if (curChar == 48) + { jjCheckNAddStates(390, 393); } + break; + case 201: + if (curChar == 49) + { jjCheckNAddStates(394, 397); } + break; + case 202: + if (curChar == 10) + { jjCheckNAddTwoStates(187, 189); } + break; + case 203: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 202; + break; + case 204: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(187, 189); } + break; + case 205: + if (curChar == 53) + { jjCheckNAdd(201); } + break; + case 206: + if (curChar == 55) + { jjCheckNAdd(201); } + break; + case 207: + if (curChar == 48) + { jjCheckNAddStates(398, 402); } + break; + case 208: + if (curChar == 48) + { jjCheckNAddTwoStates(205, 206); } + break; + case 209: + if (curChar == 48) + { jjCheckNAddStates(403, 405); } + break; + case 210: + if (curChar == 48) + { jjCheckNAddStates(406, 409); } + break; + case 215: + if (curChar == 40 && kind > 102) + kind = 102; + break; + case 217: + if (curChar == 55) + { jjCheckNAddStates(410, 412); } + break; + case 218: + if (curChar == 10) + { jjCheckNAdd(215); } + break; + case 219: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 218; + break; + case 220: + if ((0x100003600L & l) != 0L) + { jjCheckNAdd(215); } + break; + case 221: + if (curChar == 52) + { jjCheckNAdd(217); } + break; + case 222: + if (curChar == 54) + { jjCheckNAdd(217); } + break; + case 223: + if (curChar == 48) + { jjCheckNAddStates(413, 417); } + break; + case 224: + if (curChar == 48) + { jjCheckNAddTwoStates(221, 222); } + break; + case 225: + if (curChar == 48) + { jjCheckNAddStates(418, 420); } + break; + case 226: + if (curChar == 48) + { jjCheckNAddStates(421, 424); } + break; + case 229: + if (curChar == 10) + { jjCheckNAddTwoStates(214, 216); } + break; + case 230: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 229; + break; + case 231: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(214, 216); } + break; + case 232: + if (curChar == 52) + { jjCheckNAdd(228); } + break; + case 233: + if (curChar == 54) + { jjCheckNAdd(228); } + break; + case 234: + if (curChar == 48) + { jjCheckNAddStates(425, 429); } + break; + case 235: + if (curChar == 48) + { jjCheckNAddTwoStates(232, 233); } + break; + case 236: + if (curChar == 48) + { jjCheckNAddStates(430, 432); } + break; + case 237: + if (curChar == 48) + { jjCheckNAddStates(433, 436); } + break; + case 239: + if (curChar == 49) + { jjCheckNAddStates(437, 440); } + break; + case 240: + if (curChar == 10) + { jjCheckNAddTwoStates(213, 227); } + break; + case 241: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 240; + break; + case 242: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(213, 227); } + break; + case 243: + if (curChar == 52) + { jjCheckNAdd(239); } + break; + case 244: + if (curChar == 54) + { jjCheckNAdd(239); } + break; + case 245: + if (curChar == 48) + { jjCheckNAddStates(441, 445); } + break; + case 246: + if (curChar == 48) + { jjCheckNAddTwoStates(243, 244); } + break; + case 247: + if (curChar == 48) + { jjCheckNAddStates(446, 448); } + break; + case 248: + if (curChar == 48) + { jjCheckNAddStates(449, 452); } + break; + case 249: + if ((0x100003600L & l) == 0L) + break; + if (kind > 1) + kind = 1; + { jjCheckNAddStates(151, 160); } + break; + case 250: + if ((0x100003600L & l) == 0L) + break; + if (kind > 1) + kind = 1; + { jjCheckNAdd(250); } + break; + case 251: + if ((0x100003600L & l) == 0L) + break; + if (kind > 2) + kind = 2; + { jjCheckNAdd(251); } + break; + case 252: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(252, 44); } + break; + case 253: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(253, 45); } + break; + case 254: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(254, 46); } + break; + case 255: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(255, 47); } + break; + case 256: + if (curChar == 46) + { jjCheckNAddStates(165, 185); } + break; + case 257: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 20) + kind = 20; + { jjCheckNAdd(257); } + break; + case 258: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 24) + kind = 24; + { jjCheckNAdd(258); } + break; + case 259: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(49, 51); } + break; + case 264: + if (curChar == 10 && kind > 79) + kind = 79; + break; + case 265: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 264; + break; + case 266: + if ((0x100003600L & l) != 0L && kind > 79) + kind = 79; + break; + case 267: + if (curChar == 52) + { jjCheckNAdd(263); } + break; + case 268: + if (curChar == 54) + { jjCheckNAdd(263); } + break; + case 269: + if (curChar == 48) + { jjCheckNAddStates(453, 457); } + break; + case 270: + if (curChar == 48) + { jjCheckNAddTwoStates(267, 268); } + break; + case 271: + if (curChar == 48) + { jjCheckNAddStates(458, 460); } + break; + case 272: + if (curChar == 48) + { jjCheckNAddStates(461, 464); } + break; + case 274: + if (curChar == 53) + { jjCheckNAddStates(465, 468); } + break; + case 275: + if (curChar == 10) + { jjCheckNAddTwoStates(261, 262); } + break; + case 276: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 275; + break; + case 277: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(261, 262); } + break; + case 278: + if (curChar == 52) + { jjCheckNAdd(274); } + break; + case 279: + if (curChar == 54) + { jjCheckNAdd(274); } + break; + case 280: + if (curChar == 48) + { jjCheckNAddStates(469, 473); } + break; + case 281: + if (curChar == 48) + { jjCheckNAddTwoStates(278, 279); } + break; + case 282: + if (curChar == 48) + { jjCheckNAddStates(474, 476); } + break; + case 283: + if (curChar == 48) + { jjCheckNAddStates(477, 480); } + break; + case 284: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(46, 48); } + break; + case 288: + if (curChar != 56) + break; + if (kind > 80) + kind = 80; + { jjAddStates(481, 482); } + break; + case 289: + if (curChar == 10 && kind > 80) + kind = 80; + break; + case 290: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 289; + break; + case 291: + if ((0x100003600L & l) != 0L && kind > 80) + kind = 80; + break; + case 292: + if (curChar == 53) + { jjCheckNAdd(288); } + break; + case 293: + if (curChar == 55) + { jjCheckNAdd(288); } + break; + case 294: + if (curChar == 48) + { jjCheckNAddStates(483, 487); } + break; + case 295: + if (curChar == 48) + { jjCheckNAddTwoStates(292, 293); } + break; + case 296: + if (curChar == 48) + { jjCheckNAddStates(488, 490); } + break; + case 297: + if (curChar == 48) + { jjCheckNAddStates(491, 494); } + break; + case 299: + if (curChar == 53) + { jjCheckNAddStates(495, 498); } + break; + case 300: + if (curChar == 10) + { jjCheckNAddTwoStates(286, 287); } + break; + case 301: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 300; + break; + case 302: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(286, 287); } + break; + case 303: + if (curChar == 52) + { jjCheckNAdd(299); } + break; + case 304: + if (curChar == 54) + { jjCheckNAdd(299); } + break; + case 305: + if (curChar == 48) + { jjCheckNAddStates(499, 503); } + break; + case 306: + if (curChar == 48) + { jjCheckNAddTwoStates(303, 304); } + break; + case 307: + if (curChar == 48) + { jjCheckNAddStates(504, 506); } + break; + case 308: + if (curChar == 48) + { jjCheckNAddStates(507, 510); } + break; + case 309: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(43, 45); } + break; + case 313: + if (curChar != 56) + break; + if (kind > 81) + kind = 81; + { jjAddStates(511, 512); } + break; + case 314: + if (curChar == 10 && kind > 81) + kind = 81; + break; + case 315: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 314; + break; + case 316: + if ((0x100003600L & l) != 0L && kind > 81) + kind = 81; + break; + case 317: + if (curChar == 53) + { jjCheckNAdd(313); } + break; + case 318: + if (curChar == 55) + { jjCheckNAdd(313); } + break; + case 319: + if (curChar == 48) + { jjCheckNAddStates(513, 517); } + break; + case 320: + if (curChar == 48) + { jjCheckNAddTwoStates(317, 318); } + break; + case 321: + if (curChar == 48) + { jjCheckNAddStates(518, 520); } + break; + case 322: + if (curChar == 48) + { jjCheckNAddStates(521, 524); } + break; + case 324: + if (curChar == 48) + { jjCheckNAddStates(525, 528); } + break; + case 325: + if (curChar == 10) + { jjCheckNAddTwoStates(311, 312); } + break; + case 326: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 325; + break; + case 327: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(311, 312); } + break; + case 328: + if (curChar == 53) + { jjCheckNAdd(324); } + break; + case 329: + if (curChar == 55) + { jjCheckNAdd(324); } + break; + case 330: + if (curChar == 48) + { jjCheckNAddStates(529, 533); } + break; + case 331: + if (curChar == 48) + { jjCheckNAddTwoStates(328, 329); } + break; + case 332: + if (curChar == 48) + { jjCheckNAddStates(534, 536); } + break; + case 333: + if (curChar == 48) + { jjCheckNAddStates(537, 540); } + break; + case 334: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(40, 42); } + break; + case 339: + if (curChar == 10 && kind > 82) + kind = 82; + break; + case 340: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 339; + break; + case 341: + if ((0x100003600L & l) != 0L && kind > 82) + kind = 82; + break; + case 342: + if (curChar == 52) + { jjCheckNAdd(338); } + break; + case 343: + if (curChar == 54) + { jjCheckNAdd(338); } + break; + case 344: + if (curChar == 48) + { jjCheckNAddStates(541, 545); } + break; + case 345: + if (curChar == 48) + { jjCheckNAddTwoStates(342, 343); } + break; + case 346: + if (curChar == 48) + { jjCheckNAddStates(546, 548); } + break; + case 347: + if (curChar == 48) + { jjCheckNAddStates(549, 552); } + break; + case 349: + if (curChar == 51) + { jjCheckNAddStates(553, 556); } + break; + case 350: + if (curChar == 10) + { jjCheckNAddTwoStates(336, 337); } + break; + case 351: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 350; + break; + case 352: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(336, 337); } + break; + case 353: + if (curChar == 52) + { jjCheckNAdd(349); } + break; + case 354: + if (curChar == 54) + { jjCheckNAdd(349); } + break; + case 355: + if (curChar == 48) + { jjCheckNAddStates(557, 561); } + break; + case 356: + if (curChar == 48) + { jjCheckNAddTwoStates(353, 354); } + break; + case 357: + if (curChar == 48) + { jjCheckNAddStates(562, 564); } + break; + case 358: + if (curChar == 48) + { jjCheckNAddStates(565, 568); } + break; + case 359: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(37, 39); } + break; + case 364: + if (curChar == 10 && kind > 83) + kind = 83; + break; + case 365: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 364; + break; + case 366: + if ((0x100003600L & l) != 0L && kind > 83) + kind = 83; + break; + case 367: + if (curChar == 52) + { jjCheckNAdd(363); } + break; + case 368: + if (curChar == 54) + { jjCheckNAdd(363); } + break; + case 369: + if (curChar == 48) + { jjCheckNAddStates(569, 573); } + break; + case 370: + if (curChar == 48) + { jjCheckNAddTwoStates(367, 368); } + break; + case 371: + if (curChar == 48) + { jjCheckNAddStates(574, 576); } + break; + case 372: + if (curChar == 48) + { jjCheckNAddStates(577, 580); } + break; + case 375: + if (curChar == 10) + { jjCheckNAddTwoStates(361, 362); } + break; + case 376: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 375; + break; + case 377: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(361, 362); } + break; + case 378: + if (curChar == 52) + { jjCheckNAdd(374); } + break; + case 379: + if (curChar == 54) + { jjCheckNAdd(374); } + break; + case 380: + if (curChar == 48) + { jjCheckNAddStates(581, 585); } + break; + case 381: + if (curChar == 48) + { jjCheckNAddTwoStates(378, 379); } + break; + case 382: + if (curChar == 48) + { jjCheckNAddStates(586, 588); } + break; + case 383: + if (curChar == 48) + { jjCheckNAddStates(589, 592); } + break; + case 384: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(34, 36); } + break; + case 389: + if (curChar == 10 && kind > 84) + kind = 84; + break; + case 390: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 389; + break; + case 391: + if ((0x100003600L & l) != 0L && kind > 84) + kind = 84; + break; + case 392: + if (curChar == 52) + { jjCheckNAdd(388); } + break; + case 393: + if (curChar == 54) + { jjCheckNAdd(388); } + break; + case 394: + if (curChar == 48) + { jjCheckNAddStates(593, 597); } + break; + case 395: + if (curChar == 48) + { jjCheckNAddTwoStates(392, 393); } + break; + case 396: + if (curChar == 48) + { jjCheckNAddStates(598, 600); } + break; + case 397: + if (curChar == 48) + { jjCheckNAddStates(601, 604); } + break; + case 399: + if (curChar == 57) + { jjCheckNAddStates(605, 608); } + break; + case 400: + if (curChar == 10) + { jjCheckNAddTwoStates(386, 387); } + break; + case 401: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 400; + break; + case 402: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(386, 387); } + break; + case 403: + if (curChar == 52) + { jjCheckNAdd(399); } + break; + case 404: + if (curChar == 54) + { jjCheckNAdd(399); } + break; + case 405: + if (curChar == 48) + { jjCheckNAddStates(609, 613); } + break; + case 406: + if (curChar == 48) + { jjCheckNAddTwoStates(403, 404); } + break; + case 407: + if (curChar == 48) + { jjCheckNAddStates(614, 616); } + break; + case 408: + if (curChar == 48) + { jjCheckNAddStates(617, 620); } + break; + case 409: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(31, 33); } + break; + case 413: + if (curChar != 52) + break; + if (kind > 85) + kind = 85; + { jjAddStates(621, 622); } + break; + case 414: + if (curChar == 10 && kind > 85) + kind = 85; + break; + case 415: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 414; + break; + case 416: + if ((0x100003600L & l) != 0L && kind > 85) + kind = 85; + break; + case 417: + if (curChar == 53) + { jjCheckNAdd(413); } + break; + case 418: + if (curChar == 55) + { jjCheckNAdd(413); } + break; + case 419: + if (curChar == 48) + { jjCheckNAddStates(623, 627); } + break; + case 420: + if (curChar == 48) + { jjCheckNAddTwoStates(417, 418); } + break; + case 421: + if (curChar == 48) + { jjCheckNAddStates(628, 630); } + break; + case 422: + if (curChar == 48) + { jjCheckNAddStates(631, 634); } + break; + case 424: + if (curChar == 48) + { jjCheckNAddStates(635, 638); } + break; + case 425: + if (curChar == 10) + { jjCheckNAddTwoStates(411, 412); } + break; + case 426: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 425; + break; + case 427: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(411, 412); } + break; + case 428: + if (curChar == 53) + { jjCheckNAdd(424); } + break; + case 429: + if (curChar == 55) + { jjCheckNAdd(424); } + break; + case 430: + if (curChar == 48) + { jjCheckNAddStates(639, 643); } + break; + case 431: + if (curChar == 48) + { jjCheckNAddTwoStates(428, 429); } + break; + case 432: + if (curChar == 48) + { jjCheckNAddStates(644, 646); } + break; + case 433: + if (curChar == 48) + { jjCheckNAddStates(647, 650); } + break; + case 434: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(28, 30); } + break; + case 438: + if (curChar != 51) + break; + if (kind > 86) + kind = 86; + { jjAddStates(651, 652); } + break; + case 439: + if (curChar == 10 && kind > 86) + kind = 86; + break; + case 440: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 439; + break; + case 441: + if ((0x100003600L & l) != 0L && kind > 86) + kind = 86; + break; + case 442: + if (curChar == 52) + { jjCheckNAdd(438); } + break; + case 443: + if (curChar == 54) + { jjCheckNAdd(438); } + break; + case 444: + if (curChar == 48) + { jjCheckNAddStates(653, 657); } + break; + case 445: + if (curChar == 48) + { jjCheckNAddTwoStates(442, 443); } + break; + case 446: + if (curChar == 48) + { jjCheckNAddStates(658, 660); } + break; + case 447: + if (curChar == 48) + { jjCheckNAddStates(661, 664); } + break; + case 449: + if (curChar == 48) + { jjCheckNAddStates(665, 668); } + break; + case 450: + if (curChar == 10) + { jjCheckNAddTwoStates(436, 437); } + break; + case 451: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 450; + break; + case 452: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(436, 437); } + break; + case 453: + if (curChar == 53) + { jjCheckNAdd(449); } + break; + case 454: + if (curChar == 55) + { jjCheckNAdd(449); } + break; + case 455: + if (curChar == 48) + { jjCheckNAddStates(669, 673); } + break; + case 456: + if (curChar == 48) + { jjCheckNAddTwoStates(453, 454); } + break; + case 457: + if (curChar == 48) + { jjCheckNAddStates(674, 676); } + break; + case 458: + if (curChar == 48) + { jjCheckNAddStates(677, 680); } + break; + case 459: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(25, 27); } + break; + case 464: + if (curChar != 55) + break; + if (kind > 87) + kind = 87; + { jjAddStates(681, 682); } + break; + case 465: + if (curChar == 10 && kind > 87) + kind = 87; + break; + case 466: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 465; + break; + case 467: + if ((0x100003600L & l) != 0L && kind > 87) + kind = 87; + break; + case 468: + if (curChar == 52) + { jjCheckNAdd(464); } + break; + case 469: + if (curChar == 54) + { jjCheckNAdd(464); } + break; + case 470: + if (curChar == 48) + { jjCheckNAddStates(683, 687); } + break; + case 471: + if (curChar == 48) + { jjCheckNAddTwoStates(468, 469); } + break; + case 472: + if (curChar == 48) + { jjCheckNAddStates(688, 690); } + break; + case 473: + if (curChar == 48) + { jjCheckNAddStates(691, 694); } + break; + case 475: + if (curChar == 53) + { jjCheckNAddStates(695, 698); } + break; + case 476: + if (curChar == 10) + { jjCheckNAddTwoStates(462, 463); } + break; + case 477: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 476; + break; + case 478: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(462, 463); } + break; + case 479: + if (curChar == 52) + { jjCheckNAdd(475); } + break; + case 480: + if (curChar == 54) + { jjCheckNAdd(475); } + break; + case 481: + if (curChar == 48) + { jjCheckNAddStates(699, 703); } + break; + case 482: + if (curChar == 48) + { jjCheckNAddTwoStates(479, 480); } + break; + case 483: + if (curChar == 48) + { jjCheckNAddStates(704, 706); } + break; + case 484: + if (curChar == 48) + { jjCheckNAddStates(707, 710); } + break; + case 486: + if (curChar == 52) + { jjCheckNAddStates(711, 714); } + break; + case 487: + if (curChar == 10) + { jjCheckNAddTwoStates(461, 474); } + break; + case 488: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 487; + break; + case 489: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(461, 474); } + break; + case 490: + if (curChar == 52) + { jjCheckNAdd(486); } + break; + case 491: + if (curChar == 54) + { jjCheckNAdd(486); } + break; + case 492: + if (curChar == 48) + { jjCheckNAddStates(715, 719); } + break; + case 493: + if (curChar == 48) + { jjCheckNAddTwoStates(490, 491); } + break; + case 494: + if (curChar == 48) + { jjCheckNAddStates(720, 722); } + break; + case 495: + if (curChar == 48) + { jjCheckNAddStates(723, 726); } + break; + case 496: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(22, 24); } + break; + case 501: + if (curChar != 52) + break; + if (kind > 88) + kind = 88; + { jjAddStates(727, 728); } + break; + case 502: + if (curChar == 10 && kind > 88) + kind = 88; + break; + case 503: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 502; + break; + case 504: + if ((0x100003600L & l) != 0L && kind > 88) + kind = 88; + break; + case 505: + if (curChar == 52) + { jjCheckNAdd(501); } + break; + case 506: + if (curChar == 54) + { jjCheckNAdd(501); } + break; + case 507: + if (curChar == 48) + { jjCheckNAddStates(729, 733); } + break; + case 508: + if (curChar == 48) + { jjCheckNAddTwoStates(505, 506); } + break; + case 509: + if (curChar == 48) + { jjCheckNAddStates(734, 736); } + break; + case 510: + if (curChar == 48) + { jjCheckNAddStates(737, 740); } + break; + case 512: + if (curChar == 49) + { jjCheckNAddStates(741, 744); } + break; + case 513: + if (curChar == 10) + { jjCheckNAddTwoStates(499, 500); } + break; + case 514: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 513; + break; + case 515: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(499, 500); } + break; + case 516: + if (curChar == 52) + { jjCheckNAdd(512); } + break; + case 517: + if (curChar == 54) + { jjCheckNAdd(512); } + break; + case 518: + if (curChar == 48) + { jjCheckNAddStates(745, 749); } + break; + case 519: + if (curChar == 48) + { jjCheckNAddTwoStates(516, 517); } + break; + case 520: + if (curChar == 48) + { jjCheckNAddStates(750, 752); } + break; + case 521: + if (curChar == 48) + { jjCheckNAddStates(753, 756); } + break; + case 523: + if (curChar == 50) + { jjCheckNAddStates(757, 760); } + break; + case 524: + if (curChar == 10) + { jjCheckNAddTwoStates(498, 511); } + break; + case 525: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 524; + break; + case 526: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(498, 511); } + break; + case 527: + if (curChar == 53) + { jjCheckNAdd(523); } + break; + case 528: + if (curChar == 55) + { jjCheckNAdd(523); } + break; + case 529: + if (curChar == 48) + { jjCheckNAddStates(761, 765); } + break; + case 530: + if (curChar == 48) + { jjCheckNAddTwoStates(527, 528); } + break; + case 531: + if (curChar == 48) + { jjCheckNAddStates(766, 768); } + break; + case 532: + if (curChar == 48) + { jjCheckNAddStates(769, 772); } + break; + case 533: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(19, 21); } + break; + case 539: + if (curChar != 52) + break; + if (kind > 89) + kind = 89; + { jjAddStates(773, 774); } + break; + case 540: + if (curChar == 10 && kind > 89) + kind = 89; + break; + case 541: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 540; + break; + case 542: + if ((0x100003600L & l) != 0L && kind > 89) + kind = 89; + break; + case 543: + if (curChar == 52) + { jjCheckNAdd(539); } + break; + case 544: + if (curChar == 54) + { jjCheckNAdd(539); } + break; + case 545: + if (curChar == 48) + { jjCheckNAddStates(775, 779); } + break; + case 546: + if (curChar == 48) + { jjCheckNAddTwoStates(543, 544); } + break; + case 547: + if (curChar == 48) + { jjCheckNAddStates(780, 782); } + break; + case 548: + if (curChar == 48) + { jjCheckNAddStates(783, 786); } + break; + case 550: + if (curChar == 49) + { jjCheckNAddStates(787, 790); } + break; + case 551: + if (curChar == 10) + { jjCheckNAddTwoStates(537, 538); } + break; + case 552: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 551; + break; + case 553: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(537, 538); } + break; + case 554: + if (curChar == 52) + { jjCheckNAdd(550); } + break; + case 555: + if (curChar == 54) + { jjCheckNAdd(550); } + break; + case 556: + if (curChar == 48) + { jjCheckNAddStates(791, 795); } + break; + case 557: + if (curChar == 48) + { jjCheckNAddTwoStates(554, 555); } + break; + case 558: + if (curChar == 48) + { jjCheckNAddStates(796, 798); } + break; + case 559: + if (curChar == 48) + { jjCheckNAddStates(799, 802); } + break; + case 561: + if (curChar == 50) + { jjCheckNAddStates(803, 806); } + break; + case 562: + if (curChar == 10) + { jjCheckNAddTwoStates(536, 549); } + break; + case 563: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 562; + break; + case 564: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(536, 549); } + break; + case 565: + if (curChar == 53) + { jjCheckNAdd(561); } + break; + case 566: + if (curChar == 55) + { jjCheckNAdd(561); } + break; + case 567: + if (curChar == 48) + { jjCheckNAddStates(807, 811); } + break; + case 568: + if (curChar == 48) + { jjCheckNAddTwoStates(565, 566); } + break; + case 569: + if (curChar == 48) + { jjCheckNAddStates(812, 814); } + break; + case 570: + if (curChar == 48) + { jjCheckNAddStates(815, 818); } + break; + case 572: + if (curChar == 55) + { jjCheckNAddStates(819, 822); } + break; + case 573: + if (curChar == 10) + { jjCheckNAddTwoStates(535, 560); } + break; + case 574: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 573; + break; + case 575: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(535, 560); } + break; + case 576: + if (curChar == 52) + { jjCheckNAdd(572); } + break; + case 577: + if (curChar == 54) + { jjCheckNAdd(572); } + break; + case 578: + if (curChar == 48) + { jjCheckNAddStates(823, 827); } + break; + case 579: + if (curChar == 48) + { jjCheckNAddTwoStates(576, 577); } + break; + case 580: + if (curChar == 48) + { jjCheckNAddStates(828, 830); } + break; + case 581: + if (curChar == 48) + { jjCheckNAddStates(831, 834); } + break; + case 582: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(16, 18); } + break; + case 586: + if (curChar != 51) + break; + if (kind > 90) + kind = 90; + { jjAddStates(835, 836); } + break; + case 587: + if (curChar == 10 && kind > 90) + kind = 90; + break; + case 588: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 587; + break; + case 589: + if ((0x100003600L & l) != 0L && kind > 90) + kind = 90; + break; + case 590: + if (curChar == 53) + { jjCheckNAdd(586); } + break; + case 591: + if (curChar == 55) + { jjCheckNAdd(586); } + break; + case 592: + if (curChar == 48) + { jjCheckNAddStates(837, 841); } + break; + case 593: + if (curChar == 48) + { jjCheckNAddTwoStates(590, 591); } + break; + case 594: + if (curChar == 48) + { jjCheckNAddStates(842, 844); } + break; + case 595: + if (curChar == 48) + { jjCheckNAddStates(845, 848); } + break; + case 598: + if (curChar == 10) + { jjCheckNAddTwoStates(584, 585); } + break; + case 599: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 598; + break; + case 600: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(584, 585); } + break; + case 601: + if (curChar == 52) + { jjCheckNAdd(597); } + break; + case 602: + if (curChar == 54) + { jjCheckNAdd(597); } + break; + case 603: + if (curChar == 48) + { jjCheckNAddStates(849, 853); } + break; + case 604: + if (curChar == 48) + { jjCheckNAddTwoStates(601, 602); } + break; + case 605: + if (curChar == 48) + { jjCheckNAddStates(854, 856); } + break; + case 606: + if (curChar == 48) + { jjCheckNAddStates(857, 860); } + break; + case 607: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(13, 15); } + break; + case 610: + if (curChar != 51) + break; + if (kind > 91) + kind = 91; + { jjAddStates(861, 862); } + break; + case 611: + if (curChar == 10 && kind > 91) + kind = 91; + break; + case 612: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 611; + break; + case 613: + if ((0x100003600L & l) != 0L && kind > 91) + kind = 91; + break; + case 614: + if (curChar == 53) + { jjCheckNAdd(610); } + break; + case 615: + if (curChar == 55) + { jjCheckNAdd(610); } + break; + case 616: + if (curChar == 48) + { jjCheckNAddStates(863, 867); } + break; + case 617: + if (curChar == 48) + { jjCheckNAddTwoStates(614, 615); } + break; + case 618: + if (curChar == 48) + { jjCheckNAddStates(868, 870); } + break; + case 619: + if (curChar == 48) + { jjCheckNAddStates(871, 874); } + break; + case 620: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(10, 12); } + break; + case 625: + if (curChar == 10 && kind > 92) + kind = 92; + break; + case 626: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 625; + break; + case 627: + if ((0x100003600L & l) != 0L && kind > 92) + kind = 92; + break; + case 628: + if (curChar == 53) + { jjCheckNAdd(624); } + break; + case 629: + if (curChar == 55) + { jjCheckNAdd(624); } + break; + case 630: + if (curChar == 48) + { jjCheckNAddStates(875, 879); } + break; + case 631: + if (curChar == 48) + { jjCheckNAddTwoStates(628, 629); } + break; + case 632: + if (curChar == 48) + { jjCheckNAddStates(880, 882); } + break; + case 633: + if (curChar == 48) + { jjCheckNAddStates(883, 886); } + break; + case 635: + if (curChar == 56) + { jjCheckNAddStates(887, 890); } + break; + case 636: + if (curChar == 10) + { jjCheckNAddTwoStates(622, 623); } + break; + case 637: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 636; + break; + case 638: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(622, 623); } + break; + case 639: + if (curChar == 52) + { jjCheckNAdd(635); } + break; + case 640: + if (curChar == 54) + { jjCheckNAdd(635); } + break; + case 641: + if (curChar == 48) + { jjCheckNAddStates(891, 895); } + break; + case 642: + if (curChar == 48) + { jjCheckNAddTwoStates(639, 640); } + break; + case 643: + if (curChar == 48) + { jjCheckNAddStates(896, 898); } + break; + case 644: + if (curChar == 48) + { jjCheckNAddStates(899, 902); } + break; + case 645: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(7, 9); } + break; + case 651: + if (curChar == 10 && kind > 93) + kind = 93; + break; + case 652: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 651; + break; + case 653: + if ((0x100003600L & l) != 0L && kind > 93) + kind = 93; + break; + case 654: + if (curChar == 53) + { jjCheckNAdd(650); } + break; + case 655: + if (curChar == 55) + { jjCheckNAdd(650); } + break; + case 656: + if (curChar == 48) + { jjCheckNAddStates(903, 907); } + break; + case 657: + if (curChar == 48) + { jjCheckNAddTwoStates(654, 655); } + break; + case 658: + if (curChar == 48) + { jjCheckNAddStates(908, 910); } + break; + case 659: + if (curChar == 48) + { jjCheckNAddStates(911, 914); } + break; + case 661: + if (curChar == 56) + { jjCheckNAddStates(915, 918); } + break; + case 662: + if (curChar == 10) + { jjCheckNAddTwoStates(648, 649); } + break; + case 663: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 662; + break; + case 664: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(648, 649); } + break; + case 665: + if (curChar == 52) + { jjCheckNAdd(661); } + break; + case 666: + if (curChar == 54) + { jjCheckNAdd(661); } + break; + case 667: + if (curChar == 48) + { jjCheckNAddStates(919, 923); } + break; + case 668: + if (curChar == 48) + { jjCheckNAddTwoStates(665, 666); } + break; + case 669: + if (curChar == 48) + { jjCheckNAddStates(924, 926); } + break; + case 670: + if (curChar == 48) + { jjCheckNAddStates(927, 930); } + break; + case 673: + if (curChar == 10) + { jjCheckNAddTwoStates(647, 660); } + break; + case 674: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 673; + break; + case 675: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(647, 660); } + break; + case 676: + if (curChar == 52) + { jjCheckNAdd(672); } + break; + case 677: + if (curChar == 54) + { jjCheckNAdd(672); } + break; + case 678: + if (curChar == 48) + { jjCheckNAddStates(931, 935); } + break; + case 679: + if (curChar == 48) + { jjCheckNAddTwoStates(676, 677); } + break; + case 680: + if (curChar == 48) + { jjCheckNAddStates(936, 938); } + break; + case 681: + if (curChar == 48) + { jjCheckNAddStates(939, 942); } + break; + case 682: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(682, 685); } + break; + case 686: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(686, 690); } + break; + case 691: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(691, 692); } + break; + case 692: + if (curChar == 37 && kind > 96) + kind = 96; + break; + case 693: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(3, 6); } + break; + case 694: + if (curChar == 45) + { jjCheckNAddTwoStates(695, 714); } + break; + case 696: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 97) + kind = 97; + { jjCheckNAddTwoStates(696, 697); } + break; + case 698: + if ((0xfc00ffffffffcbffL & l) == 0L) + break; + if (kind > 97) + kind = 97; + { jjCheckNAddTwoStates(696, 697); } + break; + case 699: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 97) + kind = 97; + { jjCheckNAddStates(943, 951); } + break; + case 700: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 97) + kind = 97; + { jjCheckNAddStates(952, 955); } + break; + case 701: + if (curChar != 10) + break; + if (kind > 97) + kind = 97; + { jjCheckNAddTwoStates(696, 697); } + break; + case 702: + case 717: + if (curChar == 13) + { jjCheckNAdd(701); } + break; + case 703: + if ((0x100003600L & l) == 0L) + break; + if (kind > 97) + kind = 97; + { jjCheckNAddTwoStates(696, 697); } + break; + case 704: + case 706: + case 709: + case 713: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(700); } + break; + case 705: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 706; + break; + case 707: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 708; + break; + case 708: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 709; + break; + case 710: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 711; + break; + case 711: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 712; + break; + case 712: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 713; + break; + case 715: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 97) + kind = 97; + { jjCheckNAddStates(956, 964); } + break; + case 716: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 97) + kind = 97; + { jjCheckNAddStates(965, 968); } + break; + case 718: + case 720: + case 723: + case 727: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(716); } + break; + case 719: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 720; + break; + case 721: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 722; + break; + case 722: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 723; + break; + case 724: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 725; + break; + case 725: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 726; + break; + case 726: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 727; + break; + case 728: + if (curChar == 45) + { jjAddStates(161, 164); } + break; + case 730: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + break; + case 732: + if ((0xfc00ffffffffcbffL & l) == 0L) + break; + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + break; + case 733: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 22) + kind = 22; + { jjCheckNAddStates(969, 977); } + break; + case 734: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 22) + kind = 22; + { jjCheckNAddStates(978, 981); } + break; + case 735: + if (curChar != 10) + break; + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + break; + case 736: + case 785: + if (curChar == 13) + { jjCheckNAdd(735); } + break; + case 737: + if ((0x100003600L & l) == 0L) + break; + if (kind > 22) + kind = 22; + { 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 ((0x3ff200000000000L & l) != 0L) + { jjCheckNAddStates(0, 2); } + break; + case 750: + if (curChar == 40 && kind > 103) + kind = 103; + break; + case 752: + if ((0xfc00ffffffffcbffL & l) != 0L) + { jjCheckNAddStates(0, 2); } + break; + case 753: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(982, 991); } + break; + case 754: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(992, 996); } + break; + case 755: + if (curChar == 10) + { jjCheckNAddStates(0, 2); } + break; + case 756: + case 771: + if (curChar == 13) + { jjCheckNAdd(755); } + break; + case 757: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(0, 2); } + break; + case 758: + case 760: + case 763: + case 767: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(754); } + break; + case 759: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 760; + break; + case 761: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 762; + break; + case 762: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 763; + break; + case 764: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 765; + break; + case 765: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 766; + break; + case 766: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 767; + break; + case 769: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(997, 1006); } + break; + case 770: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1007, 1011); } + break; + case 772: + case 774: + case 777: + case 781: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(770); } + 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 ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 22) + kind = 22; + { jjCheckNAddStates(1012, 1020); } + break; + case 784: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 22) + kind = 22; + { jjCheckNAddStates(1021, 1024); } + break; + case 786: + case 788: + case 791: + case 795: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(784); } + break; + case 787: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 788; + break; + case 789: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 790; + break; + case 790: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 791; + break; + case 792: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 793; + break; + case 793: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 794; + break; + case 794: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 795; + break; + case 805: + if (curChar != 52) + break; + if (kind > 73) + kind = 73; + { jjAddStates(1025, 1026); } + break; + case 806: + if (curChar == 10 && kind > 73) + kind = 73; + break; + case 807: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 806; + break; + case 808: + if ((0x100003600L & l) != 0L && kind > 73) + kind = 73; + break; + case 809: + if (curChar == 53) + { jjCheckNAdd(805); } + break; + case 810: + if (curChar == 55) + { jjCheckNAdd(805); } + break; + case 811: + if (curChar == 48) + { jjCheckNAddStates(1027, 1031); } + break; + case 812: + if (curChar == 48) + { jjCheckNAddTwoStates(809, 810); } + break; + case 813: + if (curChar == 48) + { jjCheckNAddStates(1032, 1034); } + break; + case 814: + if (curChar == 48) + { jjCheckNAddStates(1035, 1038); } + break; + case 816: + if (curChar == 50) + { jjCheckNAddStates(1039, 1042); } + break; + case 817: + if (curChar == 10) + { jjCheckNAddTwoStates(803, 804); } + break; + case 818: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 817; + break; + case 819: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(803, 804); } + break; + case 820: + if (curChar == 53) + { jjCheckNAdd(816); } + break; + case 821: + if (curChar == 55) + { jjCheckNAdd(816); } + break; + case 822: + if (curChar == 48) + { jjCheckNAddStates(1043, 1047); } + break; + case 823: + if (curChar == 48) + { jjCheckNAddTwoStates(820, 821); } + break; + case 824: + if (curChar == 48) + { jjCheckNAddStates(1048, 1050); } + break; + case 825: + if (curChar == 48) + { jjCheckNAddStates(1051, 1054); } + break; + case 827: + if (curChar == 49) + { jjCheckNAddStates(1055, 1058); } + break; + case 828: + if (curChar == 10) + { jjCheckNAddTwoStates(802, 815); } + break; + case 829: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 828; + break; + case 830: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(802, 815); } + break; + case 831: + if (curChar == 53) + { jjCheckNAdd(827); } + break; + case 832: + if (curChar == 55) + { jjCheckNAdd(827); } + break; + case 833: + if (curChar == 48) + { jjCheckNAddStates(1059, 1063); } + break; + case 834: + if (curChar == 48) + { jjCheckNAddTwoStates(831, 832); } + break; + case 835: + if (curChar == 48) + { jjCheckNAddStates(1064, 1066); } + break; + case 836: + if (curChar == 48) + { jjCheckNAddStates(1067, 1070); } + break; + case 838: + if (curChar == 48) + { jjCheckNAddStates(1071, 1074); } + break; + case 839: + if (curChar == 10) + { jjCheckNAddTwoStates(801, 826); } + break; + case 840: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 839; + break; + case 841: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(801, 826); } + break; + case 842: + if (curChar == 53) + { jjCheckNAdd(838); } + break; + case 843: + if (curChar == 55) + { jjCheckNAdd(838); } + break; + case 844: + if (curChar == 48) + { jjCheckNAddStates(1075, 1079); } + break; + case 845: + if (curChar == 48) + { jjCheckNAddTwoStates(842, 843); } + break; + case 846: + if (curChar == 48) + { jjCheckNAddStates(1080, 1082); } + break; + case 847: + if (curChar == 48) + { jjCheckNAddStates(1083, 1086); } + break; + case 850: + if (curChar == 10) + { jjCheckNAddTwoStates(800, 837); } + break; + case 851: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 850; + break; + case 852: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(800, 837); } + break; + case 853: + if (curChar == 52) + { jjCheckNAdd(849); } + break; + case 854: + if (curChar == 54) + { jjCheckNAdd(849); } + break; + case 855: + if (curChar == 48) + { jjCheckNAddStates(1087, 1091); } + break; + case 856: + if (curChar == 48) + { jjCheckNAddTwoStates(853, 854); } + break; + case 857: + if (curChar == 48) + { jjCheckNAddStates(1092, 1094); } + break; + case 858: + if (curChar == 48) + { jjCheckNAddStates(1095, 1098); } + break; + case 864: + if (curChar != 53) + break; + if (kind > 74) + kind = 74; + { jjAddStates(1099, 1100); } + break; + case 865: + if (curChar == 10 && kind > 74) + kind = 74; + break; + case 866: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 865; + break; + case 867: + if ((0x100003600L & l) != 0L && kind > 74) + kind = 74; + break; + case 868: + if (curChar == 52) + { jjCheckNAdd(864); } + break; + case 869: + if (curChar == 54) + { jjCheckNAdd(864); } + break; + case 870: + if (curChar == 48) + { jjCheckNAddStates(1101, 1105); } + break; + case 871: + if (curChar == 48) + { jjCheckNAddTwoStates(868, 869); } + break; + case 872: + if (curChar == 48) + { jjCheckNAddStates(1106, 1108); } + break; + case 873: + if (curChar == 48) + { jjCheckNAddStates(1109, 1112); } + break; + case 875: + if (curChar == 55) + { jjCheckNAddStates(1113, 1116); } + break; + case 876: + if (curChar == 10) + { jjCheckNAddTwoStates(862, 863); } + break; + case 877: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 876; + break; + case 878: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(862, 863); } + break; + case 879: + if (curChar == 52) + { jjCheckNAdd(875); } + break; + case 880: + if (curChar == 54) + { jjCheckNAdd(875); } + break; + case 881: + if (curChar == 48) + { jjCheckNAddStates(1117, 1121); } + break; + case 882: + if (curChar == 48) + { jjCheckNAddTwoStates(879, 880); } + break; + case 883: + if (curChar == 48) + { jjCheckNAddStates(1122, 1124); } + break; + case 884: + if (curChar == 48) + { jjCheckNAddStates(1125, 1128); } + break; + case 886: + if (curChar == 49) + { jjCheckNAddStates(1129, 1132); } + break; + case 887: + if (curChar == 10) + { jjCheckNAddTwoStates(861, 874); } + break; + case 888: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 887; + break; + case 889: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(861, 874); } + break; + case 890: + if (curChar == 52) + { jjCheckNAdd(886); } + break; + case 891: + if (curChar == 54) + { jjCheckNAdd(886); } + break; + case 892: + if (curChar == 48) + { jjCheckNAddStates(1133, 1137); } + break; + case 893: + if (curChar == 48) + { jjCheckNAddTwoStates(890, 891); } + break; + case 894: + if (curChar == 48) + { jjCheckNAddStates(1138, 1140); } + break; + case 895: + if (curChar == 48) + { jjCheckNAddStates(1141, 1144); } + break; + case 902: + if (curChar != 49) + break; + if (kind > 75) + kind = 75; + { jjAddStates(1145, 1146); } + break; + case 903: + if (curChar == 10 && kind > 75) + kind = 75; + break; + case 904: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 903; + break; + case 905: + if ((0x100003600L & l) != 0L && kind > 75) + kind = 75; + break; + case 906: + if (curChar == 52) + { jjCheckNAdd(902); } + break; + case 907: + if (curChar == 54) + { jjCheckNAdd(902); } + break; + case 908: + if (curChar == 48) + { jjCheckNAddStates(1147, 1151); } + break; + case 909: + if (curChar == 48) + { jjCheckNAddTwoStates(906, 907); } + break; + case 910: + if (curChar == 48) + { jjCheckNAddStates(1152, 1154); } + break; + case 911: + if (curChar == 48) + { jjCheckNAddStates(1155, 1158); } + break; + case 913: + if (curChar == 57) + { jjCheckNAddStates(1159, 1162); } + break; + case 914: + if (curChar == 10) + { jjCheckNAddTwoStates(900, 901); } + break; + case 915: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 914; + break; + case 916: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(900, 901); } + break; + case 917: + if (curChar == 52) + { jjCheckNAdd(913); } + break; + case 918: + if (curChar == 54) + { jjCheckNAdd(913); } + break; + case 919: + if (curChar == 48) + { jjCheckNAddStates(1163, 1167); } + break; + case 920: + if (curChar == 48) + { jjCheckNAddTwoStates(917, 918); } + break; + case 921: + if (curChar == 48) + { jjCheckNAddStates(1168, 1170); } + break; + case 922: + if (curChar == 48) + { jjCheckNAddStates(1171, 1174); } + break; + case 924: + if (curChar == 52) + { jjCheckNAddStates(1175, 1178); } + break; + case 925: + if (curChar == 10) + { jjCheckNAddTwoStates(899, 912); } + break; + case 926: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 925; + break; + case 927: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(899, 912); } + break; + case 928: + if (curChar == 52) + { jjCheckNAdd(924); } + break; + case 929: + if (curChar == 54) + { jjCheckNAdd(924); } + break; + case 930: + if (curChar == 48) + { jjCheckNAddStates(1179, 1183); } + break; + case 931: + if (curChar == 48) + { jjCheckNAddTwoStates(928, 929); } + break; + case 932: + if (curChar == 48) + { jjCheckNAddStates(1184, 1186); } + break; + case 933: + if (curChar == 48) + { jjCheckNAddStates(1187, 1190); } + break; + case 935: + if (curChar == 53) + { jjCheckNAddStates(1191, 1194); } + break; + case 936: + if (curChar == 10) + { jjCheckNAddTwoStates(898, 923); } + break; + case 937: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 936; + break; + case 938: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(898, 923); } + break; + case 939: + if (curChar == 52) + { jjCheckNAdd(935); } + break; + case 940: + if (curChar == 54) + { jjCheckNAdd(935); } + break; + case 941: + if (curChar == 48) + { jjCheckNAddStates(1195, 1199); } + break; + case 942: + if (curChar == 48) + { jjCheckNAddTwoStates(939, 940); } + break; + case 943: + if (curChar == 48) + { jjCheckNAddStates(1200, 1202); } + break; + case 944: + if (curChar == 48) + { jjCheckNAddStates(1203, 1206); } + break; + case 949: + if (curChar == 45) + { jjAddStates(1207, 1208); } + break; + case 955: + if (curChar != 53) + break; + if (kind > 76) + kind = 76; + { jjAddStates(1209, 1210); } + break; + case 956: + if (curChar == 10 && kind > 76) + kind = 76; + break; + case 957: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 956; + break; + case 958: + if ((0x100003600L & l) != 0L && kind > 76) + kind = 76; + break; + case 959: + if (curChar == 52) + { jjCheckNAdd(955); } + break; + case 960: + if (curChar == 54) + { jjCheckNAdd(955); } + break; + case 961: + if (curChar == 48) + { jjCheckNAddStates(1211, 1215); } + break; + case 962: + if (curChar == 48) + { jjCheckNAddTwoStates(959, 960); } + break; + case 963: + if (curChar == 48) + { jjCheckNAddStates(1216, 1218); } + break; + case 964: + if (curChar == 48) + { jjCheckNAddStates(1219, 1222); } + break; + case 966: + if (curChar == 51) + { jjCheckNAddStates(1223, 1226); } + break; + case 967: + if (curChar == 10) + { jjCheckNAddTwoStates(953, 954); } + break; + case 968: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 967; + break; + case 969: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(953, 954); } + break; + case 970: + if (curChar == 52) + { jjCheckNAdd(966); } + break; + case 971: + if (curChar == 54) + { jjCheckNAdd(966); } + break; + case 972: + if (curChar == 48) + { jjCheckNAddStates(1227, 1231); } + break; + case 973: + if (curChar == 48) + { jjCheckNAddTwoStates(970, 971); } + break; + case 974: + if (curChar == 48) + { jjCheckNAddStates(1232, 1234); } + break; + case 975: + if (curChar == 48) + { jjCheckNAddStates(1235, 1238); } + break; + case 977: + if (curChar == 49) + { jjCheckNAddStates(1239, 1242); } + break; + case 978: + if (curChar == 10) + { jjCheckNAddTwoStates(952, 965); } + break; + case 979: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 978; + break; + case 980: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(952, 965); } + break; + case 981: + if (curChar == 52) + { jjCheckNAdd(977); } + break; + case 982: + if (curChar == 54) + { jjCheckNAdd(977); } + break; + case 983: + if (curChar == 48) + { jjCheckNAddStates(1243, 1247); } + break; + case 984: + if (curChar == 48) + { jjCheckNAddTwoStates(981, 982); } + break; + case 985: + if (curChar == 48) + { jjCheckNAddStates(1248, 1250); } + break; + case 986: + if (curChar == 48) + { jjCheckNAddStates(1251, 1254); } + break; + case 988: + if (curChar == 54) + { jjCheckNAddStates(1255, 1258); } + break; + case 989: + if (curChar == 10) + { jjCheckNAddTwoStates(951, 976); } + break; + case 990: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 989; + break; + case 991: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(951, 976); } + break; + case 992: + if (curChar == 52) + { jjCheckNAdd(988); } + break; + case 993: + if (curChar == 54) + { jjCheckNAdd(988); } + break; + case 994: + if (curChar == 48) + { jjCheckNAddStates(1259, 1263); } + break; + case 995: + if (curChar == 48) + { jjCheckNAddTwoStates(992, 993); } + break; + case 996: + if (curChar == 48) + { jjCheckNAddStates(1264, 1266); } + break; + case 997: + if (curChar == 48) + { jjCheckNAddStates(1267, 1270); } + break; + case 999: + if (curChar == 52) + { jjCheckNAddStates(1271, 1273); } + break; + case 1000: + if (curChar == 10) + { jjCheckNAdd(949); } + break; + case 1001: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1000; + break; + case 1002: + if ((0x100003600L & l) != 0L) + { jjCheckNAdd(949); } + break; + case 1003: + if (curChar == 53) + { jjCheckNAdd(999); } + break; + case 1004: + if (curChar == 55) + { jjCheckNAdd(999); } + break; + case 1005: + if (curChar == 48) + { jjCheckNAddStates(1274, 1278); } + break; + case 1006: + if (curChar == 48) + { jjCheckNAddTwoStates(1003, 1004); } + break; + case 1007: + if (curChar == 48) + { jjCheckNAddStates(1279, 1281); } + break; + case 1008: + if (curChar == 48) + { jjCheckNAddStates(1282, 1285); } + break; + case 1011: + if (curChar == 10) + { jjCheckNAddTwoStates(948, 998); } + break; + case 1012: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1011; + break; + case 1013: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(948, 998); } + break; + case 1014: + if (curChar == 52) + { jjCheckNAdd(1010); } + break; + case 1015: + if (curChar == 54) + { jjCheckNAdd(1010); } + break; + case 1016: + if (curChar == 48) + { jjCheckNAddStates(1286, 1290); } + break; + case 1017: + if (curChar == 48) + { jjCheckNAddTwoStates(1014, 1015); } + break; + case 1018: + if (curChar == 48) + { jjCheckNAddStates(1291, 1293); } + break; + case 1019: + if (curChar == 48) + { jjCheckNAddStates(1294, 1297); } + break; + case 1021: + if (curChar == 49) + { jjCheckNAddStates(1298, 1301); } + break; + case 1022: + if (curChar == 10) + { jjCheckNAddTwoStates(947, 1009); } + break; + case 1023: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1022; + break; + case 1024: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(947, 1009); } + break; + case 1025: + if (curChar == 53) + { jjCheckNAdd(1021); } + break; + case 1026: + if (curChar == 55) + { jjCheckNAdd(1021); } + break; + case 1027: + if (curChar == 48) + { jjCheckNAddStates(1302, 1306); } + break; + case 1028: + if (curChar == 48) + { jjCheckNAddTwoStates(1025, 1026); } + break; + case 1029: + if (curChar == 48) + { jjCheckNAddStates(1307, 1309); } + break; + case 1030: + if (curChar == 48) + { jjCheckNAddStates(1310, 1313); } + break; + case 1032: + if (curChar == 54) + { jjCheckNAddStates(1314, 1317); } + break; + case 1033: + if (curChar == 10) + { jjCheckNAddTwoStates(946, 1020); } + break; + case 1034: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1033; + break; + case 1035: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(946, 1020); } + break; + case 1036: + if (curChar == 52) + { jjCheckNAdd(1032); } + break; + case 1037: + if (curChar == 54) + { jjCheckNAdd(1032); } + break; + case 1038: + if (curChar == 48) + { jjCheckNAddStates(1318, 1322); } + break; + case 1039: + if (curChar == 48) + { jjCheckNAddTwoStates(1036, 1037); } + break; + case 1040: + if (curChar == 48) + { jjCheckNAddStates(1323, 1325); } + break; + case 1041: + if (curChar == 48) + { jjCheckNAddStates(1326, 1329); } + break; + case 1050: + if (curChar != 52) + break; + if (kind > 77) + kind = 77; + { jjAddStates(1330, 1331); } + break; + case 1051: + if (curChar == 10 && kind > 77) + kind = 77; + break; + case 1052: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1051; + break; + case 1053: + if ((0x100003600L & l) != 0L && kind > 77) + kind = 77; + break; + case 1054: + if (curChar == 53) + { jjCheckNAdd(1050); } + break; + case 1055: + if (curChar == 55) + { jjCheckNAdd(1050); } + break; + case 1056: + if (curChar == 48) + { jjCheckNAddStates(1332, 1336); } + break; + case 1057: + if (curChar == 48) + { jjCheckNAddTwoStates(1054, 1055); } + break; + case 1058: + if (curChar == 48) + { jjCheckNAddStates(1337, 1339); } + break; + case 1059: + if (curChar == 48) + { jjCheckNAddStates(1340, 1343); } + break; + case 1061: + if (curChar == 53) + { jjCheckNAddStates(1344, 1347); } + break; + case 1062: + if (curChar == 10) + { jjCheckNAddTwoStates(1048, 1049); } + break; + case 1063: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1062; + break; + case 1064: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(1048, 1049); } + break; + case 1065: + if (curChar == 52) + { jjCheckNAdd(1061); } + break; + case 1066: + if (curChar == 54) + { jjCheckNAdd(1061); } + break; + case 1067: + if (curChar == 48) + { jjCheckNAddStates(1348, 1352); } + break; + case 1068: + if (curChar == 48) + { jjCheckNAddTwoStates(1065, 1066); } + break; + case 1069: + if (curChar == 48) + { jjCheckNAddStates(1353, 1355); } + break; + case 1070: + if (curChar == 48) + { jjCheckNAddStates(1356, 1359); } + break; + case 1072: + if (curChar == 51) + { jjCheckNAddStates(1360, 1363); } + break; + case 1073: + if (curChar == 10) + { jjCheckNAddTwoStates(1047, 1060); } + break; + case 1074: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1073; + break; + case 1075: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(1047, 1060); } + break; + case 1076: + if (curChar == 53) + { jjCheckNAdd(1072); } + break; + case 1077: + if (curChar == 55) + { jjCheckNAdd(1072); } + break; + case 1078: + if (curChar == 48) + { jjCheckNAddStates(1364, 1368); } + break; + case 1079: + if (curChar == 48) + { jjCheckNAddTwoStates(1076, 1077); } + break; + case 1080: + if (curChar == 48) + { jjCheckNAddStates(1369, 1371); } + break; + case 1081: + if (curChar == 48) + { jjCheckNAddStates(1372, 1375); } + break; + case 1083: + if (curChar == 50) + { jjCheckNAddStates(1376, 1379); } + break; + case 1084: + if (curChar == 10) + { jjCheckNAddTwoStates(1046, 1071); } + break; + case 1085: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1084; + break; + case 1086: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(1046, 1071); } + break; + case 1087: + if (curChar == 53) + { jjCheckNAdd(1083); } + break; + case 1088: + if (curChar == 55) + { jjCheckNAdd(1083); } + break; + case 1089: + if (curChar == 48) + { jjCheckNAddStates(1380, 1384); } + break; + case 1090: + if (curChar == 48) + { jjCheckNAddTwoStates(1087, 1088); } + break; + case 1091: + if (curChar == 48) + { jjCheckNAddStates(1385, 1387); } + break; + case 1092: + if (curChar == 48) + { jjCheckNAddStates(1388, 1391); } + break; + case 1094: + if (curChar == 49) + { jjCheckNAddStates(1392, 1395); } + break; + case 1095: + if (curChar == 10) + { jjCheckNAddTwoStates(1045, 1082); } + break; + case 1096: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1095; + break; + case 1097: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(1045, 1082); } + break; + case 1098: + if (curChar == 52) + { jjCheckNAdd(1094); } + break; + case 1099: + if (curChar == 54) + { jjCheckNAdd(1094); } + break; + case 1100: + if (curChar == 48) + { jjCheckNAddStates(1396, 1400); } + break; + case 1101: + if (curChar == 48) + { jjCheckNAddTwoStates(1098, 1099); } + break; + case 1102: + if (curChar == 48) + { jjCheckNAddStates(1401, 1403); } + break; + case 1103: + if (curChar == 48) + { jjCheckNAddStates(1404, 1407); } + break; + case 1105: + if (curChar == 56) + { jjCheckNAddStates(1408, 1411); } + break; + case 1106: + if (curChar == 10) + { jjCheckNAddTwoStates(1044, 1093); } + break; + case 1107: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1106; + break; + case 1108: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(1044, 1093); } + break; + case 1109: + if (curChar == 52) + { jjCheckNAdd(1105); } + break; + case 1110: + if (curChar == 54) + { jjCheckNAdd(1105); } + break; + case 1111: + if (curChar == 48) + { jjCheckNAddStates(1412, 1416); } + break; + case 1112: + if (curChar == 48) + { jjCheckNAddTwoStates(1109, 1110); } + break; + case 1113: + if (curChar == 48) + { jjCheckNAddStates(1417, 1419); } + break; + case 1114: + if (curChar == 48) + { jjCheckNAddStates(1420, 1423); } + break; + case 1116: + if (curChar == 51) + { jjCheckNAddStates(1424, 1427); } + break; + case 1117: + if (curChar == 10) + { jjCheckNAddTwoStates(1043, 1104); } + break; + case 1118: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1117; + break; + case 1119: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(1043, 1104); } + break; + case 1120: + if (curChar == 52) + { jjCheckNAdd(1116); } + break; + case 1121: + if (curChar == 54) + { jjCheckNAdd(1116); } + break; + case 1122: + if (curChar == 48) + { jjCheckNAddStates(1428, 1432); } + break; + case 1123: + if (curChar == 48) + { jjCheckNAddTwoStates(1120, 1121); } + break; + case 1124: + if (curChar == 48) + { jjCheckNAddStates(1433, 1435); } + break; + case 1125: + if (curChar == 48) + { jjCheckNAddStates(1436, 1439); } + break; + case 1126: + if (curChar == 45) + { jjAddStates(1440, 1441); } + break; + case 1128: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 104) + kind = 104; + { jjCheckNAddTwoStates(1128, 1129); } + break; + case 1130: + if ((0xfc00ffffffffcbffL & l) == 0L) + break; + if (kind > 104) + kind = 104; + { jjCheckNAddTwoStates(1128, 1129); } + break; + case 1131: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 104) + kind = 104; + { jjCheckNAddStates(1442, 1450); } + break; + case 1132: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 104) + kind = 104; + { jjCheckNAddStates(1451, 1454); } + break; + case 1133: + if (curChar != 10) + break; + if (kind > 104) + kind = 104; + { jjCheckNAddTwoStates(1128, 1129); } + break; + case 1134: + case 1149: + if (curChar == 13) + { jjCheckNAdd(1133); } + break; + case 1135: + if ((0x100003600L & l) == 0L) + break; + if (kind > 104) + kind = 104; + { jjCheckNAddTwoStates(1128, 1129); } + break; + case 1136: + case 1138: + case 1141: + case 1145: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(1132); } + break; + case 1137: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1138; + break; + case 1139: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1140; + break; + case 1140: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1141; + break; + case 1142: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1143; + break; + case 1143: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1144; + break; + case 1144: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1145; + break; + case 1147: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 104) + kind = 104; + { jjCheckNAddStates(1455, 1463); } + break; + case 1148: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 104) + kind = 104; + { jjCheckNAddStates(1464, 1467); } + break; + case 1150: + case 1152: + case 1155: + case 1159: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(1148); } + break; + case 1151: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1152; + break; + case 1153: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1154; + break; + case 1154: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1155; + break; + case 1156: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1157; + break; + case 1157: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1158; + break; + case 1158: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1159; + break; + case 1162: + if (curChar == 10) + { jjCheckNAddTwoStates(897, 934); } + break; + case 1163: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1162; + break; + case 1164: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(897, 934); } + break; + case 1165: + if (curChar == 52) + { jjCheckNAdd(1161); } + break; + case 1166: + if (curChar == 54) + { jjCheckNAdd(1161); } + break; + case 1167: + if (curChar == 48) + { jjCheckNAddStates(1468, 1472); } + break; + case 1168: + if (curChar == 48) + { jjCheckNAddTwoStates(1165, 1166); } + break; + case 1169: + if (curChar == 48) + { jjCheckNAddStates(1473, 1475); } + break; + case 1170: + if (curChar == 48) + { jjCheckNAddStates(1476, 1479); } + break; + case 1172: + if (curChar == 48) + { jjCheckNAddStates(1480, 1483); } + break; + case 1173: + if (curChar == 10) + { jjCheckNAddTwoStates(860, 885); } + break; + case 1174: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1173; + break; + case 1175: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(860, 885); } + break; + case 1176: + if (curChar == 53) + { jjCheckNAdd(1172); } + break; + case 1177: + if (curChar == 55) + { jjCheckNAdd(1172); } + break; + case 1178: + if (curChar == 48) + { jjCheckNAddStates(1484, 1488); } + break; + case 1179: + if (curChar == 48) + { jjCheckNAddTwoStates(1176, 1177); } + break; + case 1180: + if (curChar == 48) + { jjCheckNAddStates(1489, 1491); } + break; + case 1181: + if (curChar == 48) + { jjCheckNAddStates(1492, 1495); } + break; + case 1183: + if (curChar == 57) + { jjCheckNAddStates(1496, 1499); } + break; + case 1184: + if (curChar == 10) + { jjCheckNAddTwoStates(799, 848); } + break; + case 1185: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1184; + break; + case 1186: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(799, 848); } + break; + case 1187: + if (curChar == 52) + { jjCheckNAdd(1183); } + break; + case 1188: + if (curChar == 54) + { jjCheckNAdd(1183); } + break; + case 1189: + if (curChar == 48) + { jjCheckNAddStates(1500, 1504); } + break; + case 1190: + if (curChar == 48) + { jjCheckNAddTwoStates(1187, 1188); } + break; + case 1191: + if (curChar == 48) + { jjCheckNAddStates(1505, 1507); } + break; + case 1192: + if (curChar == 48) + { jjCheckNAddStates(1508, 1511); } + break; + case 1194: + if (curChar == 43) + jjstateSet[jjnewStateCnt++] = 1195; + break; + case 1195: + if ((0x83ff000000000000L & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAddTwoStates(1196, 1203); } + break; + case 1196: + if (curChar == 45) + jjstateSet[jjnewStateCnt++] = 1197; + break; + case 1197: + if ((0x83ff000000000000L & l) == 0L) + break; + if (kind > 99) + kind = 99; + jjstateSet[jjnewStateCnt++] = 1198; + break; + case 1198: + if ((0x83ff000000000000L & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAddStates(1512, 1515); } + break; + case 1199: + if ((0x83ff000000000000L & l) != 0L && kind > 99) + kind = 99; + break; + case 1200: + if ((0x83ff000000000000L & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAdd(1199); } + break; + case 1201: + if ((0x83ff000000000000L & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAddTwoStates(1199, 1200); } + break; + case 1202: + if ((0x83ff000000000000L & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAddStates(1516, 1518); } + break; + case 1203: + if ((0x83ff000000000000L & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAddStates(1519, 1523); } + break; + case 1204: + if ((0x83ff000000000000L & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAdd(1196); } + break; + case 1205: + if ((0x83ff000000000000L & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAddTwoStates(1204, 1196); } + break; + case 1206: + if ((0x83ff000000000000L & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAddStates(1524, 1526); } + break; + case 1207: + if ((0x83ff000000000000L & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAddStates(1527, 1530); } + break; + case 1209: + if (curChar == 40) + { jjCheckNAddStates(1531, 1536); } + break; + case 1210: + if ((0xfffffc7a00000000L & l) != 0L) + { jjCheckNAddStates(1537, 1540); } + break; + case 1211: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(1211, 1212); } + break; + case 1212: + if (curChar == 41 && kind > 100) + kind = 100; + break; + case 1214: + if ((0xfc00ffffffffcbffL & l) != 0L) + { jjCheckNAddStates(1537, 1540); } + break; + case 1215: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1541, 1550); } + break; + case 1216: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1551, 1555); } + break; + case 1217: + if (curChar == 10) + { jjCheckNAddStates(1537, 1540); } + break; + case 1218: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1217; + break; + case 1219: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(1537, 1540); } + break; + case 1220: + case 1222: + case 1225: + case 1229: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(1216); } + break; + case 1221: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1222; + break; + case 1223: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1224; + break; + case 1224: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1225; + break; + case 1226: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1227; + break; + case 1227: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1228; + break; + case 1228: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1229; + break; + case 1230: + if (curChar == 39) + { jjCheckNAddStates(1556, 1558); } + break; + case 1231: + if ((0xffffff7fffffcbffL & l) != 0L) + { jjCheckNAddStates(1556, 1558); } + break; + case 1232: + if (curChar == 39) + { jjCheckNAddTwoStates(1211, 1212); } + break; + case 1234: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(1556, 1558); } + break; + case 1235: + if (curChar == 10) + { jjCheckNAddStates(1556, 1558); } + break; + case 1236: + case 1240: + if (curChar == 13) + { jjCheckNAdd(1235); } + break; + case 1237: + if ((0xfc00ffffffffcbffL & l) != 0L) + { jjCheckNAddStates(1556, 1558); } + break; + case 1238: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1559, 1568); } + break; + case 1239: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1569, 1573); } + break; + case 1241: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(1556, 1558); } + break; + case 1242: + case 1244: + case 1247: + case 1251: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(1239); } + break; + case 1243: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1244; + break; + case 1245: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1246; + break; + case 1246: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1247; + break; + case 1248: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1249; + break; + case 1249: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1250; + break; + case 1250: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1251; + break; + case 1252: + if (curChar == 34) + { jjCheckNAddStates(1574, 1576); } + break; + case 1253: + if ((0xfffffffbffffcbffL & l) != 0L) + { jjCheckNAddStates(1574, 1576); } + break; + case 1254: + if (curChar == 34) + { jjCheckNAddTwoStates(1211, 1212); } + break; + case 1256: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(1574, 1576); } + break; + case 1257: + if (curChar == 10) + { jjCheckNAddStates(1574, 1576); } + break; + case 1258: + case 1262: + if (curChar == 13) + { jjCheckNAdd(1257); } + break; + case 1259: + if ((0xfc00ffffffffcbffL & l) != 0L) + { jjCheckNAddStates(1574, 1576); } + break; + case 1260: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1577, 1586); } + break; + case 1261: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1587, 1591); } + break; + case 1263: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(1574, 1576); } + break; + case 1264: + case 1266: + case 1269: + case 1273: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(1261); } + break; + case 1265: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1266; + break; + case 1267: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1268; + break; + case 1268: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1269; + break; + case 1270: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1271; + break; + case 1271: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1272; + break; + case 1272: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1273; + break; + case 1274: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(1592, 1598); } + break; + case 1278: + if (curChar == 10) + { jjCheckNAddTwoStates(186, 200); } + break; + case 1279: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1278; + break; + case 1280: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(186, 200); } + break; + case 1281: + if (curChar == 52) + { jjCheckNAdd(1277); } + break; + case 1282: + if (curChar == 54) + { jjCheckNAdd(1277); } + break; + case 1284: + if (curChar == 10) + { jjCheckNAddTwoStates(212, 238); } + break; + case 1285: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 1284; + break; + case 1286: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(212, 238); } + break; + case 1287: + if (curChar == 52) + { jjCheckNAdd(1283); } + break; + case 1288: + if (curChar == 54) + { jjCheckNAdd(1283); } + break; + case 1289: + if (curChar == 48) + { jjCheckNAddStates(1599, 1603); } + break; + case 1290: + if (curChar == 48) + { jjCheckNAddTwoStates(1287, 1288); } + break; + case 1291: + if (curChar == 48) + { jjCheckNAddStates(1604, 1606); } + break; + case 1292: + if (curChar == 48) + { jjCheckNAddStates(1607, 1610); } + break; + case 1293: + if (curChar == 48) + { jjCheckNAddStates(1611, 1615); } + break; + case 1294: + if (curChar == 48) + { jjCheckNAddTwoStates(1281, 1282); } + break; + case 1295: + if (curChar == 48) + { jjCheckNAddStates(1616, 1618); } + break; + case 1296: + if (curChar == 48) + { jjCheckNAddStates(1619, 1622); } + break; + case 1297: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 20) + kind = 20; + { jjCheckNAddStates(52, 150); } + break; + case 1298: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 20) + kind = 20; + { jjCheckNAdd(1298); } + break; + case 1299: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1299, 1300); } + break; + case 1300: + if (curChar == 46) + { jjCheckNAdd(257); } + break; + case 1301: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 24) + kind = 24; + { jjCheckNAdd(1301); } + break; + case 1302: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1302, 1303); } + break; + case 1303: + if (curChar == 46) + { jjCheckNAdd(258); } + break; + case 1304: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1623, 1625); } + break; + case 1305: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1305, 1306); } + break; + case 1306: + if (curChar == 46) + { jjCheckNAdd(259); } + break; + case 1307: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1626, 1628); } + break; + case 1308: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1308, 1309); } + break; + case 1309: + if (curChar == 46) + { jjCheckNAdd(284); } + break; + case 1310: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1629, 1631); } + break; + case 1311: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1311, 1312); } + break; + case 1312: + if (curChar == 46) + { jjCheckNAdd(309); } + break; + case 1313: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1632, 1634); } + break; + case 1314: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1314, 1315); } + break; + case 1315: + if (curChar == 46) + { jjCheckNAdd(334); } + break; + case 1316: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1635, 1637); } + break; + case 1317: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1317, 1318); } + break; + case 1318: + if (curChar == 46) + { jjCheckNAdd(359); } + break; + case 1319: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1638, 1640); } + break; + case 1320: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1320, 1321); } + break; + case 1321: + if (curChar == 46) + { jjCheckNAdd(384); } + break; + case 1322: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1641, 1643); } + break; + case 1323: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1323, 1324); } + break; + case 1324: + if (curChar == 46) + { jjCheckNAdd(409); } + break; + case 1325: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1644, 1646); } + break; + case 1326: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1326, 1327); } + break; + case 1327: + if (curChar == 46) + { jjCheckNAdd(434); } + break; + case 1328: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1647, 1649); } + break; + case 1329: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1329, 1330); } + break; + case 1330: + if (curChar == 46) + { jjCheckNAdd(459); } + break; + case 1331: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1650, 1652); } + break; + case 1332: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1332, 1333); } + break; + case 1333: + if (curChar == 46) + { jjCheckNAdd(496); } + break; + case 1334: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1653, 1655); } + break; + case 1335: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1335, 1336); } + break; + case 1336: + if (curChar == 46) + { jjCheckNAdd(533); } + break; + case 1337: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1656, 1658); } + break; + case 1338: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1338, 1339); } + break; + case 1339: + if (curChar == 46) + { jjCheckNAdd(582); } + break; + case 1340: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1659, 1661); } + break; + case 1341: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1341, 1342); } + break; + case 1342: + if (curChar == 46) + { jjCheckNAdd(607); } + break; + case 1343: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1662, 1664); } + break; + case 1344: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1344, 1345); } + break; + case 1345: + if (curChar == 46) + { jjCheckNAdd(620); } + break; + case 1346: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1665, 1667); } + break; + case 1347: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1347, 1348); } + break; + case 1348: + if (curChar == 46) + { jjCheckNAdd(645); } + break; + case 1349: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1349, 685); } + break; + case 1350: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1350, 1351); } + break; + case 1351: + if (curChar == 46) + { jjCheckNAdd(682); } + break; + case 1352: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1352, 690); } + break; + case 1353: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1353, 1354); } + break; + case 1354: + if (curChar == 46) + { jjCheckNAdd(686); } + break; + case 1355: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1355, 692); } + break; + case 1356: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1356, 1357); } + break; + case 1357: + if (curChar == 46) + { jjCheckNAdd(691); } + break; + case 1358: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(1668, 1671); } + break; + case 1359: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(1359, 1360); } + break; + case 1360: + if (curChar == 46) + { jjCheckNAdd(693); } + break; + default : break; + } + } while(i != startsAt); + } + else if (curChar < 128) + { + long l = 1L << (curChar & 077); + do + { + switch(jjstateSet[--i]) + { + case 1364: + if ((0x7fffffe87fffffeL & l) != 0L) + { jjCheckNAddStates(0, 2); } + else if (curChar == 92) + { jjCheckNAddTwoStates(732, 733); } + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + } + else if (curChar == 92) + { jjCheckNAddStates(1672, 1675); } + if ((0x10000000100000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 188; + else if (curChar == 92) + { jjCheckNAddTwoStates(752, 753); } + break; + case 1362: + if ((0x7fffffe87fffffeL & l) != 0L) + { jjCheckNAddStates(0, 2); } + else if (curChar == 92) + { jjCheckNAddTwoStates(732, 733); } + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + } + else if (curChar == 92) + { jjCheckNAddStates(1676, 1679); } + if ((0x800000008000L & l) != 0L) + { jjCheckNAddTwoStates(187, 189); } + else if (curChar == 92) + { jjCheckNAddTwoStates(752, 753); } + break; + case 1363: + if ((0x7fffffe87fffffeL & l) != 0L) + { jjCheckNAddStates(0, 2); } + else if (curChar == 92) + { jjCheckNAddTwoStates(732, 733); } + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + } + else if (curChar == 92) + { jjCheckNAddTwoStates(752, 753); } + break; + case 729: + if ((0x7fffffe87fffffeL & l) != 0L) + { jjCheckNAddStates(0, 2); } + else if (curChar == 92) + { jjCheckNAddTwoStates(732, 783); } + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + } + else if (curChar == 92) + { jjCheckNAddTwoStates(752, 769); } + break; + case 1365: + if ((0x7fffffe87fffffeL & l) != 0L) + { jjCheckNAddStates(0, 2); } + else if (curChar == 92) + { jjCheckNAddTwoStates(732, 733); } + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + } + else if (curChar == 92) + { jjCheckNAddTwoStates(752, 753); } + break; + case 0: + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 22) + kind = 22; + { jjCheckNAddStates(1680, 1684); } + } + else if (curChar == 92) + { jjCheckNAddStates(1685, 1696); } + else if (curChar == 64) + { jjCheckNAddStates(1697, 1709); } + else if (curChar == 123) + { + if (kind > 55) + kind = 55; + } + if ((0x20000000200000L & l) != 0L) + { jjAddStates(1710, 1711); } + else if ((0x100000001000L & l) != 0L) + { jjCheckNAddTwoStates(212, 238); } + else if ((0x400000004000L & l) != 0L) + { jjCheckNAddTwoStates(186, 200); } + break; + case 1: + if ((0xffffffffefffffffL & l) != 0L) + { jjCheckNAddStates(193, 195); } + break; + case 3: + if (curChar == 92) + { jjAddStates(1712, 1715); } + break; + case 7: + if ((0xffffff81ffffff81L & l) != 0L) + { jjCheckNAddStates(193, 195); } + break; + case 8: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(196, 205); } + break; + case 9: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(206, 210); } + 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(190, 192); } + break; + case 25: + if (curChar == 92) + { jjAddStates(1716, 1719); } + break; + case 29: + if ((0xffffff81ffffff81L & l) != 0L) + { jjCheckNAddStates(190, 192); } + break; + case 30: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(211, 220); } + break; + case 31: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(221, 225); } + 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 > 55) + kind = 55; + break; + case 49: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 72) + kind = 72; + { jjCheckNAddTwoStates(49, 50); } + break; + case 50: + if (curChar == 92) + { jjAddStates(1720, 1721); } + break; + case 51: + if ((0xffffff81ffffff81L & l) == 0L) + break; + if (kind > 72) + kind = 72; + { jjCheckNAddTwoStates(49, 50); } + break; + case 52: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 72) + kind = 72; + { jjCheckNAddStates(226, 234); } + break; + case 53: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 72) + kind = 72; + { jjCheckNAddStates(235, 238); } + 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(1722, 1723); } + 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(1724, 1725); } + 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 > 78) + kind = 78; + break; + case 86: + if (curChar == 92) + { jjCheckNAddStates(1726, 1729); } + break; + case 97: + if (curChar == 92) + { jjCheckNAddStates(1730, 1733); } + break; + case 98: + if ((0x2000000020L & l) != 0L) + { jjCheckNAddStates(1734, 1737); } + break; + case 108: + if (curChar == 92) + { jjAddStates(1738, 1740); } + break; + case 119: + if (curChar == 92) + { jjCheckNAddStates(1741, 1744); } + break; + case 130: + if (curChar == 92) + { jjCheckNAddStates(1745, 1748); } + break; + case 141: + if (curChar == 92) + { jjCheckNAddStates(1749, 1752); } + break; + case 152: + if (curChar == 92) + { jjCheckNAddStates(1753, 1756); } + break; + case 163: + if (curChar == 92) + { jjCheckNAddStates(1757, 1760); } + break; + case 164: + if ((0x1000000010L & l) != 0L) + { jjCheckNAddStates(1761, 1764); } + break; + case 174: + if (curChar == 92) + { jjAddStates(1765, 1768); } + break; + case 185: + if ((0x400000004000L & l) != 0L) + { jjCheckNAddTwoStates(186, 200); } + break; + case 186: + if ((0x800000008000L & l) != 0L) + { jjCheckNAddTwoStates(187, 189); } + break; + case 187: + if ((0x10000000100000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 188; + break; + case 189: + if (curChar == 92) + { jjCheckNAddStates(1672, 1675); } + break; + case 200: + if (curChar == 92) + { jjCheckNAddStates(1676, 1679); } + break; + case 211: + if ((0x100000001000L & l) != 0L) + { jjCheckNAddTwoStates(212, 238); } + break; + case 212: + if ((0x200000002L & l) != 0L) + { jjCheckNAddTwoStates(213, 227); } + break; + case 213: + if ((0x400000004000L & l) != 0L) + { jjCheckNAddTwoStates(214, 216); } + break; + case 214: + if ((0x8000000080L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 215; + break; + case 216: + if (curChar == 92) + { jjCheckNAddStates(1769, 1772); } + break; + case 227: + if (curChar == 92) + { jjCheckNAddStates(1773, 1776); } + break; + case 228: + if ((0x2000000020L & l) != 0L) + { jjCheckNAddStates(1777, 1780); } + break; + case 238: + if (curChar == 92) + { jjAddStates(1781, 1783); } + break; + case 260: + if ((0x2000000020L & l) != 0L) + { jjCheckNAddTwoStates(261, 262); } + break; + case 261: + if ((0x200000002000L & l) != 0L && kind > 79) + kind = 79; + break; + case 262: + if (curChar == 92) + { jjCheckNAddStates(1784, 1787); } + break; + case 263: + if ((0x1000000010L & l) == 0L) + break; + if (kind > 79) + kind = 79; + { jjAddStates(1788, 1789); } + break; + case 273: + if (curChar == 92) + { jjAddStates(1790, 1792); } + break; + case 285: + if ((0x2000000020L & l) != 0L) + { jjCheckNAddTwoStates(286, 287); } + break; + case 286: + if ((0x100000001000000L & l) != 0L && kind > 80) + kind = 80; + break; + case 287: + if (curChar == 92) + { jjCheckNAddStates(1793, 1796); } + break; + case 298: + if (curChar == 92) + { jjAddStates(1797, 1799); } + break; + case 310: + if ((0x1000000010000L & l) != 0L) + { jjCheckNAddTwoStates(311, 312); } + break; + case 311: + if ((0x100000001000000L & l) != 0L && kind > 81) + kind = 81; + break; + case 312: + if (curChar == 92) + { jjCheckNAddStates(1800, 1803); } + break; + case 323: + if (curChar == 92) + { jjAddStates(1804, 1807); } + break; + case 335: + if ((0x800000008L & l) != 0L) + { jjCheckNAddTwoStates(336, 337); } + break; + case 336: + if ((0x200000002000L & l) != 0L && kind > 82) + kind = 82; + break; + case 337: + if (curChar == 92) + { jjCheckNAddStates(1808, 1811); } + break; + case 338: + if ((0x1000000010L & l) == 0L) + break; + if (kind > 82) + kind = 82; + { jjAddStates(1812, 1813); } + break; + case 348: + if (curChar == 92) + { jjAddStates(1814, 1816); } + break; + case 360: + if ((0x200000002000L & l) != 0L) + { jjCheckNAddTwoStates(361, 362); } + break; + case 361: + if ((0x200000002000L & l) != 0L && kind > 83) + kind = 83; + break; + case 362: + if (curChar == 92) + { jjCheckNAddStates(1817, 1820); } + break; + case 363: + if ((0x1000000010L & l) == 0L) + break; + if (kind > 83) + kind = 83; + { jjAddStates(1821, 1822); } + break; + case 373: + if (curChar == 92) + { jjAddStates(1823, 1826); } + break; + case 374: + if ((0x1000000010L & l) != 0L) + { jjCheckNAddStates(1827, 1830); } + break; + case 385: + if ((0x20000000200L & l) != 0L) + { jjCheckNAddTwoStates(386, 387); } + break; + case 386: + if ((0x400000004000L & l) != 0L && kind > 84) + kind = 84; + break; + case 387: + if (curChar == 92) + { jjCheckNAddStates(1831, 1834); } + break; + case 388: + if ((0x2000000020L & l) == 0L) + break; + if (kind > 84) + kind = 84; + { jjAddStates(1835, 1836); } + break; + case 398: + if (curChar == 92) + { jjAddStates(1837, 1840); } + break; + case 410: + if ((0x1000000010000L & l) != 0L) + { jjCheckNAddTwoStates(411, 412); } + break; + case 411: + if ((0x10000000100000L & l) != 0L && kind > 85) + kind = 85; + break; + case 412: + if (curChar == 92) + { jjCheckNAddStates(1841, 1844); } + break; + case 423: + if (curChar == 92) + { jjAddStates(1845, 1848); } + break; + case 435: + if ((0x1000000010000L & l) != 0L) + { jjAddStates(1849, 1850); } + break; + case 436: + if ((0x800000008L & l) != 0L && kind > 86) + kind = 86; + break; + case 437: + if (curChar == 92) + { jjAddStates(1851, 1853); } + break; + case 448: + if (curChar == 92) + { jjAddStates(1854, 1857); } + break; + case 460: + if ((0x1000000010L & l) != 0L) + { jjAddStates(1858, 1859); } + break; + case 461: + if ((0x2000000020L & l) != 0L) + { jjCheckNAddTwoStates(462, 463); } + break; + case 462: + if ((0x8000000080L & l) != 0L && kind > 87) + kind = 87; + break; + case 463: + if (curChar == 92) + { jjCheckNAddStates(1860, 1863); } + break; + case 474: + if (curChar == 92) + { jjAddStates(1864, 1866); } + break; + case 485: + if (curChar == 92) + { jjAddStates(1867, 1869); } + break; + case 497: + if ((0x4000000040000L & l) != 0L) + { jjAddStates(1870, 1871); } + break; + case 498: + if ((0x200000002L & l) != 0L) + { jjAddStates(1872, 1873); } + break; + case 499: + if ((0x1000000010L & l) != 0L && kind > 88) + kind = 88; + break; + case 500: + if (curChar == 92) + { jjAddStates(1874, 1876); } + break; + case 511: + if (curChar == 92) + { jjAddStates(1877, 1879); } + break; + case 522: + if (curChar == 92) + { jjAddStates(1880, 1883); } + break; + case 534: + if ((0x8000000080L & l) != 0L) + { jjCheckNAddTwoStates(535, 560); } + break; + case 535: + if ((0x4000000040000L & l) != 0L) + { jjAddStates(1884, 1885); } + break; + case 536: + if ((0x200000002L & l) != 0L) + { jjAddStates(1886, 1887); } + break; + case 537: + if ((0x1000000010L & l) != 0L && kind > 89) + kind = 89; + break; + case 538: + if (curChar == 92) + { jjAddStates(1888, 1890); } + break; + case 549: + if (curChar == 92) + { jjAddStates(1891, 1893); } + break; + case 560: + if (curChar == 92) + { jjCheckNAddStates(1894, 1897); } + break; + case 571: + if (curChar == 92) + { jjAddStates(1898, 1901); } + break; + case 583: + if ((0x200000002000L & l) != 0L) + { jjCheckNAddTwoStates(584, 585); } + break; + case 584: + if ((0x8000000080000L & l) != 0L && kind > 90) + kind = 90; + break; + case 585: + if (curChar == 92) + { jjCheckNAddStates(1902, 1905); } + break; + case 596: + if (curChar == 92) + { jjAddStates(1906, 1909); } + break; + case 597: + if ((0x1000000010L & l) != 0L) + { jjCheckNAddStates(1910, 1913); } + break; + case 608: + if ((0x8000000080000L & l) != 0L && kind > 91) + kind = 91; + break; + case 609: + if (curChar == 92) + { jjAddStates(1914, 1917); } + break; + case 621: + if ((0x10000000100L & l) != 0L) + { jjCheckNAddTwoStates(622, 623); } + break; + case 622: + if ((0x400000004000000L & l) != 0L && kind > 92) + kind = 92; + break; + case 623: + if (curChar == 92) + { jjCheckNAddStates(1918, 1921); } + break; + case 624: + if ((0x200000002L & l) == 0L) + break; + if (kind > 92) + kind = 92; + { jjAddStates(1922, 1923); } + break; + case 634: + if (curChar == 92) + { jjAddStates(1924, 1927); } + break; + case 646: + if ((0x80000000800L & l) != 0L) + { jjCheckNAddTwoStates(647, 660); } + break; + case 647: + if ((0x10000000100L & l) != 0L) + { jjCheckNAddTwoStates(648, 649); } + break; + case 648: + if ((0x400000004000000L & l) != 0L && kind > 93) + kind = 93; + break; + case 649: + if (curChar == 92) + { jjCheckNAddStates(1928, 1931); } + break; + case 650: + if ((0x200000002L & l) == 0L) + break; + if (kind > 93) + kind = 93; + { jjAddStates(1932, 1933); } + break; + case 660: + if (curChar == 92) + { jjCheckNAddStates(1934, 1937); } + break; + case 671: + if (curChar == 92) + { jjAddStates(1938, 1941); } + break; + case 672: + if ((0x400000004L & l) != 0L) + { jjCheckNAddStates(1942, 1945); } + break; + case 683: + if ((0x20000000200L & l) != 0L && kind > 94) + kind = 94; + break; + case 684: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 683; + break; + case 685: + if ((0x1000000010L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 684; + break; + case 687: + if ((0x200000002000L & l) != 0L && kind > 95) + kind = 95; + break; + case 688: + if ((0x800000008L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 687; + break; + case 689: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 688; + break; + case 690: + if ((0x1000000010L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 689; + break; + case 695: + case 696: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 97) + kind = 97; + { jjCheckNAddTwoStates(696, 697); } + break; + case 697: + if (curChar == 92) + { jjCheckNAddTwoStates(698, 699); } + break; + case 698: + if ((0xffffff81ffffff81L & l) == 0L) + break; + if (kind > 97) + kind = 97; + { jjCheckNAddTwoStates(696, 697); } + break; + case 699: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 97) + kind = 97; + { jjCheckNAddStates(943, 951); } + break; + case 700: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 97) + kind = 97; + { jjCheckNAddStates(952, 955); } + break; + case 704: + case 706: + case 709: + case 713: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(700); } + break; + case 705: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 706; + break; + case 707: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 708; + break; + case 708: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 709; + break; + case 710: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 711; + break; + case 711: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 712; + break; + case 712: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 713; + break; + case 714: + if (curChar == 92) + { jjCheckNAddTwoStates(698, 715); } + break; + case 715: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 97) + kind = 97; + { jjCheckNAddStates(956, 964); } + break; + case 716: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 97) + kind = 97; + { jjCheckNAddStates(965, 968); } + break; + case 718: + case 720: + case 723: + case 727: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(716); } + break; + case 719: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 720; + break; + case 721: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 722; + break; + case 722: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 723; + break; + case 724: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 725; + break; + case 725: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 726; + break; + case 726: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 727; + break; + case 730: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + break; + case 731: + if (curChar == 92) + { jjCheckNAddTwoStates(732, 733); } + break; + case 732: + if ((0xffffff81ffffff81L & l) == 0L) + break; + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + break; + case 733: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 22) + kind = 22; + { jjCheckNAddStates(969, 977); } + break; + case 734: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 22) + kind = 22; + { jjCheckNAddStates(978, 981); } + 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 ((0x7fffffe87fffffeL & l) != 0L) + { jjCheckNAddStates(0, 2); } + break; + case 749: + if ((0x7fffffe87fffffeL & l) != 0L) + { jjCheckNAddStates(0, 2); } + break; + case 751: + if (curChar == 92) + { jjCheckNAddTwoStates(752, 753); } + break; + case 752: + if ((0xffffff81ffffff81L & l) != 0L) + { jjCheckNAddStates(0, 2); } + break; + case 753: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(982, 991); } + break; + case 754: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(992, 996); } + break; + case 758: + case 760: + case 763: + case 767: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(754); } + break; + case 759: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 760; + break; + case 761: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 762; + break; + case 762: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 763; + break; + case 764: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 765; + break; + case 765: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 766; + break; + case 766: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 767; + break; + case 768: + if (curChar == 92) + { jjCheckNAddTwoStates(752, 769); } + break; + case 769: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(997, 1006); } + break; + case 770: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(1007, 1011); } + break; + case 772: + case 774: + case 777: + case 781: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(770); } + 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 (curChar == 92) + { jjCheckNAddTwoStates(732, 783); } + break; + case 783: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 22) + kind = 22; + { jjCheckNAddStates(1012, 1020); } + break; + case 784: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 22) + kind = 22; + { jjCheckNAddStates(1021, 1024); } + break; + case 786: + case 788: + case 791: + case 795: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(784); } + break; + case 787: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 788; + break; + case 789: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 790; + break; + case 790: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 791; + break; + case 792: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 793; + break; + case 793: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 794; + break; + case 794: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 795; + break; + case 796: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 22) + kind = 22; + { jjCheckNAddStates(1680, 1684); } + break; + case 797: + if (curChar == 64) + { jjCheckNAddStates(1697, 1709); } + break; + case 798: + if ((0x20000000200L & l) != 0L) + { jjCheckNAddTwoStates(799, 848); } + break; + case 799: + if ((0x200000002000L & l) != 0L) + { jjCheckNAddTwoStates(800, 837); } + break; + case 800: + if ((0x1000000010000L & l) != 0L) + { jjCheckNAddTwoStates(801, 826); } + break; + case 801: + if ((0x800000008000L & l) != 0L) + { jjCheckNAddTwoStates(802, 815); } + break; + case 802: + if ((0x4000000040000L & l) != 0L) + { jjCheckNAddTwoStates(803, 804); } + break; + case 803: + if ((0x10000000100000L & l) != 0L && kind > 73) + kind = 73; + break; + case 804: + if (curChar == 92) + { jjCheckNAddStates(1946, 1949); } + break; + case 815: + if (curChar == 92) + { jjCheckNAddStates(1950, 1953); } + break; + case 826: + if (curChar == 92) + { jjCheckNAddStates(1954, 1957); } + break; + case 837: + if (curChar == 92) + { jjCheckNAddStates(1958, 1961); } + break; + case 848: + if (curChar == 92) + { jjCheckNAddStates(1962, 1965); } + break; + case 849: + if ((0x1000000010L & l) != 0L) + { jjCheckNAddStates(1966, 1969); } + break; + case 859: + if ((0x1000000010000L & l) != 0L) + { jjAddStates(1970, 1971); } + break; + case 860: + if ((0x200000002L & l) != 0L) + { jjCheckNAddTwoStates(861, 874); } + break; + case 861: + if ((0x8000000080L & l) != 0L) + { jjAddStates(1972, 1973); } + break; + case 862: + if ((0x2000000020L & l) != 0L && kind > 74) + kind = 74; + break; + case 863: + if (curChar == 92) + { jjAddStates(1974, 1976); } + break; + case 874: + if (curChar == 92) + { jjCheckNAddStates(1977, 1980); } + break; + case 885: + if (curChar == 92) + { jjAddStates(1981, 1983); } + break; + case 896: + if ((0x200000002000L & l) != 0L) + { jjCheckNAddTwoStates(897, 934); } + break; + case 897: + if ((0x2000000020L & l) != 0L) + { jjAddStates(1984, 1985); } + break; + case 898: + if ((0x1000000010L & l) != 0L) + { jjCheckNAddTwoStates(899, 912); } + break; + case 899: + if ((0x20000000200L & l) != 0L) + { jjAddStates(1986, 1987); } + break; + case 900: + if ((0x200000002L & l) != 0L && kind > 75) + kind = 75; + break; + case 901: + if (curChar == 92) + { jjAddStates(1988, 1990); } + break; + case 912: + if (curChar == 92) + { jjCheckNAddStates(1991, 1994); } + break; + case 923: + if (curChar == 92) + { jjAddStates(1995, 1997); } + break; + case 934: + if (curChar == 92) + { jjAddStates(1998, 2000); } + break; + case 945: + if ((0x4000000040L & l) != 0L) + { jjCheckNAddTwoStates(946, 1020); } + break; + case 946: + if ((0x800000008000L & l) != 0L) + { jjCheckNAddTwoStates(947, 1009); } + break; + case 947: + if ((0x400000004000L & l) != 0L) + { jjCheckNAddTwoStates(948, 998); } + break; + case 948: + if ((0x10000000100000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 949; + break; + case 950: + if ((0x4000000040L & l) != 0L) + { jjAddStates(2001, 2002); } + break; + case 951: + if ((0x200000002L & l) != 0L) + { jjAddStates(2003, 2004); } + break; + case 952: + if ((0x800000008L & l) != 0L) + { jjAddStates(2005, 2006); } + break; + case 953: + if ((0x2000000020L & l) != 0L && kind > 76) + kind = 76; + break; + case 954: + if (curChar == 92) + { jjAddStates(2007, 2009); } + break; + case 965: + if (curChar == 92) + { jjAddStates(2010, 2012); } + break; + case 976: + if (curChar == 92) + { jjAddStates(2013, 2015); } + break; + case 987: + if (curChar == 92) + { jjAddStates(2016, 2018); } + break; + case 998: + if (curChar == 92) + { jjCheckNAddStates(2019, 2022); } + break; + case 1009: + if (curChar == 92) + { jjCheckNAddStates(2023, 2026); } + break; + case 1010: + if ((0x2000000020L & l) != 0L) + { jjCheckNAddStates(2027, 2030); } + break; + case 1020: + if (curChar == 92) + { jjCheckNAddStates(2031, 2034); } + break; + case 1031: + if (curChar == 92) + { jjAddStates(2035, 2037); } + break; + case 1042: + if ((0x800000008L & l) != 0L) + { jjCheckNAddTwoStates(1043, 1104); } + break; + case 1043: + if ((0x10000000100L & l) != 0L) + { jjAddStates(2038, 2039); } + break; + case 1044: + if ((0x200000002L & l) != 0L) + { jjCheckNAddTwoStates(1045, 1082); } + break; + case 1045: + if ((0x4000000040000L & l) != 0L) + { jjCheckNAddTwoStates(1046, 1071); } + break; + case 1046: + if ((0x8000000080000L & l) != 0L) + { jjAddStates(2040, 2041); } + break; + case 1047: + if ((0x2000000020L & l) != 0L) + { jjCheckNAddTwoStates(1048, 1049); } + break; + case 1048: + if ((0x10000000100000L & l) != 0L && kind > 77) + kind = 77; + break; + case 1049: + if (curChar == 92) + { jjCheckNAddStates(2042, 2045); } + break; + case 1060: + if (curChar == 92) + { jjAddStates(2046, 2048); } + break; + case 1071: + if (curChar == 92) + { jjCheckNAddStates(2049, 2052); } + break; + case 1082: + if (curChar == 92) + { jjCheckNAddStates(2053, 2056); } + break; + case 1093: + if (curChar == 92) + { jjAddStates(2057, 2059); } + break; + case 1104: + if (curChar == 92) + { jjCheckNAddStates(2060, 2063); } + break; + case 1115: + if (curChar == 92) + { jjAddStates(2064, 2066); } + break; + case 1127: + case 1128: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 104) + kind = 104; + { jjCheckNAddTwoStates(1128, 1129); } + break; + case 1129: + if (curChar == 92) + { jjCheckNAddTwoStates(1130, 1131); } + break; + case 1130: + if ((0xffffff81ffffff81L & l) == 0L) + break; + if (kind > 104) + kind = 104; + { jjCheckNAddTwoStates(1128, 1129); } + break; + case 1131: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 104) + kind = 104; + { jjCheckNAddStates(1442, 1450); } + break; + case 1132: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 104) + kind = 104; + { jjCheckNAddStates(1451, 1454); } + break; + case 1136: + case 1138: + case 1141: + case 1145: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(1132); } + break; + case 1137: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1138; + break; + case 1139: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1140; + break; + case 1140: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1141; + break; + case 1142: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1143; + break; + case 1143: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1144; + break; + case 1144: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1145; + break; + case 1146: + if (curChar == 92) + { jjCheckNAddTwoStates(1130, 1147); } + break; + case 1147: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 104) + kind = 104; + { jjCheckNAddStates(1455, 1463); } + break; + case 1148: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 104) + kind = 104; + { jjCheckNAddStates(1464, 1467); } + break; + case 1150: + case 1152: + case 1155: + case 1159: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(1148); } + break; + case 1151: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1152; + break; + case 1153: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1154; + break; + case 1154: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1155; + break; + case 1156: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1157; + break; + case 1157: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1158; + break; + case 1158: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1159; + break; + case 1160: + if (curChar == 92) + { jjCheckNAddStates(2067, 2070); } + break; + case 1161: + if ((0x1000000010L & l) != 0L) + { jjCheckNAddStates(2071, 2074); } + break; + case 1171: + if (curChar == 92) + { jjCheckNAddStates(2075, 2078); } + break; + case 1182: + if (curChar == 92) + { jjCheckNAddStates(2079, 2082); } + break; + case 1193: + if ((0x20000000200000L & l) != 0L) + { jjAddStates(1710, 1711); } + break; + case 1195: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAddTwoStates(1196, 1203); } + break; + case 1197: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 99) + kind = 99; + jjstateSet[jjnewStateCnt++] = 1198; + break; + case 1198: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAddStates(1512, 1515); } + break; + case 1199: + if ((0x7e0000007eL & l) != 0L && kind > 99) + kind = 99; + break; + case 1200: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAdd(1199); } + break; + case 1201: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAddTwoStates(1199, 1200); } + break; + case 1202: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAddStates(1516, 1518); } + break; + case 1203: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAddStates(1519, 1523); } + break; + case 1204: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAdd(1196); } + break; + case 1205: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAddTwoStates(1204, 1196); } + break; + case 1206: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAddStates(1524, 1526); } + break; + case 1207: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 99) + kind = 99; + { jjCheckNAddStates(1527, 1530); } + break; + case 1208: + if ((0x100000001000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1209; + break; + case 1210: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(1537, 1540); } + break; + case 1213: + if (curChar == 92) + { jjAddStates(2083, 2084); } + break; + case 1214: + if ((0xffffff81ffffff81L & l) != 0L) + { jjCheckNAddStates(1537, 1540); } + break; + case 1215: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(1541, 1550); } + break; + case 1216: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(1551, 1555); } + break; + case 1220: + case 1222: + case 1225: + case 1229: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(1216); } + break; + case 1221: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1222; + break; + case 1223: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1224; + break; + case 1224: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1225; + break; + case 1226: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1227; + break; + case 1227: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1228; + break; + case 1228: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1229; + break; + case 1231: + if ((0xffffffffefffffffL & l) != 0L) + { jjCheckNAddStates(1556, 1558); } + break; + case 1233: + if (curChar == 92) + { jjAddStates(2085, 2088); } + break; + case 1237: + if ((0xffffff81ffffff81L & l) != 0L) + { jjCheckNAddStates(1556, 1558); } + break; + case 1238: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(1559, 1568); } + break; + case 1239: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(1569, 1573); } + break; + case 1242: + case 1244: + case 1247: + case 1251: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(1239); } + break; + case 1243: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1244; + break; + case 1245: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1246; + break; + case 1246: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1247; + break; + case 1248: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1249; + break; + case 1249: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1250; + break; + case 1250: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1251; + break; + case 1253: + if ((0xffffffffefffffffL & l) != 0L) + { jjCheckNAddStates(1574, 1576); } + break; + case 1255: + if (curChar == 92) + { jjAddStates(2089, 2092); } + break; + case 1259: + if ((0xffffff81ffffff81L & l) != 0L) + { jjCheckNAddStates(1574, 1576); } + break; + case 1260: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(1577, 1586); } + break; + case 1261: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(1587, 1591); } + break; + case 1264: + case 1266: + case 1269: + case 1273: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(1261); } + break; + case 1265: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1266; + break; + case 1267: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1268; + break; + case 1268: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1269; + break; + case 1270: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1271; + break; + case 1271: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1272; + break; + case 1272: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1273; + break; + case 1275: + if ((0x4000000040000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 1208; + break; + case 1276: + if (curChar == 92) + { jjCheckNAddStates(1685, 1696); } + break; + case 1277: + if ((0x2000000020L & l) != 0L) + { jjCheckNAddStates(2093, 2096); } + break; + case 1283: + if ((0x800000008L & l) != 0L) + { jjCheckNAddStates(2097, 2100); } + 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 1364: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + } + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(0, 2); } + break; + case 1362: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + } + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(0, 2); } + break; + case 1363: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + } + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(0, 2); } + break; + case 729: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + } + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(0, 2); } + break; + case 1365: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + } + 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 > 22) + kind = 22; + { jjCheckNAddStates(1680, 1684); } + break; + case 1: + case 7: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(193, 195); } + break; + case 23: + case 29: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(190, 192); } + break; + case 49: + case 51: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 72) + kind = 72; + { jjCheckNAddTwoStates(49, 50); } + break; + case 71: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjAddStates(1722, 1723); } + break; + case 73: + case 74: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddTwoStates(74, 75); } + break; + case 695: + case 696: + case 698: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 97) + kind = 97; + { jjCheckNAddTwoStates(696, 697); } + break; + case 730: + case 732: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 22) + kind = 22; + { jjCheckNAddTwoStates(730, 731); } + break; + case 748: + case 752: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(0, 2); } + break; + case 749: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(0, 2); } + break; + case 1127: + case 1128: + case 1130: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 104) + kind = 104; + { jjCheckNAddTwoStates(1128, 1129); } + break; + case 1210: + case 1214: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(1537, 1540); } + break; + case 1231: + case 1237: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(1556, 1558); } + break; + case 1253: + case 1259: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(1574, 1576); } + 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 = 1361 - (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, null, null, null, null, null, null, "\74\41\55\55", "\55\55\76", "\176\75", +"\174\75", "\136\75", "\44\75", "\52\75", null, "\175", "\50", "\51", "\56", "\73", +"\72", "\52", "\57", "\55", "\75", "\133", "\135", null, null, "\176", 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 = { + 749, 750, 751, 693, 694, 695, 714, 645, 646, 671, 620, 621, 634, 607, 608, 609, + 582, 583, 596, 533, 534, 571, 496, 497, 522, 459, 460, 485, 434, 435, 448, 409, + 410, 423, 384, 385, 398, 359, 360, 373, 334, 335, 348, 309, 310, 323, 284, 285, + 298, 259, 260, 273, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1306, 260, 273, 1307, + 1308, 1309, 285, 298, 1310, 1311, 1312, 310, 1313, 1314, 1315, 335, 348, 1316, 1317, 1318, + 360, 1319, 1320, 1321, 385, 1322, 1323, 1324, 410, 1325, 1326, 1327, 435, 1328, 1329, 1330, + 460, 485, 1331, 1332, 1333, 497, 1334, 1335, 1336, 534, 1337, 1338, 1339, 583, 1340, 1341, + 1342, 608, 1343, 1344, 1345, 621, 1346, 1347, 1348, 646, 1349, 1350, 1351, 685, 1352, 1353, + 1354, 690, 1355, 1356, 1357, 692, 1358, 1359, 1360, 694, 695, 714, 671, 634, 609, 596, + 571, 522, 448, 423, 398, 373, 323, 250, 251, 252, 44, 253, 45, 254, 46, 255, + 47, 729, 748, 768, 782, 257, 258, 259, 284, 309, 334, 359, 384, 409, 434, 459, + 496, 533, 582, 607, 620, 645, 682, 686, 691, 693, 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, 192, 193, 188, 197, 194, + 195, 198, 199, 197, 194, 195, 197, 194, 195, 198, 203, 204, 187, 189, 208, 205, + 206, 209, 210, 208, 205, 206, 208, 205, 206, 209, 219, 220, 215, 224, 221, 222, + 225, 226, 224, 221, 222, 224, 221, 222, 225, 235, 232, 233, 236, 237, 235, 232, + 233, 235, 232, 233, 236, 241, 242, 213, 227, 246, 243, 244, 247, 248, 246, 243, + 244, 246, 243, 244, 247, 270, 267, 268, 271, 272, 270, 267, 268, 270, 267, 268, + 271, 276, 277, 261, 262, 281, 278, 279, 282, 283, 281, 278, 279, 281, 278, 279, + 282, 290, 291, 295, 292, 293, 296, 297, 295, 292, 293, 295, 292, 293, 296, 301, + 302, 286, 287, 306, 303, 304, 307, 308, 306, 303, 304, 306, 303, 304, 307, 315, + 316, 320, 317, 318, 321, 322, 320, 317, 318, 320, 317, 318, 321, 326, 327, 311, + 312, 331, 328, 329, 332, 333, 331, 328, 329, 331, 328, 329, 332, 345, 342, 343, + 346, 347, 345, 342, 343, 345, 342, 343, 346, 351, 352, 336, 337, 356, 353, 354, + 357, 358, 356, 353, 354, 356, 353, 354, 357, 370, 367, 368, 371, 372, 370, 367, + 368, 370, 367, 368, 371, 381, 378, 379, 382, 383, 381, 378, 379, 381, 378, 379, + 382, 395, 392, 393, 396, 397, 395, 392, 393, 395, 392, 393, 396, 401, 402, 386, + 387, 406, 403, 404, 407, 408, 406, 403, 404, 406, 403, 404, 407, 415, 416, 420, + 417, 418, 421, 422, 420, 417, 418, 420, 417, 418, 421, 426, 427, 411, 412, 431, + 428, 429, 432, 433, 431, 428, 429, 431, 428, 429, 432, 440, 441, 445, 442, 443, + 446, 447, 445, 442, 443, 445, 442, 443, 446, 451, 452, 436, 437, 456, 453, 454, + 457, 458, 456, 453, 454, 456, 453, 454, 457, 466, 467, 471, 468, 469, 472, 473, + 471, 468, 469, 471, 468, 469, 472, 477, 478, 462, 463, 482, 479, 480, 483, 484, + 482, 479, 480, 482, 479, 480, 483, 488, 489, 461, 474, 493, 490, 491, 494, 495, + 493, 490, 491, 493, 490, 491, 494, 503, 504, 508, 505, 506, 509, 510, 508, 505, + 506, 508, 505, 506, 509, 514, 515, 499, 500, 519, 516, 517, 520, 521, 519, 516, + 517, 519, 516, 517, 520, 525, 526, 498, 511, 530, 527, 528, 531, 532, 530, 527, + 528, 530, 527, 528, 531, 541, 542, 546, 543, 544, 547, 548, 546, 543, 544, 546, + 543, 544, 547, 552, 553, 537, 538, 557, 554, 555, 558, 559, 557, 554, 555, 557, + 554, 555, 558, 563, 564, 536, 549, 568, 565, 566, 569, 570, 568, 565, 566, 568, + 565, 566, 569, 574, 575, 535, 560, 579, 576, 577, 580, 581, 579, 576, 577, 579, + 576, 577, 580, 588, 589, 593, 590, 591, 594, 595, 593, 590, 591, 593, 590, 591, + 594, 604, 601, 602, 605, 606, 604, 601, 602, 604, 601, 602, 605, 612, 613, 617, + 614, 615, 618, 619, 617, 614, 615, 617, 614, 615, 618, 631, 628, 629, 632, 633, + 631, 628, 629, 631, 628, 629, 632, 637, 638, 622, 623, 642, 639, 640, 643, 644, + 642, 639, 640, 642, 639, 640, 643, 657, 654, 655, 658, 659, 657, 654, 655, 657, + 654, 655, 658, 663, 664, 648, 649, 668, 665, 666, 669, 670, 668, 665, 666, 668, + 665, 666, 669, 679, 676, 677, 680, 681, 679, 676, 677, 679, 676, 677, 680, 696, + 700, 704, 705, 707, 710, 702, 703, 697, 696, 702, 703, 697, 716, 718, 719, 721, + 724, 717, 703, 696, 697, 717, 703, 696, 697, 730, 734, 738, 739, 741, 744, 736, + 737, 731, 730, 736, 737, 731, 749, 754, 758, 759, 761, 764, 756, 757, 750, 751, + 749, 756, 757, 750, 751, 770, 772, 773, 775, 778, 771, 757, 749, 750, 751, 771, + 757, 749, 750, 751, 784, 786, 787, 789, 792, 785, 737, 730, 731, 785, 737, 730, + 731, 807, 808, 812, 809, 810, 813, 814, 812, 809, 810, 812, 809, 810, 813, 818, + 819, 803, 804, 823, 820, 821, 824, 825, 823, 820, 821, 823, 820, 821, 824, 829, + 830, 802, 815, 834, 831, 832, 835, 836, 834, 831, 832, 834, 831, 832, 835, 840, + 841, 801, 826, 845, 842, 843, 846, 847, 845, 842, 843, 845, 842, 843, 846, 856, + 853, 854, 857, 858, 856, 853, 854, 856, 853, 854, 857, 866, 867, 871, 868, 869, + 872, 873, 871, 868, 869, 871, 868, 869, 872, 877, 878, 862, 863, 882, 879, 880, + 883, 884, 882, 879, 880, 882, 879, 880, 883, 888, 889, 861, 874, 893, 890, 891, + 894, 895, 893, 890, 891, 893, 890, 891, 894, 904, 905, 909, 906, 907, 910, 911, + 909, 906, 907, 909, 906, 907, 910, 915, 916, 900, 901, 920, 917, 918, 921, 922, + 920, 917, 918, 920, 917, 918, 921, 926, 927, 899, 912, 931, 928, 929, 932, 933, + 931, 928, 929, 931, 928, 929, 932, 937, 938, 898, 923, 942, 939, 940, 943, 944, + 942, 939, 940, 942, 939, 940, 943, 950, 987, 957, 958, 962, 959, 960, 963, 964, + 962, 959, 960, 962, 959, 960, 963, 968, 969, 953, 954, 973, 970, 971, 974, 975, + 973, 970, 971, 973, 970, 971, 974, 979, 980, 952, 965, 984, 981, 982, 985, 986, + 984, 981, 982, 984, 981, 982, 985, 990, 991, 951, 976, 995, 992, 993, 996, 997, + 995, 992, 993, 995, 992, 993, 996, 1001, 1002, 949, 1006, 1003, 1004, 1007, 1008, 1006, + 1003, 1004, 1006, 1003, 1004, 1007, 1017, 1014, 1015, 1018, 1019, 1017, 1014, 1015, 1017, 1014, + 1015, 1018, 1023, 1024, 947, 1009, 1028, 1025, 1026, 1029, 1030, 1028, 1025, 1026, 1028, 1025, + 1026, 1029, 1034, 1035, 946, 1020, 1039, 1036, 1037, 1040, 1041, 1039, 1036, 1037, 1039, 1036, + 1037, 1040, 1052, 1053, 1057, 1054, 1055, 1058, 1059, 1057, 1054, 1055, 1057, 1054, 1055, 1058, + 1063, 1064, 1048, 1049, 1068, 1065, 1066, 1069, 1070, 1068, 1065, 1066, 1068, 1065, 1066, 1069, + 1074, 1075, 1047, 1060, 1079, 1076, 1077, 1080, 1081, 1079, 1076, 1077, 1079, 1076, 1077, 1080, + 1085, 1086, 1046, 1071, 1090, 1087, 1088, 1091, 1092, 1090, 1087, 1088, 1090, 1087, 1088, 1091, + 1096, 1097, 1045, 1082, 1101, 1098, 1099, 1102, 1103, 1101, 1098, 1099, 1101, 1098, 1099, 1102, + 1107, 1108, 1044, 1093, 1112, 1109, 1110, 1113, 1114, 1112, 1109, 1110, 1112, 1109, 1110, 1113, + 1118, 1119, 1043, 1104, 1123, 1120, 1121, 1124, 1125, 1123, 1120, 1121, 1123, 1120, 1121, 1124, + 1127, 1146, 1128, 1132, 1136, 1137, 1139, 1142, 1134, 1135, 1129, 1128, 1134, 1135, 1129, 1148, + 1150, 1151, 1153, 1156, 1149, 1135, 1128, 1129, 1149, 1135, 1128, 1129, 1168, 1165, 1166, 1169, + 1170, 1168, 1165, 1166, 1168, 1165, 1166, 1169, 1174, 1175, 860, 885, 1179, 1176, 1177, 1180, + 1181, 1179, 1176, 1177, 1179, 1176, 1177, 1180, 1185, 1186, 799, 848, 1190, 1187, 1188, 1191, + 1192, 1190, 1187, 1188, 1190, 1187, 1188, 1191, 1199, 1200, 1201, 1202, 1199, 1200, 1201, 1204, + 1196, 1205, 1206, 1207, 1204, 1196, 1205, 1204, 1196, 1205, 1206, 1210, 1230, 1252, 1212, 1213, + 1274, 1210, 1211, 1212, 1213, 1210, 1216, 1220, 1221, 1223, 1226, 1218, 1212, 1213, 1219, 1210, + 1218, 1212, 1213, 1219, 1231, 1232, 1233, 1231, 1239, 1242, 1243, 1245, 1248, 1240, 1241, 1232, + 1233, 1231, 1240, 1241, 1232, 1233, 1253, 1254, 1255, 1253, 1261, 1264, 1265, 1267, 1270, 1262, + 1263, 1254, 1255, 1253, 1262, 1263, 1254, 1255, 1210, 1230, 1252, 1211, 1212, 1213, 1274, 1290, + 1287, 1288, 1291, 1292, 1290, 1287, 1288, 1290, 1287, 1288, 1291, 1294, 1281, 1282, 1295, 1296, + 1294, 1281, 1282, 1294, 1281, 1282, 1295, 1304, 260, 273, 1307, 285, 298, 1310, 310, 323, + 1313, 335, 348, 1316, 360, 373, 1319, 385, 398, 1322, 410, 423, 1325, 435, 448, 1328, + 460, 485, 1331, 497, 522, 1334, 534, 571, 1337, 583, 596, 1340, 608, 609, 1343, 621, + 634, 1346, 646, 671, 1358, 694, 695, 714, 194, 195, 187, 196, 205, 206, 186, 207, + 730, 749, 750, 751, 731, 732, 1281, 1282, 185, 1287, 1288, 211, 752, 769, 1289, 1293, + 783, 798, 859, 896, 945, 1031, 1042, 1115, 1126, 1127, 1146, 1160, 1171, 1182, 1194, 1275, + 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, 221, 222, 214, 223, 232, 233, 213, + 234, 230, 231, 214, 216, 243, 244, 245, 267, 268, 261, 269, 265, 266, 278, 279, + 280, 292, 293, 286, 294, 303, 304, 305, 317, 318, 311, 319, 328, 329, 310, 330, + 342, 343, 336, 344, 340, 341, 353, 354, 355, 367, 368, 361, 369, 365, 366, 378, + 379, 360, 380, 376, 377, 361, 362, 392, 393, 386, 394, 390, 391, 403, 404, 385, + 405, 417, 418, 411, 419, 428, 429, 410, 430, 436, 437, 442, 443, 444, 453, 454, + 435, 455, 461, 474, 468, 469, 462, 470, 479, 480, 481, 490, 491, 492, 498, 511, + 499, 500, 505, 506, 507, 516, 517, 518, 527, 528, 497, 529, 536, 549, 537, 538, + 543, 544, 545, 554, 555, 556, 565, 566, 535, 567, 576, 577, 534, 578, 590, 591, + 584, 592, 601, 602, 583, 603, 599, 600, 584, 585, 614, 615, 608, 616, 628, 629, + 622, 630, 626, 627, 639, 640, 621, 641, 654, 655, 648, 656, 652, 653, 665, 666, + 647, 667, 676, 677, 646, 678, 674, 675, 647, 660, 809, 810, 803, 811, 820, 821, + 802, 822, 831, 832, 801, 833, 842, 843, 800, 844, 853, 854, 799, 855, 851, 852, + 800, 837, 860, 885, 862, 863, 868, 869, 870, 879, 880, 861, 881, 890, 891, 892, + 898, 923, 900, 901, 906, 907, 908, 917, 918, 899, 919, 928, 929, 930, 939, 940, + 941, 951, 976, 952, 965, 953, 954, 959, 960, 961, 970, 971, 972, 981, 982, 983, + 992, 993, 994, 1003, 1004, 948, 1005, 1014, 1015, 947, 1016, 1012, 1013, 948, 998, 1025, + 1026, 946, 1027, 1036, 1037, 1038, 1044, 1093, 1047, 1060, 1054, 1055, 1048, 1056, 1065, 1066, + 1067, 1076, 1077, 1046, 1078, 1087, 1088, 1045, 1089, 1098, 1099, 1100, 1109, 1110, 1043, 1111, + 1120, 1121, 1122, 1165, 1166, 896, 1167, 1163, 1164, 897, 934, 1176, 1177, 859, 1178, 1187, + 1188, 798, 1189, 1214, 1215, 1234, 1236, 1237, 1238, 1256, 1258, 1259, 1260, 1279, 1280, 186, + 200, 1285, 1286, 212, 238, +}; +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 > 105)) + { + jjmatchedKind = 105; + 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 25 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 1, 1); + 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, 2); + 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, 2); + break; + case 83 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 84 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 85 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 86 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 87 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 3); + break; + case 88 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 3); + break; + case 89 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 4); + break; + case 90 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 91 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 1); + break; + case 92 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 2); + break; + case 93 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 3); + break; + case 94 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 3); + break; + case 95 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 4); + break; + case 96 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 0, 1); + break; + case 100 : + 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 SACParserCSS3TokenManager(CharStream stream){ + + + input_stream = stream; + } + + /** Constructor. */ + public SACParserCSS3TokenManager (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 = 1361; 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, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, +}; +static final long[] jjtoToken = { + 0xffff0000037e0007L, 0x7fbffffffffL, +}; +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[1361]; + private final int[] jjstateSet = new int[2 * 1361]; + 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/SACParserCSSmobileOKBasic1.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSSmobileOKBasic1.java new file mode 100644 index 000000000..b21ec1b29 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSSmobileOKBasic1.java @@ -0,0 +1,1859 @@ +/* SACParserCSSmobileOKBasic1.java */ +/* Generated By:JavaCC: Do not edit this line. SACParserCSSmobileOKBasic1.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 SACParserCSSmobileOKBasic1 extends AbstractSACParser implements SACParserCSSmobileOKBasic1Constants { + + public SACParserCSSmobileOKBasic1() { + this((CharStream) null); + } + + public String getParserVersion() { + return "http://www.w3.org/TR/mobileOK-basic10-tests/#validity"; + } + + protected String getGrammarUri() + { + return "CSSgrammarMobileOKBasic1.0.txt"; + } + +// +// stylesheet +// : [S|CDO|CDC]* [ import [S|CDO|CDC]* ]* +// [ [ ruleset | media ] [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 ASTERISK: + case IMPORT_SYM: + case MEDIA_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 ASTERISK: + case MEDIA_SYM: + 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: + case ASTERISK:{ + styleRule(); + break; + } + case MEDIA_SYM:{ + mediaRule(); + 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: + case ASTERISK:{ + styleRule(); + break; + } + case MEDIA_SYM:{ + mediaRule(); + 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* [ medium [ ',' 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_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); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + mediaList(ml); + break; + } + default: + jj_la1[12] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); +if (nonImportRuleFoundBefore) + { + getErrorHandler().error(toCSSParseException("invalidImportRuleIgnored", 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 [ ',' 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_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); + } + mediaList(ml); +start = true; + handleStartMedia(ml, locator); + jj_consume_token(LBRACE); + 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 IDENT: + case LINK_PSCLASS: + case VISITED_PSCLASS: + case ACTIVE_PSCLASS: + case HASH: + case DOT: + case ASTERISK: + case ATKEYWORD:{ + mediaRuleList(); + break; + } + default: + jj_la1[15] = jj_gen; + ; + } + jj_consume_token(RBRACE); + } catch (CSSParseException e) { +getErrorHandler().error(e); + error_skipblock(); + } catch (ParseException e) { +CSSParseException cpe = toCSSParseException("invalidMediaRule", e); + getErrorHandler().error(cpe); + getErrorHandler().warning(createSkipWarning("ignoringRule", cpe)); + error_skipblock(); + } finally { +if (start) { + handleEndMedia(ml); + } + } +} + + final public void mediaList(SACMediaListImpl ml) throws ParseException {String s; + try { + s = medium(); +ml.setLocator(createLocator(token)); + label_9: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[16] = jj_gen; + break label_9; + } + jj_consume_token(COMMA); + 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); + } +ml.add(s); + s = medium(); + } +ml.add(s); + } catch (ParseException e) { +throw toCSSParseException("invalidMediaList", e); + } +} + + final public void mediaRuleList() throws ParseException { + label_11: + 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 ASTERISK:{ + styleRule(); + break; + } + case ATKEYWORD:{ + unknownAtRule(); + break; + } + default: + jj_la1[18] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + 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); + } + 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 ASTERISK: + case ATKEYWORD:{ + ; + break; + } + default: + jj_la1[20] = jj_gen; + break label_11; + } + } +} + +// +// medium +// : IDENT S* +// ; +// + final public String medium() throws ParseException {Token t; + t = jj_consume_token(IDENT); + label_13: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[21] = jj_gen; + break label_13; + } + 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_14: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[22] = jj_gen; + break label_14; + } + jj_consume_token(S); + } +return new LexicalUnitImpl(prev, LexicalUnit.SAC_OPERATOR_SLASH); + } + case COMMA:{ + jj_consume_token(COMMA); + label_15: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[23] = jj_gen; + break label_15; + } + jj_consume_token(S); + } +return LexicalUnitImpl.createComma(prev); + } + default: + jj_la1[24] = 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[25] = 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_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); + } +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_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); + } +start = true; + handleStartSelector(selList, createLocator(t.next)); + declaration(); + label_18: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SEMICOLON:{ + ; + break; + } + default: + jj_la1[28] = jj_gen; + break label_18; + } + jj_consume_token(SEMICOLON); + 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); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + declaration(); + break; + } + default: + jj_la1[30] = jj_gen; + ; + } + } + 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_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); + } + 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_21: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA:{ + ; + break; + } + default: + jj_la1[32] = jj_gen; + break label_21; + } + jj_consume_token(COMMA); + label_22: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[33] = jj_gen; + break label_22; + } + jj_consume_token(S); + } +selList.add(sel); + sel = selector(); + } + label_23: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[34] = jj_gen; + break label_23; + } + 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_24: + while (true) { + if (jj_2_1(2)) { + ; + } else { + break label_24; + } + 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[35] = 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: + case ASTERISK:{ + simpleSel = elementName(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case HASH:{ + c = hash(c); + break; + } + default: + jj_la1[36] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT:{ + c = _class(c); + break; + } + default: + jj_la1[37] = 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[38] = jj_gen; + ; + } + break; + } + case HASH:{ + c = hash(c); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case DOT:{ + c = _class(c); + break; + } + default: + jj_la1[39] = 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[40] = jj_gen; + ; + } + break; + } + case DOT:{ + 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[41] = jj_gen; + ; + } + break; + } + case LINK_PSCLASS: + case VISITED_PSCLASS: + case ACTIVE_PSCLASS:{ + c = pseudoClass(c); + break; + } + default: + jj_la1[42] = 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 { + 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[43] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (ParseException e) { +throw toCSSParseException("invalidElementName", e); + } +} + +// +// pseudo +// : ':' [ IDENT | S* ')' ] +// ; +// + 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[44] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +// There appears to be an issue here regarding "first-letter" & "first-line" + //String s = unescape(t.image, false); + String s = t.image; + c = getConditionFactory().createPseudoClassCondition(null, s, 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[45] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +String s = t.image; + return getSelectorFactory().createPseudoElementSelector(null, s, 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 { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + declaration(); + break; + } + default: + jj_la1[46] = jj_gen; + ; + } + label_25: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case SEMICOLON:{ + ; + break; + } + default: + jj_la1[47] = jj_gen; + break label_25; + } + jj_consume_token(SEMICOLON); + label_26: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[48] = jj_gen; + break label_26; + } + jj_consume_token(S); + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENT:{ + declaration(); + break; + } + default: + jj_la1[49] = 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_27: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[50] = jj_gen; + break label_27; + } + jj_consume_token(S); + } + e = expr(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IMPORTANT_SYM:{ + priority = prio(); + break; + } + default: + jj_la1[51] = jj_gen; + ; + } +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_28: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[52] = jj_gen; + break label_28; + } + 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_29: + 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[53] = jj_gen; + break label_29; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMA: + case SLASH:{ + body = operator(body); + break; + } + default: + jj_la1[54] = jj_gen; + ; + } + body = term(body); + } +return head; } catch (ParseException ex) { +throw toCSSParseException("invalidExpr", ex); + } +} + +// +// term +// : unary_operator? +// [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | +// STRING S* | URI S* | RGB S* | hexcolor ] +// ; +// + 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[55] = 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[56] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + } + case STRING:{ + t = jj_consume_token(STRING); +value = new LexicalUnitImpl(prev, LexicalUnit.SAC_STRING_VALUE, t.image); + break; + } + case IDENT:{ + t = jj_consume_token(IDENT); +value = new LexicalUnitImpl(prev, LexicalUnit.SAC_IDENT, t.image); + break; + } + case URL:{ + t = jj_consume_token(URL); +value = new LexicalUnitImpl(prev, LexicalUnit.SAC_URI, 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[57] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +if (locator == null) + { + locator = createLocator(token); + } + label_30: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[58] = jj_gen; + break label_30; + } + 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_31: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case S:{ + ; + break; + } + default: + jj_la1[59] = jj_gen; + break label_31; + } + 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); + if (t.kind == LBRACE) + nesting++; + else if (t.kind == RBRACE) + nesting--; + else if (t.kind == SEMICOLON && nesting <= 0) + break; + } + while ((t.kind != RBRACE) || (nesting > 0)); + + return sb.toString(); + } + + 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_3R_33() + { + if (jj_3R_37()) return true; + return false; + } + + private boolean jj_3R_42() + { + if (jj_scan_token(ASTERISK)) return true; + return false; + } + + private boolean jj_3R_36() + { + if (jj_3R_40()) return true; + return false; + } + + private boolean jj_3R_40() + { + 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_41() + { + if (jj_scan_token(IDENT)) return true; + return false; + } + + private boolean jj_3_1() + { + if (jj_scan_token(S)) return true; + if (jj_3R_32()) return true; + return false; + } + + private boolean jj_3R_32() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_33()) { + jj_scanpos = xsp; + if (jj_3R_34()) { + jj_scanpos = xsp; + if (jj_3R_35()) { + jj_scanpos = xsp; + if (jj_3R_36()) return true; + } + } + } + return false; + } + + private boolean jj_3R_35() + { + if (jj_3R_39()) return true; + return false; + } + + private boolean jj_3R_37() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_41()) { + jj_scanpos = xsp; + if (jj_3R_42()) return true; + } + return false; + } + + private boolean jj_3R_34() + { + if (jj_3R_38()) return true; + return false; + } + + private boolean jj_3R_39() + { + if (jj_scan_token(DOT)) return true; + return false; + } + + private boolean jj_3R_38() + { + if (jj_scan_token(HASH)) return true; + return false; + } + + /** Generated Token Manager. */ + public SACParserCSSmobileOKBasic1TokenManager 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[60]; + 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[] {0x18000002,0x18000002,0x60012278,0x40012278,0x60012278,0x18000002,0x18000002,0x2,0x60012278,0x2,0x5000000,0x2,0x8,0x2,0x2,0x12278,0x1000,0x2,0x12278,0x2,0x12278,0x2,0x2,0x2,0x21000,0xc0000,0x2,0x2,0x4000,0x2,0x8,0x2,0x1000,0x2,0x2,0x180,0x200,0x2000,0x70,0x2000,0x70,0x70,0x12278,0x10008,0x70,0x180,0x8,0x4000,0x2,0x8,0x2,0x80000000,0x2,0x50e1208,0x21000,0xc0000,0x0,0x5000208,0x2,0x2,}; + } + private static void jj_la1_init_1() { + jj_la1_1 = new int[] {0x0,0x0,0x1,0x1,0x1,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8ffe,0x0,0x0,0x7fe,0x8ffe,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,}; + } + 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 SACParserCSSmobileOKBasic1(CharStream stream) { + token_source = new SACParserCSSmobileOKBasic1TokenManager(stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 60; 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 < 60; 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 SACParserCSSmobileOKBasic1(SACParserCSSmobileOKBasic1TokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 60; 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(SACParserCSSmobileOKBasic1TokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 60; 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[68]; + if (jj_kind >= 0) { + la1tokens[jj_kind] = true; + jj_kind = -1; + } + for (int i = 0; i < 60; 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/SACParserCSSmobileOKBasic1Constants.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSSmobileOKBasic1Constants.java new file mode 100644 index 000000000..58168a07d --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSSmobileOKBasic1Constants.java @@ -0,0 +1,219 @@ +/* Generated By:JavaCC: Do not edit this line. SACParserCSSmobileOKBasic1Constants.java */ +package com.fr.third.steadystate.css.parser; + + +/** + * Token literal values and constants. + * Generated by org.javacc.parser.OtherFilesGen#start() + */ +public interface SACParserCSSmobileOKBasic1Constants { + + /** 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 ASTERISK = 16; + /** RegularExpression Id. */ + int SLASH = 17; + /** RegularExpression Id. */ + int PLUS = 18; + /** RegularExpression Id. */ + int MINUS = 19; + /** RegularExpression Id. */ + int EQUALS = 20; + /** RegularExpression Id. */ + int GT = 21; + /** RegularExpression Id. */ + int LSQUARE = 22; + /** RegularExpression Id. */ + int RSQUARE = 23; + /** RegularExpression Id. */ + int STRING = 24; + /** RegularExpression Id. */ + int RROUND = 25; + /** RegularExpression Id. */ + int URL = 26; + /** RegularExpression Id. */ + int CDO = 27; + /** RegularExpression Id. */ + int CDC = 28; + /** RegularExpression Id. */ + int IMPORT_SYM = 29; + /** RegularExpression Id. */ + int MEDIA_SYM = 30; + /** RegularExpression Id. */ + int IMPORTANT_SYM = 31; + /** RegularExpression Id. */ + int ATKEYWORD = 32; + /** RegularExpression Id. */ + int EMS = 33; + /** RegularExpression Id. */ + int EXS = 34; + /** RegularExpression Id. */ + int LENGTH_PX = 35; + /** RegularExpression Id. */ + int LENGTH_CM = 36; + /** RegularExpression Id. */ + int LENGTH_MM = 37; + /** RegularExpression Id. */ + int LENGTH_IN = 38; + /** RegularExpression Id. */ + int LENGTH_PT = 39; + /** RegularExpression Id. */ + int LENGTH_PC = 40; + /** RegularExpression Id. */ + int PERCENTAGE = 41; + /** RegularExpression Id. */ + int NUMBER = 42; + /** RegularExpression Id. */ + int RGB = 43; + /** RegularExpression Id. */ + int NAME = 44; + /** RegularExpression Id. */ + int D = 45; + /** RegularExpression Id. */ + int NUM = 46; + /** RegularExpression Id. */ + int UNICODERANGE = 47; + /** RegularExpression Id. */ + int RANGE = 48; + /** RegularExpression Id. */ + int Q16 = 49; + /** RegularExpression Id. */ + int Q15 = 50; + /** RegularExpression Id. */ + int Q14 = 51; + /** RegularExpression Id. */ + int Q13 = 52; + /** RegularExpression Id. */ + int Q12 = 53; + /** RegularExpression Id. */ + int Q11 = 54; + /** RegularExpression Id. */ + int NMSTART = 55; + /** RegularExpression Id. */ + int NMCHAR = 56; + /** RegularExpression Id. */ + int STRING1 = 57; + /** RegularExpression Id. */ + int STRING2 = 58; + /** RegularExpression Id. */ + int NONASCII = 59; + /** RegularExpression Id. */ + int ESCAPE = 60; + /** RegularExpression Id. */ + int NL = 61; + /** RegularExpression Id. */ + int UNICODE = 62; + /** RegularExpression Id. */ + int HNUM = 63; + /** RegularExpression Id. */ + int H = 64; + /** RegularExpression Id. */ + int UNKNOWN = 67; + + /** Lexical state. */ + int DEFAULT = 0; + /** Lexical state. */ + int COMMENT = 1; + + /** Literal token values. */ + String[] tokenImage = { + "", + "", + "\"/*\"", + "", + "\":link\"", + "\":visited\"", + "\":active\"", + "\":first-line\"", + "\":first-letter\"", + "", + "\"{\"", + "\"}\"", + "\",\"", + "\".\"", + "\";\"", + "\":\"", + "\"*\"", + "\"/\"", + "\"+\"", + "\"-\"", + "\"=\"", + "\">\"", + "\"[\"", + "\"]\"", + "", + "\")\"", + "", + "\"\"", + "\"@import\"", + "\"@media\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"rgb(\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"?\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"*/\"", + "", + "", + }; + +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSSmobileOKBasic1TokenManager.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSSmobileOKBasic1TokenManager.java new file mode 100644 index 000000000..92f6ac36f --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSSmobileOKBasic1TokenManager.java @@ -0,0 +1,2950 @@ +/* SACParserCSSmobileOKBasic1TokenManager.java */ +/* Generated By:JavaCC: Do not edit this line. SACParserCSSmobileOKBasic1TokenManager.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 SACParserCSSmobileOKBasic1TokenManager implements SACParserCSSmobileOKBasic1Constants { + + /** 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 & 0x2000L) != 0L) + return 317; + if ((active0 & 0x80000000000L) != 0L) + { + jjmatchedKind = 3; + return 318; + } + if ((active0 & 0x60000000L) != 0L) + return 89; + return -1; + case 1: + if ((active0 & 0x60000000L) != 0L) + { + jjmatchedKind = 32; + jjmatchedPos = 1; + return 319; + } + if ((active0 & 0x80000000000L) != 0L) + { + jjmatchedKind = 3; + jjmatchedPos = 1; + return 318; + } + return -1; + case 2: + if ((active0 & 0x80000000000L) != 0L) + { + jjmatchedKind = 3; + jjmatchedPos = 2; + return 318; + } + if ((active0 & 0x60000000L) != 0L) + { + jjmatchedKind = 32; + jjmatchedPos = 2; + return 319; + } + return -1; + case 3: + if ((active0 & 0x60000000L) != 0L) + { + jjmatchedKind = 32; + jjmatchedPos = 3; + return 319; + } + return -1; + case 4: + if ((active0 & 0x60000000L) != 0L) + { + jjmatchedKind = 32; + jjmatchedPos = 4; + return 319; + } + return -1; + case 5: + if ((active0 & 0x20000000L) != 0L) + { + jjmatchedKind = 32; + jjmatchedPos = 5; + return 319; + } + if ((active0 & 0x40000000L) != 0L) + return 319; + return -1; + case 6: + if ((active0 & 0x20000000L) != 0L) + return 319; + 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, 25); + case 42: + return jjStopAtPos(0, 16); + case 43: + return jjStopAtPos(0, 18); + case 44: + return jjStopAtPos(0, 12); + case 45: + jjmatchedKind = 19; + return jjMoveStringLiteralDfa1_0(0x10000000L); + case 46: + return jjStartNfaWithStates_0(0, 13, 317); + case 47: + jjmatchedKind = 17; + return jjMoveStringLiteralDfa1_0(0x4L); + case 58: + jjmatchedKind = 15; + return jjMoveStringLiteralDfa1_0(0x1f0L); + case 59: + return jjStopAtPos(0, 14); + case 60: + return jjMoveStringLiteralDfa1_0(0x8000000L); + case 61: + return jjStopAtPos(0, 20); + case 62: + return jjStopAtPos(0, 21); + case 64: + return jjMoveStringLiteralDfa1_0(0x60000000L); + case 91: + return jjStopAtPos(0, 22); + case 93: + return jjStopAtPos(0, 23); + case 82: + case 114: + return jjMoveStringLiteralDfa1_0(0x80000000000L); + 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, 0x8000000L); + case 42: + if ((active0 & 0x4L) != 0L) + return jjStopAtPos(1, 2); + break; + case 45: + return jjMoveStringLiteralDfa2_0(active0, 0x10000000L); + 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, 0x80000000000L); + case 73: + case 105: + return jjMoveStringLiteralDfa2_0(active0, 0x20000000L); + case 76: + case 108: + return jjMoveStringLiteralDfa2_0(active0, 0x10L); + case 77: + case 109: + return jjMoveStringLiteralDfa2_0(active0, 0x40000000L); + 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, 0x8000000L); + case 62: + if ((active0 & 0x10000000L) != 0L) + return jjStopAtPos(2, 28); + break; + case 66: + case 98: + return jjMoveStringLiteralDfa3_0(active0, 0x80000000000L); + case 67: + case 99: + return jjMoveStringLiteralDfa3_0(active0, 0x40L); + case 69: + case 101: + return jjMoveStringLiteralDfa3_0(active0, 0x40000000L); + case 73: + case 105: + return jjMoveStringLiteralDfa3_0(active0, 0x1b0L); + case 77: + case 109: + return jjMoveStringLiteralDfa3_0(active0, 0x20000000L); + 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 & 0x80000000000L) != 0L) + return jjStopAtPos(3, 43); + break; + case 45: + if ((active0 & 0x8000000L) != 0L) + return jjStopAtPos(3, 27); + break; + case 68: + case 100: + return jjMoveStringLiteralDfa4_0(active0, 0x40000000L); + case 78: + case 110: + return jjMoveStringLiteralDfa4_0(active0, 0x10L); + case 80: + case 112: + return jjMoveStringLiteralDfa4_0(active0, 0x20000000L); + 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, 0x40000060L); + case 75: + case 107: + if ((active0 & 0x10L) != 0L) + return jjStopAtPos(4, 4); + break; + case 79: + case 111: + return jjMoveStringLiteralDfa5_0(active0, 0x20000000L); + 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 65: + case 97: + if ((active0 & 0x40000000L) != 0L) + return jjStartNfaWithStates_0(5, 30, 319); + break; + case 82: + case 114: + return jjMoveStringLiteralDfa6_0(active0, 0x20000000L); + 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 & 0x20000000L) != 0L) + return jjStartNfaWithStates_0(6, 29, 319); + 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 = { + 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL +}; +static final long[] jjbitVec2 = { + 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL +}; +private int jjMoveNfa_0(int startState, int curPos) +{ + int startsAt = 0; + jjnewStateCnt = 317; + 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 317: + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 46) + kind = 46; + { jjCheckNAdd(282); } + } + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 42) + kind = 42; + { jjCheckNAdd(281); } + } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(279, 280); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(276, 278); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(273, 275); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(270, 272); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(267, 269); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(264, 266); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(261, 263); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(258, 260); } + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(255, 257); } + break; + case 318: + case 2: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(2, 3); } + break; + case 1: + if ((0x3ff000000000000L & l) != 0L) + { + if (kind > 42) + kind = 42; + { jjCheckNAddStates(0, 41); } + } + else if ((0x100003600L & l) != 0L) + { + if (kind > 1) + kind = 1; + { jjCheckNAdd(0); } + } + else if (curChar == 46) + { jjCheckNAddStates(42, 52); } + else if (curChar == 33) + { jjCheckNAddTwoStates(78, 87); } + else if (curChar == 39) + { jjCheckNAddStates(53, 55); } + else if (curChar == 34) + { jjCheckNAddStates(56, 58); } + else if (curChar == 35) + { jjCheckNAddTwoStates(19, 20); } + break; + case 319: + case 90: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 32) + kind = 32; + { jjCheckNAddTwoStates(90, 91); } + break; + case 0: + if ((0x100003600L & l) == 0L) + break; + if (kind > 1) + kind = 1; + { jjCheckNAdd(0); } + break; + case 4: + if ((0xffffffff00000000L & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(2, 3); } + break; + case 5: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddStates(59, 66); } + break; + case 6: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddStates(67, 69); } + break; + case 7: + if ((0x100003600L & l) == 0L) + break; + if (kind > 3) + kind = 3; + { 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 == 35) + { jjCheckNAddTwoStates(19, 20); } + break; + case 19: + if ((0x3ff200000000000L & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddTwoStates(19, 20); } + break; + case 21: + if ((0xffffffff00000000L & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddTwoStates(19, 20); } + break; + case 22: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddStates(70, 77); } + break; + case 23: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddStates(78, 80); } + break; + case 24: + if ((0x100003600L & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddTwoStates(19, 20); } + break; + case 25: + case 27: + case 30: + case 34: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(23); } + break; + case 26: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 27; + break; + case 28: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 29; + 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 33: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 34; + break; + case 35: + if (curChar == 34) + { jjCheckNAddStates(56, 58); } + break; + case 36: + if ((0xfffffffb00000200L & l) != 0L) + { jjCheckNAddStates(56, 58); } + break; + case 37: + if (curChar == 34 && kind > 24) + kind = 24; + break; + case 39: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(56, 58); } + break; + case 40: + if (curChar == 10) + { jjCheckNAddStates(56, 58); } + break; + case 41: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 40; + break; + case 42: + if ((0xffffffff00000000L & l) != 0L) + { jjCheckNAddStates(56, 58); } + break; + case 43: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(81, 89); } + break; + case 44: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(90, 93); } + break; + case 45: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(56, 58); } + break; + case 46: + case 48: + case 51: + case 55: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(44); } + break; + case 47: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 48; + break; + case 49: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 50; + 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 54: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 55; + break; + case 56: + if (curChar == 39) + { jjCheckNAddStates(53, 55); } + break; + case 57: + if ((0xffffff7f00000200L & l) != 0L) + { jjCheckNAddStates(53, 55); } + break; + case 58: + if (curChar == 39 && kind > 24) + kind = 24; + break; + case 60: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(53, 55); } + break; + case 61: + if (curChar == 10) + { jjCheckNAddStates(53, 55); } + break; + case 62: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 61; + break; + case 63: + if ((0xffffffff00000000L & l) != 0L) + { jjCheckNAddStates(53, 55); } + break; + case 64: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(94, 102); } + break; + case 65: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(103, 106); } + break; + case 66: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(53, 55); } + 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 77: + if (curChar == 33) + { jjCheckNAddTwoStates(78, 87); } + break; + case 78: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(78, 87); } + break; + case 92: + if ((0xffffffff00000000L & l) == 0L) + break; + if (kind > 32) + kind = 32; + { jjCheckNAddTwoStates(90, 91); } + break; + case 93: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 32) + kind = 32; + { jjCheckNAddStates(107, 114); } + break; + case 94: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 32) + kind = 32; + { jjCheckNAddStates(115, 117); } + break; + case 95: + if ((0x100003600L & l) == 0L) + break; + if (kind > 32) + kind = 32; + { jjCheckNAddTwoStates(90, 91); } + break; + case 96: + case 98: + case 101: + case 105: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(94); } + break; + case 97: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 98; + break; + case 99: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 100; + break; + case 100: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 101; + break; + case 102: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 103; + break; + case 103: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 104; + break; + case 104: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 105; + break; + case 107: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 32) + kind = 32; + { jjCheckNAddStates(118, 125); } + break; + case 108: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 32) + kind = 32; + { jjCheckNAddStates(126, 128); } + break; + case 109: + case 111: + case 114: + case 118: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(108); } + break; + case 110: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 111; + break; + case 112: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 113; + break; + case 113: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 114; + break; + case 115: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 116; + break; + case 116: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 117; + break; + case 117: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 118; + break; + case 120: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddStates(129, 136); } + break; + case 121: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddStates(137, 139); } + break; + case 122: + case 124: + case 127: + case 131: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(121); } + break; + case 123: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 124; + break; + case 125: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 126; + break; + case 126: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 127; + break; + case 128: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 129; + break; + case 129: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 130; + break; + case 130: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 131; + break; + case 133: + if (curChar == 40) + { jjCheckNAddStates(140, 145); } + break; + case 134: + if ((0xfffffc7a00000000L & l) != 0L) + { jjCheckNAddStates(146, 149); } + break; + case 135: + if ((0x100003600L & l) != 0L) + { jjCheckNAddTwoStates(135, 136); } + break; + case 136: + if (curChar == 41 && kind > 26) + kind = 26; + break; + case 138: + if ((0xffffffff00000000L & l) != 0L) + { jjCheckNAddStates(146, 149); } + break; + case 139: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(150, 158); } + break; + case 140: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(159, 162); } + break; + case 141: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(146, 149); } + break; + case 142: + case 144: + case 147: + case 151: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(140); } + break; + case 143: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 144; + break; + case 145: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 146; + break; + case 146: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 147; + break; + case 148: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 149; + break; + case 149: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 150; + break; + case 150: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 151; + break; + case 152: + if (curChar == 39) + { jjCheckNAddStates(163, 165); } + break; + case 153: + if ((0xffffff7f00000200L & l) != 0L) + { jjCheckNAddStates(163, 165); } + break; + case 154: + if (curChar == 39) + { jjCheckNAddTwoStates(135, 136); } + break; + case 156: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(163, 165); } + break; + case 157: + if (curChar == 10) + { jjCheckNAddStates(163, 165); } + break; + case 158: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 157; + break; + case 159: + if ((0xffffffff00000000L & l) != 0L) + { jjCheckNAddStates(163, 165); } + break; + case 160: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(166, 174); } + break; + case 161: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(175, 178); } + break; + case 162: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(163, 165); } + break; + case 163: + case 165: + case 168: + case 172: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(161); } + break; + case 164: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 165; + break; + case 166: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 167; + break; + case 167: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 168; + break; + case 169: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 170; + break; + case 170: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 171; + break; + case 171: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 172; + break; + case 173: + if (curChar == 34) + { jjCheckNAddStates(179, 181); } + break; + case 174: + if ((0xfffffffb00000200L & l) != 0L) + { jjCheckNAddStates(179, 181); } + break; + case 175: + if (curChar == 34) + { jjCheckNAddTwoStates(135, 136); } + break; + case 177: + if ((0x3400L & l) != 0L) + { jjCheckNAddStates(179, 181); } + break; + case 178: + if (curChar == 10) + { jjCheckNAddStates(179, 181); } + break; + case 179: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 178; + break; + case 180: + if ((0xffffffff00000000L & l) != 0L) + { jjCheckNAddStates(179, 181); } + break; + case 181: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(182, 190); } + break; + case 182: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(191, 194); } + break; + case 183: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(179, 181); } + break; + case 184: + case 186: + case 189: + case 193: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(182); } + break; + case 185: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 186; + break; + case 187: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 188; + break; + case 188: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 189; + break; + case 190: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 191; + break; + case 191: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 192; + break; + case 192: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 193; + break; + case 194: + if ((0x100003600L & l) != 0L) + { jjCheckNAddStates(195, 201); } + break; + case 197: + if (curChar == 43) + { jjCheckNAddStates(202, 204); } + break; + case 198: + case 227: + if (curChar == 63 && kind > 47) + kind = 47; + break; + case 199: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 47) + kind = 47; + { jjCheckNAddStates(205, 213); } + break; + case 200: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(201); } + break; + case 201: + if (curChar == 45) + jjstateSet[jjnewStateCnt++] = 202; + break; + case 202: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 47) + kind = 47; + { jjCheckNAddStates(214, 218); } + break; + case 203: + if ((0x3ff000000000000L & l) != 0L && kind > 47) + kind = 47; + break; + case 204: + case 206: + case 209: + case 213: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(203); } + break; + case 205: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 206; + break; + case 207: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 208; + break; + case 208: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 209; + break; + case 210: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 211; + break; + case 211: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 212; + break; + case 212: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 213; + break; + case 214: + case 216: + case 219: + case 223: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAdd(200); } + break; + case 215: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 216; + break; + case 217: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 218; + break; + case 218: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 219; + break; + case 220: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 221; + break; + case 221: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 222; + break; + case 222: + if ((0x3ff000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 223; + break; + case 224: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 47) + kind = 47; + { jjCheckNAddStates(219, 221); } + break; + case 225: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 47) + kind = 47; + { jjCheckNAddStates(222, 224); } + break; + case 226: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 47) + kind = 47; + { jjCheckNAddStates(225, 227); } + break; + case 228: + case 231: + case 233: + case 234: + case 237: + case 238: + case 240: + case 244: + case 248: + case 251: + case 253: + if (curChar == 63) + { jjCheckNAdd(227); } + break; + case 229: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 47) + kind = 47; + { jjCheckNAddTwoStates(198, 203); } + break; + case 230: + if (curChar == 63) + { jjCheckNAddTwoStates(227, 231); } + break; + case 232: + if (curChar == 63) + { jjCheckNAddStates(228, 230); } + break; + case 235: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 234; + break; + case 236: + if (curChar == 63) + { jjCheckNAddStates(231, 234); } + break; + case 239: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 238; + break; + case 241: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 240; + break; + case 242: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 241; + break; + case 243: + if (curChar == 63) + { jjCheckNAddStates(235, 239); } + break; + case 245: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 244; + break; + case 246: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 245; + break; + case 247: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 246; + break; + case 249: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 248; + break; + case 250: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 249; + break; + case 252: + if (curChar == 63) + jjstateSet[jjnewStateCnt++] = 251; + break; + case 254: + if (curChar == 46) + { jjCheckNAddStates(42, 52); } + break; + case 255: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(255, 257); } + break; + case 258: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(258, 260); } + break; + case 261: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(261, 263); } + break; + case 264: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(264, 266); } + break; + case 267: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(267, 269); } + break; + case 270: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(270, 272); } + break; + case 273: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(273, 275); } + break; + case 276: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(276, 278); } + break; + case 279: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(279, 280); } + break; + case 280: + if (curChar == 37 && kind > 41) + kind = 41; + break; + case 281: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 42) + kind = 42; + { jjCheckNAdd(281); } + break; + case 282: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 46) + kind = 46; + { jjCheckNAdd(282); } + break; + case 283: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 42) + kind = 42; + { jjCheckNAddStates(0, 41); } + break; + case 284: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(284, 257); } + break; + case 285: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(285, 286); } + break; + case 286: + if (curChar == 46) + { jjCheckNAdd(255); } + break; + case 287: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(287, 260); } + break; + case 288: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(288, 289); } + break; + case 289: + if (curChar == 46) + { jjCheckNAdd(258); } + break; + case 290: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(290, 263); } + break; + case 291: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(291, 292); } + break; + case 292: + if (curChar == 46) + { jjCheckNAdd(261); } + break; + case 293: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(293, 266); } + break; + case 294: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(294, 295); } + break; + case 295: + if (curChar == 46) + { jjCheckNAdd(264); } + break; + case 296: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(296, 269); } + break; + case 297: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(297, 298); } + break; + case 298: + if (curChar == 46) + { jjCheckNAdd(267); } + break; + case 299: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(299, 272); } + break; + case 300: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(300, 301); } + break; + case 301: + if (curChar == 46) + { jjCheckNAdd(270); } + break; + case 302: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(302, 275); } + break; + case 303: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(303, 304); } + break; + case 304: + if (curChar == 46) + { jjCheckNAdd(273); } + break; + case 305: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(305, 278); } + break; + case 306: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(306, 307); } + break; + case 307: + if (curChar == 46) + { jjCheckNAdd(276); } + break; + case 308: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(308, 280); } + break; + case 309: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(309, 310); } + break; + case 310: + if (curChar == 46) + { jjCheckNAdd(279); } + break; + case 311: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 42) + kind = 42; + { jjCheckNAdd(311); } + break; + case 312: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(312, 313); } + break; + case 313: + if (curChar == 46) + { jjCheckNAdd(281); } + break; + case 314: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 46) + kind = 46; + { jjCheckNAdd(314); } + break; + case 315: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(315, 316); } + break; + case 316: + if (curChar == 46) + { jjCheckNAdd(282); } + break; + default : break; + } + } while(i != startsAt); + } + else if (curChar < 128) + { + long l = 1L << (curChar & 077); + do + { + switch(jjstateSet[--i]) + { + case 318: + if ((0x7fffffe07fffffeL & l) != 0L) + { + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(2, 3); } + } + else if (curChar == 92) + { jjCheckNAddTwoStates(4, 5); } + break; + case 1: + if ((0x7fffffe07fffffeL & l) != 0L) + { + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(2, 3); } + } + else if (curChar == 92) + { jjCheckNAddTwoStates(4, 120); } + else if (curChar == 64) + { jjAddStates(240, 241); } + if ((0x20000000200000L & l) != 0L) + { jjAddStates(242, 243); } + break; + case 89: + if ((0x7fffffe07fffffeL & l) != 0L) + { + if (kind > 32) + kind = 32; + { jjCheckNAddTwoStates(90, 91); } + } + else if (curChar == 92) + { jjCheckNAddTwoStates(92, 107); } + break; + case 319: + if ((0x7fffffe07fffffeL & l) != 0L) + { + if (kind > 32) + kind = 32; + { jjCheckNAddTwoStates(90, 91); } + } + else if (curChar == 92) + { jjCheckNAddTwoStates(92, 93); } + break; + case 2: + if ((0x7fffffe07fffffeL & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(2, 3); } + break; + case 3: + if (curChar == 92) + { jjCheckNAddTwoStates(4, 5); } + break; + case 4: + if ((0x7fffffffffffffffL & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(2, 3); } + break; + case 5: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddStates(59, 66); } + break; + case 6: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 3) + kind = 3; + { 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 ((0x7fffffe07fffffeL & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddTwoStates(19, 20); } + break; + case 20: + if (curChar == 92) + { jjAddStates(244, 245); } + break; + case 21: + if ((0x7fffffffffffffffL & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddTwoStates(19, 20); } + break; + case 22: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddStates(70, 77); } + break; + case 23: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddStates(78, 80); } + break; + case 25: + case 27: + case 30: + case 34: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(23); } + break; + case 26: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 27; + break; + case 28: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 29; + 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 33: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 34; + break; + case 36: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(56, 58); } + break; + case 38: + if (curChar == 92) + { jjAddStates(246, 249); } + break; + case 42: + if ((0x7fffffffffffffffL & l) != 0L) + { jjCheckNAddStates(56, 58); } + break; + case 43: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(81, 89); } + break; + case 44: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(90, 93); } + break; + case 46: + case 48: + case 51: + case 55: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(44); } + break; + case 47: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 48; + break; + case 49: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 50; + 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 54: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 55; + break; + case 57: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(53, 55); } + break; + case 59: + if (curChar == 92) + { jjAddStates(250, 253); } + break; + case 63: + if ((0x7fffffffffffffffL & l) != 0L) + { jjCheckNAddStates(53, 55); } + break; + case 64: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(94, 102); } + break; + case 65: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(103, 106); } + 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 79: + if ((0x10000000100000L & l) != 0L && kind > 31) + kind = 31; + break; + case 80: + if ((0x400000004000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 79; + break; + case 81: + if ((0x200000002L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 80; + break; + case 82: + if ((0x10000000100000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 81; + break; + case 83: + if ((0x4000000040000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 82; + break; + case 84: + if ((0x800000008000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 83; + break; + case 85: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 84; + break; + case 86: + if ((0x200000002000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 85; + break; + case 87: + if ((0x20000000200L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 86; + break; + case 88: + if (curChar == 64) + { jjAddStates(240, 241); } + break; + case 90: + if ((0x7fffffe07fffffeL & l) == 0L) + break; + if (kind > 32) + kind = 32; + { jjCheckNAddTwoStates(90, 91); } + break; + case 91: + if (curChar == 92) + { jjCheckNAddTwoStates(92, 93); } + break; + case 92: + if ((0x7fffffffffffffffL & l) == 0L) + break; + if (kind > 32) + kind = 32; + { jjCheckNAddTwoStates(90, 91); } + break; + case 93: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 32) + kind = 32; + { jjCheckNAddStates(107, 114); } + break; + case 94: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 32) + kind = 32; + { jjCheckNAddStates(115, 117); } + break; + case 96: + case 98: + case 101: + case 105: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(94); } + break; + case 97: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 98; + break; + case 99: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 100; + break; + case 100: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 101; + break; + case 102: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 103; + break; + case 103: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 104; + break; + case 104: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 105; + break; + case 106: + if (curChar == 92) + { jjCheckNAddTwoStates(92, 107); } + break; + case 107: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 32) + kind = 32; + { jjCheckNAddStates(118, 125); } + break; + case 108: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 32) + kind = 32; + { jjCheckNAddStates(126, 128); } + break; + case 109: + case 111: + case 114: + case 118: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(108); } + break; + case 110: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 111; + break; + case 112: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 113; + break; + case 113: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 114; + break; + case 115: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 116; + break; + case 116: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 117; + break; + case 117: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 118; + break; + case 119: + if (curChar == 92) + { jjCheckNAddTwoStates(4, 120); } + break; + case 120: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddStates(129, 136); } + break; + case 121: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddStates(137, 139); } + break; + case 122: + case 124: + case 127: + case 131: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(121); } + break; + case 123: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 124; + break; + case 125: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 126; + break; + case 126: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 127; + break; + case 128: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 129; + break; + case 129: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 130; + break; + case 130: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 131; + break; + case 132: + if ((0x20000000200000L & l) != 0L) + { jjAddStates(242, 243); } + break; + case 134: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(146, 149); } + break; + case 137: + if (curChar == 92) + { jjAddStates(254, 255); } + break; + case 138: + if ((0x7fffffffffffffffL & l) != 0L) + { jjCheckNAddStates(146, 149); } + break; + case 139: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(150, 158); } + break; + case 140: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(159, 162); } + break; + case 142: + case 144: + case 147: + case 151: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(140); } + break; + case 143: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 144; + break; + case 145: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 146; + break; + case 146: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 147; + break; + case 148: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 149; + break; + case 149: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 150; + break; + case 150: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 151; + break; + case 153: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(163, 165); } + break; + case 155: + if (curChar == 92) + { jjAddStates(256, 259); } + break; + case 159: + if ((0x7fffffffffffffffL & l) != 0L) + { jjCheckNAddStates(163, 165); } + break; + case 160: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(166, 174); } + break; + case 161: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(175, 178); } + break; + case 163: + case 165: + case 168: + case 172: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(161); } + break; + case 164: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 165; + break; + case 166: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 167; + break; + case 167: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 168; + break; + case 169: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 170; + break; + case 170: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 171; + break; + case 171: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 172; + break; + case 174: + if ((0x7fffffffefffffffL & l) != 0L) + { jjCheckNAddStates(179, 181); } + break; + case 176: + if (curChar == 92) + { jjAddStates(260, 263); } + break; + case 180: + if ((0x7fffffffffffffffL & l) != 0L) + { jjCheckNAddStates(179, 181); } + break; + case 181: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(182, 190); } + break; + case 182: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAddStates(191, 194); } + break; + case 184: + case 186: + case 189: + case 193: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(182); } + break; + case 185: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 186; + break; + case 187: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 188; + break; + case 188: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 189; + break; + case 190: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 191; + break; + case 191: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 192; + break; + case 192: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 193; + break; + case 195: + if ((0x100000001000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 133; + break; + case 196: + if ((0x4000000040000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 195; + break; + case 199: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 47) + kind = 47; + { jjCheckNAddStates(205, 213); } + break; + case 200: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(201); } + break; + case 202: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 47) + kind = 47; + { jjCheckNAddStates(214, 218); } + break; + case 203: + if ((0x7e0000007eL & l) != 0L && kind > 47) + kind = 47; + break; + case 204: + case 206: + case 209: + case 213: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(203); } + break; + case 205: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 206; + break; + case 207: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 208; + break; + case 208: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 209; + break; + case 210: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 211; + break; + case 211: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 212; + break; + case 212: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 213; + break; + case 214: + case 216: + case 219: + case 223: + if ((0x7e0000007eL & l) != 0L) + { jjCheckNAdd(200); } + break; + case 215: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 216; + break; + case 217: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 218; + break; + case 218: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 219; + break; + case 220: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 221; + break; + case 221: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 222; + break; + case 222: + if ((0x7e0000007eL & l) != 0L) + jjstateSet[jjnewStateCnt++] = 223; + break; + case 224: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 47) + kind = 47; + { jjCheckNAddStates(219, 221); } + break; + case 225: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 47) + kind = 47; + { jjCheckNAddStates(222, 224); } + break; + case 226: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 47) + kind = 47; + { jjCheckNAddStates(225, 227); } + break; + case 229: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 47) + kind = 47; + { jjCheckNAddTwoStates(198, 203); } + break; + case 256: + if ((0x200000002000L & l) != 0L && kind > 33) + kind = 33; + break; + case 257: + if ((0x2000000020L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 256; + break; + case 259: + if ((0x100000001000000L & l) != 0L && kind > 34) + kind = 34; + break; + case 260: + if ((0x2000000020L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 259; + break; + case 262: + if ((0x100000001000000L & l) != 0L && kind > 35) + kind = 35; + break; + case 263: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 262; + break; + case 265: + if ((0x200000002000L & l) != 0L && kind > 36) + kind = 36; + break; + case 266: + if ((0x800000008L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 265; + break; + case 268: + if ((0x200000002000L & l) != 0L && kind > 37) + kind = 37; + break; + case 269: + if ((0x200000002000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 268; + break; + case 271: + if ((0x400000004000L & l) != 0L && kind > 38) + kind = 38; + break; + case 272: + if ((0x20000000200L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 271; + break; + case 274: + if ((0x10000000100000L & l) != 0L && kind > 39) + kind = 39; + break; + case 275: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 274; + break; + case 277: + if ((0x800000008L & l) != 0L && kind > 40) + kind = 40; + break; + case 278: + if ((0x1000000010000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 277; + 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 318: + case 2: + case 4: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(2, 3); } + break; + case 1: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 3) + kind = 3; + { jjCheckNAddTwoStates(2, 3); } + break; + case 89: + case 92: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 32) + kind = 32; + { jjCheckNAddTwoStates(90, 91); } + break; + case 319: + case 90: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 32) + kind = 32; + { jjCheckNAddTwoStates(90, 91); } + break; + case 19: + case 21: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) + break; + if (kind > 9) + kind = 9; + { jjCheckNAddTwoStates(19, 20); } + break; + case 36: + case 42: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(56, 58); } + break; + case 57: + case 63: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(53, 55); } + break; + case 134: + case 138: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(146, 149); } + break; + case 153: + case 159: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(163, 165); } + break; + case 174: + case 180: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddStates(179, 181); } + 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 = 317 - (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(0x2L); + 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 & 0x2L) != 0L) + return jjStopAtPos(1, 65); + 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", "\52", "\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 = { + 284, 285, 286, 257, 287, 288, 289, 260, 290, 291, 292, 263, 293, 294, 295, 266, + 296, 297, 298, 269, 299, 300, 301, 272, 302, 303, 304, 275, 305, 306, 307, 278, + 308, 309, 310, 280, 311, 312, 313, 314, 315, 316, 255, 258, 261, 264, 267, 270, + 273, 276, 279, 281, 282, 57, 58, 59, 36, 37, 38, 2, 6, 8, 9, 11, + 14, 7, 3, 2, 7, 3, 19, 23, 25, 26, 28, 31, 24, 20, 19, 24, + 20, 36, 44, 46, 47, 49, 52, 45, 37, 38, 36, 45, 37, 38, 57, 65, + 67, 68, 70, 73, 66, 58, 59, 57, 66, 58, 59, 90, 94, 96, 97, 99, + 102, 95, 91, 90, 95, 91, 108, 109, 110, 112, 115, 95, 90, 91, 95, 90, + 91, 121, 122, 123, 125, 128, 7, 2, 3, 7, 2, 3, 134, 152, 173, 136, + 137, 194, 134, 135, 136, 137, 134, 140, 142, 143, 145, 148, 136, 137, 141, 134, + 136, 137, 141, 153, 154, 155, 153, 161, 163, 164, 166, 169, 162, 154, 155, 153, + 162, 154, 155, 174, 175, 176, 174, 182, 184, 185, 187, 190, 183, 175, 176, 174, + 183, 175, 176, 134, 152, 173, 135, 136, 137, 194, 198, 199, 243, 200, 214, 215, + 217, 220, 201, 198, 224, 236, 203, 204, 205, 207, 210, 198, 225, 232, 198, 226, + 230, 198, 228, 229, 227, 233, 235, 227, 237, 239, 242, 247, 250, 252, 253, 227, + 89, 106, 196, 197, 21, 22, 39, 41, 42, 43, 60, 62, 63, 64, 138, 139, + 156, 158, 159, 160, 177, 179, 180, 181, +}; +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 = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_0(); + if (jjmatchedPos == 0 && jjmatchedKind > 67) + { + jjmatchedKind = 67; + } + break; + case 1: + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_1(); + if (jjmatchedPos == 0 && jjmatchedKind > 66) + { + jjmatchedKind = 66; + } + 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 24 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimBy(image, 1, 1); + break; + case 26 : + image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); + matchedToken.image = ParserUtils.trimUrl(image); + 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, 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, 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 SACParserCSSmobileOKBasic1TokenManager(CharStream stream){ + + + input_stream = stream; + } + + /** Constructor. */ + public SACParserCSSmobileOKBasic1TokenManager (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 = 317; 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, -1, 0, -1, -1, +}; +static final long[] jjtoToken = { + 0xcffffffffffbL, 0x8L, +}; +static final long[] jjtoSkip = { + 0x0L, 0x2L, +}; +static final long[] jjtoSpecial = { + 0x0L, 0x0L, +}; +static final long[] jjtoMore = { + 0x4L, 0x4L, +}; + protected CharStream input_stream; + + private final int[] jjrounds = new int[317]; + private final int[] jjstateSet = new int[2 * 317]; + 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/SACParserMessages.properties b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserMessages.properties new file mode 100644 index 000000000..8fefda6f6 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserMessages.properties @@ -0,0 +1,39 @@ +# resource bundle for SACParser messages - default +invalidExpectingOne=Invalid token \"{0}\". Was expecting: {1}. +invalidExpectingMore=Invalid token \"{0}\". Was expecting one of: {1}. +invalidColor=Invalid color \"{0}\". +invalidStyleSheet=Error in style sheet. +invalidRule=Error in rule. +invalidUnknownRule=Error in unknown at-rule. +invalidCharsetRule=Error in @charset rule. +misplacedCharsetRule=The @charset must be the first element in the style sheet. +invalidImportRule=Error in @import rule. +invalidImportRuleIgnored=@import rule must occur before all other rules. +invalidImportRuleIgnored2=@import rule must occur before all other rules, except the @charset rule. +invalidPageRule=Error in @page rule. +invalidFontFaceRule=Error in @font-face rule. +invalidMediaList=Error in media list. +invalidMediaRule=Error in @media rule. +invalidStyleRule=Error in style rule. +invalidStyleDeclaration=Error in style declaration. +invalidDeclaration=Error in declaration. +invalidDeclarationInvalidChar=Error in declaration; invalid character \"{0}\" found. +invalidDeclarationStarHack=Error in declaration. ''*'' is not allowed as first char of a property. +invalidSelectorList=Error in selector list. +invalidSelector=Error in selector. +invalidSimpleSelector=Error in simple selector. +invalidClassSelector=Error in class selector. +invalidElementName=Error in element name. +invalidAttrib=Error in attribute selector. +invalidPseudo=Error in pseudo class or element. +duplicatePseudo=Duplicate pseudo class \":{0}\" or pseudo class \":{0}\" not at end. +invalidHash=Error in hash. +invalidExpr=Error in expression. +invalidExprColon=Error in expression; '':'' found after identifier \"{0}\". +invalidPrio=Error in priority. + +ignoringRule=Ignoring the whole rule. +ignoringFollowingDeclarations=Ignoring the following declarations in this rule. + +tokenMgrError=Lexical error. +domException=DOM exception: ''{0}'' diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserMessages_de.properties b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserMessages_de.properties new file mode 100644 index 000000000..6aac4fedc --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserMessages_de.properties @@ -0,0 +1,39 @@ +# resource bundle for SACParser messages - german +invalidExpectingOne=Ung\u00fcltiger Token \"{0}\". Erwartet wurde: {1}. +invalidExpectingMore=Ung\u00fcltiger Token \"{0}\". Erwartet wurde einer von: {1}. +invalidColor=Ung\u00fcltige Farbe \"{0}\". +invalidStyleSheet=Fehler im Stylesheet. +invalidRule=Fehler in Regel. +invalidUnknownRule=Fehler in unbekannter At-Regel. +invalidCharsetRule=Fehler in @charset-Regel. +misplacedCharsetRule=Die @charset Regel muss das erste Element im Stylesheet sein. +invalidImportRule=Fehler in @import-Regel. +invalidImportRuleIgnored=@import-Regel muss vor allen anderen Regeln erscheinen. +invalidImportRuleIgnored2=@import-Regel muss vor allen anderen Regeln erscheinen, au\u00dfer der @charset-Regel. +invalidPageRule=Fehler in @page-Regel. +invalidFontFaceRule=Fehler in @font-face-Regel. +invalidMediaList=Fehler in Medienliste. +invalidMediaRule=Fehler in @media-Regel. +invalidStyleRule=Fehler in Style-Regel. +invalidStyleDeclaration=Fehler in Styledeklaration. +invalidDeclaration=Fehler in Deklaration. +invalidDeclarationInvalidChar=Fehler in Deklaration. Es wurde das ung\u00fcltige Zeichen \"{0}\" gefunden. +invalidDeclarationStarHack=Error in declaration. ''*'' ist als erstes Zeichen einer Property nicht erlaubt. +invalidSelectorList=Fehler in Selektorliste. +invalidSelector=Fehler in Selektor. +invalidSimpleSelector=Fehler in einfachem Selektor. +invalidClassSelector=Fehler in Klassen-Selektor. +invalidElementName=Fehler in Elementname. +invalidAttrib=Fehler in Attribut-Selektor. +invalidPseudo=Fehler in Pseudo-Klasse oder Pseudo-Element. +duplicatePseudo=Doppelte Pseudo-Klasse \":{0}\" oder die Pseudo-Klasse \":{0}\" ist nicht das letzte Element. +invalidHash=Fehler in Hash. +invalidExpr=Fehler in Ausdruck. +invalidExprColon=Fehler in Ausdruck; '':'' nach dem identifier \"{0}\" gefunden. +invalidPrio=Fehler in Priorit\u00e4t. + +ignoringRule=Ignoriere die gesamte Regel. +ignoringFollowingDeclarations=Ignoriere die folgenden Deklarationen in dieser Regel. + +tokenMgrError=Lexikalischer Fehler. +domException=DOM Fehler: ''{0}'' diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserMessages_en.properties b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserMessages_en.properties new file mode 100644 index 000000000..e78db1381 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserMessages_en.properties @@ -0,0 +1,40 @@ +# resource bundle for SACParser messages - default +invalidExpectingOne=Invalid token \"{0}\". Was expecting: {1}. +invalidExpectingMore=Invalid token \"{0}\". Was expecting one of: {1}. +invalidColor=Invalid color \"{0}\". +invalidStyleSheet=Error in style sheet. +invalidRule=Error in rule. +invalidUnknownRule=Error in unknown at-rule. +invalidCharsetRule=Error in @charset rule. +misplacedCharsetRule=The @charset must be the first element in the style sheet. +invalidImportRule=Error in @import rule. +invalidImportRuleIgnored=@import rule must occur before all other rules. +invalidImportRuleIgnored2=@import rule must occur before all other rules, except the @charset rule. +invalidPageRule=Error in @page rule. +invalidFontFaceRule=Error in @font-face rule. +invalidMediaList=Error in media list. +invalidMediaRule=Error in @media rule. +invalidStyleRule=Error in style rule. +invalidStyleDeclaration=Error in style declaration. +invalidDeclaration=Error in declaration. +invalidDeclarationInvalidChar=Error in declaration; invalid character \"{0}\" found. +invalidDeclarationStarHack=Error in declaration. ''*'' is not allowed as first char of a property. +invalidSelectorList=Error in selector list. +invalidSelector=Error in selector. +invalidSimpleSelector=Error in simple selector. +invalidClassSelector=Error in class selector. +invalidElementName=Error in element name. +invalidAttrib=Error in attribute selector. +invalidPseudo=Error in pseudo class or element. +duplicatePseudo=Duplicate pseudo class \":{0}\" or pseudo class \":{0}\" not at end. +invalidHash=Error in hash. +invalidExpr=Error in expression. +invalidExprColon=Error in expression; '':'' found after identifier \"{0}\". +invalidPrio=Error in priority. + +ignoringRule=Ignoring the whole rule. +ignoringFollowingDeclarations=Ignoring the following declarations in this rule. + +tokenMgrError=Lexical error. +domException=DOM exception: ''{0}'' + diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SelectorListImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SelectorListImpl.java new file mode 100644 index 000000000..a6209d0e1 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SelectorListImpl.java @@ -0,0 +1,81 @@ +/* + * 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 java.util.ArrayList; +import java.util.List; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SelectorList; + +import com.fr.third.steadystate.css.format.CSSFormat; + +/** + * Implementation of {@link SelectorList}. + * + * @author David Schweinsberg + * @author rbri + */ +public class SelectorListImpl extends LocatableImpl implements SelectorList, CSSFormatable, Serializable { + + private static final long serialVersionUID = 7313376916207026333L; + + private List selectors_ = new ArrayList(10); + + public List getSelectors() { + return selectors_; + } + + public void setSelectors(final List selectors) { + selectors_ = selectors; + } + + public int getLength() { + return selectors_.size(); + } + + public Selector item(final int index) { + return selectors_.get(index); + } + + public void add(final Selector sel) { + selectors_.add(sel); + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final int len = getLength(); + + final StringBuilder sb = new StringBuilder(); + for (int i = 0; i < len; i++) { + final CSSFormatable sel = (CSSFormatable) item(i); + sb.append(sel.getCssText(format)); + if (i < len - 1) { + sb.append(", "); + } + } + return sb.toString(); + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/Token.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/Token.java new file mode 100644 index 000000000..3c66ec7c2 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/Token.java @@ -0,0 +1,132 @@ +/* Generated By:JavaCC: Do not edit this line. Token.java Version 7.0 */ +/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COLUMN=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +package com.fr.third.steadystate.css.parser; + +/** + * Describes the input token stream. + */ + +@SuppressWarnings("all") public class Token implements java.io.Serializable { + + /** + * The version identifier for this Serializable class. + * Increment only if the serialized form of the + * class changes. + */ + private static final long serialVersionUID = 1L; + + /** + * An integer that describes the kind of this token. This numbering + * system is determined by JavaCCParser, and a table of these numbers is + * stored in the file ...Constants.java. + */ + public int kind; + + /** The line number of the first character of this Token. */ + public int beginLine; + /** The column number of the first character of this Token. */ + public int beginColumn; + /** The line number of the last character of this Token. */ + public int endLine; + /** The column number of the last character of this Token. */ + public int endColumn; + + /** + * The string image of the token. + */ + public String image; + + /** + * A reference to the next regular (non-special) token from the input + * stream. If this is the last token from the input stream, or if the + * token manager has not read tokens beyond this one, this field is + * set to null. This is true only if this token is also a regular + * token. Otherwise, see below for a description of the contents of + * this field. + */ + public Token next; + + /** + * This field is used to access special tokens that occur prior to this + * token, but after the immediately preceding regular (non-special) token. + * If there are no such special tokens, this field is set to null. + * When there are more than one such special token, this field refers + * to the last of these special tokens, which in turn refers to the next + * previous special token through its specialToken field, and so on + * until the first special token (whose specialToken field is null). + * The next fields of special tokens refer to other special tokens that + * immediately follow it (without an intervening regular token). If there + * is no such token, this field is null. + */ + public Token specialToken; + + /** + * An optional attribute value of the Token. + * Tokens which are not used as syntactic sugar will often contain + * meaningful values that will be used later on by the compiler or + * interpreter. This attribute value is often different from the image. + * Any subclass of Token that actually wants to return a non-null value can + * override this method as appropriate. + */ + public Object getValue() { + return null; + } + + /** + * No-argument constructor + */ + public Token() {} + + /** + * Constructs a new token for the specified Image. + */ + public Token(int kind) + { + this(kind, null); + } + + /** + * Constructs a new token for the specified Image and Kind. + */ + public Token(int kind, String image) + { + this.kind = kind; + this.image = image; + } + + /** + * Returns the image. + */ + @Override + public String toString() + { + return image; + } + + /** + * Returns a new Token object, by default. However, if you want, you + * can create and return subclass objects based on the value of ofKind. + * Simply add the cases to the switch for all those special cases. + * For example, if you have a subclass of Token called IDToken that + * you want to create if ofKind is ID, simply add something like : + * + * case MyParserConstants.ID : return new IDToken(ofKind, image); + * + * to the following switch statement. Then you can cast matchedToken + * variable to the appropriate type and use sit in your lexical actions. + */ + public static Token newToken(int ofKind, String image) + { + switch(ofKind) + { + default : return new Token(ofKind, image); + } + } + + public static Token newToken(int ofKind) + { + return newToken(ofKind, null); + } + +} +/* JavaCC - OriginalChecksum=42fb99eba8a3a8a58b2bdee94f557744 (do not edit this line) */ diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/TokenMgrError.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/TokenMgrError.java new file mode 100644 index 000000000..ab017893d --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/TokenMgrError.java @@ -0,0 +1,147 @@ +/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 7.0 */ +/* JavaCCOptions: */ +package com.fr.third.steadystate.css.parser; + +/** Token Manager Error. */ +@SuppressWarnings("all") public class TokenMgrError extends Error +{ + + /** + * The version identifier for this Serializable class. + * Increment only if the serialized form of the + * class changes. + */ + private static final long serialVersionUID = 1L; + + /* + * Ordinals for various reasons why an Error of this type can be thrown. + */ + + /** + * Lexical error occurred. + */ + public static final int LEXICAL_ERROR = 0; + + /** + * An attempt was made to create a second instance of a static token manager. + */ + public static final int STATIC_LEXER_ERROR = 1; + + /** + * Tried to change to an invalid lexical state. + */ + public static final int INVALID_LEXICAL_STATE = 2; + + /** + * Detected (and bailed out of) an infinite loop in the token manager. + */ + public static final int LOOP_DETECTED = 3; + + /** + * Indicates the reason why the exception is thrown. It will have + * one of the above 4 values. + */ + int errorCode; + + /** + * Replaces unprintable characters by their escaped (or unicode escaped) + * equivalents in the given string + */ + protected static final String addEscapes(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(); + } + + /** + * Returns a detailed message for the Error when it is thrown by the + * token manager to indicate a lexical error. + * Parameters : + * EOFSeen : indicates if EOF caused the lexical error + * curLexState : lexical state in which this error occurred + * errorLine : line number when the error occurred + * errorColumn : column number when the error occurred + * errorAfter : prefix that was seen before this error occurred + * curchar : the offending character + * Note: You can customize the lexical error message by modifying this method. + */ + protected static String LexicalErr(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar) { + char curChar1 = (char)curChar; + return("Lexical error at line " + + errorLine + ", column " + + errorColumn + ". Encountered: " + + (EOFSeen ? " " : ("\"" + addEscapes(String.valueOf(curChar1)) + "\"") + " (" + curChar + "), ") + + "after : \"" + addEscapes(errorAfter) + "\""); + } + + /** + * You can also modify the body of this method to customize your error messages. + * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not + * of end-users concern, so you can return something like : + * + * "Internal Error : Please file a bug report .... " + * + * from this method for such cases in the release version of your parser. + */ + @Override + public String getMessage() { + return super.getMessage(); + } + + /* + * Constructors of various flavors follow. + */ + + /** No arg constructor. */ + public TokenMgrError() { + } + + /** Constructor with message and reason. */ + public TokenMgrError(String message, int reason) { + super(message); + errorCode = reason; + } + + /** Full Constructor. */ + public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar, int reason) { + this(LexicalErr(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); + } +} +/* JavaCC - OriginalChecksum=79a7770cdb8d32ef3bb22077e08dbe6a (do not edit this line) */ diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/media/MediaQuery.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/media/MediaQuery.java new file mode 100644 index 000000000..3d44d1853 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/media/MediaQuery.java @@ -0,0 +1,101 @@ +/* + * 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.media; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import com.fr.third.steadystate.css.dom.Property; +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.LocatableImpl; + +/** + * @author rbri + */ +public class MediaQuery extends LocatableImpl implements CSSFormatable, Serializable { + + private static final long serialVersionUID = 456776383828897471L; + + private String media_; + private List properties_; + private boolean isOnly_; + private boolean isNot_; + + public MediaQuery(final String media) { + this(media, false, false); + } + + public MediaQuery(final String media, final boolean isOnly, final boolean isNot) { + setMedia(media); + properties_ = new ArrayList(10); + isOnly_ = isOnly; + isNot_ = isNot; + } + + public String getMedia() { + return media_; + } + + public void setMedia(final String media) { + media_ = media; + } + + public List getProperties() { + return properties_; + } + + public void addMediaProperty(final Property mp) { + properties_.add(mp); + } + + public boolean isOnly() { + return isOnly_; + } + + public boolean isNot() { + return isNot_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder(); + + if (isOnly_) { + sb.append("only "); + } + if (isNot_) { + sb.append("not "); + } + + sb.append(getMedia()); + + for (Property prop : properties_) { + sb.append(" and (") + .append(prop.getCssText(format)) + .append(')'); + } + return sb.toString(); + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/AndConditionImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/AndConditionImpl.java new file mode 100644 index 000000000..c1bb22a22 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/AndConditionImpl.java @@ -0,0 +1,94 @@ +/* + * 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.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.Locatable; +import com.fr.third.steadystate.css.parser.LocatableImpl; +import org.w3c.css.sac.CombinatorCondition; +import org.w3c.css.sac.Condition; + +import com.fr.third.steadystate.css.format.CSSFormat; + +/** + * + * @author David Schweinsberg + * @author rbri + */ +public class AndConditionImpl extends LocatableImpl implements CombinatorCondition, CSSFormatable, Serializable { + + private static final long serialVersionUID = -3180583860092672742L; + + private Condition firstCondition_; + private Condition secondCondition_; + + public void setFirstCondition(final Condition c1) { + firstCondition_ = c1; + if (c1 instanceof Locatable) { + setLocator(((Locatable) c1).getLocator()); + } + else if (c1 == null) { + setLocator(null); + } + } + + public void setSecondCondition(final Condition c2) { + secondCondition_ = c2; + } + + public AndConditionImpl(final Condition c1, final Condition c2) { + setFirstCondition(c1); + setSecondCondition(c2); + } + + public short getConditionType() { + return Condition.SAC_AND_CONDITION; + } + + public Condition getFirstCondition() { + return firstCondition_; + } + + public Condition getSecondCondition() { + return secondCondition_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder(); + + Condition cond = getFirstCondition(); + if (null != cond) { + sb.append(((CSSFormatable) cond).getCssText(format)); + } + + cond = getSecondCondition(); + if (null != cond) { + sb.append(((CSSFormatable) cond).getCssText(format)); + } + + return sb.toString(); + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/AttributeConditionImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/AttributeConditionImpl.java new file mode 100644 index 000000000..c12304d26 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/AttributeConditionImpl.java @@ -0,0 +1,92 @@ +/* + * 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.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.LocatableImpl; +import org.w3c.css.sac.AttributeCondition; +import org.w3c.css.sac.Condition; + +import com.fr.third.steadystate.css.format.CSSFormat; + +/** + * @author David Schweinsberg + * @author rbri + */ +public class AttributeConditionImpl extends LocatableImpl implements AttributeCondition, CSSFormatable, Serializable { + + private static final long serialVersionUID = 9035418830958954213L; + + private String localName_; + private String value_; + private boolean specified_; + + public void setLocaleName(final String localName) { + localName_ = localName; + } + + public void setValue(final String value) { + value_ = value; + } + + public void setSpecified(final boolean specified) { + specified_ = specified; + } + + public AttributeConditionImpl(final String localName, final String value, final boolean specified) { + setLocaleName(localName); + setValue(value); + setSpecified(specified); + } + + public short getConditionType() { + return Condition.SAC_ATTRIBUTE_CONDITION; + } + + public String getNamespaceURI() { + return null; + } + + public String getLocalName() { + return localName_; + } + + public boolean getSpecified() { + return specified_; + } + + public String getValue() { + return value_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final String value = getValue(); + if (value != null) { + return "[" + getLocalName() + "=\"" + value + "\"]"; + } + return "[" + getLocalName() + "]"; + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/BeginHyphenAttributeConditionImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/BeginHyphenAttributeConditionImpl.java new file mode 100644 index 000000000..b6be991dd --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/BeginHyphenAttributeConditionImpl.java @@ -0,0 +1,94 @@ +/* + * 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.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.LocatableImpl; +import org.w3c.css.sac.AttributeCondition; +import org.w3c.css.sac.Condition; + +import com.fr.third.steadystate.css.format.CSSFormat; + +/** + * @author David Schweinsberg + * @author rbri + */ +public class BeginHyphenAttributeConditionImpl extends LocatableImpl + implements AttributeCondition, CSSFormatable, Serializable { + + private static final long serialVersionUID = 6552118983276681650L; + + private String localName_; + private String value_; + private boolean specified_; + + public void setLocaleName(final String localName) { + localName_ = localName; + } + + public void setValue(final String value) { + value_ = value; + } + + public void setSpecified(final boolean specified) { + specified_ = specified; + } + + public BeginHyphenAttributeConditionImpl(final String localName, final String value, final boolean specified) { + setLocaleName(localName); + setValue(value); + setSpecified(specified); + } + + public short getConditionType() { + return Condition.SAC_BEGIN_HYPHEN_ATTRIBUTE_CONDITION; + } + + public String getNamespaceURI() { + return null; + } + + public String getLocalName() { + return localName_; + } + + public boolean getSpecified() { + return specified_; + } + + public String getValue() { + return value_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final String value = getValue(); + if (value != null) { + return "[" + getLocalName() + "|=\"" + value + "\"]"; + } + return "[" + getLocalName() + "]"; + } + + @Override + public String toString() { + return getCssText(null); + } +} + diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/CharacterDataSelectorImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/CharacterDataSelectorImpl.java new file mode 100644 index 000000000..d22ca4412 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/CharacterDataSelectorImpl.java @@ -0,0 +1,69 @@ +/* + * 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.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.LocatableImpl; +import org.w3c.css.sac.CharacterDataSelector; +import org.w3c.css.sac.Selector; + +/** + * + * @author David Schweinsberg + * @author rbri + */ +public class CharacterDataSelectorImpl extends LocatableImpl + implements CharacterDataSelector, CSSFormatable, Serializable { + + private static final long serialVersionUID = 4635511567927852889L; + + private String data_; + + public void setData(final String data) { + data_ = data; + } + + public CharacterDataSelectorImpl(final String data) { + setData(data); + } + + public short getSelectorType() { + return Selector.SAC_CDATA_SECTION_NODE_SELECTOR; + } + + public String getData() { + return data_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final String data = getData(); + if (data == null) { + return ""; + } + return data; + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ChildSelectorImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ChildSelectorImpl.java new file mode 100644 index 000000000..1867ec209 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ChildSelectorImpl.java @@ -0,0 +1,94 @@ +/* + * 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.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.Locatable; +import org.w3c.css.sac.DescendantSelector; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SimpleSelector; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.parser.LocatableImpl; + +/** + * @author David Schweinsberg + * @author rbri + */ +public class ChildSelectorImpl extends LocatableImpl implements DescendantSelector, CSSFormatable, Serializable { + + private static final long serialVersionUID = -5843289529637921083L; + + private Selector ancestorSelector_; + private SimpleSelector simpleSelector_; + + public void setAncestorSelector(final Selector ancestorSelector) { + ancestorSelector_ = ancestorSelector; + if (ancestorSelector instanceof Locatable) { + setLocator(((Locatable) ancestorSelector).getLocator()); + } + else if (ancestorSelector == null) { + setLocator(null); + } + } + + public void setSimpleSelector(final SimpleSelector simpleSelector) { + simpleSelector_ = simpleSelector; + } + + public ChildSelectorImpl(final Selector parent, final SimpleSelector simpleSelector) { + setAncestorSelector(parent); + setSimpleSelector(simpleSelector); + } + + public short getSelectorType() { + return Selector.SAC_CHILD_SELECTOR; + } + + public Selector getAncestorSelector() { + return ancestorSelector_; + } + + public SimpleSelector getSimpleSelector() { + return simpleSelector_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder(); + + if (null != ancestorSelector_) { + sb.append(((CSSFormatable) ancestorSelector_).getCssText(format)); + } + + sb.append(" > "); + + if (null != simpleSelector_) { + sb.append(((CSSFormatable) simpleSelector_).getCssText(format)); + } + + return sb.toString(); + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ClassConditionImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ClassConditionImpl.java new file mode 100644 index 000000000..67de8a9c8 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ClassConditionImpl.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.parser.selectors; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.LocatableImpl; +import org.w3c.css.sac.AttributeCondition; +import org.w3c.css.sac.Condition; + +import java.io.Serializable; + +/** + * + * @author David Schweinsberg + * @author rbri + */ +public class ClassConditionImpl extends LocatableImpl implements AttributeCondition, CSSFormatable, Serializable { + + private static final long serialVersionUID = -2216489300949054242L; + + private String value_; + + public void setValue(final String value) { + value_ = value; + } + + public ClassConditionImpl(final String value) { + setValue(value); + } + + public short getConditionType() { + return Condition.SAC_CLASS_CONDITION; + } + + public String getNamespaceURI() { + return null; + } + + public String getLocalName() { + return null; + } + + public boolean getSpecified() { + return true; + } + + public String getValue() { + return value_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final String value = getValue(); + if (value != null) { + return "." + value; + } + return "."; + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ConditionFactoryImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ConditionFactoryImpl.java new file mode 100644 index 000000000..d363c4b35 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ConditionFactoryImpl.java @@ -0,0 +1,164 @@ +/* + * 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.selectors; + +import org.w3c.css.sac.AttributeCondition; +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.CombinatorCondition; +import org.w3c.css.sac.Condition; +import org.w3c.css.sac.ContentCondition; +import org.w3c.css.sac.LangCondition; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.NegativeCondition; +import org.w3c.css.sac.PositionalCondition; + +import com.fr.third.steadystate.css.sac.ConditionFactoryExt; + +/** + * + * @author David Schweinsberg + * @author Ronald Brill + */ +public class ConditionFactoryImpl implements ConditionFactoryExt { + + public CombinatorCondition createAndCondition(final Condition first, final Condition second) throws CSSException { + return new AndConditionImpl(first, second); + } + + public CombinatorCondition createOrCondition(final Condition first, final Condition second) throws CSSException { + throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); + } + + public NegativeCondition createNegativeCondition(final Condition condition) throws CSSException { + throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); + } + + public PositionalCondition createPositionalCondition( + final int position, + final boolean typeNode, + final boolean type) throws CSSException { + throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); + } + + public AttributeCondition createAttributeCondition( + final String localName, + final String namespaceURI, + final boolean specified, + final String value) throws CSSException { + return new AttributeConditionImpl(localName, value, specified); + } + + public AttributeCondition createIdCondition(final String value) throws CSSException { + return createIdCondition(value, null); + } + + public AttributeCondition createIdCondition(final String value, final Locator locator) throws CSSException { + final IdConditionImpl cond = new IdConditionImpl(value); + cond.setLocator(locator); + return cond; + } + + public LangCondition createLangCondition(final String lang) throws CSSException { + return createLangCondition(lang, null); + } + public LangCondition createLangCondition(final String lang, final Locator locator) throws CSSException { + final LangConditionImpl cond = new LangConditionImpl(lang); + cond.setLocator(locator); + return cond; + } + + public AttributeCondition createOneOfAttributeCondition( + final String localName, + final String namespaceURI, + final boolean specified, + final String value) throws CSSException { + return new OneOfAttributeConditionImpl(localName, value, specified); + } + + public AttributeCondition createBeginHyphenAttributeCondition( + final String localName, + final String namespaceURI, + final boolean specified, + final String value) throws CSSException { + return new BeginHyphenAttributeConditionImpl(localName, value, specified); + } + + public AttributeCondition createPrefixAttributeCondition( + final String localName, + final String namespaceURI, + final boolean specified, + final String value) throws CSSException { + return new PrefixAttributeConditionImpl(localName, value, specified); + } + + public AttributeCondition createSuffixAttributeCondition( + final String localName, + final String namespaceURI, + final boolean specified, + final String value) throws CSSException { + return new SuffixAttributeConditionImpl(localName, value, specified); + } + + public AttributeCondition createSubstringAttributeCondition( + final String localName, + final String namespaceURI, + final boolean specified, + final String value) throws CSSException { + return new SubstringAttributeConditionImpl(localName, value, specified); + } + + public AttributeCondition createClassCondition( + final String namespaceURI, + final String value) throws CSSException { + return createClassCondition(namespaceURI, value, null); + } + + public AttributeCondition createClassCondition(final String namespaceURI, final String value, + final Locator locator) throws CSSException { + final ClassConditionImpl cond = new ClassConditionImpl(value); + cond.setLocator(locator); + return cond; + } + + public AttributeCondition createPseudoClassCondition( + final String namespaceURI, + final String value) throws CSSException { + return createPseudoClassCondition(namespaceURI, value, null, false); + } + + public AttributeCondition createPseudoClassCondition(final String namespaceURI, final String value, + final Locator locator, final boolean doubleColon) throws CSSException { + final PseudoClassConditionImpl cond = new PseudoClassConditionImpl(value); + cond.setLocator(locator); + if (doubleColon) { + cond.prefixedWithDoubleColon(); + } + return cond; + } + + public Condition createOnlyChildCondition() throws CSSException { + throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); + } + + public Condition createOnlyTypeCondition() throws CSSException { + throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); + } + + public ContentCondition createContentCondition(final String data) + throws CSSException { + throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ConditionalSelectorImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ConditionalSelectorImpl.java new file mode 100644 index 000000000..b1f555886 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ConditionalSelectorImpl.java @@ -0,0 +1,102 @@ +/* + * 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.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.Locatable; +import com.fr.third.steadystate.css.parser.LocatableImpl; +import org.w3c.css.sac.Condition; +import org.w3c.css.sac.ConditionalSelector; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SimpleSelector; + +import com.fr.third.steadystate.css.format.CSSFormat; + +/** + * + * @author David Schweinsberg + * @author rbri + */ +public class ConditionalSelectorImpl extends LocatableImpl implements ConditionalSelector, CSSFormatable, Serializable { + + private static final long serialVersionUID = 7217145899707580586L; + + private SimpleSelector simpleSelector_; + private Condition condition_; + + public void setSimpleSelector(final SimpleSelector simpleSelector) { + simpleSelector_ = simpleSelector; + if (simpleSelector instanceof Locatable) { + setLocator(((Locatable) simpleSelector).getLocator()); + } + else if (simpleSelector == null) { + setLocator(null); + } + } + + public void setCondition(final Condition condition) { + condition_ = condition; + if (getLocator() == null) { + if (condition instanceof Locatable) { + setLocator(((Locatable) condition).getLocator()); + } + else if (condition == null) { + setLocator(null); + } + } + } + + public ConditionalSelectorImpl(final SimpleSelector simpleSelector, final Condition condition) { + setSimpleSelector(simpleSelector); + setCondition(condition); + } + + public short getSelectorType() { + return Selector.SAC_CONDITIONAL_SELECTOR; + } + + public SimpleSelector getSimpleSelector() { + return simpleSelector_; + } + + public Condition getCondition() { + return condition_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder(); + + if (null != simpleSelector_) { + sb.append(((CSSFormatable) simpleSelector_).getCssText(format)); + } + + if (null != condition_) { + sb.append(((CSSFormatable) condition_).getCssText(format)); + } + + return sb.toString(); + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/DescendantSelectorImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/DescendantSelectorImpl.java new file mode 100644 index 000000000..d6549f347 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/DescendantSelectorImpl.java @@ -0,0 +1,95 @@ +/* + * 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.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.Locatable; +import com.fr.third.steadystate.css.parser.LocatableImpl; +import org.w3c.css.sac.DescendantSelector; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SimpleSelector; + +/** + * @author David Schweinsberg + * @author rbri + */ +public class DescendantSelectorImpl extends LocatableImpl implements DescendantSelector, CSSFormatable, Serializable { + + private static final long serialVersionUID = -3620467847449531232L; + + private Selector ancestorSelector_; + private SimpleSelector simpleSelector_; + + public void setAncestorSelector(final Selector ancestorSelector) { + ancestorSelector_ = ancestorSelector; + if (ancestorSelector instanceof Locatable) { + setLocator(((Locatable) ancestorSelector).getLocator()); + } + else if (ancestorSelector == null) { + setLocator(null); + } + } + + public void setSimpleSelector(final SimpleSelector simpleSelector) { + simpleSelector_ = simpleSelector; + } + + public DescendantSelectorImpl(final Selector parent, final SimpleSelector simpleSelector) { + setAncestorSelector(parent); + setSimpleSelector(simpleSelector); + } + + public short getSelectorType() { + return Selector.SAC_DESCENDANT_SELECTOR; + } + + public Selector getAncestorSelector() { + return ancestorSelector_; + } + + public SimpleSelector getSimpleSelector() { + return simpleSelector_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder(); + + if (null != ancestorSelector_) { + sb.append(((CSSFormatable) ancestorSelector_).getCssText(format)); + } + + if (Selector.SAC_PSEUDO_ELEMENT_SELECTOR != getSimpleSelector().getSelectorType()) { + sb.append(' '); + } + + if (null != simpleSelector_) { + sb.append(((CSSFormatable) simpleSelector_).getCssText(format)); + } + + return sb.toString(); + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/DirectAdjacentSelectorImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/DirectAdjacentSelectorImpl.java new file mode 100644 index 000000000..df09d6f08 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/DirectAdjacentSelectorImpl.java @@ -0,0 +1,104 @@ +/* + * 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.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.Locatable; +import com.fr.third.steadystate.css.parser.LocatableImpl; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SiblingSelector; +import org.w3c.css.sac.SimpleSelector; + +/** + * @author David Schweinsberg + * @author rbri + */ +public class DirectAdjacentSelectorImpl extends LocatableImpl implements SiblingSelector, CSSFormatable, Serializable { + + private static final long serialVersionUID = -7328602345833826516L; + + private short nodeType_; + private Selector selector_; // child + private SimpleSelector siblingSelector_; // direct adjacent + + public void setNodeType(final short nodeType) { + nodeType_ = nodeType; + } + + public void setSelector(final Selector child) { + selector_ = child; + if (child instanceof Locatable) { + setLocator(((Locatable) child).getLocator()); + } + else if (child == null) { + setLocator(null); + } + } + + public void setSiblingSelector(final SimpleSelector directAdjacent) { + siblingSelector_ = directAdjacent; + } + + public DirectAdjacentSelectorImpl(final short nodeType, + final Selector child, final SimpleSelector directAdjacent) { + setNodeType(nodeType); + setSelector(child); + setSiblingSelector(directAdjacent); + } + + public short getNodeType() { + return nodeType_; + } + + public short getSelectorType() { + return Selector.SAC_DIRECT_ADJACENT_SELECTOR; + } + + public Selector getSelector() { + return selector_; + } + + public SimpleSelector getSiblingSelector() { + return siblingSelector_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder(); + + if (null != selector_) { + sb.append(((CSSFormatable) selector_).getCssText(format)); + } + + sb.append(" + "); + + if (null != siblingSelector_) { + sb.append(((CSSFormatable) siblingSelector_).getCssText(format)); + } + + return sb.toString(); + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ElementSelectorImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ElementSelectorImpl.java new file mode 100644 index 000000000..3c4faa8aa --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/ElementSelectorImpl.java @@ -0,0 +1,72 @@ +/* + * 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.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.LocatableImpl; +import org.w3c.css.sac.ElementSelector; +import org.w3c.css.sac.Selector; + +import com.fr.third.steadystate.css.format.CSSFormat; + +/** + * @author David Schweinsberg + * @author rbri + */ +public class ElementSelectorImpl extends LocatableImpl implements ElementSelector, CSSFormatable, Serializable { + + private static final long serialVersionUID = 7507121069969409061L; + + private String localName_; + + public void setLocalName(final String localName) { + localName_ = localName; + } + + public ElementSelectorImpl(final String localName) { + localName_ = localName; + } + + public short getSelectorType() { + return Selector.SAC_ELEMENT_NODE_SELECTOR; + } + + public String getNamespaceURI() { + return null; + } + + public String getLocalName() { + return localName_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final String localeName = getLocalName(); + if (localeName == null) { + return "*"; + } + return localeName; + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/GeneralAdjacentSelectorImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/GeneralAdjacentSelectorImpl.java new file mode 100644 index 000000000..6e955bc91 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/GeneralAdjacentSelectorImpl.java @@ -0,0 +1,106 @@ +/* + * 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.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.Locatable; +import com.fr.third.steadystate.css.parser.LocatableImpl; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SiblingSelector; +import org.w3c.css.sac.SimpleSelector; + +import com.fr.third.steadystate.css.format.CSSFormat; + +/** + * @author Ahmed Ashour + * @author rbri + */ +public class GeneralAdjacentSelectorImpl extends LocatableImpl implements SiblingSelector, CSSFormatable, Serializable { + + private static final long serialVersionUID = 1292704016876205605L; + + private short nodeType_; + private Selector selector_; + private SimpleSelector siblingSelector_; + + public void setNodeType(final short nodeType) { + nodeType_ = nodeType; + } + + public void setSelector(final Selector child) { + selector_ = child; + if (child instanceof Locatable) { + setLocator(((Locatable) child).getLocator()); + } + else if (child == null) { + setLocator(null); + } + } + + public void setSiblingSelector(final SimpleSelector directAdjacent) { + siblingSelector_ = directAdjacent; + } + + public GeneralAdjacentSelectorImpl(final short nodeType, + final Selector child, final SimpleSelector directAdjacent) { + setNodeType(nodeType); + setSelector(child); + setSiblingSelector(directAdjacent); + } + + public short getNodeType() { + return nodeType_; + } + + public short getSelectorType() { + // not correct but the best choice from the old sac + return Selector.SAC_DIRECT_ADJACENT_SELECTOR; + } + + public Selector getSelector() { + return selector_; + } + + public SimpleSelector getSiblingSelector() { + return siblingSelector_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final StringBuilder sb = new StringBuilder(); + + if (null != selector_) { + sb.append(((CSSFormatable) selector_).getCssText(format)); + } + + sb.append(" ~ "); + + if (null != siblingSelector_) { + sb.append(((CSSFormatable) siblingSelector_).getCssText(format)); + } + + return sb.toString(); + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/IdConditionImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/IdConditionImpl.java new file mode 100644 index 000000000..e6aa790e3 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/IdConditionImpl.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.parser.selectors; + +import java.io.Serializable; + +import org.w3c.css.sac.AttributeCondition; +import org.w3c.css.sac.Condition; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.LocatableImpl; + +/** + * @author David Schweinsberg + * @author rbri + */ +public class IdConditionImpl extends LocatableImpl implements AttributeCondition, CSSFormatable, Serializable { + + private static final long serialVersionUID = 5955662524656167683L; + + private String value_; + + public void setValue(final String value) { + value_ = value; + } + + public IdConditionImpl(final String value) { + setValue(value); + } + + public short getConditionType() { + return Condition.SAC_ID_CONDITION; + } + + public String getNamespaceURI() { + return null; + } + + public String getLocalName() { + return null; + } + + public boolean getSpecified() { + return true; + } + + public String getValue() { + return value_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final String value = getValue(); + if (value != null) { + return "#" + value; + } + return "#"; + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/LangConditionImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/LangConditionImpl.java new file mode 100644 index 000000000..411d78830 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/LangConditionImpl.java @@ -0,0 +1,74 @@ +/* + * 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.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import org.w3c.css.sac.Condition; +import org.w3c.css.sac.LangCondition; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.parser.LocatableImpl; + +/** + * + * @author David Schweinsberg + * @author rbri + */ +public class LangConditionImpl extends LocatableImpl implements LangCondition, CSSFormatable, Serializable { + + private static final long serialVersionUID = 1701599531953055387L; + + private String lang_; + + public void setLang(final String lang) { + lang_ = lang; + } + + public LangConditionImpl(final String lang) { + setLang(lang); + } + + public short getConditionType() { + return Condition.SAC_LANG_CONDITION; + } + + public String getLang() { + return lang_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final StringBuilder result = new StringBuilder(); + result.append(":lang("); + + final String lang = getLang(); + if (null != lang) { + result.append(lang); + } + + result.append(")"); + return result.toString(); + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/OneOfAttributeConditionImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/OneOfAttributeConditionImpl.java new file mode 100644 index 000000000..f56231241 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/OneOfAttributeConditionImpl.java @@ -0,0 +1,93 @@ +/* + * 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.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import org.w3c.css.sac.AttributeCondition; +import org.w3c.css.sac.Condition; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.parser.LocatableImpl; + +/** + * @author David Schweinsberg + * @author rbri + */ +public class OneOfAttributeConditionImpl extends LocatableImpl + implements AttributeCondition, CSSFormatable, Serializable { + + private static final long serialVersionUID = -1371164446179830634L; + + private String localName_; + private String value_; + private boolean specified_; + + public void setLocalName(final String localName) { + localName_ = localName; + } + + public void setValue(final String value) { + value_ = value; + } + + public void setSpecified(final boolean specified) { + specified_ = specified; + } + + public OneOfAttributeConditionImpl(final String localName, final String value, final boolean specified) { + setLocalName(localName); + setValue(value); + setSpecified(specified); + } + + public short getConditionType() { + return Condition.SAC_ONE_OF_ATTRIBUTE_CONDITION; + } + + public String getNamespaceURI() { + return null; + } + + public String getLocalName() { + return localName_; + } + + public boolean getSpecified() { + return specified_; + } + + public String getValue() { + return value_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final String value = getValue(); + if (value != null) { + return "[" + getLocalName() + "~=\"" + value + "\"]"; + } + return "[" + getLocalName() + "]"; + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/PrefixAttributeConditionImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/PrefixAttributeConditionImpl.java new file mode 100644 index 000000000..c95880550 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/PrefixAttributeConditionImpl.java @@ -0,0 +1,91 @@ +/* + * 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.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.LocatableImpl; +import org.w3c.css.sac.AttributeCondition; +import org.w3c.css.sac.Condition; + +/** + * @author Ahmed Ashour + */ +public class PrefixAttributeConditionImpl extends LocatableImpl + implements AttributeCondition, CSSFormatable, Serializable { + + private static final long serialVersionUID = -6899059242714875011L; + + private String localName_; + private String value_; + private boolean specified_; + + public void setLocalName(final String localName) { + localName_ = localName; + } + + public void setValue(final String value) { + value_ = value; + } + + public void setSpecified(final boolean specified) { + specified_ = specified; + } + + public PrefixAttributeConditionImpl(final String localName, final String value, final boolean specified) { + setLocalName(localName); + setValue(value); + setSpecified(specified); + } + + public short getConditionType() { + return Condition.SAC_ATTRIBUTE_CONDITION; //for now + } + + public String getNamespaceURI() { + return null; + } + + public String getLocalName() { + return localName_; + } + + public boolean getSpecified() { + return specified_; + } + + public String getValue() { + return value_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final String value = getValue(); + if (value != null) { + return "[" + getLocalName() + "^=\"" + value + "\"]"; + } + return "[" + getLocalName() + "]"; + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/PseudoClassConditionImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/PseudoClassConditionImpl.java new file mode 100644 index 000000000..b57fafaf1 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/PseudoClassConditionImpl.java @@ -0,0 +1,86 @@ +/* + * 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.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormatable; +import org.w3c.css.sac.AttributeCondition; +import org.w3c.css.sac.Condition; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.parser.LocatableImpl; + +/** + * + * @author David Schweinsberg + * @author rbri + */ +public class PseudoClassConditionImpl extends LocatableImpl implements AttributeCondition, CSSFormatable, Serializable { + + private static final long serialVersionUID = 1798016773089155610L; + + private String value_; + private boolean doubleColon_; + + public void setValue(final String value) { + value_ = value; + } + + public PseudoClassConditionImpl(final String value) { + setValue(value); + } + + public short getConditionType() { + return Condition.SAC_PSEUDO_CLASS_CONDITION; + } + + public String getNamespaceURI() { + return null; + } + + public String getLocalName() { + return null; + } + + public boolean getSpecified() { + return true; + } + + public String getValue() { + return value_; + } + + public void prefixedWithDoubleColon() { + doubleColon_ = true; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final String value = getValue(); + if (value == null) { + return value; + } + return (doubleColon_ ? "::" : ":") + value; + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/PseudoElementSelectorImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/PseudoElementSelectorImpl.java new file mode 100644 index 000000000..6a25a39c4 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/PseudoElementSelectorImpl.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.parser.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.LocatableImpl; +import org.w3c.css.sac.ElementSelector; +import org.w3c.css.sac.Selector; + +/** + * + * @author David Schweinsberg + * @author rbri + */ +public class PseudoElementSelectorImpl extends LocatableImpl implements ElementSelector, CSSFormatable, Serializable { + + private static final long serialVersionUID = 2913936296006875268L; + + private String localName_; + private boolean doubleColon_; + + public void setLocaleName(final String localName) { + localName_ = localName; + } + + public PseudoElementSelectorImpl(final String localName) { + setLocaleName(localName); + } + + public short getSelectorType() { + return Selector.SAC_PSEUDO_ELEMENT_SELECTOR; + } + + public String getNamespaceURI() { + return null; + } + + public String getLocalName() { + return localName_; + } + + public void prefixedWithDoubleColon() { + doubleColon_ = true; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + if (localName_ == null) { + return localName_; + } + return (doubleColon_ ? "::" : ":") + localName_; + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/SelectorFactoryImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/SelectorFactoryImpl.java new file mode 100644 index 000000000..5f584e8ca --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/SelectorFactoryImpl.java @@ -0,0 +1,139 @@ +/* + * 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.selectors; + +import com.fr.third.steadystate.css.sac.SelectorFactoryExt; +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.CharacterDataSelector; +import org.w3c.css.sac.Condition; +import org.w3c.css.sac.ConditionalSelector; +import org.w3c.css.sac.DescendantSelector; +import org.w3c.css.sac.ElementSelector; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.NegativeSelector; +import org.w3c.css.sac.ProcessingInstructionSelector; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SiblingSelector; +import org.w3c.css.sac.SimpleSelector; + +/** + * + * @author David Schweinsberg + * @author Ronald Brill + */ +public class SelectorFactoryImpl implements SelectorFactoryExt { + + public ConditionalSelector createConditionalSelector( + final SimpleSelector selector, + final Condition condition) throws CSSException { + return new ConditionalSelectorImpl(selector, condition); + } + + public SimpleSelector createAnyNodeSelector() throws CSSException { + throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); + } + + public SimpleSelector createRootNodeSelector() throws CSSException { + throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); + } + + public NegativeSelector createNegativeSelector(final SimpleSelector selector) throws CSSException { + throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); + } + + public ElementSelector createElementSelector(final String namespaceURI, final String localName) + throws CSSException { + return createElementSelector(namespaceURI, localName, null); + } + + public ElementSelector createElementSelector(final String namespaceURI, final String localName, + final Locator locator) throws CSSException { + if (namespaceURI != null) { + throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); + } + final ElementSelectorImpl sel = new ElementSelectorImpl(localName); + sel.setLocator(locator); + return sel; + } + + public ElementSelector createSyntheticElementSelector() throws CSSException { + return new SyntheticElementSelectorImpl(); + } + + public CharacterDataSelector createTextNodeSelector(final String data) throws CSSException { + throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); + } + + public CharacterDataSelector createCDataSectionSelector(final String data) + throws CSSException { + throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); + } + + public ProcessingInstructionSelector createProcessingInstructionSelector( + final String target, + final String data) throws CSSException { + throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); + } + + public CharacterDataSelector createCommentSelector(final String data) throws CSSException { + throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); + } + + public ElementSelector createPseudoElementSelector(final String namespaceURI, final String pseudoName) + throws CSSException { + return createPseudoElementSelector(namespaceURI, pseudoName, null, false); + } + + public ElementSelector createPseudoElementSelector(final String namespaceURI, final String pseudoName, + final Locator locator, final boolean doubleColon) throws CSSException { + if (namespaceURI != null) { + throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR); + } + + final PseudoElementSelectorImpl sel = new PseudoElementSelectorImpl(pseudoName); + sel.setLocator(locator); + if (doubleColon) { + sel.prefixedWithDoubleColon(); + } + return sel; + } + + public DescendantSelector createDescendantSelector( + final Selector parent, + final SimpleSelector descendant) throws CSSException { + return new DescendantSelectorImpl(parent, descendant); + } + + public DescendantSelector createChildSelector( + final Selector parent, + final SimpleSelector child) throws CSSException { + return new ChildSelectorImpl(parent, child); + } + + public SiblingSelector createDirectAdjacentSelector( + final short nodeType, + final Selector child, + final SimpleSelector directAdjacent) throws CSSException { + return new DirectAdjacentSelectorImpl(nodeType, child, directAdjacent); + } + + public SiblingSelector createGeneralAdjacentSelector( + final short nodeType, + final Selector child, + final SimpleSelector directAdjacent) throws CSSException { + return new GeneralAdjacentSelectorImpl(nodeType, child, directAdjacent); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/SubstringAttributeConditionImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/SubstringAttributeConditionImpl.java new file mode 100644 index 000000000..e8609198f --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/SubstringAttributeConditionImpl.java @@ -0,0 +1,91 @@ +/* + * 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.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.LocatableImpl; +import org.w3c.css.sac.AttributeCondition; +import org.w3c.css.sac.Condition; + +/** + * @author Ahmed Ashour + */ +public class SubstringAttributeConditionImpl extends LocatableImpl + implements AttributeCondition, CSSFormatable, Serializable { + + private static final long serialVersionUID = 7628763646156568710L; + + private String localName_; + private String value_; + private boolean specified_; + + public void setLocalName(final String localName) { + localName_ = localName; + } + + public void setValue(final String value) { + value_ = value; + } + + public void setSpecified(final boolean specified) { + specified_ = specified; + } + + public SubstringAttributeConditionImpl(final String localName, final String value, final boolean specified) { + setLocalName(localName); + setValue(value); + setSpecified(specified); + } + + public short getConditionType() { + return Condition.SAC_ATTRIBUTE_CONDITION; //for now + } + + public String getNamespaceURI() { + return null; + } + + public String getLocalName() { + return localName_; + } + + public boolean getSpecified() { + return specified_; + } + + public String getValue() { + return value_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final String value = getValue(); + if (value != null) { + return "[" + getLocalName() + "*=\"" + value + "\"]"; + } + return "[" + getLocalName() + "]"; + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/SuffixAttributeConditionImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/SuffixAttributeConditionImpl.java new file mode 100644 index 000000000..a80dba898 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/SuffixAttributeConditionImpl.java @@ -0,0 +1,91 @@ +/* + * 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.selectors; + +import java.io.Serializable; + +import com.fr.third.steadystate.css.format.CSSFormat; +import com.fr.third.steadystate.css.format.CSSFormatable; +import com.fr.third.steadystate.css.parser.LocatableImpl; +import org.w3c.css.sac.AttributeCondition; +import org.w3c.css.sac.Condition; + +/** + * @author Ahmed Ashour + */ +public class SuffixAttributeConditionImpl extends LocatableImpl + implements AttributeCondition, CSSFormatable, Serializable { + + private static final long serialVersionUID = -957389472252773926L; + + private String localName_; + private String value_; + private boolean specified_; + + public void setLocalName(final String localName) { + localName_ = localName; + } + + public void setValue(final String value) { + value_ = value; + } + + public void setSpecified(final boolean specified) { + specified_ = specified; + } + + public SuffixAttributeConditionImpl(final String localName, final String value, final boolean specified) { + setLocalName(localName); + setValue(value); + setSpecified(specified); + } + + public short getConditionType() { + return Condition.SAC_ATTRIBUTE_CONDITION; //for now + } + + public String getNamespaceURI() { + return null; + } + + public String getLocalName() { + return localName_; + } + + public boolean getSpecified() { + return specified_; + } + + public String getValue() { + return value_; + } + + /** + * {@inheritDoc} + */ + public String getCssText(final CSSFormat format) { + final String value = getValue(); + if (value != null) { + return "[" + getLocalName() + "$=\"" + value + "\"]"; + } + return "[" + getLocalName() + "]"; + } + + @Override + public String toString() { + return getCssText(null); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/SyntheticElementSelectorImpl.java b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/SyntheticElementSelectorImpl.java new file mode 100644 index 000000000..74ca9f36a --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/selectors/SyntheticElementSelectorImpl.java @@ -0,0 +1,48 @@ +/* + * 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.selectors; + +import com.fr.third.steadystate.css.format.CSSFormat; + +/** + * Special ElementSelectorImpl used by the parser at all the places where + * the parser inserts a '*' selector. The selector will be ignored when + * generating output. + * This is done to be backward compatible. + * + * @author rbri + */ +public class SyntheticElementSelectorImpl extends ElementSelectorImpl { + + private static final long serialVersionUID = 3426191759125755798L; + + public SyntheticElementSelectorImpl() { + super(null); + } + + @Override + public void setLocalName(final String localName) { + throw new RuntimeException("Method setLocalName is not supported for SyntheticElementSelectorImpl."); + } + + /** + * {@inheritDoc} + */ + @Override + public String getCssText(final CSSFormat format) { + return ""; + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/sac/ConditionFactoryAdapter.java b/fine-cssparser/src/com/fr/third/steadystate/css/sac/ConditionFactoryAdapter.java new file mode 100644 index 000000000..6af1840e7 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/sac/ConditionFactoryAdapter.java @@ -0,0 +1,119 @@ +/* + * 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.sac; + +import org.w3c.css.sac.AttributeCondition; +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.CombinatorCondition; +import org.w3c.css.sac.Condition; +import org.w3c.css.sac.ConditionFactory; +import org.w3c.css.sac.ContentCondition; +import org.w3c.css.sac.LangCondition; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.NegativeCondition; +import org.w3c.css.sac.PositionalCondition; + +/** + * Implementation of the ConditionFactoryExt interface that maps calls back to a + * native sac ConditionFactory. + */ +public class ConditionFactoryAdapter implements ConditionFactoryExt { + + private final ConditionFactory conditionFactory_; + + public ConditionFactoryAdapter(final ConditionFactory selectorFactory) { + conditionFactory_ = selectorFactory; + } + + public CombinatorCondition createAndCondition(final Condition first, final Condition second) throws CSSException { + return conditionFactory_.createAndCondition(first, second); + } + + public CombinatorCondition createOrCondition(final Condition first, final Condition second) throws CSSException { + return conditionFactory_.createOrCondition(first, second); + } + + public NegativeCondition createNegativeCondition(final Condition condition) throws CSSException { + return conditionFactory_.createNegativeCondition(condition); + } + + public PositionalCondition createPositionalCondition(final int position, final boolean typeNode, final boolean type) + throws CSSException { + return conditionFactory_.createPositionalCondition(position, typeNode, type); + } + + public AttributeCondition createAttributeCondition(final String localName, final String namespaceURI, + final boolean specified, final String value) throws CSSException { + return conditionFactory_.createAttributeCondition(localName, namespaceURI, specified, value); + } + + public AttributeCondition createIdCondition(final String value) throws CSSException { + return conditionFactory_.createIdCondition(value); + } + + public AttributeCondition createIdCondition(final String value, final Locator locator) throws CSSException { + return conditionFactory_.createIdCondition(value); + } + + public LangCondition createLangCondition(final String lang) throws CSSException { + return conditionFactory_.createLangCondition(lang); + } + + public LangCondition createLangCondition(final String lang, final Locator locator) throws CSSException { + return conditionFactory_.createLangCondition(lang); + } + + public AttributeCondition createOneOfAttributeCondition(final String localName, final String namespaceURI, + final boolean specified, final String value) throws CSSException { + return conditionFactory_.createOneOfAttributeCondition(localName, namespaceURI, specified, value); + } + + public AttributeCondition createBeginHyphenAttributeCondition(final String localName, final String namespaceURI, + final boolean specified, final String value) throws CSSException { + return conditionFactory_.createBeginHyphenAttributeCondition(localName, namespaceURI, specified, value); + } + + public AttributeCondition createClassCondition(final String namespaceURI, final String value) throws CSSException { + return conditionFactory_.createClassCondition(namespaceURI, value); + } + + public AttributeCondition createClassCondition(final String namespaceURI, final String value, final Locator locator) + throws CSSException { + return conditionFactory_.createClassCondition(namespaceURI, value); + } + + public AttributeCondition createPseudoClassCondition(final String namespaceURI, final String value) + throws CSSException { + return conditionFactory_.createPseudoClassCondition(namespaceURI, value); + } + + public AttributeCondition createPseudoClassCondition(final String namespaceURI, final String value, + final Locator locator, final boolean doubleColon) throws CSSException { + return conditionFactory_.createPseudoClassCondition(namespaceURI, value); + } + + public Condition createOnlyChildCondition() throws CSSException { + return conditionFactory_.createOnlyChildCondition(); + } + + public Condition createOnlyTypeCondition() throws CSSException { + return conditionFactory_.createOnlyTypeCondition(); + } + + public ContentCondition createContentCondition(final String data) throws CSSException { + return conditionFactory_.createContentCondition(data); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/sac/ConditionFactoryExt.java b/fine-cssparser/src/com/fr/third/steadystate/css/sac/ConditionFactoryExt.java new file mode 100644 index 000000000..fb81e2e7a --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/sac/ConditionFactoryExt.java @@ -0,0 +1,40 @@ +/* + * 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.sac; + +import org.w3c.css.sac.AttributeCondition; +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.ConditionFactory; +import org.w3c.css.sac.LangCondition; +import org.w3c.css.sac.Locator; + +/** + * Extension of the ConditionFactory interface. + * This was added to support the locator parameter to + * inform about the code position. + */ +public interface ConditionFactoryExt extends ConditionFactory { + + AttributeCondition createClassCondition(String namespaceURI, String value, Locator locator) throws CSSException; + + AttributeCondition createIdCondition(String value, Locator locator) throws CSSException; + + AttributeCondition createPseudoClassCondition(String namespaceURI, String value, + Locator locator, boolean doubleColon) + throws CSSException; + + LangCondition createLangCondition(String lang, Locator locator) throws CSSException; +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/sac/DocumentHandlerAdapter.java b/fine-cssparser/src/com/fr/third/steadystate/css/sac/DocumentHandlerAdapter.java new file mode 100644 index 000000000..2d5a5b2bc --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/sac/DocumentHandlerAdapter.java @@ -0,0 +1,169 @@ +/* + * 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.sac; + +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.CSSParseException; +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.SACMediaList; +import org.w3c.css.sac.SelectorList; + +/** + * Implementation of the DocumentHandlerExt interface that maps calls back to a + * native sac DocumentHandler. + */ +public class DocumentHandlerAdapter implements DocumentHandlerExt, ErrorHandler { + + private final DocumentHandler documentHanlder_; + + public DocumentHandlerAdapter(final DocumentHandler documentHanlder) { + documentHanlder_ = documentHanlder; + } + + public void startDocument(final InputSource source) throws CSSException { + documentHanlder_.startDocument(source); + } + + public void endDocument(final InputSource source) throws CSSException { + documentHanlder_.endDocument(source); + } + + public void comment(final String text) throws CSSException { + documentHanlder_.comment(text); + } + + public void ignorableAtRule(final String atRule) throws CSSException { + documentHanlder_.ignorableAtRule(atRule); + } + + public void ignorableAtRule(final String atRule, final Locator locator) throws CSSException { + documentHanlder_.ignorableAtRule(atRule); + } + + public void namespaceDeclaration(final String prefix, final String uri) throws CSSException { + documentHanlder_.namespaceDeclaration(prefix, uri); + } + + public void importStyle(final String uri, final SACMediaList media, + final String defaultNamespaceURI) throws CSSException { + documentHanlder_.importStyle(uri, media, defaultNamespaceURI); + } + + public void importStyle(final String uri, final SACMediaList media, + final String defaultNamespaceURI, final Locator locator) throws CSSException { + documentHanlder_.importStyle(uri, media, defaultNamespaceURI); + } + + public void startMedia(final SACMediaList media) throws CSSException { + documentHanlder_.startMedia(media); + } + + public void startMedia(final SACMediaList media, final Locator locator) throws CSSException { + documentHanlder_.startMedia(media); + } + + public void endMedia(final SACMediaList media) throws CSSException { + documentHanlder_.endMedia(media); + } + + public void startPage(final String name, final String pseudoPage) throws CSSException { + documentHanlder_.startPage(name, pseudoPage); + } + + public void startPage(final String name, final String pseudoPage, final Locator locator) throws CSSException { + documentHanlder_.startPage(name, pseudoPage); + } + + public void endPage(final String name, final String pseudoPage) throws CSSException { + documentHanlder_.endPage(name, pseudoPage); + } + + public void startFontFace() throws CSSException { + documentHanlder_.startFontFace(); + } + + public void startFontFace(final Locator locator) throws CSSException { + documentHanlder_.startFontFace(); + } + + public void endFontFace() throws CSSException { + documentHanlder_.endFontFace(); + } + + public void startSelector(final SelectorList selectors) throws CSSException { + documentHanlder_.startSelector(selectors); + } + + public void startSelector(final SelectorList selectors, final Locator locator) throws CSSException { + documentHanlder_.startSelector(selectors); + } + + public void endSelector(final SelectorList selectors) throws CSSException { + documentHanlder_.endSelector(selectors); + } + + public void property(final String name, final LexicalUnit value, final boolean important) throws CSSException { + documentHanlder_.property(name, value, important); + } + + public void property(final String name, final LexicalUnit value, final boolean important, final Locator locator) { + documentHanlder_.property(name, value, important); + } + + 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/sac/DocumentHandlerExt.java b/fine-cssparser/src/com/fr/third/steadystate/css/sac/DocumentHandlerExt.java new file mode 100644 index 000000000..27014e1d4 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/sac/DocumentHandlerExt.java @@ -0,0 +1,128 @@ +/* + * 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.sac; + +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.DocumentHandler; +import org.w3c.css.sac.LexicalUnit; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.SACMediaList; +import org.w3c.css.sac.SelectorList; + +/** + * Extension of the DocumentHanlder interface. + * This was added to support the locator parameter to + * inform about the code position. + */ +public interface DocumentHandlerExt extends DocumentHandler { + + /** + * Receive notification of a charset at-rule. + * + * @param characterEncoding the character encoding + * @param locator the SAC locator + * @throws CSSException Any CSS exception, possibly wrapping another + * exception. + */ + void charset(String characterEncoding, Locator locator) throws CSSException; + + /** + * Receive notification of a import statement in the style sheet. + * + * @param uri The URI of the imported style sheet. + * @param media The intended destination media for style information. + * @param defaultNamespaceURI The default namespace URI for the imported + * style sheet. + * @param locator the SAC locator + * @exception CSSException Any CSS exception, possibly wrapping another + * exception. + */ + void importStyle(String uri, SACMediaList media, + String defaultNamespaceURI, Locator locator) throws CSSException; + + /** + * Receive notification of an unknown rule t-rule not supported by this + * parser. + * + * @param atRule The complete ignored at-rule. + * @param locator the SAC locator + * @exception CSSException Any CSS exception, possibly wrapping another + * exception. + */ + void ignorableAtRule(String atRule, Locator locator) throws CSSException; + + /** + * Receive notification of the beginning of a font face statement. + * + * The Parser will invoke this method at the beginning of every font face + * statement in the style sheet. there will be a corresponding endFontFace() + * event for every startFontFace() event. + * + * @param locator the SAC locator + * @exception CSSException Any CSS exception, possibly wrapping another + * exception. + */ + void startFontFace(Locator locator) throws CSSException; + + /** + * Receive notification of the beginning of a page statement. + * + * The Parser will invoke this method at the beginning of every page + * statement in the style sheet. there will be a corresponding endPage() + * event for every startPage() event. + * + * @param name the name of the page (if any, null otherwise) + * @param pseudoPage the pseudo page (if any, null otherwise) + * @param locator the SAC locator + * @exception CSSException Any CSS exception, possibly wrapping another + * exception. + */ + void startPage(String name, String pseudoPage, Locator locator) throws CSSException; + + /** + * Receive notification of the beginning of a media statement. + * + * The Parser will invoke this method at the beginning of every media + * statement in the style sheet. there will be a corresponding endMedia() + * event for every startElement() event. + * + * @param media The intended destination media for style information. + * @param locator the SAC locator + * @exception CSSException Any CSS exception, possibly wrapping another + * exception. + */ + void startMedia(SACMediaList media, Locator locator) throws CSSException; + + /** + * Receive notification of the beginning of a rule statement. + * + * @param selectors All intended selectors for all declarations. + * @param locator the SAC locator + * @exception CSSException Any CSS exception, possibly wrapping another + * exception. + */ + void startSelector(SelectorList selectors, Locator locator) throws CSSException; + + /** + * Receive notification of a declaration. + * + * @param name the name of the property. + * @param value the value of the property. All whitespace are stripped. + * @param important is this property important ? + * @param locator the SAC locator + */ + void property(String name, LexicalUnit value, boolean important, Locator locator); +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/sac/SelectorFactoryAdapter.java b/fine-cssparser/src/com/fr/third/steadystate/css/sac/SelectorFactoryAdapter.java new file mode 100644 index 000000000..88e5066a8 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/sac/SelectorFactoryAdapter.java @@ -0,0 +1,124 @@ +/* + * 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.sac; + +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.CharacterDataSelector; +import org.w3c.css.sac.Condition; +import org.w3c.css.sac.ConditionalSelector; +import org.w3c.css.sac.DescendantSelector; +import org.w3c.css.sac.ElementSelector; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.NegativeSelector; +import org.w3c.css.sac.ProcessingInstructionSelector; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SelectorFactory; +import org.w3c.css.sac.SiblingSelector; +import org.w3c.css.sac.SimpleSelector; + +/** + * Implementation of the SelectorFactoryExt interface that maps calls back to a + * native sac SelectorFactory. + */ +public class SelectorFactoryAdapter implements SelectorFactoryExt { + + private final SelectorFactory selectorFactory_; + + public SelectorFactoryAdapter(final SelectorFactory selectorFactory) { + selectorFactory_ = selectorFactory; + } + + public ConditionalSelector createConditionalSelector(final SimpleSelector selector, final Condition condition) + throws CSSException { + return selectorFactory_.createConditionalSelector(selector, condition); + } + + public SimpleSelector createAnyNodeSelector() throws CSSException { + return selectorFactory_.createAnyNodeSelector(); + } + + public SimpleSelector createRootNodeSelector() throws CSSException { + return selectorFactory_.createRootNodeSelector(); + } + + public NegativeSelector createNegativeSelector(final SimpleSelector selector) + throws CSSException { + return selectorFactory_.createNegativeSelector(selector); + } + + public ElementSelector createElementSelector(final String namespaceURI, final String tagName) + throws CSSException { + return selectorFactory_.createElementSelector(namespaceURI, tagName); + } + + public CharacterDataSelector createTextNodeSelector(final String data) throws CSSException { + return selectorFactory_.createTextNodeSelector(data); + } + + public CharacterDataSelector createCDataSectionSelector(final String data) throws CSSException { + return selectorFactory_.createCDataSectionSelector(data); + } + + public ProcessingInstructionSelector createProcessingInstructionSelector(final String target, final String data) + throws CSSException { + return selectorFactory_.createProcessingInstructionSelector(target, data); + } + + public CharacterDataSelector createCommentSelector(final String data) throws CSSException { + return selectorFactory_.createCommentSelector(data); + } + + public ElementSelector createPseudoElementSelector(final String namespaceURI, final String pseudoName) + throws CSSException { + return selectorFactory_.createPseudoElementSelector(namespaceURI, pseudoName); + } + + public DescendantSelector createDescendantSelector(final Selector parent, final SimpleSelector descendant) + throws CSSException { + return selectorFactory_.createDescendantSelector(parent, descendant); + } + + public DescendantSelector createChildSelector(final Selector parent, final SimpleSelector child) + throws CSSException { + return selectorFactory_.createChildSelector(parent, child); + } + + public SiblingSelector createDirectAdjacentSelector(final short nodeType, final Selector child, + final SimpleSelector directAdjacent) throws CSSException { + return selectorFactory_.createDirectAdjacentSelector(nodeType, child, directAdjacent); + } + + public ElementSelector createElementSelector(final String namespaceURI, final String tagName, + final Locator locator) throws CSSException { + return selectorFactory_.createElementSelector(namespaceURI, tagName); + } + + public ElementSelector createPseudoElementSelector(final String namespaceURI, final String pseudoName, + final Locator locator, final boolean doubleColon) throws CSSException { + return selectorFactory_.createPseudoElementSelector(namespaceURI, pseudoName); + } + + public ElementSelector createSyntheticElementSelector() throws CSSException { + return null; + } + + public SiblingSelector createGeneralAdjacentSelector( + final short nodeType, + final Selector child, + final SimpleSelector directAdjacent) throws CSSException { + return null; + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/sac/SelectorFactoryExt.java b/fine-cssparser/src/com/fr/third/steadystate/css/sac/SelectorFactoryExt.java new file mode 100644 index 000000000..85cf2804a --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/sac/SelectorFactoryExt.java @@ -0,0 +1,44 @@ +/* + * 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.sac; + +import org.w3c.css.sac.CSSException; +import org.w3c.css.sac.ElementSelector; +import org.w3c.css.sac.Locator; +import org.w3c.css.sac.Selector; +import org.w3c.css.sac.SelectorFactory; +import org.w3c.css.sac.SiblingSelector; +import org.w3c.css.sac.SimpleSelector; + +/** + * Extension of the SelectorFactory interface. + * This was added to support the locator parameter to + * inform about the code position. + */ +public interface SelectorFactoryExt extends SelectorFactory { + + ElementSelector createElementSelector(String namespaceURI, String tagName, Locator locator) + throws CSSException; + + ElementSelector createPseudoElementSelector(String namespaceURI, String pseudoName, + Locator locator, boolean doubleColon) + throws CSSException; + + ElementSelector createSyntheticElementSelector() throws CSSException; + + SiblingSelector createGeneralAdjacentSelector(short nodeType, Selector child, SimpleSelector directAdjacent) + throws CSSException; +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/userdata/UserDataConstants.java b/fine-cssparser/src/com/fr/third/steadystate/css/userdata/UserDataConstants.java new file mode 100644 index 000000000..d618dd836 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/userdata/UserDataConstants.java @@ -0,0 +1,25 @@ +/* + * 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.userdata; + +public final class UserDataConstants { + + private static final String KEY_PREFIX = UserDataConstants.class.getPackage().getName(); + public static final String KEY_LOCATOR = KEY_PREFIX + ".locator"; + + private UserDataConstants() { + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/util/LangUtils.java b/fine-cssparser/src/com/fr/third/steadystate/css/util/LangUtils.java new file mode 100644 index 000000000..cb13f3339 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/util/LangUtils.java @@ -0,0 +1,66 @@ +/* + * 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.util; + +import java.util.List; + +public final class LangUtils { + public static final int HASH_SEED = 17; + public static final int HASH_OFFSET = 37; + + private LangUtils() { + } + + public static int hashCode(final int seed, final int hashcode) { + return seed * HASH_OFFSET + hashcode; + } + + public static int hashCode(final int seed, final boolean b) { + return hashCode(seed, b ? 1 : 0); + } + + public static int hashCode(final int seed, final Object obj) { + return hashCode(seed, obj != null ? obj.hashCode() : 0); + } + + public static String join(final List values, String separator) { + if (values == null) { + return null; + } + if (separator == null) { + separator = ""; + } + + boolean isFirst = true; + final StringBuilder result = new StringBuilder(); + for (String part : values) { + if (part != null && part.length() > 0) { + if (isFirst) { + isFirst = false; + } + else { + result.append(separator); + } + result.append(part); + } + } + return result.toString(); + } + + public static boolean equals(final Object obj1, final Object obj2) { + return obj1 == null ? obj2 == null : obj1.equals(obj2); + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/util/Output.java b/fine-cssparser/src/com/fr/third/steadystate/css/util/Output.java new file mode 100644 index 000000000..eb2eafb4b --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/util/Output.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.util; + +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.Writer; + +/** + * A simple helper to write formated to a writer. + * + * @author rbri + */ +public final class Output { + private static final String NEW_LINE = System.getProperty("line.separator"); + + private Writer writer_; + private StringBuffer currentIndent_; + private boolean afterNewLine_; + private final String indent_; + + /** + * Constructor. + * + * @param aWriter the writer to write to + * @param anIndent String to be used for indenting (e.g. "", " ", " ", "\t") + */ + public Output(final Writer aWriter, final String anIndent) { + writer_ = new BufferedWriter(aWriter); + indent_ = anIndent; + currentIndent_ = new StringBuffer(); + } + + /** + * Write the char. + * + * @param aChar the char to be written + * @return this (for convenience) + * @throws IOException in case of problems + */ + public Output print(final char aChar) throws IOException { + writeIndentIfNeeded(); + writer_.write(aChar); + return this; + } + + /** + * Write the String. + * + * @param aString the string to be written + * @return this (for convenience) + * @throws IOException in case of problems + */ + public Output print(final String aString) throws IOException { + if (null != aString) { + writeIndentIfNeeded(); + writer_.write(aString); + } + return this; + } + + /** + * Write the string on a new line. + * + * @param aString the string to be written + * @return this (for convenience) + * @throws IOException in case of problems + */ + public Output println(final String aString) throws IOException { + writeIndentIfNeeded(); + writer_.write(aString); + writer_.write(NEW_LINE); + afterNewLine_ = true; + return this; + } + + /** + * Start a newline. + * + * @return this (for convenience) + * @throws IOException in case of problems + */ + public Output println() throws IOException { + writer_.write(NEW_LINE); + afterNewLine_ = true; + return this; + } + + /** + * Flushes the output. + * + * @return this (for convenience) + * @throws IOException in case of error + */ + public Output flush() throws IOException { + writer_.flush(); + return this; + } + + /** + * Indent the following. + * + * @return this (for convenience) + */ + public Output indent() { + currentIndent_.append(indent_); + return this; + } + + /** + * Clear the indent. + * + * @return this (for convenience) + */ + public Output unindent() { + currentIndent_.setLength(Math.max(0, currentIndent_.length() - indent_.length())); + return this; + } + + /** + * Helper to write a newline. + * + * @throws IOException + * in case of problems + */ + private void writeIndentIfNeeded() throws IOException { + if (afterNewLine_) { + writer_.write(currentIndent_.toString()); + afterNewLine_ = false; + } + } +} diff --git a/fine-cssparser/src/com/fr/third/steadystate/css/util/ThrowCssExceptionErrorHandler.java b/fine-cssparser/src/com/fr/third/steadystate/css/util/ThrowCssExceptionErrorHandler.java new file mode 100644 index 000000000..dbea98197 --- /dev/null +++ b/fine-cssparser/src/com/fr/third/steadystate/css/util/ThrowCssExceptionErrorHandler.java @@ -0,0 +1,57 @@ +/* + * 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.util; + +import java.io.Serializable; + +import org.w3c.css.sac.CSSParseException; +import org.w3c.css.sac.ErrorHandler; + +/** + * Helper implementation of {@link ErrorHandler}, which throws CssException in case of problems. + * + * @author rbri + * @see ErrorHandler + */ +public class ThrowCssExceptionErrorHandler implements ErrorHandler, Serializable { + private static final long serialVersionUID = -3933638774901855095L; + + /** + * Singleton. + */ + public static final ThrowCssExceptionErrorHandler INSTANCE = new ThrowCssExceptionErrorHandler(); + + /** + * {@inheritDoc} + */ + public void error(final CSSParseException exception) { + throw exception; + } + + /** + * {@inheritDoc} + */ + public void fatalError(final CSSParseException exception) { + throw exception; + } + + /** + * {@inheritDoc} + */ + public void warning(final CSSParseException exception) { + // ignore warnings + } +} From 5bc7dda82bd15cb33ae406a7c0f73b6f1e98466f Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 15 Mar 2018 18:15:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-6935=20=E6=89=93=E5=8C=85=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../steadystate/css/parser/CSSOMParser.java | 43 +++++++++---------- .../steadystate/css/parser/SACParserCSS1.java | 7 ++- .../steadystate/css/parser/SACParserCSS2.java | 3 +- .../css/parser/SACParserCSS21.java | 3 +- .../steadystate/css/parser/SACParserCSS3.java | 13 +++--- 5 files changed, 32 insertions(+), 37 deletions(-) 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 index 88a7e6516..383e9b74f 100644 --- a/fine-cssparser/src/com/fr/third/steadystate/css/parser/CSSOMParser.java +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/CSSOMParser.java @@ -15,14 +15,22 @@ 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.CSSCharsetRuleImpl; +import com.fr.third.steadystate.css.dom.CSSFontFaceRuleImpl; import com.fr.third.steadystate.css.dom.CSSImportRuleImpl; +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.sac.DocumentHandlerExt; +import com.fr.third.steadystate.css.userdata.UserDataConstants; import org.w3c.css.sac.CSSException; import org.w3c.css.sac.ErrorHandler; import org.w3c.css.sac.InputSource; @@ -39,20 +47,11 @@ 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; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Stack; +import java.util.logging.Logger; /** * @author David Schweinsberg @@ -60,7 +59,7 @@ import com.fr.third.steadystate.css.userdata.UserDataConstants; public class CSSOMParser { private static final Object LOCK = new Object(); - private static final String DEFAULT_PARSER = "com.steadystate.css.parser.SACParserCSS21"; + private static final String DEFAULT_PARSER = "com.fr.third.steadystate.css.parser.SACParserCSS21"; private static String LastFailed_; @@ -102,7 +101,7 @@ public class CSSOMParser { } } catch (final Exception e) { - final Logger log = Logger.getLogger("com.steadystate.css"); + final Logger log = Logger.getLogger("com.fr.third.steadystate.css"); log.warning(e.toString()); log.warning("using the default 'SACParserCSS21' instead"); log.throwing("CSSOMParser", "consturctor", e); 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 index 7438371b2..ae859ba58 100644 --- a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS1.java +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS1.java @@ -6,7 +6,6 @@ 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; @@ -619,7 +618,7 @@ throw toCSSParseException("invalidSelector", e); break; } case HASH:{ -simpleSel = ((com.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelectorFactory()).createSyntheticElementSelector(); +simpleSel = ((com.fr.third.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelectorFactory()).createSyntheticElementSelector(); c = hash(c); switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case DOT:{ @@ -644,7 +643,7 @@ simpleSel = ((com.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelec break; } case DOT:{ -simpleSel = ((com.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelectorFactory()).createSyntheticElementSelector(); +simpleSel = ((com.fr.third.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelectorFactory()).createSyntheticElementSelector(); c = _class(c); switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { case LINK_PSCLASS: @@ -662,7 +661,7 @@ simpleSel = ((com.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelec case LINK_PSCLASS: case VISITED_PSCLASS: case ACTIVE_PSCLASS:{ -simpleSel = ((com.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelectorFactory()).createSyntheticElementSelector(); +simpleSel = ((com.fr.third.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelectorFactory()).createSyntheticElementSelector(); c = pseudoClass(c); break; } 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 index f6e160d90..8fa4e67c0 100644 --- a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS2.java +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS2.java @@ -6,7 +6,6 @@ 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; @@ -1265,7 +1264,7 @@ if (o instanceof Condition) case COLON: case LSQUARE: case HASH:{ -simpleSel = ((com.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelectorFactory()).createSyntheticElementSelector(); +simpleSel = ((com.fr.third.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelectorFactory()).createSyntheticElementSelector(); label_41: while (true) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 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 index 695ea2295..1bbfe713d 100644 --- a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS21.java +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS21.java @@ -6,7 +6,6 @@ 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; @@ -1133,7 +1132,7 @@ if (o instanceof Condition) case COLON: case LSQUARE: case HASH:{ -simpleSel = ((com.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelectorFactory()).createSyntheticElementSelector(); +simpleSel = ((com.fr.third.steadystate.css.parser.selectors.SelectorFactoryImpl) getSelectorFactory()).createSyntheticElementSelector(); label_32: while (true) { switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 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 index 01f16243b..7a13da52b 100644 --- a/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS3.java +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/SACParserCSS3.java @@ -2,9 +2,6 @@ /* 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; @@ -14,11 +11,13 @@ 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; +import java.util.LinkedList; +import java.util.Locale; + /** * @author David Schweinsberg * @author waldbaer @@ -1797,15 +1796,15 @@ Condition c = null; c = getConditionFactory().createBeginHyphenAttributeCondition(name, null, null != value, value); break; case 4: - c = ((com.steadystate.css.parser.selectors.ConditionFactoryImpl) getConditionFactory()) + c = ((com.fr.third.steadystate.css.parser.selectors.ConditionFactoryImpl) getConditionFactory()) .createPrefixAttributeCondition(name, null, null != value, value); break; case 5: - c = ((com.steadystate.css.parser.selectors.ConditionFactoryImpl) getConditionFactory()) + c = ((com.fr.third.steadystate.css.parser.selectors.ConditionFactoryImpl) getConditionFactory()) .createSuffixAttributeCondition(name, null, null != value, value); break; case 6: - c = ((com.steadystate.css.parser.selectors.ConditionFactoryImpl) getConditionFactory()) + c = ((com.fr.third.steadystate.css.parser.selectors.ConditionFactoryImpl) getConditionFactory()) .createSubstringAttributeCondition(name, null, null != value, value); break; } From c102cfcb0bf42bd1b012d52f9b5d56200aa46d5d Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 15 Mar 2018 18:18:27 +0800 Subject: [PATCH 3/3] rt --- .../steadystate/css/dom/DOMExceptionImpl.java | 6 ++-- .../css/parser/AbstractSACParser.java | 33 +++++++++---------- 2 files changed, 19 insertions(+), 20 deletions(-) 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 index 5e8318c1f..ad1143866 100644 --- a/fine-cssparser/src/com/fr/third/steadystate/css/dom/DOMExceptionImpl.java +++ b/fine-cssparser/src/com/fr/third/steadystate/css/dom/DOMExceptionImpl.java @@ -15,11 +15,11 @@ package com.fr.third.steadystate.css.dom; +import org.w3c.dom.DOMException; + import java.util.Locale; import java.util.ResourceBundle; -import org.w3c.dom.DOMException; - /** * Custom {@link DOMException} extension. * @@ -54,7 +54,7 @@ public class DOMExceptionImpl extends DOMException { private static ResourceBundle ExceptionResource_ = ResourceBundle.getBundle( - "com.steadystate.css.parser.ExceptionResource", + "com.fr.third.steadystate.css.parser.ExceptionResource", Locale.getDefault()); public DOMExceptionImpl(final short code, final int messageKey) { 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 index 1d18bed73..ef73e0daf 100644 --- a/fine-cssparser/src/com/fr/third/steadystate/css/parser/AbstractSACParser.java +++ b/fine-cssparser/src/com/fr/third/steadystate/css/parser/AbstractSACParser.java @@ -15,16 +15,14 @@ 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.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.SelectorFactoryAdapter; +import com.fr.third.steadystate.css.sac.SelectorFactoryExt; import org.w3c.css.sac.CSSParseException; import org.w3c.css.sac.ConditionFactory; import org.w3c.css.sac.DocumentHandler; @@ -39,13 +37,14 @@ 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; +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; /** * Base implementation of {@link Parser}. @@ -155,7 +154,7 @@ abstract class AbstractSACParser implements SACParser { if (sacParserMessages_ == null) { try { sacParserMessages_ = ResourceBundle.getBundle( - "com.steadystate.css.parser.SACParserMessages", + "com.fr.third.steadystate.css.parser.SACParserMessages", getLocale()); } catch (final MissingResourceException e) {