You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Parser.java 247KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524
  1. /*
  2. * Copyright 2000-2013 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. /* Generated By:JavaCC: Do not edit this line. Parser.java */
  17. package com.vaadin.sass.internal.parser;
  18. import java.io.*;
  19. import java.net.*;
  20. import java.util.ArrayList;
  21. import java.util.Locale;
  22. import java.util.Map;
  23. import java.util.UUID;
  24. import org.w3c.css.sac.ConditionFactory;
  25. import org.w3c.css.sac.Condition;
  26. import org.w3c.css.sac.SelectorFactory;
  27. import org.w3c.css.sac.SelectorList;
  28. import org.w3c.css.sac.Selector;
  29. import org.w3c.css.sac.SimpleSelector;
  30. import org.w3c.css.sac.DocumentHandler;
  31. import org.w3c.css.sac.InputSource;
  32. import org.w3c.css.sac.ErrorHandler;
  33. import org.w3c.css.sac.CSSException;
  34. import org.w3c.css.sac.CSSParseException;
  35. import org.w3c.css.sac.Locator;
  36. import org.w3c.css.sac.LexicalUnit;
  37. import org.w3c.flute.parser.selectors.SelectorFactoryImpl;
  38. import org.w3c.flute.parser.selectors.ConditionFactoryImpl;
  39. import org.w3c.flute.util.Encoding;
  40. import com.vaadin.sass.internal.handler.*;
  41. import com.vaadin.sass.internal.tree.*;
  42. /**
  43. * A CSS2 parser
  44. *
  45. * @author Philippe Le H�garet
  46. * @version $Revision: 1.15 $
  47. */
  48. public class Parser implements org.w3c.css.sac.Parser, ParserConstants {
  49. // replaces all \t, \n, etc with this StringBuffer.
  50. static final StringBuilder SPACE = new StringBuilder(" ");
  51. // the document handler for the parser
  52. protected SCSSDocumentHandlerImpl documentHandler;
  53. // the error handler for the parser
  54. protected ErrorHandler errorHandler;
  55. // the input source for the parser
  56. protected InputSource source;
  57. protected ConditionFactory conditionFactory;
  58. protected SelectorFactory selectorFactory;
  59. // temporary place holder for pseudo-element ...
  60. private String pseudoElt;
  61. /**
  62. * Creates a new Parser
  63. */
  64. public Parser() {
  65. this((CharStream) null);
  66. }
  67. /**
  68. * @@TODO
  69. * @exception CSSException
  70. * Not yet implemented
  71. */
  72. public void setLocale(Locale locale) throws CSSException {
  73. throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR);
  74. }
  75. public InputSource getInputSource() {
  76. return source;
  77. }
  78. /**
  79. * Set the document handler for this parser
  80. */
  81. public void setDocumentHandler(DocumentHandler handler) {
  82. documentHandler = (SCSSDocumentHandlerImpl) handler;
  83. }
  84. public void setSelectorFactory(SelectorFactory selectorFactory) {
  85. this.selectorFactory = selectorFactory;
  86. }
  87. public void setConditionFactory(ConditionFactory conditionFactory) {
  88. this.conditionFactory = conditionFactory;
  89. }
  90. /**
  91. * Set the error handler for this parser
  92. */
  93. public void setErrorHandler(ErrorHandler error) {
  94. errorHandler = error;
  95. }
  96. /**
  97. * Main parse methods
  98. *
  99. * @param source
  100. * the source of the style sheet.
  101. * @exception IOException
  102. * the source can't be parsed.
  103. * @exception CSSException
  104. * the source is not CSS valid.
  105. */
  106. public void parseStyleSheet(InputSource source) throws CSSException,
  107. IOException {
  108. this.source = source;
  109. ReInit(getCharStreamWithLurk(source));
  110. if (selectorFactory == null) {
  111. selectorFactory = new SelectorFactoryImpl();
  112. }
  113. if (conditionFactory == null) {
  114. conditionFactory = new ConditionFactoryImpl();
  115. }
  116. parserUnit();
  117. }
  118. /**
  119. * Convenient method for URIs.
  120. *
  121. * @param systemId
  122. * the fully resolved URI of the style sheet.
  123. * @exception IOException
  124. * the source can't be parsed.
  125. * @exception CSSException
  126. * the source is not CSS valid.
  127. */
  128. public void parseStyleSheet(String systemId) throws CSSException,
  129. IOException {
  130. parseStyleSheet(new InputSource(systemId));
  131. }
  132. /**
  133. * This method parses only one rule (style rule or at-rule, except
  134. * @charset).
  135. *
  136. * @param source
  137. * the source of the rule.
  138. * @exception IOException
  139. * the source can't be parsed.
  140. * @exception CSSException
  141. * the source is not CSS valid.
  142. */
  143. public void parseRule(InputSource source) throws CSSException, IOException {
  144. this.source = source;
  145. ReInit(getCharStreamWithLurk(source));
  146. if (selectorFactory == null) {
  147. selectorFactory = new SelectorFactoryImpl();
  148. }
  149. if (conditionFactory == null) {
  150. conditionFactory = new ConditionFactoryImpl();
  151. }
  152. _parseRule();
  153. }
  154. /**
  155. * This method parses a style declaration (including the surrounding curly
  156. * braces).
  157. *
  158. * @param source
  159. * the source of the style declaration.
  160. * @exception IOException
  161. * the source can't be parsed.
  162. * @exception CSSException
  163. * the source is not CSS valid.
  164. */
  165. public void parseStyleDeclaration(InputSource source) throws CSSException,
  166. IOException {
  167. this.source = source;
  168. ReInit(getCharStreamWithLurk(source));
  169. if (selectorFactory == null) {
  170. selectorFactory = new SelectorFactoryImpl();
  171. }
  172. if (conditionFactory == null) {
  173. conditionFactory = new ConditionFactoryImpl();
  174. }
  175. _parseDeclarationBlock();
  176. }
  177. /**
  178. * This methods returns "http://www.w3.org/TR/REC-CSS2".
  179. *
  180. * @return the string "http://www.w3.org/TR/REC-CSS2".
  181. */
  182. public String getParserVersion() {
  183. return "http://www.w3.org/TR/REC-CSS2";
  184. }
  185. /**
  186. * Parse methods used by DOM Level 2 implementation.
  187. */
  188. public void parseImportRule(InputSource source) throws CSSException,
  189. IOException {
  190. this.source = source;
  191. ReInit(getCharStreamWithLurk(source));
  192. if (selectorFactory == null) {
  193. selectorFactory = new SelectorFactoryImpl();
  194. }
  195. if (conditionFactory == null) {
  196. conditionFactory = new ConditionFactoryImpl();
  197. }
  198. _parseImportRule();
  199. }
  200. public void parseMediaRule(InputSource source) throws CSSException,
  201. IOException {
  202. this.source = source;
  203. ReInit(getCharStreamWithLurk(source));
  204. if (selectorFactory == null) {
  205. selectorFactory = new SelectorFactoryImpl();
  206. }
  207. if (conditionFactory == null) {
  208. conditionFactory = new ConditionFactoryImpl();
  209. }
  210. _parseMediaRule();
  211. }
  212. public SelectorList parseSelectors(InputSource source) throws CSSException,
  213. IOException {
  214. this.source = source;
  215. ReInit(getCharStreamWithLurk(source));
  216. return null;
  217. }
  218. public LexicalUnit parsePropertyValue(InputSource source)
  219. throws CSSException, IOException {
  220. this.source = source;
  221. ReInit(getCharStreamWithLurk(source));
  222. return expr();
  223. }
  224. public boolean parsePriority(InputSource source) throws CSSException,
  225. IOException {
  226. this.source = source;
  227. ReInit(getCharStreamWithLurk(source));
  228. return prio();
  229. }
  230. /**
  231. * Convert the source into a Reader. Used only by DOM Level 2 parser
  232. * methods.
  233. */
  234. private Reader getReader(InputSource source) throws IOException {
  235. if (source.getCharacterStream() != null) {
  236. return source.getCharacterStream();
  237. } else if (source.getByteStream() != null) {
  238. // My DOM level 2 implementation doesn't use this case.
  239. if (source.getEncoding() == null) {
  240. // unknown encoding, use ASCII as default.
  241. return new InputStreamReader(source.getByteStream(), "ASCII");
  242. } else {
  243. return new InputStreamReader(source.getByteStream(),
  244. source.getEncoding());
  245. }
  246. } else {
  247. // systemId
  248. // @@TODO
  249. throw new CSSException("not yet implemented");
  250. }
  251. }
  252. /**
  253. * Convert the source into a CharStream with encoding informations. The
  254. * encoding can be found in the InputSource or in the CSS document. Since
  255. * this method marks the reader and make a reset after looking for the
  256. * charset declaration, you'll find the charset declaration into the stream.
  257. */
  258. private CharStream getCharStreamWithLurk(InputSource source)
  259. throws CSSException, IOException {
  260. if (source.getCharacterStream() != null) {
  261. // all encoding are supposed to be resolved by the user
  262. // return the reader
  263. return new Generic_CharStream(source.getCharacterStream(), 1, 1);
  264. } else if (source.getByteStream() == null) {
  265. // @@CONTINUE ME. see also getReader() with systemId
  266. try {
  267. source.setByteStream(new URL(source.getURI()).openStream());
  268. } catch (Exception e) {
  269. try {
  270. source.setByteStream(new FileInputStream(source.getURI()));
  271. } catch (IOException ex) {
  272. throw new CSSException("invalid url ?");
  273. }
  274. }
  275. }
  276. // use UTF-8 as the default encoding.
  277. String encoding = source.getEncoding();
  278. InputStream input = source.getByteStream();
  279. if (!input.markSupported()) {
  280. // If mark is not supported, wrap it in a stream which supports mark
  281. input = new BufferedInputStream(input);
  282. source.setByteStream(input);
  283. }
  284. // Mark either the original stream or the wrapped stream
  285. input.mark(100);
  286. if (encoding == null) {
  287. encoding = "ASCII";
  288. char c = ' ';
  289. c = (char) input.read();
  290. if (c == '@') {
  291. // hum, is it a charset ?
  292. int size = 100;
  293. byte[] buf = new byte[size];
  294. input.read(buf, 0, 7);
  295. String keyword = new String(buf, 0, 7);
  296. if (keyword.equals("charset")) {
  297. // Yes, this is the charset declaration !
  298. // here I don't use the right declaration : white space are
  299. // ' '.
  300. while ((c = (char) input.read()) == ' ') {
  301. // find the first quote
  302. }
  303. char endChar = c;
  304. int i = 0;
  305. if ((endChar != '"') && (endChar != '\u005c'')) {
  306. // hum this is not a quote.
  307. throw new CSSException("invalid charset declaration");
  308. }
  309. while ((c = (char) input.read()) != endChar) {
  310. buf[i++] = (byte) c;
  311. if (i == size) {
  312. byte[] old = buf;
  313. buf = new byte[size + 100];
  314. System.arraycopy(old, 0, buf, 0, size);
  315. size += 100;
  316. }
  317. }
  318. while ((c = (char) input.read()) == ' ') {
  319. // find the next relevant character
  320. }
  321. if (c != ';') {
  322. // no semi colon at the end ?
  323. throw new CSSException("invalid charset declaration: "
  324. + "missing semi colon");
  325. }
  326. encoding = new String(buf, 0, i);
  327. if (source.getEncoding() != null) {
  328. // compare the two encoding informations.
  329. // For example, I don't accept to have ASCII and after
  330. // UTF-8.
  331. // Is it really good ? That is the question.
  332. if (!encoding.equals(source.getEncoding())) {
  333. throw new CSSException(
  334. "invalid encoding information.");
  335. }
  336. }
  337. } // else no charset declaration available
  338. }
  339. }
  340. // ok set the real encoding of this source.
  341. source.setEncoding(encoding);
  342. // set the real reader of this source.
  343. source.setCharacterStream(new InputStreamReader(source.getByteStream(),
  344. Encoding.getJavaEncoding(encoding)));
  345. // reset the stream (leave the charset declaration in the stream).
  346. input.reset();
  347. return new Generic_CharStream(source.getCharacterStream(), 1, 1);
  348. }
  349. private LocatorImpl currentLocator;
  350. private Locator getLocator() {
  351. if (currentLocator == null) {
  352. currentLocator = new LocatorImpl(this);
  353. return currentLocator;
  354. }
  355. return currentLocator.reInit(this);
  356. }
  357. private LocatorImpl getLocator(Token save) {
  358. if (currentLocator == null) {
  359. currentLocator = new LocatorImpl(this, save);
  360. return currentLocator;
  361. }
  362. return currentLocator.reInit(this, save);
  363. }
  364. private void reportError(Locator l, Exception e) {
  365. if (errorHandler != null) {
  366. if (e instanceof ParseException) {
  367. // construct a clean error message.
  368. ParseException pe = (ParseException) e;
  369. if (pe.specialConstructor) {
  370. StringBuffer errorM = new StringBuffer();
  371. if (pe.currentToken != null) {
  372. errorM.append("encountered \u005c"").append(
  373. pe.currentToken.next);
  374. }
  375. errorM.append('"');
  376. if (pe.expectedTokenSequences.length != 0) {
  377. errorM.append(". Was expecting one of: ");
  378. for (int i = 0; i < pe.expectedTokenSequences.length; i++) {
  379. for (int j = 0; j < pe.expectedTokenSequences[i].length; j++) {
  380. int kind = pe.expectedTokenSequences[i][j];
  381. if (kind != S) {
  382. errorM.append(pe.tokenImage[kind]);
  383. errorM.append(' ');
  384. }
  385. }
  386. }
  387. }
  388. errorHandler.error(new CSSParseException(errorM.toString(),
  389. l, e));
  390. } else {
  391. errorHandler.error(new CSSParseException(e.getMessage(), l,
  392. e));
  393. }
  394. } else if (e == null) {
  395. errorHandler.error(new CSSParseException("error", l, null));
  396. } else {
  397. errorHandler.error(new CSSParseException(e.getMessage(), l, e));
  398. }
  399. }
  400. }
  401. private void reportWarningSkipText(Locator l, String text) {
  402. if (errorHandler != null && text != null) {
  403. errorHandler.warning(new CSSParseException("Skipping: " + text, l));
  404. }
  405. }
  406. /*
  407. * The grammar of CSS2
  408. */
  409. /**
  410. * The main entry for the parser.
  411. *
  412. * @exception ParseException
  413. * exception during the parse
  414. */
  415. final public void parserUnit() throws ParseException {
  416. try {
  417. documentHandler.startDocument(source);
  418. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  419. case CHARSET_SYM:
  420. charset();
  421. break;
  422. default:
  423. jj_la1[0] = jj_gen;
  424. ;
  425. }
  426. label_1: while (true) {
  427. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  428. case S:
  429. case CDO:
  430. case CDC:
  431. case ATKEYWORD:
  432. ;
  433. break;
  434. default:
  435. jj_la1[1] = jj_gen;
  436. break label_1;
  437. }
  438. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  439. case S:
  440. jj_consume_token(S);
  441. comments();
  442. break;
  443. case CDO:
  444. case CDC:
  445. case ATKEYWORD:
  446. ignoreStatement();
  447. break;
  448. default:
  449. jj_la1[2] = jj_gen;
  450. jj_consume_token(-1);
  451. throw new ParseException();
  452. }
  453. }
  454. label_2: while (true) {
  455. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  456. case IMPORT_SYM:
  457. ;
  458. break;
  459. default:
  460. jj_la1[3] = jj_gen;
  461. break label_2;
  462. }
  463. importDeclaration();
  464. label_3: while (true) {
  465. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  466. case CDO:
  467. case CDC:
  468. case ATKEYWORD:
  469. ;
  470. break;
  471. default:
  472. jj_la1[4] = jj_gen;
  473. break label_3;
  474. }
  475. ignoreStatement();
  476. label_4: while (true) {
  477. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  478. case S:
  479. ;
  480. break;
  481. default:
  482. jj_la1[5] = jj_gen;
  483. break label_4;
  484. }
  485. jj_consume_token(S);
  486. }
  487. }
  488. }
  489. afterImportDeclaration();
  490. jj_consume_token(0);
  491. } finally {
  492. documentHandler.endDocument(source);
  493. }
  494. }
  495. final public void charset() throws ParseException {
  496. Token n;
  497. try {
  498. jj_consume_token(CHARSET_SYM);
  499. label_5: while (true) {
  500. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  501. case S:
  502. ;
  503. break;
  504. default:
  505. jj_la1[6] = jj_gen;
  506. break label_5;
  507. }
  508. jj_consume_token(S);
  509. }
  510. n = jj_consume_token(STRING);
  511. label_6: while (true) {
  512. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  513. case S:
  514. ;
  515. break;
  516. default:
  517. jj_la1[7] = jj_gen;
  518. break label_6;
  519. }
  520. jj_consume_token(S);
  521. }
  522. jj_consume_token(SEMICOLON);
  523. } catch (ParseException e) {
  524. reportError(getLocator(e.currentToken.next), e);
  525. skipStatement();
  526. // reportWarningSkipText(getLocator(), skipStatement());
  527. } catch (Exception e) {
  528. reportError(getLocator(), e);
  529. skipStatement();
  530. // reportWarningSkipText(getLocator(), skipStatement());
  531. }
  532. }
  533. final public void afterImportDeclaration() throws ParseException {
  534. String ret;
  535. Locator l;
  536. label_7: while (true) {
  537. ;
  538. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  539. case DEBUG_SYM:
  540. case WARN_SYM:
  541. debuggingDirective();
  542. break;
  543. case MIXIN_SYM:
  544. mixinDirective();
  545. break;
  546. case EACH_SYM:
  547. case IF_SYM:
  548. controlDirective();
  549. break;
  550. case INCLUDE_SYM:
  551. includeDirective();
  552. break;
  553. case PLUS:
  554. case PRECEDES:
  555. case SIBLING:
  556. case LBRACKET:
  557. case ANY:
  558. case PARENT:
  559. case DOT:
  560. case COLON:
  561. case INTERPOLATION:
  562. case IDENT:
  563. case HASH:
  564. styleRule();
  565. break;
  566. case MEDIA_SYM:
  567. media();
  568. break;
  569. case PAGE_SYM:
  570. page();
  571. break;
  572. case FONT_FACE_SYM:
  573. fontFace();
  574. break;
  575. case KEY_FRAME_SYM:
  576. keyframes();
  577. break;
  578. default:
  579. jj_la1[8] = jj_gen;
  580. if (jj_2_1(2147483647)) {
  581. variable();
  582. } else {
  583. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  584. case VARIABLE:
  585. listModifyDirective();
  586. break;
  587. default:
  588. jj_la1[9] = jj_gen;
  589. l = getLocator();
  590. ret = skipStatement();
  591. if ((ret == null) || (ret.length() == 0)) {
  592. {
  593. if (true) {
  594. return;
  595. }
  596. }
  597. }
  598. if (ret.charAt(0) == '@') {
  599. documentHandler.unrecognizedRule(ret);
  600. } else {
  601. reportWarningSkipText(l, ret);
  602. }
  603. }
  604. }
  605. }
  606. label_8: while (true) {
  607. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  608. case CDO:
  609. case CDC:
  610. case ATKEYWORD:
  611. ;
  612. break;
  613. default:
  614. jj_la1[10] = jj_gen;
  615. break label_8;
  616. }
  617. ignoreStatement();
  618. label_9: while (true) {
  619. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  620. case S:
  621. ;
  622. break;
  623. default:
  624. jj_la1[11] = jj_gen;
  625. break label_9;
  626. }
  627. jj_consume_token(S);
  628. }
  629. }
  630. }
  631. }
  632. final public void ignoreStatement() throws ParseException {
  633. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  634. case CDO:
  635. jj_consume_token(CDO);
  636. break;
  637. case CDC:
  638. jj_consume_token(CDC);
  639. break;
  640. case ATKEYWORD:
  641. atRuleDeclaration();
  642. break;
  643. default:
  644. jj_la1[12] = jj_gen;
  645. jj_consume_token(-1);
  646. throw new ParseException();
  647. }
  648. }
  649. /**
  650. * The import statement
  651. *
  652. * @exception ParseException
  653. * exception during the parse
  654. */
  655. final public void importDeclaration() throws ParseException {
  656. Token n;
  657. String uri;
  658. MediaListImpl ml = new MediaListImpl();
  659. boolean isURL = false;
  660. try {
  661. jj_consume_token(IMPORT_SYM);
  662. label_10: while (true) {
  663. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  664. case S:
  665. ;
  666. break;
  667. default:
  668. jj_la1[13] = jj_gen;
  669. break label_10;
  670. }
  671. jj_consume_token(S);
  672. }
  673. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  674. case STRING:
  675. n = jj_consume_token(STRING);
  676. uri = convertStringIndex(n.image, 1, n.image.length() - 1);
  677. break;
  678. case URL:
  679. n = jj_consume_token(URL);
  680. isURL = true;
  681. uri = n.image.substring(4, n.image.length() - 1).trim();
  682. if ((uri.charAt(0) == '"') || (uri.charAt(0) == '\u005c'')) {
  683. uri = uri.substring(1, uri.length() - 1);
  684. }
  685. break;
  686. default:
  687. jj_la1[14] = jj_gen;
  688. jj_consume_token(-1);
  689. throw new ParseException();
  690. }
  691. label_11: while (true) {
  692. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  693. case S:
  694. ;
  695. break;
  696. default:
  697. jj_la1[15] = jj_gen;
  698. break label_11;
  699. }
  700. jj_consume_token(S);
  701. }
  702. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  703. case IDENT:
  704. mediaStatement(ml);
  705. break;
  706. default:
  707. jj_la1[16] = jj_gen;
  708. ;
  709. }
  710. jj_consume_token(SEMICOLON);
  711. label_12: while (true) {
  712. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  713. case S:
  714. ;
  715. break;
  716. default:
  717. jj_la1[17] = jj_gen;
  718. break label_12;
  719. }
  720. jj_consume_token(S);
  721. }
  722. if (ml.getLength() == 0) {
  723. // see section 6.3 of the CSS2 recommandation.
  724. ml.addItem("all");
  725. }
  726. documentHandler.importStyle(uri, ml, isURL);
  727. } catch (ParseException e) {
  728. reportError(getLocator(), e);
  729. skipStatement();
  730. // reportWarningSkipText(getLocator(), skipStatement());
  731. }
  732. }
  733. /**
  734. * @exception ParseException
  735. * exception during the parse
  736. */
  737. final public void keyframes() throws ParseException {
  738. Token n;
  739. boolean start = false;
  740. String keyframeName = null;
  741. String animationname = "";
  742. try {
  743. n = jj_consume_token(KEY_FRAME_SYM);
  744. label_13: while (true) {
  745. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  746. case S:
  747. ;
  748. break;
  749. default:
  750. jj_la1[18] = jj_gen;
  751. break label_13;
  752. }
  753. jj_consume_token(S);
  754. }
  755. keyframeName = n.image;
  756. label_14: while (true) {
  757. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  758. case IDENT:
  759. n = jj_consume_token(IDENT);
  760. animationname += n.image;
  761. break;
  762. case INTERPOLATION:
  763. n = jj_consume_token(INTERPOLATION);
  764. animationname += n.image;
  765. break;
  766. default:
  767. jj_la1[19] = jj_gen;
  768. jj_consume_token(-1);
  769. throw new ParseException();
  770. }
  771. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  772. case INTERPOLATION:
  773. case IDENT:
  774. ;
  775. break;
  776. default:
  777. jj_la1[20] = jj_gen;
  778. break label_14;
  779. }
  780. }
  781. label_15: while (true) {
  782. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  783. case S:
  784. ;
  785. break;
  786. default:
  787. jj_la1[21] = jj_gen;
  788. break label_15;
  789. }
  790. jj_consume_token(S);
  791. }
  792. start = true;
  793. documentHandler.startKeyFrames(keyframeName, animationname);
  794. jj_consume_token(LBRACE);
  795. label_16: while (true) {
  796. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  797. case S:
  798. ;
  799. break;
  800. default:
  801. jj_la1[22] = jj_gen;
  802. break label_16;
  803. }
  804. jj_consume_token(S);
  805. }
  806. label_17: while (true) {
  807. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  808. case TO:
  809. case FROM:
  810. case PERCENTAGE:
  811. ;
  812. break;
  813. default:
  814. jj_la1[23] = jj_gen;
  815. break label_17;
  816. }
  817. keyframeSelector();
  818. }
  819. jj_consume_token(RBRACE);
  820. label_18: while (true) {
  821. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  822. case S:
  823. ;
  824. break;
  825. default:
  826. jj_la1[24] = jj_gen;
  827. break label_18;
  828. }
  829. jj_consume_token(S);
  830. }
  831. } catch (ParseException e) {
  832. reportError(getLocator(), e);
  833. skipStatement();
  834. } finally {
  835. if (start) {
  836. documentHandler.endKeyFrames();
  837. }
  838. }
  839. }
  840. final public void keyframeSelector() throws ParseException {
  841. Token n;
  842. boolean start = false;
  843. try {
  844. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  845. case FROM:
  846. n = jj_consume_token(FROM);
  847. break;
  848. case TO:
  849. n = jj_consume_token(TO);
  850. break;
  851. case PERCENTAGE:
  852. n = jj_consume_token(PERCENTAGE);
  853. break;
  854. default:
  855. jj_la1[25] = jj_gen;
  856. jj_consume_token(-1);
  857. throw new ParseException();
  858. }
  859. label_19: while (true) {
  860. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  861. case S:
  862. ;
  863. break;
  864. default:
  865. jj_la1[26] = jj_gen;
  866. break label_19;
  867. }
  868. jj_consume_token(S);
  869. }
  870. jj_consume_token(LBRACE);
  871. label_20: while (true) {
  872. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  873. case S:
  874. ;
  875. break;
  876. default:
  877. jj_la1[27] = jj_gen;
  878. break label_20;
  879. }
  880. jj_consume_token(S);
  881. }
  882. start = true;
  883. documentHandler.startKeyframeSelector(n.image);
  884. label_21: while (true) {
  885. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  886. case PLUS:
  887. case PRECEDES:
  888. case SIBLING:
  889. case LBRACKET:
  890. case ANY:
  891. case PARENT:
  892. case DOT:
  893. case COLON:
  894. case INTERPOLATION:
  895. case INCLUDE_SYM:
  896. case DEBUG_SYM:
  897. case WARN_SYM:
  898. case EACH_SYM:
  899. case IF_SYM:
  900. case EXTEND_SYM:
  901. case MICROSOFT_RULE:
  902. case IDENT:
  903. case VARIABLE:
  904. case HASH:
  905. case MEDIA_SYM:
  906. case KEY_FRAME_SYM:
  907. ;
  908. break;
  909. default:
  910. jj_la1[28] = jj_gen;
  911. break label_21;
  912. }
  913. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  914. case PLUS:
  915. case PRECEDES:
  916. case SIBLING:
  917. case LBRACKET:
  918. case ANY:
  919. case PARENT:
  920. case DOT:
  921. case COLON:
  922. case INTERPOLATION:
  923. case INCLUDE_SYM:
  924. case DEBUG_SYM:
  925. case WARN_SYM:
  926. case EXTEND_SYM:
  927. case IDENT:
  928. case VARIABLE:
  929. case HASH:
  930. case MEDIA_SYM:
  931. case KEY_FRAME_SYM:
  932. ifContentStatement();
  933. break;
  934. case EACH_SYM:
  935. case IF_SYM:
  936. controlDirective();
  937. break;
  938. case MICROSOFT_RULE:
  939. microsoftExtension();
  940. break;
  941. default:
  942. jj_la1[29] = jj_gen;
  943. jj_consume_token(-1);
  944. throw new ParseException();
  945. }
  946. }
  947. jj_consume_token(RBRACE);
  948. label_22: while (true) {
  949. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  950. case S:
  951. ;
  952. break;
  953. default:
  954. jj_la1[30] = jj_gen;
  955. break label_22;
  956. }
  957. jj_consume_token(S);
  958. }
  959. } catch (ThrowedParseException e) {
  960. if (errorHandler != null) {
  961. LocatorImpl li = new LocatorImpl(this,
  962. e.e.currentToken.next.beginLine,
  963. e.e.currentToken.next.beginColumn - 1);
  964. reportError(li, e.e);
  965. }
  966. } catch (ParseException e) {
  967. reportError(getLocator(), e);
  968. skipStatement();
  969. // reportWarningSkipText(getLocator(), skipStatement());
  970. } catch (TokenMgrError e) {
  971. reportWarningSkipText(getLocator(), skipStatement());
  972. } finally {
  973. if (start) {
  974. documentHandler.endKeyframeSelector();
  975. }
  976. }
  977. }
  978. /**
  979. * @exception ParseException
  980. * exception during the parse
  981. */
  982. final public void media() throws ParseException {
  983. boolean start = false;
  984. String ret;
  985. MediaListImpl ml = new MediaListImpl();
  986. try {
  987. jj_consume_token(MEDIA_SYM);
  988. label_23: while (true) {
  989. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  990. case S:
  991. ;
  992. break;
  993. default:
  994. jj_la1[31] = jj_gen;
  995. break label_23;
  996. }
  997. jj_consume_token(S);
  998. }
  999. mediaStatement(ml);
  1000. start = true;
  1001. documentHandler.startMedia(ml);
  1002. jj_consume_token(LBRACE);
  1003. label_24: while (true) {
  1004. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1005. case S:
  1006. ;
  1007. break;
  1008. default:
  1009. jj_la1[32] = jj_gen;
  1010. break label_24;
  1011. }
  1012. jj_consume_token(S);
  1013. }
  1014. label_25: while (true) {
  1015. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1016. case CDO:
  1017. case LBRACE:
  1018. case DASHMATCH:
  1019. case INCLUDES:
  1020. case PLUS:
  1021. case MINUS:
  1022. case COMMA:
  1023. case SEMICOLON:
  1024. case PRECEDES:
  1025. case SIBLING:
  1026. case LBRACKET:
  1027. case ANY:
  1028. case PARENT:
  1029. case DOT:
  1030. case COLON:
  1031. case INTERPOLATION:
  1032. case NONASCII:
  1033. case DEBUG_SYM:
  1034. case WARN_SYM:
  1035. case STRING:
  1036. case IDENT:
  1037. case NUMBER:
  1038. case URL:
  1039. case PERCENTAGE:
  1040. case HASH:
  1041. case IMPORT_SYM:
  1042. case MEDIA_SYM:
  1043. case CHARSET_SYM:
  1044. case PAGE_SYM:
  1045. case FONT_FACE_SYM:
  1046. case ATKEYWORD:
  1047. case IMPORTANT_SYM:
  1048. case UNICODERANGE:
  1049. case FUNCTION:
  1050. case UNKNOWN:
  1051. ;
  1052. break;
  1053. default:
  1054. jj_la1[33] = jj_gen;
  1055. break label_25;
  1056. }
  1057. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1058. case DEBUG_SYM:
  1059. case WARN_SYM:
  1060. debuggingDirective();
  1061. break;
  1062. case PLUS:
  1063. case PRECEDES:
  1064. case SIBLING:
  1065. case LBRACKET:
  1066. case ANY:
  1067. case PARENT:
  1068. case DOT:
  1069. case COLON:
  1070. case INTERPOLATION:
  1071. case IDENT:
  1072. case HASH:
  1073. styleRule();
  1074. break;
  1075. case CDO:
  1076. case LBRACE:
  1077. case DASHMATCH:
  1078. case INCLUDES:
  1079. case MINUS:
  1080. case COMMA:
  1081. case SEMICOLON:
  1082. case NONASCII:
  1083. case STRING:
  1084. case NUMBER:
  1085. case URL:
  1086. case PERCENTAGE:
  1087. case IMPORT_SYM:
  1088. case MEDIA_SYM:
  1089. case CHARSET_SYM:
  1090. case PAGE_SYM:
  1091. case FONT_FACE_SYM:
  1092. case ATKEYWORD:
  1093. case IMPORTANT_SYM:
  1094. case UNICODERANGE:
  1095. case FUNCTION:
  1096. case UNKNOWN:
  1097. skipUnknownRule();
  1098. break;
  1099. default:
  1100. jj_la1[34] = jj_gen;
  1101. jj_consume_token(-1);
  1102. throw new ParseException();
  1103. }
  1104. }
  1105. jj_consume_token(RBRACE);
  1106. label_26: while (true) {
  1107. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1108. case S:
  1109. ;
  1110. break;
  1111. default:
  1112. jj_la1[35] = jj_gen;
  1113. break label_26;
  1114. }
  1115. jj_consume_token(S);
  1116. }
  1117. } catch (ParseException e) {
  1118. reportError(getLocator(), e);
  1119. skipStatement();
  1120. // reportWarningSkipText(getLocator(), skipStatement());
  1121. } finally {
  1122. if (start) {
  1123. documentHandler.endMedia(ml);
  1124. }
  1125. }
  1126. }
  1127. final public void mediaStatement(MediaListImpl ml) throws ParseException {
  1128. String m;
  1129. m = medium();
  1130. label_27: while (true) {
  1131. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1132. case COMMA:
  1133. ;
  1134. break;
  1135. default:
  1136. jj_la1[36] = jj_gen;
  1137. break label_27;
  1138. }
  1139. jj_consume_token(COMMA);
  1140. label_28: while (true) {
  1141. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1142. case S:
  1143. ;
  1144. break;
  1145. default:
  1146. jj_la1[37] = jj_gen;
  1147. break label_28;
  1148. }
  1149. jj_consume_token(S);
  1150. }
  1151. ml.addItem(m);
  1152. m = medium();
  1153. }
  1154. ml.addItem(m);
  1155. }
  1156. /**
  1157. * @exception ParseException
  1158. * exception during the parse
  1159. */
  1160. final public String medium() throws ParseException {
  1161. Token n;
  1162. n = jj_consume_token(IDENT);
  1163. label_29: while (true) {
  1164. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1165. case S:
  1166. ;
  1167. break;
  1168. default:
  1169. jj_la1[38] = jj_gen;
  1170. break label_29;
  1171. }
  1172. jj_consume_token(S);
  1173. }
  1174. {
  1175. if (true) {
  1176. return convertIdent(n.image);
  1177. }
  1178. }
  1179. throw new Error("Missing return statement in function");
  1180. }
  1181. /**
  1182. * @exception ParseException
  1183. * exception during the parse
  1184. */
  1185. final public void page() throws ParseException {
  1186. boolean start = false;
  1187. Token n = null;
  1188. String page = null;
  1189. String pseudo = null;
  1190. try {
  1191. jj_consume_token(PAGE_SYM);
  1192. label_30: while (true) {
  1193. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1194. case S:
  1195. ;
  1196. break;
  1197. default:
  1198. jj_la1[39] = jj_gen;
  1199. break label_30;
  1200. }
  1201. jj_consume_token(S);
  1202. }
  1203. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1204. case IDENT:
  1205. n = jj_consume_token(IDENT);
  1206. label_31: while (true) {
  1207. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1208. case S:
  1209. ;
  1210. break;
  1211. default:
  1212. jj_la1[40] = jj_gen;
  1213. break label_31;
  1214. }
  1215. jj_consume_token(S);
  1216. }
  1217. break;
  1218. default:
  1219. jj_la1[41] = jj_gen;
  1220. ;
  1221. }
  1222. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1223. case COLON:
  1224. pseudo = pseudo_page();
  1225. break;
  1226. default:
  1227. jj_la1[42] = jj_gen;
  1228. ;
  1229. }
  1230. if (n != null) {
  1231. page = convertIdent(n.image);
  1232. }
  1233. jj_consume_token(LBRACE);
  1234. label_32: while (true) {
  1235. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1236. case S:
  1237. ;
  1238. break;
  1239. default:
  1240. jj_la1[43] = jj_gen;
  1241. break label_32;
  1242. }
  1243. jj_consume_token(S);
  1244. }
  1245. start = true;
  1246. documentHandler.startPage(page, pseudo);
  1247. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1248. case INTERPOLATION:
  1249. case IDENT:
  1250. declaration();
  1251. break;
  1252. default:
  1253. jj_la1[44] = jj_gen;
  1254. ;
  1255. }
  1256. label_33: while (true) {
  1257. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1258. case SEMICOLON:
  1259. ;
  1260. break;
  1261. default:
  1262. jj_la1[45] = jj_gen;
  1263. break label_33;
  1264. }
  1265. jj_consume_token(SEMICOLON);
  1266. label_34: while (true) {
  1267. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1268. case S:
  1269. ;
  1270. break;
  1271. default:
  1272. jj_la1[46] = jj_gen;
  1273. break label_34;
  1274. }
  1275. jj_consume_token(S);
  1276. }
  1277. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1278. case INTERPOLATION:
  1279. case IDENT:
  1280. declaration();
  1281. break;
  1282. default:
  1283. jj_la1[47] = jj_gen;
  1284. ;
  1285. }
  1286. }
  1287. jj_consume_token(RBRACE);
  1288. label_35: while (true) {
  1289. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1290. case S:
  1291. ;
  1292. break;
  1293. default:
  1294. jj_la1[48] = jj_gen;
  1295. break label_35;
  1296. }
  1297. jj_consume_token(S);
  1298. }
  1299. } catch (ParseException e) {
  1300. if (errorHandler != null) {
  1301. LocatorImpl li = new LocatorImpl(this,
  1302. e.currentToken.next.beginLine,
  1303. e.currentToken.next.beginColumn - 1);
  1304. reportError(li, e);
  1305. skipStatement();
  1306. // reportWarningSkipText(li, skipStatement());
  1307. } else {
  1308. skipStatement();
  1309. }
  1310. } finally {
  1311. if (start) {
  1312. documentHandler.endPage(page, pseudo);
  1313. }
  1314. }
  1315. }
  1316. final public String pseudo_page() throws ParseException {
  1317. Token n;
  1318. jj_consume_token(COLON);
  1319. n = jj_consume_token(IDENT);
  1320. label_36: while (true) {
  1321. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1322. case S:
  1323. ;
  1324. break;
  1325. default:
  1326. jj_la1[49] = jj_gen;
  1327. break label_36;
  1328. }
  1329. jj_consume_token(S);
  1330. }
  1331. {
  1332. if (true) {
  1333. return convertIdent(n.image);
  1334. }
  1335. }
  1336. throw new Error("Missing return statement in function");
  1337. }
  1338. final public void fontFace() throws ParseException {
  1339. boolean start = false;
  1340. try {
  1341. jj_consume_token(FONT_FACE_SYM);
  1342. label_37: while (true) {
  1343. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1344. case S:
  1345. ;
  1346. break;
  1347. default:
  1348. jj_la1[50] = jj_gen;
  1349. break label_37;
  1350. }
  1351. jj_consume_token(S);
  1352. }
  1353. jj_consume_token(LBRACE);
  1354. label_38: while (true) {
  1355. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1356. case S:
  1357. ;
  1358. break;
  1359. default:
  1360. jj_la1[51] = jj_gen;
  1361. break label_38;
  1362. }
  1363. jj_consume_token(S);
  1364. }
  1365. start = true;
  1366. documentHandler.startFontFace();
  1367. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1368. case INTERPOLATION:
  1369. case IDENT:
  1370. declaration();
  1371. break;
  1372. default:
  1373. jj_la1[52] = jj_gen;
  1374. ;
  1375. }
  1376. label_39: while (true) {
  1377. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1378. case SEMICOLON:
  1379. ;
  1380. break;
  1381. default:
  1382. jj_la1[53] = jj_gen;
  1383. break label_39;
  1384. }
  1385. jj_consume_token(SEMICOLON);
  1386. label_40: while (true) {
  1387. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1388. case S:
  1389. ;
  1390. break;
  1391. default:
  1392. jj_la1[54] = jj_gen;
  1393. break label_40;
  1394. }
  1395. jj_consume_token(S);
  1396. }
  1397. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1398. case INTERPOLATION:
  1399. case IDENT:
  1400. declaration();
  1401. break;
  1402. default:
  1403. jj_la1[55] = jj_gen;
  1404. ;
  1405. }
  1406. }
  1407. jj_consume_token(RBRACE);
  1408. label_41: while (true) {
  1409. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1410. case S:
  1411. ;
  1412. break;
  1413. default:
  1414. jj_la1[56] = jj_gen;
  1415. break label_41;
  1416. }
  1417. jj_consume_token(S);
  1418. }
  1419. } catch (ParseException e) {
  1420. reportError(getLocator(), e);
  1421. skipStatement();
  1422. // reportWarningSkipText(getLocator(), skipStatement());
  1423. } finally {
  1424. if (start) {
  1425. documentHandler.endFontFace();
  1426. }
  1427. }
  1428. }
  1429. /**
  1430. * @exception ParseException
  1431. * exception during the parse
  1432. */
  1433. final public void atRuleDeclaration() throws ParseException {
  1434. Token n;
  1435. String ret;
  1436. n = jj_consume_token(ATKEYWORD);
  1437. ret = skipStatement();
  1438. if ((ret != null) && (ret.charAt(0) == '@')) {
  1439. documentHandler.unrecognizedRule(ret);
  1440. } else {
  1441. reportWarningSkipText(getLocator(), ret);
  1442. }
  1443. }
  1444. final public void skipUnknownRule() throws ParseException {
  1445. Token n;
  1446. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1447. case ATKEYWORD:
  1448. n = jj_consume_token(ATKEYWORD);
  1449. break;
  1450. case CDO:
  1451. n = jj_consume_token(CDO);
  1452. break;
  1453. case CHARSET_SYM:
  1454. n = jj_consume_token(CHARSET_SYM);
  1455. break;
  1456. case COMMA:
  1457. n = jj_consume_token(COMMA);
  1458. break;
  1459. case DASHMATCH:
  1460. n = jj_consume_token(DASHMATCH);
  1461. break;
  1462. case FONT_FACE_SYM:
  1463. n = jj_consume_token(FONT_FACE_SYM);
  1464. break;
  1465. case FUNCTION:
  1466. n = jj_consume_token(FUNCTION);
  1467. break;
  1468. case IMPORTANT_SYM:
  1469. n = jj_consume_token(IMPORTANT_SYM);
  1470. break;
  1471. case IMPORT_SYM:
  1472. n = jj_consume_token(IMPORT_SYM);
  1473. break;
  1474. case INCLUDES:
  1475. n = jj_consume_token(INCLUDES);
  1476. break;
  1477. case LBRACE:
  1478. n = jj_consume_token(LBRACE);
  1479. break;
  1480. case MEDIA_SYM:
  1481. n = jj_consume_token(MEDIA_SYM);
  1482. break;
  1483. case NONASCII:
  1484. n = jj_consume_token(NONASCII);
  1485. break;
  1486. case NUMBER:
  1487. n = jj_consume_token(NUMBER);
  1488. break;
  1489. case PAGE_SYM:
  1490. n = jj_consume_token(PAGE_SYM);
  1491. break;
  1492. case PERCENTAGE:
  1493. n = jj_consume_token(PERCENTAGE);
  1494. break;
  1495. case STRING:
  1496. n = jj_consume_token(STRING);
  1497. break;
  1498. case UNICODERANGE:
  1499. n = jj_consume_token(UNICODERANGE);
  1500. break;
  1501. case URL:
  1502. n = jj_consume_token(URL);
  1503. break;
  1504. case SEMICOLON:
  1505. n = jj_consume_token(SEMICOLON);
  1506. break;
  1507. case MINUS:
  1508. n = jj_consume_token(MINUS);
  1509. break;
  1510. case UNKNOWN:
  1511. n = jj_consume_token(UNKNOWN);
  1512. break;
  1513. default:
  1514. jj_la1[57] = jj_gen;
  1515. jj_consume_token(-1);
  1516. throw new ParseException();
  1517. }
  1518. String ret;
  1519. Locator loc = getLocator();
  1520. ret = skipStatement();
  1521. if ((ret != null) && (n.image.charAt(0) == '@')) {
  1522. documentHandler.unrecognizedRule(ret);
  1523. } else {
  1524. reportWarningSkipText(loc, ret);
  1525. }
  1526. }
  1527. /**
  1528. * @exception ParseException
  1529. * exception during the parse
  1530. */
  1531. final public char combinator() throws ParseException {
  1532. char connector = ' ';
  1533. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1534. case PLUS:
  1535. case PRECEDES:
  1536. case SIBLING:
  1537. connector = combinatorChar();
  1538. break;
  1539. case S:
  1540. jj_consume_token(S);
  1541. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1542. case PLUS:
  1543. case PRECEDES:
  1544. case SIBLING:
  1545. connector = combinatorChar();
  1546. break;
  1547. default:
  1548. jj_la1[58] = jj_gen;
  1549. ;
  1550. }
  1551. break;
  1552. default:
  1553. jj_la1[59] = jj_gen;
  1554. jj_consume_token(-1);
  1555. throw new ParseException();
  1556. }
  1557. {
  1558. if (true) {
  1559. return connector;
  1560. }
  1561. }
  1562. throw new Error("Missing return statement in function");
  1563. }
  1564. /** to refactor combinator and reuse in selector(). */
  1565. final public char combinatorChar() throws ParseException {
  1566. Token t;
  1567. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1568. case PLUS:
  1569. t = jj_consume_token(PLUS);
  1570. break;
  1571. case PRECEDES:
  1572. t = jj_consume_token(PRECEDES);
  1573. break;
  1574. case SIBLING:
  1575. t = jj_consume_token(SIBLING);
  1576. break;
  1577. default:
  1578. jj_la1[60] = jj_gen;
  1579. jj_consume_token(-1);
  1580. throw new ParseException();
  1581. }
  1582. label_42: while (true) {
  1583. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1584. case S:
  1585. ;
  1586. break;
  1587. default:
  1588. jj_la1[61] = jj_gen;
  1589. break label_42;
  1590. }
  1591. jj_consume_token(S);
  1592. }
  1593. {
  1594. if (true) {
  1595. return t.image.charAt(0);
  1596. }
  1597. }
  1598. throw new Error("Missing return statement in function");
  1599. }
  1600. final public void microsoftExtension() throws ParseException {
  1601. Token n;
  1602. String name = "";
  1603. String value = "";
  1604. // This is not really taking the syntax of filter rules into account
  1605. n = jj_consume_token(MICROSOFT_RULE);
  1606. label_43: while (true) {
  1607. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1608. case S:
  1609. ;
  1610. break;
  1611. default:
  1612. jj_la1[62] = jj_gen;
  1613. break label_43;
  1614. }
  1615. jj_consume_token(S);
  1616. }
  1617. name = n.image;
  1618. jj_consume_token(COLON);
  1619. label_44: while (true) {
  1620. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1621. case IDENT:
  1622. n = jj_consume_token(IDENT);
  1623. value += n.image;
  1624. break;
  1625. case NUMBER:
  1626. n = jj_consume_token(NUMBER);
  1627. value += n.image;
  1628. break;
  1629. case STRING:
  1630. n = jj_consume_token(STRING);
  1631. value += n.image;
  1632. break;
  1633. case COMMA:
  1634. n = jj_consume_token(COMMA);
  1635. value += n.image;
  1636. break;
  1637. case INTERPOLATION:
  1638. n = jj_consume_token(INTERPOLATION);
  1639. value += n.image;
  1640. break;
  1641. case COLON:
  1642. n = jj_consume_token(COLON);
  1643. value += n.image;
  1644. break;
  1645. case FUNCTION:
  1646. n = jj_consume_token(FUNCTION);
  1647. value += n.image;
  1648. break;
  1649. case RPARAN:
  1650. n = jj_consume_token(RPARAN);
  1651. value += n.image;
  1652. break;
  1653. case EQ:
  1654. n = jj_consume_token(EQ);
  1655. value += n.image;
  1656. break;
  1657. case DOT:
  1658. n = jj_consume_token(DOT);
  1659. value += n.image;
  1660. break;
  1661. case S:
  1662. n = jj_consume_token(S);
  1663. if (value.lastIndexOf(' ') != value.length() - 1) {
  1664. value += n.image;
  1665. }
  1666. break;
  1667. default:
  1668. jj_la1[63] = jj_gen;
  1669. jj_consume_token(-1);
  1670. throw new ParseException();
  1671. }
  1672. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1673. case S:
  1674. case EQ:
  1675. case COMMA:
  1676. case DOT:
  1677. case RPARAN:
  1678. case COLON:
  1679. case INTERPOLATION:
  1680. case STRING:
  1681. case IDENT:
  1682. case NUMBER:
  1683. case FUNCTION:
  1684. ;
  1685. break;
  1686. default:
  1687. jj_la1[64] = jj_gen;
  1688. break label_44;
  1689. }
  1690. }
  1691. jj_consume_token(SEMICOLON);
  1692. label_45: while (true) {
  1693. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1694. case S:
  1695. ;
  1696. break;
  1697. default:
  1698. jj_la1[65] = jj_gen;
  1699. break label_45;
  1700. }
  1701. jj_consume_token(S);
  1702. }
  1703. documentHandler.microsoftDirective(name, value);
  1704. }
  1705. /**
  1706. * @exception ParseException
  1707. * exception during the parse
  1708. */
  1709. final public String property() throws ParseException {
  1710. Token t;
  1711. String s = "";
  1712. label_46: while (true) {
  1713. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1714. case IDENT:
  1715. t = jj_consume_token(IDENT);
  1716. s += t.image;
  1717. break;
  1718. case INTERPOLATION:
  1719. t = jj_consume_token(INTERPOLATION);
  1720. s += t.image;
  1721. break;
  1722. default:
  1723. jj_la1[66] = jj_gen;
  1724. jj_consume_token(-1);
  1725. throw new ParseException();
  1726. }
  1727. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1728. case INTERPOLATION:
  1729. case IDENT:
  1730. ;
  1731. break;
  1732. default:
  1733. jj_la1[67] = jj_gen;
  1734. break label_46;
  1735. }
  1736. }
  1737. label_47: while (true) {
  1738. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1739. case S:
  1740. ;
  1741. break;
  1742. default:
  1743. jj_la1[68] = jj_gen;
  1744. break label_47;
  1745. }
  1746. jj_consume_token(S);
  1747. }
  1748. {
  1749. if (true) {
  1750. return s;
  1751. }
  1752. }
  1753. throw new Error("Missing return statement in function");
  1754. }
  1755. final public String variableName() throws ParseException {
  1756. Token n;
  1757. n = jj_consume_token(VARIABLE);
  1758. label_48: while (true) {
  1759. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1760. case S:
  1761. ;
  1762. break;
  1763. default:
  1764. jj_la1[69] = jj_gen;
  1765. break label_48;
  1766. }
  1767. jj_consume_token(S);
  1768. }
  1769. {
  1770. if (true) {
  1771. return convertIdent(n.image.substring(1));
  1772. }
  1773. }
  1774. throw new Error("Missing return statement in function");
  1775. }
  1776. final public String functionName() throws ParseException {
  1777. Token n;
  1778. n = jj_consume_token(FUNCTION);
  1779. label_49: while (true) {
  1780. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1781. case S:
  1782. ;
  1783. break;
  1784. default:
  1785. jj_la1[70] = jj_gen;
  1786. break label_49;
  1787. }
  1788. jj_consume_token(S);
  1789. }
  1790. {
  1791. if (true) {
  1792. return convertIdent(n.image.substring(0, n.image.length() - 1));
  1793. }
  1794. }
  1795. throw new Error("Missing return statement in function");
  1796. }
  1797. /**
  1798. * @exception ParseException
  1799. * exception during the parse
  1800. */
  1801. final public void styleRule() throws ParseException {
  1802. boolean start = false;
  1803. ArrayList<String> l = null;
  1804. Token save;
  1805. Locator loc;
  1806. try {
  1807. l = selectorList();
  1808. save = token;
  1809. jj_consume_token(LBRACE);
  1810. label_50: while (true) {
  1811. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1812. case S:
  1813. ;
  1814. break;
  1815. default:
  1816. jj_la1[71] = jj_gen;
  1817. break label_50;
  1818. }
  1819. jj_consume_token(S);
  1820. }
  1821. start = true;
  1822. documentHandler.startSelector(l);
  1823. label_51: while (true) {
  1824. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1825. case PLUS:
  1826. case PRECEDES:
  1827. case SIBLING:
  1828. case LBRACKET:
  1829. case ANY:
  1830. case PARENT:
  1831. case DOT:
  1832. case COLON:
  1833. case INTERPOLATION:
  1834. case INCLUDE_SYM:
  1835. case DEBUG_SYM:
  1836. case WARN_SYM:
  1837. case EACH_SYM:
  1838. case IF_SYM:
  1839. case EXTEND_SYM:
  1840. case MICROSOFT_RULE:
  1841. case IDENT:
  1842. case VARIABLE:
  1843. case HASH:
  1844. case MEDIA_SYM:
  1845. case KEY_FRAME_SYM:
  1846. ;
  1847. break;
  1848. default:
  1849. jj_la1[72] = jj_gen;
  1850. break label_51;
  1851. }
  1852. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1853. case PLUS:
  1854. case PRECEDES:
  1855. case SIBLING:
  1856. case LBRACKET:
  1857. case ANY:
  1858. case PARENT:
  1859. case DOT:
  1860. case COLON:
  1861. case INTERPOLATION:
  1862. case INCLUDE_SYM:
  1863. case DEBUG_SYM:
  1864. case WARN_SYM:
  1865. case EXTEND_SYM:
  1866. case IDENT:
  1867. case VARIABLE:
  1868. case HASH:
  1869. case MEDIA_SYM:
  1870. case KEY_FRAME_SYM:
  1871. ifContentStatement();
  1872. break;
  1873. case EACH_SYM:
  1874. case IF_SYM:
  1875. controlDirective();
  1876. break;
  1877. case MICROSOFT_RULE:
  1878. microsoftExtension();
  1879. break;
  1880. default:
  1881. jj_la1[73] = jj_gen;
  1882. jj_consume_token(-1);
  1883. throw new ParseException();
  1884. }
  1885. }
  1886. jj_consume_token(RBRACE);
  1887. label_52: while (true) {
  1888. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1889. case S:
  1890. ;
  1891. break;
  1892. default:
  1893. jj_la1[74] = jj_gen;
  1894. break label_52;
  1895. }
  1896. jj_consume_token(S);
  1897. }
  1898. } catch (ThrowedParseException e) {
  1899. if (errorHandler != null) {
  1900. LocatorImpl li = new LocatorImpl(this,
  1901. e.e.currentToken.next.beginLine,
  1902. e.e.currentToken.next.beginColumn - 1);
  1903. reportError(li, e.e);
  1904. }
  1905. } catch (ParseException e) {
  1906. reportError(getLocator(), e);
  1907. skipStatement();
  1908. // reportWarningSkipText(getLocator(), skipStatement());
  1909. } catch (TokenMgrError e) {
  1910. reportWarningSkipText(getLocator(), skipStatement());
  1911. } finally {
  1912. if (start) {
  1913. documentHandler.endSelector();
  1914. }
  1915. }
  1916. }
  1917. final public ArrayList<String> selectorList() throws ParseException {
  1918. ArrayList<String> selectors = new ArrayList<String>();
  1919. String selector;
  1920. selector = selector();
  1921. label_53: while (true) {
  1922. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1923. case COMMA:
  1924. ;
  1925. break;
  1926. default:
  1927. jj_la1[75] = jj_gen;
  1928. break label_53;
  1929. }
  1930. jj_consume_token(COMMA);
  1931. label_54: while (true) {
  1932. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1933. case S:
  1934. ;
  1935. break;
  1936. default:
  1937. jj_la1[76] = jj_gen;
  1938. break label_54;
  1939. }
  1940. jj_consume_token(S);
  1941. }
  1942. selectors.add(selector);
  1943. selector = selector();
  1944. }
  1945. selectors.add(selector);
  1946. {
  1947. if (true) {
  1948. return selectors;
  1949. }
  1950. }
  1951. throw new Error("Missing return statement in function");
  1952. }
  1953. /**
  1954. * @exception ParseException
  1955. * exception during the parse
  1956. */
  1957. final public String selector() throws ParseException {
  1958. String selector = null;
  1959. char comb;
  1960. try {
  1961. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1962. case LBRACKET:
  1963. case ANY:
  1964. case PARENT:
  1965. case DOT:
  1966. case COLON:
  1967. case INTERPOLATION:
  1968. case IDENT:
  1969. case HASH:
  1970. selector = simple_selector(null, ' ');
  1971. break;
  1972. case PLUS:
  1973. case PRECEDES:
  1974. case SIBLING:
  1975. comb = combinatorChar();
  1976. selector = simple_selector(selector, comb);
  1977. break;
  1978. default:
  1979. jj_la1[77] = jj_gen;
  1980. jj_consume_token(-1);
  1981. throw new ParseException();
  1982. }
  1983. label_55: while (true) {
  1984. if (jj_2_2(2)) {
  1985. ;
  1986. } else {
  1987. break label_55;
  1988. }
  1989. comb = combinator();
  1990. selector = simple_selector(selector, comb);
  1991. }
  1992. label_56: while (true) {
  1993. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  1994. case S:
  1995. ;
  1996. break;
  1997. default:
  1998. jj_la1[78] = jj_gen;
  1999. break label_56;
  2000. }
  2001. jj_consume_token(S);
  2002. }
  2003. {
  2004. if (true) {
  2005. return selector;
  2006. }
  2007. }
  2008. } catch (ParseException e) {
  2009. /*
  2010. * Token t = getToken(1); StringBuffer s = new StringBuffer();
  2011. * s.append(getToken(0).image); while ((t.kind != COMMA) && (t.kind
  2012. * != SEMICOLON) && (t.kind != LBRACE) && (t.kind != EOF)) {
  2013. * s.append(t.image); getNextToken(); t = getToken(1); }
  2014. * reportWarningSkipText(getLocator(), s.toString());
  2015. */
  2016. Token t = getToken(1);
  2017. while ((t.kind != COMMA) && (t.kind != SEMICOLON)
  2018. && (t.kind != LBRACE) && (t.kind != EOF)) {
  2019. getNextToken();
  2020. t = getToken(1);
  2021. }
  2022. {
  2023. if (true) {
  2024. throw new ThrowedParseException(e);
  2025. }
  2026. }
  2027. }
  2028. throw new Error("Missing return statement in function");
  2029. }
  2030. /**
  2031. * @exception ParseException
  2032. * exception during the parse
  2033. */
  2034. final public String simple_selector(String selector, char comb)
  2035. throws ParseException {
  2036. String simple_current = null;
  2037. String cond = null;
  2038. pseudoElt = null;
  2039. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2040. case ANY:
  2041. case PARENT:
  2042. case INTERPOLATION:
  2043. case IDENT:
  2044. simple_current = element_name();
  2045. label_57: while (true) {
  2046. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2047. case LBRACKET:
  2048. case DOT:
  2049. case COLON:
  2050. case HASH:
  2051. ;
  2052. break;
  2053. default:
  2054. jj_la1[79] = jj_gen;
  2055. break label_57;
  2056. }
  2057. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2058. case HASH:
  2059. cond = hash(cond);
  2060. break;
  2061. case DOT:
  2062. cond = _class(cond);
  2063. break;
  2064. case LBRACKET:
  2065. cond = attrib(cond);
  2066. break;
  2067. case COLON:
  2068. cond = pseudo(cond);
  2069. break;
  2070. default:
  2071. jj_la1[80] = jj_gen;
  2072. jj_consume_token(-1);
  2073. throw new ParseException();
  2074. }
  2075. }
  2076. break;
  2077. case HASH:
  2078. cond = hash(cond);
  2079. label_58: while (true) {
  2080. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2081. case LBRACKET:
  2082. case DOT:
  2083. case COLON:
  2084. ;
  2085. break;
  2086. default:
  2087. jj_la1[81] = jj_gen;
  2088. break label_58;
  2089. }
  2090. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2091. case DOT:
  2092. cond = _class(cond);
  2093. break;
  2094. case LBRACKET:
  2095. cond = attrib(cond);
  2096. break;
  2097. case COLON:
  2098. cond = pseudo(cond);
  2099. break;
  2100. default:
  2101. jj_la1[82] = jj_gen;
  2102. jj_consume_token(-1);
  2103. throw new ParseException();
  2104. }
  2105. }
  2106. break;
  2107. case DOT:
  2108. cond = _class(cond);
  2109. label_59: while (true) {
  2110. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2111. case LBRACKET:
  2112. case DOT:
  2113. case COLON:
  2114. case HASH:
  2115. ;
  2116. break;
  2117. default:
  2118. jj_la1[83] = jj_gen;
  2119. break label_59;
  2120. }
  2121. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2122. case HASH:
  2123. cond = hash(cond);
  2124. break;
  2125. case DOT:
  2126. cond = _class(cond);
  2127. break;
  2128. case LBRACKET:
  2129. cond = attrib(cond);
  2130. break;
  2131. case COLON:
  2132. cond = pseudo(cond);
  2133. break;
  2134. default:
  2135. jj_la1[84] = jj_gen;
  2136. jj_consume_token(-1);
  2137. throw new ParseException();
  2138. }
  2139. }
  2140. break;
  2141. case COLON:
  2142. cond = pseudo(cond);
  2143. label_60: while (true) {
  2144. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2145. case LBRACKET:
  2146. case DOT:
  2147. case COLON:
  2148. case HASH:
  2149. ;
  2150. break;
  2151. default:
  2152. jj_la1[85] = jj_gen;
  2153. break label_60;
  2154. }
  2155. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2156. case HASH:
  2157. cond = hash(cond);
  2158. break;
  2159. case DOT:
  2160. cond = _class(cond);
  2161. break;
  2162. case LBRACKET:
  2163. cond = attrib(cond);
  2164. break;
  2165. case COLON:
  2166. cond = pseudo(cond);
  2167. break;
  2168. default:
  2169. jj_la1[86] = jj_gen;
  2170. jj_consume_token(-1);
  2171. throw new ParseException();
  2172. }
  2173. }
  2174. break;
  2175. case LBRACKET:
  2176. cond = attrib(cond);
  2177. label_61: while (true) {
  2178. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2179. case LBRACKET:
  2180. case DOT:
  2181. case COLON:
  2182. case HASH:
  2183. ;
  2184. break;
  2185. default:
  2186. jj_la1[87] = jj_gen;
  2187. break label_61;
  2188. }
  2189. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2190. case HASH:
  2191. cond = hash(cond);
  2192. break;
  2193. case DOT:
  2194. cond = _class(cond);
  2195. break;
  2196. case LBRACKET:
  2197. cond = attrib(cond);
  2198. break;
  2199. case COLON:
  2200. cond = pseudo(cond);
  2201. break;
  2202. default:
  2203. jj_la1[88] = jj_gen;
  2204. jj_consume_token(-1);
  2205. throw new ParseException();
  2206. }
  2207. }
  2208. break;
  2209. default:
  2210. jj_la1[89] = jj_gen;
  2211. jj_consume_token(-1);
  2212. throw new ParseException();
  2213. }
  2214. if (simple_current == null) {
  2215. simple_current = "";
  2216. }
  2217. if (cond != null) {
  2218. simple_current = simple_current + cond;
  2219. }
  2220. StringBuilder builder = new StringBuilder();
  2221. switch (comb) {
  2222. case ' ':
  2223. if (selector != null) {
  2224. builder.append(selector).append(" ");
  2225. }
  2226. break;
  2227. case '+':
  2228. case '>':
  2229. case '~':
  2230. if (selector != null) {
  2231. builder.append(selector).append(" ");
  2232. }
  2233. builder.append(comb).append(" ");
  2234. break;
  2235. default: {
  2236. if (true) {
  2237. throw new ParseException("invalid state. send a bug report");
  2238. }
  2239. }
  2240. }
  2241. builder.append(simple_current);
  2242. selector = builder.toString();
  2243. if (pseudoElt != null) {
  2244. selector = selector + pseudoElt;
  2245. }
  2246. {
  2247. if (true) {
  2248. return selector;
  2249. }
  2250. }
  2251. throw new Error("Missing return statement in function");
  2252. }
  2253. /**
  2254. * @exception ParseException
  2255. * exception during the parse
  2256. */
  2257. final public String _class(String pred) throws ParseException {
  2258. Token t;
  2259. String s = ".";
  2260. jj_consume_token(DOT);
  2261. label_62: while (true) {
  2262. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2263. case IDENT:
  2264. t = jj_consume_token(IDENT);
  2265. s += t.image;
  2266. break;
  2267. case INTERPOLATION:
  2268. t = jj_consume_token(INTERPOLATION);
  2269. s += t.image;
  2270. break;
  2271. default:
  2272. jj_la1[90] = jj_gen;
  2273. jj_consume_token(-1);
  2274. throw new ParseException();
  2275. }
  2276. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2277. case INTERPOLATION:
  2278. case IDENT:
  2279. ;
  2280. break;
  2281. default:
  2282. jj_la1[91] = jj_gen;
  2283. break label_62;
  2284. }
  2285. }
  2286. if (pred == null) {
  2287. {
  2288. if (true) {
  2289. return s;
  2290. }
  2291. }
  2292. } else {
  2293. {
  2294. if (true) {
  2295. return pred + s;
  2296. }
  2297. }
  2298. }
  2299. throw new Error("Missing return statement in function");
  2300. }
  2301. /**
  2302. * @exception ParseException
  2303. * exception during the parse
  2304. */
  2305. final public String element_name() throws ParseException {
  2306. Token t;
  2307. String s = "";
  2308. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2309. case INTERPOLATION:
  2310. case IDENT:
  2311. label_63: while (true) {
  2312. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2313. case IDENT:
  2314. t = jj_consume_token(IDENT);
  2315. s += t.image;
  2316. break;
  2317. case INTERPOLATION:
  2318. t = jj_consume_token(INTERPOLATION);
  2319. s += t.image;
  2320. break;
  2321. default:
  2322. jj_la1[92] = jj_gen;
  2323. jj_consume_token(-1);
  2324. throw new ParseException();
  2325. }
  2326. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2327. case INTERPOLATION:
  2328. case IDENT:
  2329. ;
  2330. break;
  2331. default:
  2332. jj_la1[93] = jj_gen;
  2333. break label_63;
  2334. }
  2335. }
  2336. {
  2337. if (true) {
  2338. return s;
  2339. }
  2340. }
  2341. break;
  2342. case ANY:
  2343. jj_consume_token(ANY);
  2344. {
  2345. if (true) {
  2346. return "*";
  2347. }
  2348. }
  2349. break;
  2350. case PARENT:
  2351. jj_consume_token(PARENT);
  2352. {
  2353. if (true) {
  2354. return "&";
  2355. }
  2356. }
  2357. break;
  2358. default:
  2359. jj_la1[94] = jj_gen;
  2360. jj_consume_token(-1);
  2361. throw new ParseException();
  2362. }
  2363. throw new Error("Missing return statement in function");
  2364. }
  2365. /**
  2366. * @exception ParseException
  2367. * exception during the parse
  2368. */
  2369. final public String attrib(String pred) throws ParseException {
  2370. int cases = 0;
  2371. Token att = null;
  2372. Token val = null;
  2373. String attValue = null;
  2374. jj_consume_token(LBRACKET);
  2375. label_64: while (true) {
  2376. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2377. case S:
  2378. ;
  2379. break;
  2380. default:
  2381. jj_la1[95] = jj_gen;
  2382. break label_64;
  2383. }
  2384. jj_consume_token(S);
  2385. }
  2386. att = jj_consume_token(IDENT);
  2387. label_65: while (true) {
  2388. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2389. case S:
  2390. ;
  2391. break;
  2392. default:
  2393. jj_la1[96] = jj_gen;
  2394. break label_65;
  2395. }
  2396. jj_consume_token(S);
  2397. }
  2398. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2399. case DASHMATCH:
  2400. case CARETMATCH:
  2401. case DOLLARMATCH:
  2402. case STARMATCH:
  2403. case INCLUDES:
  2404. case EQ:
  2405. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2406. case EQ:
  2407. jj_consume_token(EQ);
  2408. cases = 1;
  2409. break;
  2410. case INCLUDES:
  2411. jj_consume_token(INCLUDES);
  2412. cases = 2;
  2413. break;
  2414. case DASHMATCH:
  2415. jj_consume_token(DASHMATCH);
  2416. cases = 3;
  2417. break;
  2418. case CARETMATCH:
  2419. jj_consume_token(CARETMATCH);
  2420. cases = 4;
  2421. break;
  2422. case DOLLARMATCH:
  2423. jj_consume_token(DOLLARMATCH);
  2424. cases = 5;
  2425. break;
  2426. case STARMATCH:
  2427. jj_consume_token(STARMATCH);
  2428. cases = 6;
  2429. break;
  2430. default:
  2431. jj_la1[97] = jj_gen;
  2432. jj_consume_token(-1);
  2433. throw new ParseException();
  2434. }
  2435. label_66: while (true) {
  2436. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2437. case S:
  2438. ;
  2439. break;
  2440. default:
  2441. jj_la1[98] = jj_gen;
  2442. break label_66;
  2443. }
  2444. jj_consume_token(S);
  2445. }
  2446. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2447. case IDENT:
  2448. val = jj_consume_token(IDENT);
  2449. attValue = val.image;
  2450. break;
  2451. case STRING:
  2452. val = jj_consume_token(STRING);
  2453. attValue = val.image;
  2454. break;
  2455. default:
  2456. jj_la1[99] = jj_gen;
  2457. jj_consume_token(-1);
  2458. throw new ParseException();
  2459. }
  2460. label_67: while (true) {
  2461. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2462. case S:
  2463. ;
  2464. break;
  2465. default:
  2466. jj_la1[100] = jj_gen;
  2467. break label_67;
  2468. }
  2469. jj_consume_token(S);
  2470. }
  2471. break;
  2472. default:
  2473. jj_la1[101] = jj_gen;
  2474. ;
  2475. }
  2476. jj_consume_token(RBRACKET);
  2477. String name = convertIdent(att.image);
  2478. String c;
  2479. switch (cases) {
  2480. case 0:
  2481. c = name;
  2482. break;
  2483. case 1:
  2484. c = name + "=" + attValue;
  2485. break;
  2486. case 2:
  2487. c = name + "~=" + attValue;
  2488. break;
  2489. case 3:
  2490. c = name + "|=" + attValue;
  2491. break;
  2492. case 4:
  2493. c = name + "^=" + attValue;
  2494. break;
  2495. case 5:
  2496. c = name + "$=" + attValue;
  2497. break;
  2498. case 6:
  2499. c = name + "*=" + attValue;
  2500. break;
  2501. default:
  2502. // never reached.
  2503. c = null;
  2504. }
  2505. c = "[" + c + "]";
  2506. if (pred == null) {
  2507. {
  2508. if (true) {
  2509. return c;
  2510. }
  2511. }
  2512. } else {
  2513. {
  2514. if (true) {
  2515. return pred + c;
  2516. }
  2517. }
  2518. }
  2519. throw new Error("Missing return statement in function");
  2520. }
  2521. /**
  2522. * @exception ParseException
  2523. * exception during the parse
  2524. */
  2525. final public String pseudo(String pred) throws ParseException {
  2526. Token n;
  2527. Token param;
  2528. String d;
  2529. boolean isPseudoElement = false;
  2530. jj_consume_token(COLON);
  2531. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2532. case COLON:
  2533. jj_consume_token(COLON);
  2534. isPseudoElement = true;
  2535. break;
  2536. default:
  2537. jj_la1[102] = jj_gen;
  2538. ;
  2539. }
  2540. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2541. case IDENT:
  2542. n = jj_consume_token(IDENT);
  2543. String s = ":" + convertIdent(n.image);
  2544. if (isPseudoElement) {
  2545. if (pseudoElt != null) {
  2546. {
  2547. if (true) {
  2548. throw new CSSParseException(
  2549. "duplicate pseudo element definition " + s,
  2550. getLocator());
  2551. }
  2552. }
  2553. } else {
  2554. pseudoElt = ":" + s;
  2555. {
  2556. if (true) {
  2557. return pred;
  2558. }
  2559. }
  2560. }
  2561. } else {
  2562. String c = s;
  2563. if (pred == null) {
  2564. {
  2565. if (true) {
  2566. return c;
  2567. }
  2568. }
  2569. } else {
  2570. {
  2571. if (true) {
  2572. return pred + c;
  2573. }
  2574. }
  2575. }
  2576. }
  2577. break;
  2578. case FUNCTION:
  2579. n = jj_consume_token(FUNCTION);
  2580. label_68: while (true) {
  2581. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2582. case S:
  2583. ;
  2584. break;
  2585. default:
  2586. jj_la1[103] = jj_gen;
  2587. break label_68;
  2588. }
  2589. jj_consume_token(S);
  2590. }
  2591. d = skipStatementUntilRightParan();
  2592. jj_consume_token(RPARAN);
  2593. // accept anything between function and a right parenthesis
  2594. String f = convertIdent(n.image);
  2595. String colons = isPseudoElement ? "::" : ":";
  2596. String pseudofn = colons + f + d + ")";
  2597. if (pred == null) {
  2598. {
  2599. if (true) {
  2600. return pseudofn;
  2601. }
  2602. }
  2603. } else {
  2604. {
  2605. if (true) {
  2606. return pred + pseudofn;
  2607. }
  2608. }
  2609. }
  2610. break;
  2611. default:
  2612. jj_la1[104] = jj_gen;
  2613. jj_consume_token(-1);
  2614. throw new ParseException();
  2615. }
  2616. throw new Error("Missing return statement in function");
  2617. }
  2618. /**
  2619. * @exception ParseException
  2620. * exception during the parse
  2621. */
  2622. final public String hash(String pred) throws ParseException {
  2623. Token n;
  2624. n = jj_consume_token(HASH);
  2625. String d = n.image;
  2626. if (pred == null) {
  2627. {
  2628. if (true) {
  2629. return d;
  2630. }
  2631. }
  2632. } else {
  2633. {
  2634. if (true) {
  2635. return pred + d;
  2636. }
  2637. }
  2638. }
  2639. throw new Error("Missing return statement in function");
  2640. }
  2641. final public void variable() throws ParseException {
  2642. String name;
  2643. LexicalUnitImpl exp = null;
  2644. boolean guarded = false;
  2645. String raw;
  2646. try {
  2647. name = variableName();
  2648. jj_consume_token(COLON);
  2649. label_69: while (true) {
  2650. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2651. case S:
  2652. ;
  2653. break;
  2654. default:
  2655. jj_la1[105] = jj_gen;
  2656. break label_69;
  2657. }
  2658. jj_consume_token(S);
  2659. }
  2660. exp = expr();
  2661. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2662. case GUARDED_SYM:
  2663. guarded = guarded();
  2664. break;
  2665. default:
  2666. jj_la1[106] = jj_gen;
  2667. ;
  2668. }
  2669. label_70: while (true) {
  2670. jj_consume_token(SEMICOLON);
  2671. label_71: while (true) {
  2672. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2673. case S:
  2674. ;
  2675. break;
  2676. default:
  2677. jj_la1[107] = jj_gen;
  2678. break label_71;
  2679. }
  2680. jj_consume_token(S);
  2681. }
  2682. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2683. case SEMICOLON:
  2684. ;
  2685. break;
  2686. default:
  2687. jj_la1[108] = jj_gen;
  2688. break label_70;
  2689. }
  2690. }
  2691. documentHandler.variable(name, exp, guarded);
  2692. } catch (JumpException e) {
  2693. skipAfterExpression();
  2694. } catch (NumberFormatException e) {
  2695. if (errorHandler != null) {
  2696. errorHandler.error(new CSSParseException("Invalid number "
  2697. + e.getMessage(), getLocator(), e));
  2698. }
  2699. reportWarningSkipText(getLocator(), skipAfterExpression());
  2700. } catch (ParseException e) {
  2701. if (errorHandler != null) {
  2702. if (e.currentToken != null) {
  2703. LocatorImpl li = new LocatorImpl(this,
  2704. e.currentToken.next.beginLine,
  2705. e.currentToken.next.beginColumn - 1);
  2706. reportError(li, e);
  2707. } else {
  2708. reportError(getLocator(), e);
  2709. }
  2710. skipAfterExpression();
  2711. } else {
  2712. skipAfterExpression();
  2713. }
  2714. }
  2715. }
  2716. final public void controlDirective() throws ParseException {
  2717. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2718. case IF_SYM:
  2719. ifDirective();
  2720. break;
  2721. case EACH_SYM:
  2722. eachDirective();
  2723. break;
  2724. default:
  2725. jj_la1[109] = jj_gen;
  2726. jj_consume_token(-1);
  2727. throw new ParseException();
  2728. }
  2729. }
  2730. final public void ifContentStatement() throws ParseException {
  2731. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2732. case INCLUDE_SYM:
  2733. includeDirective();
  2734. break;
  2735. case MEDIA_SYM:
  2736. media();
  2737. break;
  2738. case EXTEND_SYM:
  2739. extendDirective();
  2740. break;
  2741. case PLUS:
  2742. case PRECEDES:
  2743. case SIBLING:
  2744. case LBRACKET:
  2745. case ANY:
  2746. case PARENT:
  2747. case DOT:
  2748. case COLON:
  2749. case INTERPOLATION:
  2750. case DEBUG_SYM:
  2751. case WARN_SYM:
  2752. case IDENT:
  2753. case HASH:
  2754. styleRuleOrDeclarationOrNestedProperties();
  2755. break;
  2756. case KEY_FRAME_SYM:
  2757. keyframes();
  2758. break;
  2759. default:
  2760. jj_la1[110] = jj_gen;
  2761. if (jj_2_3(2147483647)) {
  2762. variable();
  2763. } else {
  2764. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2765. case VARIABLE:
  2766. listModifyDirective();
  2767. break;
  2768. default:
  2769. jj_la1[111] = jj_gen;
  2770. jj_consume_token(-1);
  2771. throw new ParseException();
  2772. }
  2773. }
  2774. }
  2775. }
  2776. final public void ifDirective() throws ParseException {
  2777. Token n = null;
  2778. String s = null;
  2779. String evaluator = "";
  2780. jj_consume_token(IF_SYM);
  2781. label_72: while (true) {
  2782. s = booleanExpressionToken();
  2783. evaluator += s;
  2784. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2785. case S:
  2786. case EQ:
  2787. case PLUS:
  2788. case MINUS:
  2789. case PRECEDES:
  2790. case SUCCEEDS:
  2791. case DIV:
  2792. case ANY:
  2793. case LPARAN:
  2794. case RPARAN:
  2795. case COMPARE:
  2796. case OR:
  2797. case AND:
  2798. case NOT_EQ:
  2799. case IDENT:
  2800. case NUMBER:
  2801. case VARIABLE:
  2802. case CONTAINS:
  2803. ;
  2804. break;
  2805. default:
  2806. jj_la1[112] = jj_gen;
  2807. break label_72;
  2808. }
  2809. }
  2810. jj_consume_token(LBRACE);
  2811. label_73: while (true) {
  2812. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2813. case S:
  2814. ;
  2815. break;
  2816. default:
  2817. jj_la1[113] = jj_gen;
  2818. break label_73;
  2819. }
  2820. jj_consume_token(S);
  2821. }
  2822. documentHandler.startIfElseDirective();
  2823. documentHandler.ifDirective(evaluator);
  2824. label_74: while (true) {
  2825. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2826. case PLUS:
  2827. case PRECEDES:
  2828. case SIBLING:
  2829. case LBRACKET:
  2830. case ANY:
  2831. case PARENT:
  2832. case DOT:
  2833. case COLON:
  2834. case INTERPOLATION:
  2835. case INCLUDE_SYM:
  2836. case DEBUG_SYM:
  2837. case WARN_SYM:
  2838. case EXTEND_SYM:
  2839. case IDENT:
  2840. case VARIABLE:
  2841. case HASH:
  2842. case MEDIA_SYM:
  2843. case KEY_FRAME_SYM:
  2844. ;
  2845. break;
  2846. default:
  2847. jj_la1[114] = jj_gen;
  2848. break label_74;
  2849. }
  2850. ifContentStatement();
  2851. }
  2852. jj_consume_token(RBRACE);
  2853. label_75: while (true) {
  2854. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2855. case S:
  2856. ;
  2857. break;
  2858. default:
  2859. jj_la1[115] = jj_gen;
  2860. break label_75;
  2861. }
  2862. jj_consume_token(S);
  2863. }
  2864. label_76: while (true) {
  2865. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2866. case ELSE_SYM:
  2867. ;
  2868. break;
  2869. default:
  2870. jj_la1[116] = jj_gen;
  2871. break label_76;
  2872. }
  2873. elseDirective();
  2874. }
  2875. documentHandler.endIfElseDirective();
  2876. }
  2877. final public void elseDirective() throws ParseException {
  2878. String evaluator = "";
  2879. Token n = null;
  2880. String s = null;
  2881. jj_consume_token(ELSE_SYM);
  2882. label_77: while (true) {
  2883. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2884. case S:
  2885. ;
  2886. break;
  2887. default:
  2888. jj_la1[117] = jj_gen;
  2889. break label_77;
  2890. }
  2891. jj_consume_token(S);
  2892. }
  2893. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2894. case IF:
  2895. jj_consume_token(IF);
  2896. label_78: while (true) {
  2897. s = booleanExpressionToken();
  2898. evaluator += s;
  2899. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2900. case S:
  2901. case EQ:
  2902. case PLUS:
  2903. case MINUS:
  2904. case PRECEDES:
  2905. case SUCCEEDS:
  2906. case DIV:
  2907. case ANY:
  2908. case LPARAN:
  2909. case RPARAN:
  2910. case COMPARE:
  2911. case OR:
  2912. case AND:
  2913. case NOT_EQ:
  2914. case IDENT:
  2915. case NUMBER:
  2916. case VARIABLE:
  2917. case CONTAINS:
  2918. ;
  2919. break;
  2920. default:
  2921. jj_la1[118] = jj_gen;
  2922. break label_78;
  2923. }
  2924. }
  2925. break;
  2926. default:
  2927. jj_la1[119] = jj_gen;
  2928. ;
  2929. }
  2930. jj_consume_token(LBRACE);
  2931. label_79: while (true) {
  2932. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2933. case S:
  2934. ;
  2935. break;
  2936. default:
  2937. jj_la1[120] = jj_gen;
  2938. break label_79;
  2939. }
  2940. jj_consume_token(S);
  2941. }
  2942. if (!evaluator.trim().equals("")) {
  2943. documentHandler.ifDirective(evaluator);
  2944. } else {
  2945. documentHandler.elseDirective();
  2946. }
  2947. label_80: while (true) {
  2948. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2949. case PLUS:
  2950. case PRECEDES:
  2951. case SIBLING:
  2952. case LBRACKET:
  2953. case ANY:
  2954. case PARENT:
  2955. case DOT:
  2956. case COLON:
  2957. case INTERPOLATION:
  2958. case INCLUDE_SYM:
  2959. case DEBUG_SYM:
  2960. case WARN_SYM:
  2961. case EXTEND_SYM:
  2962. case IDENT:
  2963. case VARIABLE:
  2964. case HASH:
  2965. case MEDIA_SYM:
  2966. case KEY_FRAME_SYM:
  2967. ;
  2968. break;
  2969. default:
  2970. jj_la1[121] = jj_gen;
  2971. break label_80;
  2972. }
  2973. ifContentStatement();
  2974. }
  2975. jj_consume_token(RBRACE);
  2976. label_81: while (true) {
  2977. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2978. case S:
  2979. ;
  2980. break;
  2981. default:
  2982. jj_la1[122] = jj_gen;
  2983. break label_81;
  2984. }
  2985. jj_consume_token(S);
  2986. }
  2987. }
  2988. final public String booleanExpressionToken() throws ParseException {
  2989. Token n = null;
  2990. String s = null;
  2991. if (jj_2_4(2147483647)) {
  2992. s = containsDirective();
  2993. } else {
  2994. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  2995. case VARIABLE:
  2996. n = jj_consume_token(VARIABLE);
  2997. break;
  2998. case IDENT:
  2999. n = jj_consume_token(IDENT);
  3000. break;
  3001. case NUMBER:
  3002. n = jj_consume_token(NUMBER);
  3003. break;
  3004. case LPARAN:
  3005. n = jj_consume_token(LPARAN);
  3006. break;
  3007. case RPARAN:
  3008. n = jj_consume_token(RPARAN);
  3009. break;
  3010. case PLUS:
  3011. n = jj_consume_token(PLUS);
  3012. break;
  3013. case MINUS:
  3014. n = jj_consume_token(MINUS);
  3015. break;
  3016. case DIV:
  3017. n = jj_consume_token(DIV);
  3018. break;
  3019. case ANY:
  3020. n = jj_consume_token(ANY);
  3021. break;
  3022. case COMPARE:
  3023. n = jj_consume_token(COMPARE);
  3024. break;
  3025. case EQ:
  3026. n = jj_consume_token(EQ);
  3027. break;
  3028. case PRECEDES:
  3029. n = jj_consume_token(PRECEDES);
  3030. break;
  3031. case SUCCEEDS:
  3032. n = jj_consume_token(SUCCEEDS);
  3033. break;
  3034. case OR:
  3035. n = jj_consume_token(OR);
  3036. break;
  3037. case AND:
  3038. n = jj_consume_token(AND);
  3039. break;
  3040. case S:
  3041. n = jj_consume_token(S);
  3042. break;
  3043. case NOT_EQ:
  3044. n = jj_consume_token(NOT_EQ);
  3045. break;
  3046. default:
  3047. jj_la1[123] = jj_gen;
  3048. jj_consume_token(-1);
  3049. throw new ParseException();
  3050. }
  3051. }
  3052. if (n != null) {
  3053. {
  3054. if (true) {
  3055. return n.image;
  3056. }
  3057. }
  3058. } else {
  3059. {
  3060. if (true) {
  3061. return s;
  3062. }
  3063. }
  3064. }
  3065. throw new Error("Missing return statement in function");
  3066. }
  3067. final public void eachDirective() throws ParseException {
  3068. Token var;
  3069. ArrayList<String> list = null;
  3070. String listVariable = null;
  3071. jj_consume_token(EACH_SYM);
  3072. label_82: while (true) {
  3073. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3074. case S:
  3075. ;
  3076. break;
  3077. default:
  3078. jj_la1[124] = jj_gen;
  3079. break label_82;
  3080. }
  3081. jj_consume_token(S);
  3082. }
  3083. var = jj_consume_token(VARIABLE);
  3084. label_83: while (true) {
  3085. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3086. case S:
  3087. ;
  3088. break;
  3089. default:
  3090. jj_la1[125] = jj_gen;
  3091. break label_83;
  3092. }
  3093. jj_consume_token(S);
  3094. }
  3095. jj_consume_token(EACH_IN);
  3096. label_84: while (true) {
  3097. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3098. case S:
  3099. ;
  3100. break;
  3101. default:
  3102. jj_la1[126] = jj_gen;
  3103. break label_84;
  3104. }
  3105. jj_consume_token(S);
  3106. }
  3107. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3108. case IDENT:
  3109. list = stringList();
  3110. documentHandler.startEachDirective(var.image, list);
  3111. break;
  3112. case VARIABLE:
  3113. listVariable = variableName();
  3114. documentHandler.startEachDirective(var.image, listVariable);
  3115. break;
  3116. default:
  3117. jj_la1[127] = jj_gen;
  3118. jj_consume_token(-1);
  3119. throw new ParseException();
  3120. }
  3121. jj_consume_token(LBRACE);
  3122. label_85: while (true) {
  3123. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3124. case S:
  3125. ;
  3126. break;
  3127. default:
  3128. jj_la1[128] = jj_gen;
  3129. break label_85;
  3130. }
  3131. jj_consume_token(S);
  3132. }
  3133. label_86: while (true) {
  3134. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3135. case PLUS:
  3136. case PRECEDES:
  3137. case SIBLING:
  3138. case LBRACKET:
  3139. case ANY:
  3140. case PARENT:
  3141. case DOT:
  3142. case COLON:
  3143. case INTERPOLATION:
  3144. case INCLUDE_SYM:
  3145. case DEBUG_SYM:
  3146. case WARN_SYM:
  3147. case EXTEND_SYM:
  3148. case IDENT:
  3149. case VARIABLE:
  3150. case HASH:
  3151. case MEDIA_SYM:
  3152. case KEY_FRAME_SYM:
  3153. ;
  3154. break;
  3155. default:
  3156. jj_la1[129] = jj_gen;
  3157. break label_86;
  3158. }
  3159. ifContentStatement();
  3160. }
  3161. jj_consume_token(RBRACE);
  3162. label_87: while (true) {
  3163. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3164. case S:
  3165. ;
  3166. break;
  3167. default:
  3168. jj_la1[130] = jj_gen;
  3169. break label_87;
  3170. }
  3171. jj_consume_token(S);
  3172. }
  3173. documentHandler.endEachDirective();
  3174. }
  3175. final public ArrayList<String> stringList() throws ParseException {
  3176. ArrayList<String> strings = new ArrayList<String>();
  3177. Token input;
  3178. input = jj_consume_token(IDENT);
  3179. label_88: while (true) {
  3180. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3181. case S:
  3182. ;
  3183. break;
  3184. default:
  3185. jj_la1[131] = jj_gen;
  3186. break label_88;
  3187. }
  3188. jj_consume_token(S);
  3189. }
  3190. strings.add(input.image);
  3191. label_89: while (true) {
  3192. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3193. case COMMA:
  3194. ;
  3195. break;
  3196. default:
  3197. jj_la1[132] = jj_gen;
  3198. break label_89;
  3199. }
  3200. jj_consume_token(COMMA);
  3201. label_90: while (true) {
  3202. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3203. case S:
  3204. ;
  3205. break;
  3206. default:
  3207. jj_la1[133] = jj_gen;
  3208. break label_90;
  3209. }
  3210. jj_consume_token(S);
  3211. }
  3212. input = jj_consume_token(IDENT);
  3213. strings.add(input.image);
  3214. label_91: while (true) {
  3215. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3216. case S:
  3217. ;
  3218. break;
  3219. default:
  3220. jj_la1[134] = jj_gen;
  3221. break label_91;
  3222. }
  3223. jj_consume_token(S);
  3224. }
  3225. }
  3226. {
  3227. if (true) {
  3228. return strings;
  3229. }
  3230. }
  3231. throw new Error("Missing return statement in function");
  3232. }
  3233. final public void mixinDirective() throws ParseException {
  3234. String name;
  3235. ArrayList<VariableNode> args = null;
  3236. String body;
  3237. jj_consume_token(MIXIN_SYM);
  3238. label_92: while (true) {
  3239. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3240. case S:
  3241. ;
  3242. break;
  3243. default:
  3244. jj_la1[135] = jj_gen;
  3245. break label_92;
  3246. }
  3247. jj_consume_token(S);
  3248. }
  3249. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3250. case INTERPOLATION:
  3251. case IDENT:
  3252. name = property();
  3253. break;
  3254. case FUNCTION:
  3255. name = functionName();
  3256. args = arglist();
  3257. jj_consume_token(RPARAN);
  3258. label_93: while (true) {
  3259. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3260. case S:
  3261. ;
  3262. break;
  3263. default:
  3264. jj_la1[136] = jj_gen;
  3265. break label_93;
  3266. }
  3267. jj_consume_token(S);
  3268. }
  3269. break;
  3270. default:
  3271. jj_la1[137] = jj_gen;
  3272. jj_consume_token(-1);
  3273. throw new ParseException();
  3274. }
  3275. jj_consume_token(LBRACE);
  3276. label_94: while (true) {
  3277. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3278. case S:
  3279. ;
  3280. break;
  3281. default:
  3282. jj_la1[138] = jj_gen;
  3283. break label_94;
  3284. }
  3285. jj_consume_token(S);
  3286. }
  3287. documentHandler.startMixinDirective(name, args);
  3288. label_95: while (true) {
  3289. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3290. case PLUS:
  3291. case PRECEDES:
  3292. case SIBLING:
  3293. case LBRACKET:
  3294. case ANY:
  3295. case PARENT:
  3296. case DOT:
  3297. case COLON:
  3298. case INTERPOLATION:
  3299. case INCLUDE_SYM:
  3300. case DEBUG_SYM:
  3301. case WARN_SYM:
  3302. case EACH_SYM:
  3303. case IF_SYM:
  3304. case EXTEND_SYM:
  3305. case IDENT:
  3306. case VARIABLE:
  3307. case HASH:
  3308. case MEDIA_SYM:
  3309. case PAGE_SYM:
  3310. case FONT_FACE_SYM:
  3311. case KEY_FRAME_SYM:
  3312. ;
  3313. break;
  3314. default:
  3315. jj_la1[139] = jj_gen;
  3316. break label_95;
  3317. }
  3318. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3319. case PLUS:
  3320. case PRECEDES:
  3321. case SIBLING:
  3322. case LBRACKET:
  3323. case ANY:
  3324. case PARENT:
  3325. case DOT:
  3326. case COLON:
  3327. case INTERPOLATION:
  3328. case INCLUDE_SYM:
  3329. case DEBUG_SYM:
  3330. case WARN_SYM:
  3331. case EXTEND_SYM:
  3332. case IDENT:
  3333. case VARIABLE:
  3334. case HASH:
  3335. case MEDIA_SYM:
  3336. case KEY_FRAME_SYM:
  3337. ifContentStatement();
  3338. break;
  3339. case EACH_SYM:
  3340. case IF_SYM:
  3341. controlDirective();
  3342. break;
  3343. case FONT_FACE_SYM:
  3344. fontFace();
  3345. break;
  3346. case PAGE_SYM:
  3347. page();
  3348. break;
  3349. default:
  3350. jj_la1[140] = jj_gen;
  3351. jj_consume_token(-1);
  3352. throw new ParseException();
  3353. }
  3354. }
  3355. jj_consume_token(RBRACE);
  3356. label_96: while (true) {
  3357. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3358. case S:
  3359. ;
  3360. break;
  3361. default:
  3362. jj_la1[141] = jj_gen;
  3363. break label_96;
  3364. }
  3365. jj_consume_token(S);
  3366. }
  3367. documentHandler.endMixinDirective(name, args);
  3368. }
  3369. final public ArrayList<VariableNode> arglist() throws ParseException {
  3370. ArrayList<VariableNode> args = new ArrayList<VariableNode>();
  3371. VariableNode arg;
  3372. boolean hasNonOptionalArgument = false;
  3373. arg = mixinArg();
  3374. label_97: while (true) {
  3375. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3376. case COMMA:
  3377. ;
  3378. break;
  3379. default:
  3380. jj_la1[142] = jj_gen;
  3381. break label_97;
  3382. }
  3383. jj_consume_token(COMMA);
  3384. label_98: while (true) {
  3385. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3386. case S:
  3387. ;
  3388. break;
  3389. default:
  3390. jj_la1[143] = jj_gen;
  3391. break label_98;
  3392. }
  3393. jj_consume_token(S);
  3394. }
  3395. hasNonOptionalArgument = checkMixinForNonOptionalArguments(arg,
  3396. hasNonOptionalArgument);
  3397. args.add(arg);
  3398. arg = mixinArg();
  3399. }
  3400. hasNonOptionalArgument = checkMixinForNonOptionalArguments(arg,
  3401. hasNonOptionalArgument);
  3402. args.add(arg);
  3403. {
  3404. if (true) {
  3405. return args;
  3406. }
  3407. }
  3408. throw new Error("Missing return statement in function");
  3409. }
  3410. boolean checkMixinForNonOptionalArguments(VariableNode arg,
  3411. boolean hasNonOptionalArguments) throws ParseException {
  3412. boolean currentArgHasArguments = arg.getExpr() != null
  3413. && arg.getExpr().getLexicalUnitType() == LexicalUnitImpl.SCSS_VARIABLE
  3414. && arg.getExpr().getNextLexicalUnit() != null;
  3415. if (currentArgHasArguments) {
  3416. if (hasNonOptionalArguments) {
  3417. throw new ParseException("Sass Error: Required argument $"
  3418. + arg.getName()
  3419. + " must come before any optional arguments.");
  3420. }
  3421. return hasNonOptionalArguments;
  3422. } else {
  3423. return true;
  3424. }
  3425. }
  3426. final public VariableNode mixinArg() throws ParseException {
  3427. String name;
  3428. Token variable = null;
  3429. LexicalUnitImpl first = null;
  3430. LexicalUnitImpl prev = null;
  3431. LexicalUnitImpl next = null;
  3432. name = variableName();
  3433. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3434. case COLON:
  3435. case VARIABLE:
  3436. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3437. case COLON:
  3438. jj_consume_token(COLON);
  3439. label_99: while (true) {
  3440. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3441. case S:
  3442. ;
  3443. break;
  3444. default:
  3445. jj_la1[144] = jj_gen;
  3446. break label_99;
  3447. }
  3448. jj_consume_token(S);
  3449. }
  3450. first = nonVariableTerm(null);
  3451. prev = first;
  3452. label_100: while (true) {
  3453. if (jj_2_5(3)) {
  3454. ;
  3455. } else {
  3456. break label_100;
  3457. }
  3458. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3459. case COMMA:
  3460. jj_consume_token(COMMA);
  3461. label_101: while (true) {
  3462. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3463. case S:
  3464. ;
  3465. break;
  3466. default:
  3467. jj_la1[145] = jj_gen;
  3468. break label_101;
  3469. }
  3470. jj_consume_token(S);
  3471. }
  3472. break;
  3473. default:
  3474. jj_la1[146] = jj_gen;
  3475. ;
  3476. }
  3477. prev = nonVariableTerm(prev);
  3478. }
  3479. break;
  3480. case VARIABLE:
  3481. variable = jj_consume_token(VARIABLE);
  3482. first = LexicalUnitImpl.createVariable(token.beginLine,
  3483. token.beginColumn, prev, variable.image);
  3484. break;
  3485. default:
  3486. jj_la1[147] = jj_gen;
  3487. jj_consume_token(-1);
  3488. throw new ParseException();
  3489. }
  3490. break;
  3491. default:
  3492. jj_la1[148] = jj_gen;
  3493. ;
  3494. }
  3495. VariableNode arg = new VariableNode(name, first, false);
  3496. {
  3497. if (true) {
  3498. return arg;
  3499. }
  3500. }
  3501. throw new Error("Missing return statement in function");
  3502. }
  3503. final public ArrayList<LexicalUnitImpl> argValuelist()
  3504. throws ParseException {
  3505. ArrayList<LexicalUnitImpl> args = new ArrayList<LexicalUnitImpl>();
  3506. LexicalUnitImpl first = null;
  3507. LexicalUnitImpl next = null;
  3508. LexicalUnitImpl prev = null;
  3509. first = term(null);
  3510. args.add(first);
  3511. prev = first;
  3512. label_102: while (true) {
  3513. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3514. case PLUS:
  3515. case MINUS:
  3516. case DOT:
  3517. case COLON:
  3518. case STRING:
  3519. case IDENT:
  3520. case NUMBER:
  3521. case URL:
  3522. case VARIABLE:
  3523. case PERCENTAGE:
  3524. case PT:
  3525. case MM:
  3526. case CM:
  3527. case PC:
  3528. case IN:
  3529. case PX:
  3530. case EMS:
  3531. case LEM:
  3532. case REM:
  3533. case EXS:
  3534. case DEG:
  3535. case RAD:
  3536. case GRAD:
  3537. case MS:
  3538. case SECOND:
  3539. case HZ:
  3540. case KHZ:
  3541. case DIMEN:
  3542. case HASH:
  3543. case UNICODERANGE:
  3544. case FUNCTION:
  3545. ;
  3546. break;
  3547. default:
  3548. jj_la1[149] = jj_gen;
  3549. break label_102;
  3550. }
  3551. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3552. case COLON:
  3553. jj_consume_token(COLON);
  3554. label_103: while (true) {
  3555. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3556. case S:
  3557. ;
  3558. break;
  3559. default:
  3560. jj_la1[150] = jj_gen;
  3561. break label_103;
  3562. }
  3563. jj_consume_token(S);
  3564. }
  3565. break;
  3566. default:
  3567. jj_la1[151] = jj_gen;
  3568. ;
  3569. }
  3570. next = term(prev);
  3571. prev.setNextLexicalUnit(next);
  3572. prev = next;
  3573. }
  3574. label_104: while (true) {
  3575. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3576. case COMMA:
  3577. ;
  3578. break;
  3579. default:
  3580. jj_la1[152] = jj_gen;
  3581. break label_104;
  3582. }
  3583. jj_consume_token(COMMA);
  3584. label_105: while (true) {
  3585. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3586. case S:
  3587. ;
  3588. break;
  3589. default:
  3590. jj_la1[153] = jj_gen;
  3591. break label_105;
  3592. }
  3593. jj_consume_token(S);
  3594. }
  3595. first = term(null);
  3596. args.add(first);
  3597. prev = first;
  3598. label_106: while (true) {
  3599. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3600. case PLUS:
  3601. case MINUS:
  3602. case DOT:
  3603. case COLON:
  3604. case STRING:
  3605. case IDENT:
  3606. case NUMBER:
  3607. case URL:
  3608. case VARIABLE:
  3609. case PERCENTAGE:
  3610. case PT:
  3611. case MM:
  3612. case CM:
  3613. case PC:
  3614. case IN:
  3615. case PX:
  3616. case EMS:
  3617. case LEM:
  3618. case REM:
  3619. case EXS:
  3620. case DEG:
  3621. case RAD:
  3622. case GRAD:
  3623. case MS:
  3624. case SECOND:
  3625. case HZ:
  3626. case KHZ:
  3627. case DIMEN:
  3628. case HASH:
  3629. case UNICODERANGE:
  3630. case FUNCTION:
  3631. ;
  3632. break;
  3633. default:
  3634. jj_la1[154] = jj_gen;
  3635. break label_106;
  3636. }
  3637. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3638. case COLON:
  3639. jj_consume_token(COLON);
  3640. label_107: while (true) {
  3641. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3642. case S:
  3643. ;
  3644. break;
  3645. default:
  3646. jj_la1[155] = jj_gen;
  3647. break label_107;
  3648. }
  3649. jj_consume_token(S);
  3650. }
  3651. break;
  3652. default:
  3653. jj_la1[156] = jj_gen;
  3654. ;
  3655. }
  3656. next = term(prev);
  3657. prev.setNextLexicalUnit(next);
  3658. prev = next;
  3659. }
  3660. }
  3661. {
  3662. if (true) {
  3663. return args;
  3664. }
  3665. }
  3666. throw new Error("Missing return statement in function");
  3667. }
  3668. final public void includeDirective() throws ParseException {
  3669. String name;
  3670. ArrayList<LexicalUnitImpl> args = null;
  3671. jj_consume_token(INCLUDE_SYM);
  3672. label_108: while (true) {
  3673. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3674. case S:
  3675. ;
  3676. break;
  3677. default:
  3678. jj_la1[157] = jj_gen;
  3679. break label_108;
  3680. }
  3681. jj_consume_token(S);
  3682. }
  3683. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3684. case INTERPOLATION:
  3685. case IDENT:
  3686. name = property();
  3687. break;
  3688. case VARIABLE:
  3689. name = variableName();
  3690. name = "$" + name;
  3691. break;
  3692. case FUNCTION:
  3693. name = functionName();
  3694. args = argValuelist();
  3695. jj_consume_token(RPARAN);
  3696. break;
  3697. default:
  3698. jj_la1[158] = jj_gen;
  3699. jj_consume_token(-1);
  3700. throw new ParseException();
  3701. }
  3702. label_109: while (true) {
  3703. jj_consume_token(SEMICOLON);
  3704. label_110: while (true) {
  3705. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3706. case S:
  3707. ;
  3708. break;
  3709. default:
  3710. jj_la1[159] = jj_gen;
  3711. break label_110;
  3712. }
  3713. jj_consume_token(S);
  3714. }
  3715. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3716. case SEMICOLON:
  3717. ;
  3718. break;
  3719. default:
  3720. jj_la1[160] = jj_gen;
  3721. break label_109;
  3722. }
  3723. }
  3724. documentHandler.includeDirective(name, args);
  3725. }
  3726. final public String interpolation() throws ParseException {
  3727. Token n;
  3728. n = jj_consume_token(INTERPOLATION);
  3729. {
  3730. if (true) {
  3731. return n.image;
  3732. }
  3733. }
  3734. throw new Error("Missing return statement in function");
  3735. }
  3736. final public void listModifyDirective() throws ParseException {
  3737. String list = null;
  3738. String remove = null;
  3739. String separator = null;
  3740. String variable = null;
  3741. Token n = null;
  3742. Token type = null;
  3743. // refactor, remove those 3 LOOKAHEAD(5).
  3744. n = jj_consume_token(VARIABLE);
  3745. variable = n.image;
  3746. label_111: while (true) {
  3747. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3748. case S:
  3749. ;
  3750. break;
  3751. default:
  3752. jj_la1[161] = jj_gen;
  3753. break label_111;
  3754. }
  3755. jj_consume_token(S);
  3756. }
  3757. jj_consume_token(COLON);
  3758. label_112: while (true) {
  3759. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3760. case S:
  3761. ;
  3762. break;
  3763. default:
  3764. jj_la1[162] = jj_gen;
  3765. break label_112;
  3766. }
  3767. jj_consume_token(S);
  3768. }
  3769. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3770. case APPEND:
  3771. type = jj_consume_token(APPEND);
  3772. break;
  3773. case REMOVE:
  3774. type = jj_consume_token(REMOVE);
  3775. break;
  3776. case CONTAINS:
  3777. type = jj_consume_token(CONTAINS);
  3778. break;
  3779. default:
  3780. jj_la1[163] = jj_gen;
  3781. jj_consume_token(-1);
  3782. throw new ParseException();
  3783. }
  3784. label_113: while (true) {
  3785. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3786. case S:
  3787. ;
  3788. break;
  3789. default:
  3790. jj_la1[164] = jj_gen;
  3791. break label_113;
  3792. }
  3793. jj_consume_token(S);
  3794. }
  3795. list = listModifyDirectiveArgs(0);
  3796. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3797. case RPARAN:
  3798. jj_consume_token(RPARAN);
  3799. break;
  3800. default:
  3801. jj_la1[165] = jj_gen;
  3802. ;
  3803. }
  3804. jj_consume_token(COMMA);
  3805. label_114: while (true) {
  3806. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3807. case S:
  3808. ;
  3809. break;
  3810. default:
  3811. jj_la1[166] = jj_gen;
  3812. break label_114;
  3813. }
  3814. jj_consume_token(S);
  3815. }
  3816. remove = listModifyDirectiveArgs(1);
  3817. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3818. case COMMA:
  3819. jj_consume_token(COMMA);
  3820. label_115: while (true) {
  3821. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3822. case S:
  3823. ;
  3824. break;
  3825. default:
  3826. jj_la1[167] = jj_gen;
  3827. break label_115;
  3828. }
  3829. jj_consume_token(S);
  3830. }
  3831. n = jj_consume_token(IDENT);
  3832. separator = n.image;
  3833. label_116: while (true) {
  3834. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3835. case S:
  3836. ;
  3837. break;
  3838. default:
  3839. jj_la1[168] = jj_gen;
  3840. break label_116;
  3841. }
  3842. jj_consume_token(S);
  3843. }
  3844. break;
  3845. default:
  3846. jj_la1[169] = jj_gen;
  3847. ;
  3848. }
  3849. jj_consume_token(RPARAN);
  3850. switch (type.kind) {
  3851. case APPEND:
  3852. documentHandler.appendDirective(variable, list, remove, separator);
  3853. break;
  3854. case REMOVE:
  3855. documentHandler.removeDirective(variable, list, remove, separator);
  3856. break;
  3857. case CONTAINS:
  3858. if (variable == null) {
  3859. variable = "$var_" + UUID.randomUUID();
  3860. }
  3861. documentHandler
  3862. .containsDirective(variable, list, remove, separator);
  3863. break;
  3864. default:
  3865. break;
  3866. }
  3867. label_117: while (true) {
  3868. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3869. case S:
  3870. ;
  3871. break;
  3872. default:
  3873. jj_la1[170] = jj_gen;
  3874. break label_117;
  3875. }
  3876. jj_consume_token(S);
  3877. }
  3878. jj_consume_token(SEMICOLON);
  3879. label_118: while (true) {
  3880. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3881. case S:
  3882. ;
  3883. break;
  3884. default:
  3885. jj_la1[171] = jj_gen;
  3886. break label_118;
  3887. }
  3888. jj_consume_token(S);
  3889. }
  3890. }
  3891. /**
  3892. * @exception ParseException
  3893. * exception during the parse
  3894. */
  3895. final public void appendDirective() throws ParseException {
  3896. String list = null;
  3897. String remove = null;
  3898. String separator = null;
  3899. String variable = null;
  3900. Token n = null;
  3901. n = jj_consume_token(VARIABLE);
  3902. variable = n.image;
  3903. label_119: while (true) {
  3904. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3905. case S:
  3906. ;
  3907. break;
  3908. default:
  3909. jj_la1[172] = jj_gen;
  3910. break label_119;
  3911. }
  3912. jj_consume_token(S);
  3913. }
  3914. jj_consume_token(COLON);
  3915. label_120: while (true) {
  3916. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3917. case S:
  3918. ;
  3919. break;
  3920. default:
  3921. jj_la1[173] = jj_gen;
  3922. break label_120;
  3923. }
  3924. jj_consume_token(S);
  3925. }
  3926. jj_consume_token(APPEND);
  3927. label_121: while (true) {
  3928. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3929. case S:
  3930. ;
  3931. break;
  3932. default:
  3933. jj_la1[174] = jj_gen;
  3934. break label_121;
  3935. }
  3936. jj_consume_token(S);
  3937. }
  3938. list = listModifyDirectiveArgs(0);
  3939. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3940. case RPARAN:
  3941. jj_consume_token(RPARAN);
  3942. break;
  3943. default:
  3944. jj_la1[175] = jj_gen;
  3945. ;
  3946. }
  3947. jj_consume_token(COMMA);
  3948. label_122: while (true) {
  3949. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3950. case S:
  3951. ;
  3952. break;
  3953. default:
  3954. jj_la1[176] = jj_gen;
  3955. break label_122;
  3956. }
  3957. jj_consume_token(S);
  3958. }
  3959. remove = listModifyDirectiveArgs(1);
  3960. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3961. case COMMA:
  3962. jj_consume_token(COMMA);
  3963. label_123: while (true) {
  3964. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3965. case S:
  3966. ;
  3967. break;
  3968. default:
  3969. jj_la1[177] = jj_gen;
  3970. break label_123;
  3971. }
  3972. jj_consume_token(S);
  3973. }
  3974. n = jj_consume_token(IDENT);
  3975. separator = n.image;
  3976. label_124: while (true) {
  3977. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  3978. case S:
  3979. ;
  3980. break;
  3981. default:
  3982. jj_la1[178] = jj_gen;
  3983. break label_124;
  3984. }
  3985. jj_consume_token(S);
  3986. }
  3987. break;
  3988. default:
  3989. jj_la1[179] = jj_gen;
  3990. ;
  3991. }
  3992. jj_consume_token(RPARAN);
  3993. documentHandler.appendDirective(variable, list, remove, separator);
  3994. }
  3995. /**
  3996. * @exception ParseException
  3997. * exception during the parse
  3998. */
  3999. final public void removeDirective() throws ParseException {
  4000. String list = null;
  4001. String remove = null;
  4002. String separator = null;
  4003. String variable = null;
  4004. Token n = null;
  4005. n = jj_consume_token(VARIABLE);
  4006. variable = n.image;
  4007. label_125: while (true) {
  4008. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4009. case S:
  4010. ;
  4011. break;
  4012. default:
  4013. jj_la1[180] = jj_gen;
  4014. break label_125;
  4015. }
  4016. jj_consume_token(S);
  4017. }
  4018. jj_consume_token(COLON);
  4019. label_126: while (true) {
  4020. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4021. case S:
  4022. ;
  4023. break;
  4024. default:
  4025. jj_la1[181] = jj_gen;
  4026. break label_126;
  4027. }
  4028. jj_consume_token(S);
  4029. }
  4030. jj_consume_token(REMOVE);
  4031. label_127: while (true) {
  4032. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4033. case S:
  4034. ;
  4035. break;
  4036. default:
  4037. jj_la1[182] = jj_gen;
  4038. break label_127;
  4039. }
  4040. jj_consume_token(S);
  4041. }
  4042. list = listModifyDirectiveArgs(0);
  4043. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4044. case RPARAN:
  4045. jj_consume_token(RPARAN);
  4046. break;
  4047. default:
  4048. jj_la1[183] = jj_gen;
  4049. ;
  4050. }
  4051. jj_consume_token(COMMA);
  4052. label_128: while (true) {
  4053. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4054. case S:
  4055. ;
  4056. break;
  4057. default:
  4058. jj_la1[184] = jj_gen;
  4059. break label_128;
  4060. }
  4061. jj_consume_token(S);
  4062. }
  4063. remove = listModifyDirectiveArgs(1);
  4064. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4065. case COMMA:
  4066. jj_consume_token(COMMA);
  4067. label_129: while (true) {
  4068. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4069. case S:
  4070. ;
  4071. break;
  4072. default:
  4073. jj_la1[185] = jj_gen;
  4074. break label_129;
  4075. }
  4076. jj_consume_token(S);
  4077. }
  4078. n = jj_consume_token(IDENT);
  4079. separator = n.image;
  4080. label_130: while (true) {
  4081. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4082. case S:
  4083. ;
  4084. break;
  4085. default:
  4086. jj_la1[186] = jj_gen;
  4087. break label_130;
  4088. }
  4089. jj_consume_token(S);
  4090. }
  4091. break;
  4092. default:
  4093. jj_la1[187] = jj_gen;
  4094. ;
  4095. }
  4096. jj_consume_token(RPARAN);
  4097. documentHandler.removeDirective(variable, list, remove, separator);
  4098. }
  4099. /**
  4100. * @exception ParseException
  4101. * exception during the parse
  4102. */
  4103. final public String containsDirective() throws ParseException {
  4104. String list = null;
  4105. String remove = null;
  4106. String separator = null;
  4107. String variable = null;
  4108. Token n = null;
  4109. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4110. case VARIABLE:
  4111. n = jj_consume_token(VARIABLE);
  4112. variable = n.image;
  4113. label_131: while (true) {
  4114. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4115. case S:
  4116. ;
  4117. break;
  4118. default:
  4119. jj_la1[188] = jj_gen;
  4120. break label_131;
  4121. }
  4122. jj_consume_token(S);
  4123. }
  4124. jj_consume_token(COLON);
  4125. label_132: while (true) {
  4126. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4127. case S:
  4128. ;
  4129. break;
  4130. default:
  4131. jj_la1[189] = jj_gen;
  4132. break label_132;
  4133. }
  4134. jj_consume_token(S);
  4135. }
  4136. break;
  4137. default:
  4138. jj_la1[190] = jj_gen;
  4139. ;
  4140. }
  4141. jj_consume_token(CONTAINS);
  4142. label_133: while (true) {
  4143. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4144. case S:
  4145. ;
  4146. break;
  4147. default:
  4148. jj_la1[191] = jj_gen;
  4149. break label_133;
  4150. }
  4151. jj_consume_token(S);
  4152. }
  4153. list = listModifyDirectiveArgs(0);
  4154. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4155. case RPARAN:
  4156. jj_consume_token(RPARAN);
  4157. break;
  4158. default:
  4159. jj_la1[192] = jj_gen;
  4160. ;
  4161. }
  4162. jj_consume_token(COMMA);
  4163. label_134: while (true) {
  4164. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4165. case S:
  4166. ;
  4167. break;
  4168. default:
  4169. jj_la1[193] = jj_gen;
  4170. break label_134;
  4171. }
  4172. jj_consume_token(S);
  4173. }
  4174. remove = listModifyDirectiveArgs(1);
  4175. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4176. case COMMA:
  4177. jj_consume_token(COMMA);
  4178. label_135: while (true) {
  4179. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4180. case S:
  4181. ;
  4182. break;
  4183. default:
  4184. jj_la1[194] = jj_gen;
  4185. break label_135;
  4186. }
  4187. jj_consume_token(S);
  4188. }
  4189. n = jj_consume_token(IDENT);
  4190. separator = n.image;
  4191. label_136: while (true) {
  4192. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4193. case S:
  4194. ;
  4195. break;
  4196. default:
  4197. jj_la1[195] = jj_gen;
  4198. break label_136;
  4199. }
  4200. jj_consume_token(S);
  4201. }
  4202. break;
  4203. default:
  4204. jj_la1[196] = jj_gen;
  4205. ;
  4206. }
  4207. jj_consume_token(RPARAN);
  4208. /*
  4209. * if it is not in the form like
  4210. * "$contains : contains($items, .v-button);"for example in @if, like
  4211. * "@if (contains(a b c, b))", then create a tempvariable for contains(a
  4212. * b c, b);
  4213. */
  4214. if (variable == null) {
  4215. variable = "$var_" + UUID.randomUUID();
  4216. }
  4217. documentHandler.containsDirective(variable, list, remove, separator);
  4218. {
  4219. if (true) {
  4220. return variable;
  4221. }
  4222. }
  4223. throw new Error("Missing return statement in function");
  4224. }
  4225. String listModifyDirectiveArgs(int nest) throws ParseException {
  4226. String list = "";
  4227. int nesting = nest;
  4228. Token t = null;
  4229. while (true) {
  4230. t = getToken(1);
  4231. String s = t.image;
  4232. if (t.kind == VARIABLE || t.kind == IDENT) {
  4233. list += s;
  4234. } else if (s.toLowerCase().equals("auto")
  4235. || s.toLowerCase().equals("space")
  4236. || s.toLowerCase().equals("comma")) {
  4237. int i = 2;
  4238. Token temp = getToken(i);
  4239. boolean isLast = true;
  4240. while (temp.kind != SEMICOLON) {
  4241. if (temp.kind != RPARAN || temp.kind != S) {
  4242. isLast = false;
  4243. }
  4244. i++;
  4245. temp = getToken(i);
  4246. }
  4247. if (isLast) {
  4248. return list;
  4249. }
  4250. } else if (t.kind == STRING) {
  4251. list += s.substring(1, s.length()).substring(0, s.length() - 2);
  4252. } else if (t.kind == LPARAN) {
  4253. nesting++;
  4254. if (nesting > nest + 1) {
  4255. throw new CSSParseException(
  4256. "Only one ( ) pair per parameter allowed",
  4257. getLocator());
  4258. }
  4259. } else if (t.kind == RPARAN) {
  4260. nesting--;
  4261. if (nesting == 0) {
  4262. return list;
  4263. }
  4264. } else if (t.kind == COMMA) {
  4265. if (nesting == nest) {
  4266. return list;
  4267. } else {
  4268. list += ",";
  4269. }
  4270. } else if (t.kind == S) {
  4271. list += " ";
  4272. } else if (t.kind == LBRACE) {
  4273. throw new CSSParseException("Invalid token,'{' found",
  4274. getLocator());
  4275. }
  4276. getNextToken();
  4277. }
  4278. }
  4279. final public Node returnDirective() throws ParseException {
  4280. String raw;
  4281. raw = skipStatement();
  4282. {
  4283. if (true) {
  4284. return null;
  4285. }
  4286. }
  4287. throw new Error("Missing return statement in function");
  4288. }
  4289. final public void debuggingDirective() throws ParseException {
  4290. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4291. case DEBUG_SYM:
  4292. debugDirective();
  4293. break;
  4294. case WARN_SYM:
  4295. warnDirective();
  4296. break;
  4297. default:
  4298. jj_la1[197] = jj_gen;
  4299. jj_consume_token(-1);
  4300. throw new ParseException();
  4301. }
  4302. }
  4303. final public void debugDirective() throws ParseException {
  4304. jj_consume_token(DEBUG_SYM);
  4305. String content = skipStatementUntilSemiColon();
  4306. // TODO should evaluate the content expression, call
  4307. // documentHandler.debugDirective() etc.
  4308. System.out.println(content);
  4309. label_137: while (true) {
  4310. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4311. case S:
  4312. ;
  4313. break;
  4314. default:
  4315. jj_la1[198] = jj_gen;
  4316. break label_137;
  4317. }
  4318. jj_consume_token(S);
  4319. }
  4320. }
  4321. final public void warnDirective() throws ParseException {
  4322. jj_consume_token(WARN_SYM);
  4323. String content = skipStatementUntilSemiColon();
  4324. // TODO should evaluate the content expression, call
  4325. // documentHandler.warnDirective() etc.
  4326. System.err.println(content);
  4327. label_138: while (true) {
  4328. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4329. case S:
  4330. ;
  4331. break;
  4332. default:
  4333. jj_la1[199] = jj_gen;
  4334. break label_138;
  4335. }
  4336. jj_consume_token(S);
  4337. }
  4338. }
  4339. final public Node forDirective() throws ParseException {
  4340. String var;
  4341. String from;
  4342. String to;
  4343. boolean exclusive;
  4344. String body;
  4345. Token tok;
  4346. var = variableName();
  4347. int[] toThrough = { TO, THROUGH };
  4348. from = skipStatementUntil(toThrough);
  4349. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4350. case TO:
  4351. tok = jj_consume_token(TO);
  4352. exclusive = true;
  4353. break;
  4354. case THROUGH:
  4355. tok = jj_consume_token(THROUGH);
  4356. exclusive = false;
  4357. break;
  4358. default:
  4359. jj_la1[200] = jj_gen;
  4360. jj_consume_token(-1);
  4361. throw new ParseException();
  4362. }
  4363. to = skipStatementUntilLeftBrace();
  4364. label_139: while (true) {
  4365. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4366. case S:
  4367. ;
  4368. break;
  4369. default:
  4370. jj_la1[201] = jj_gen;
  4371. break label_139;
  4372. }
  4373. jj_consume_token(S);
  4374. }
  4375. body = skipStatement();
  4376. {
  4377. if (true) {
  4378. return documentHandler.forDirective(var, from, to, exclusive,
  4379. body);
  4380. }
  4381. }
  4382. throw new Error("Missing return statement in function");
  4383. }
  4384. final public Node whileDirective() throws ParseException {
  4385. String condition;
  4386. String body;
  4387. condition = skipStatementUntilLeftBrace();
  4388. body = skipStatement();
  4389. {
  4390. if (true) {
  4391. return documentHandler.whileDirective(condition, body);
  4392. }
  4393. }
  4394. throw new Error("Missing return statement in function");
  4395. }
  4396. final public void extendDirective() throws ParseException {
  4397. ArrayList<String> list;
  4398. jj_consume_token(EXTEND_SYM);
  4399. label_140: while (true) {
  4400. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4401. case S:
  4402. ;
  4403. break;
  4404. default:
  4405. jj_la1[202] = jj_gen;
  4406. break label_140;
  4407. }
  4408. jj_consume_token(S);
  4409. }
  4410. list = selectorList();
  4411. label_141: while (true) {
  4412. jj_consume_token(SEMICOLON);
  4413. label_142: while (true) {
  4414. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4415. case S:
  4416. ;
  4417. break;
  4418. default:
  4419. jj_la1[203] = jj_gen;
  4420. break label_142;
  4421. }
  4422. jj_consume_token(S);
  4423. }
  4424. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4425. case SEMICOLON:
  4426. ;
  4427. break;
  4428. default:
  4429. jj_la1[204] = jj_gen;
  4430. break label_141;
  4431. }
  4432. }
  4433. documentHandler.extendDirective(list);
  4434. }
  4435. Node importDirective() throws ParseException {
  4436. return null;
  4437. }
  4438. Node charsetDirective() throws ParseException {
  4439. return null;
  4440. }
  4441. Node mozDocumentDirective() throws ParseException {
  4442. return null;
  4443. }
  4444. Node supportsDirective() throws ParseException {
  4445. return null;
  4446. }
  4447. final public void nestedProperties() throws ParseException {
  4448. String name;
  4449. LexicalUnit exp;
  4450. name = property();
  4451. jj_consume_token(COLON);
  4452. label_143: while (true) {
  4453. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4454. case S:
  4455. ;
  4456. break;
  4457. default:
  4458. jj_la1[205] = jj_gen;
  4459. break label_143;
  4460. }
  4461. jj_consume_token(S);
  4462. }
  4463. jj_consume_token(LBRACE);
  4464. label_144: while (true) {
  4465. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4466. case S:
  4467. ;
  4468. break;
  4469. default:
  4470. jj_la1[206] = jj_gen;
  4471. break label_144;
  4472. }
  4473. jj_consume_token(S);
  4474. }
  4475. documentHandler.startNestedProperties(name);
  4476. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4477. case INTERPOLATION:
  4478. case IDENT:
  4479. declaration();
  4480. break;
  4481. default:
  4482. jj_la1[207] = jj_gen;
  4483. ;
  4484. }
  4485. label_145: while (true) {
  4486. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4487. case SEMICOLON:
  4488. ;
  4489. break;
  4490. default:
  4491. jj_la1[208] = jj_gen;
  4492. break label_145;
  4493. }
  4494. jj_consume_token(SEMICOLON);
  4495. label_146: while (true) {
  4496. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4497. case S:
  4498. ;
  4499. break;
  4500. default:
  4501. jj_la1[209] = jj_gen;
  4502. break label_146;
  4503. }
  4504. jj_consume_token(S);
  4505. }
  4506. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4507. case INTERPOLATION:
  4508. case IDENT:
  4509. declaration();
  4510. break;
  4511. default:
  4512. jj_la1[210] = jj_gen;
  4513. ;
  4514. }
  4515. }
  4516. jj_consume_token(RBRACE);
  4517. documentHandler.endNestedProperties(name);
  4518. label_147: while (true) {
  4519. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4520. case S:
  4521. ;
  4522. break;
  4523. default:
  4524. jj_la1[211] = jj_gen;
  4525. break label_147;
  4526. }
  4527. jj_consume_token(S);
  4528. }
  4529. }
  4530. /**
  4531. * @exception ParseException
  4532. * exception during the parse
  4533. */
  4534. final public void styleRuleOrDeclarationOrNestedProperties()
  4535. throws ParseException {
  4536. try {
  4537. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4538. case DEBUG_SYM:
  4539. case WARN_SYM:
  4540. debuggingDirective();
  4541. break;
  4542. default:
  4543. jj_la1[212] = jj_gen;
  4544. if (jj_2_6(2147483647)) {
  4545. styleRule();
  4546. } else if (jj_2_7(3)) {
  4547. declarationOrNestedProperties();
  4548. } else {
  4549. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4550. case PLUS:
  4551. case PRECEDES:
  4552. case SIBLING:
  4553. case LBRACKET:
  4554. case ANY:
  4555. case PARENT:
  4556. case DOT:
  4557. case COLON:
  4558. case INTERPOLATION:
  4559. case IDENT:
  4560. case HASH:
  4561. styleRule();
  4562. break;
  4563. default:
  4564. jj_la1[213] = jj_gen;
  4565. jj_consume_token(-1);
  4566. throw new ParseException();
  4567. }
  4568. }
  4569. }
  4570. } catch (JumpException e) {
  4571. skipAfterExpression();
  4572. // reportWarningSkipText(getLocator(), skipAfterExpression());
  4573. } catch (ParseException e) {
  4574. if (errorHandler != null) {
  4575. if (e.currentToken != null) {
  4576. LocatorImpl li = new LocatorImpl(this,
  4577. e.currentToken.next.beginLine,
  4578. e.currentToken.next.beginColumn - 1);
  4579. reportError(li, e);
  4580. } else {
  4581. reportError(getLocator(), e);
  4582. }
  4583. skipAfterExpression();
  4584. /*
  4585. * LocatorImpl loc = (LocatorImpl) getLocator(); loc.column--;
  4586. * reportWarningSkipText(loc, skipAfterExpression());
  4587. */
  4588. } else {
  4589. skipAfterExpression();
  4590. }
  4591. }
  4592. }
  4593. /**
  4594. * @exception ParseException
  4595. * exception during the parse
  4596. */
  4597. final public void declarationOrNestedProperties() throws ParseException {
  4598. boolean important = false;
  4599. String name;
  4600. LexicalUnitImpl exp;
  4601. Token save;
  4602. String comment = null;
  4603. try {
  4604. name = property();
  4605. save = token;
  4606. jj_consume_token(COLON);
  4607. label_148: while (true) {
  4608. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4609. case S:
  4610. ;
  4611. break;
  4612. default:
  4613. jj_la1[214] = jj_gen;
  4614. break label_148;
  4615. }
  4616. jj_consume_token(S);
  4617. }
  4618. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4619. case PLUS:
  4620. case MINUS:
  4621. case DOT:
  4622. case STRING:
  4623. case IDENT:
  4624. case NUMBER:
  4625. case URL:
  4626. case VARIABLE:
  4627. case PERCENTAGE:
  4628. case PT:
  4629. case MM:
  4630. case CM:
  4631. case PC:
  4632. case IN:
  4633. case PX:
  4634. case EMS:
  4635. case LEM:
  4636. case REM:
  4637. case EXS:
  4638. case DEG:
  4639. case RAD:
  4640. case GRAD:
  4641. case MS:
  4642. case SECOND:
  4643. case HZ:
  4644. case KHZ:
  4645. case DIMEN:
  4646. case HASH:
  4647. case UNICODERANGE:
  4648. case FUNCTION:
  4649. exp = expr();
  4650. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4651. case IMPORTANT_SYM:
  4652. important = prio();
  4653. break;
  4654. default:
  4655. jj_la1[215] = jj_gen;
  4656. ;
  4657. }
  4658. Token next = getToken(1);
  4659. if (next.kind == SEMICOLON || next.kind == RBRACE) {
  4660. while (next.kind == SEMICOLON) {
  4661. skipStatement();
  4662. next = getToken(1);
  4663. }
  4664. if (token.specialToken != null) {
  4665. documentHandler.property(name, exp, important,
  4666. token.specialToken.image);
  4667. } else {
  4668. documentHandler.property(name, exp, important, null);
  4669. }
  4670. }
  4671. break;
  4672. case LBRACE:
  4673. jj_consume_token(LBRACE);
  4674. label_149: while (true) {
  4675. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4676. case S:
  4677. ;
  4678. break;
  4679. default:
  4680. jj_la1[216] = jj_gen;
  4681. break label_149;
  4682. }
  4683. jj_consume_token(S);
  4684. }
  4685. documentHandler.startNestedProperties(name);
  4686. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4687. case INTERPOLATION:
  4688. case IDENT:
  4689. declaration();
  4690. break;
  4691. default:
  4692. jj_la1[217] = jj_gen;
  4693. ;
  4694. }
  4695. label_150: while (true) {
  4696. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4697. case SEMICOLON:
  4698. ;
  4699. break;
  4700. default:
  4701. jj_la1[218] = jj_gen;
  4702. break label_150;
  4703. }
  4704. jj_consume_token(SEMICOLON);
  4705. label_151: while (true) {
  4706. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4707. case S:
  4708. ;
  4709. break;
  4710. default:
  4711. jj_la1[219] = jj_gen;
  4712. break label_151;
  4713. }
  4714. jj_consume_token(S);
  4715. }
  4716. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4717. case INTERPOLATION:
  4718. case IDENT:
  4719. declaration();
  4720. break;
  4721. default:
  4722. jj_la1[220] = jj_gen;
  4723. ;
  4724. }
  4725. }
  4726. jj_consume_token(RBRACE);
  4727. label_152: while (true) {
  4728. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4729. case S:
  4730. ;
  4731. break;
  4732. default:
  4733. jj_la1[221] = jj_gen;
  4734. break label_152;
  4735. }
  4736. jj_consume_token(S);
  4737. }
  4738. documentHandler.endNestedProperties(name);
  4739. break;
  4740. default:
  4741. jj_la1[222] = jj_gen;
  4742. jj_consume_token(-1);
  4743. throw new ParseException();
  4744. }
  4745. } catch (JumpException e) {
  4746. skipAfterExpression();
  4747. // reportWarningSkipText(getLocator(), skipAfterExpression());
  4748. } catch (NumberFormatException e) {
  4749. if (errorHandler != null) {
  4750. errorHandler.error(new CSSParseException("Invalid number "
  4751. + e.getMessage(), getLocator(), e));
  4752. }
  4753. reportWarningSkipText(getLocator(), skipAfterExpression());
  4754. } catch (ParseException e) {
  4755. if (errorHandler != null) {
  4756. if (e.currentToken != null) {
  4757. LocatorImpl li = new LocatorImpl(this,
  4758. e.currentToken.next.beginLine,
  4759. e.currentToken.next.beginColumn - 1);
  4760. reportError(li, e);
  4761. } else {
  4762. reportError(getLocator(), e);
  4763. }
  4764. skipAfterExpression();
  4765. /*
  4766. * LocatorImpl loc = (LocatorImpl) getLocator(); loc.column--;
  4767. * reportWarningSkipText(loc, skipAfterExpression());
  4768. */
  4769. } else {
  4770. skipAfterExpression();
  4771. }
  4772. }
  4773. }
  4774. /**
  4775. * @exception ParseException
  4776. * exception during the parse
  4777. */
  4778. final public void declaration() throws ParseException {
  4779. boolean important = false;
  4780. String name;
  4781. LexicalUnit exp;
  4782. Token save;
  4783. try {
  4784. name = property();
  4785. save = token;
  4786. jj_consume_token(COLON);
  4787. label_153: while (true) {
  4788. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4789. case S:
  4790. ;
  4791. break;
  4792. default:
  4793. jj_la1[223] = jj_gen;
  4794. break label_153;
  4795. }
  4796. jj_consume_token(S);
  4797. }
  4798. exp = expr();
  4799. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4800. case IMPORTANT_SYM:
  4801. important = prio();
  4802. break;
  4803. default:
  4804. jj_la1[224] = jj_gen;
  4805. ;
  4806. }
  4807. documentHandler.property(name, exp, important);
  4808. } catch (JumpException e) {
  4809. skipAfterExpression();
  4810. // reportWarningSkipText(getLocator(), skipAfterExpression());
  4811. } catch (NumberFormatException e) {
  4812. if (errorHandler != null) {
  4813. errorHandler.error(new CSSParseException("Invalid number "
  4814. + e.getMessage(), getLocator(), e));
  4815. }
  4816. reportWarningSkipText(getLocator(), skipAfterExpression());
  4817. } catch (ParseException e) {
  4818. if (errorHandler != null) {
  4819. if (e.currentToken != null) {
  4820. LocatorImpl li = new LocatorImpl(this,
  4821. e.currentToken.next.beginLine,
  4822. e.currentToken.next.beginColumn - 1);
  4823. reportError(li, e);
  4824. } else {
  4825. reportError(getLocator(), e);
  4826. }
  4827. skipAfterExpression();
  4828. /*
  4829. * LocatorImpl loc = (LocatorImpl) getLocator(); loc.column--;
  4830. * reportWarningSkipText(loc, skipAfterExpression());
  4831. */
  4832. } else {
  4833. skipAfterExpression();
  4834. }
  4835. }
  4836. }
  4837. /**
  4838. * @exception ParseException
  4839. * exception during the parse
  4840. */
  4841. final public boolean prio() throws ParseException {
  4842. jj_consume_token(IMPORTANT_SYM);
  4843. label_154: while (true) {
  4844. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4845. case S:
  4846. ;
  4847. break;
  4848. default:
  4849. jj_la1[225] = jj_gen;
  4850. break label_154;
  4851. }
  4852. jj_consume_token(S);
  4853. }
  4854. {
  4855. if (true) {
  4856. return true;
  4857. }
  4858. }
  4859. throw new Error("Missing return statement in function");
  4860. }
  4861. final public boolean guarded() throws ParseException {
  4862. jj_consume_token(GUARDED_SYM);
  4863. label_155: while (true) {
  4864. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4865. case S:
  4866. ;
  4867. break;
  4868. default:
  4869. jj_la1[226] = jj_gen;
  4870. break label_155;
  4871. }
  4872. jj_consume_token(S);
  4873. }
  4874. {
  4875. if (true) {
  4876. return true;
  4877. }
  4878. }
  4879. throw new Error("Missing return statement in function");
  4880. }
  4881. /**
  4882. * @exception ParseException
  4883. * exception during the parse
  4884. */
  4885. final public LexicalUnitImpl operator(LexicalUnitImpl prev)
  4886. throws ParseException {
  4887. Token n;
  4888. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4889. case COMMA:
  4890. /*
  4891. * (comments copied from basic_arithmetics.scss)supports: 1.
  4892. * standard arithmetic operations (+, -, *, /, %) 2. / is treated as
  4893. * css operator, unless one of its operands is variable or there is
  4894. * another binary arithmetic operatorlimits: 1. cannot mix
  4895. * arithmetic and css operations, e.g. "margin: 1px + 3px 2px" will
  4896. * fail 2. space between add and minus operator and their following
  4897. * operand is mandatory. e.g. "1 + 2" is valid, "1+2" is not 3.
  4898. * parenthesis is not supported now.
  4899. */
  4900. n = jj_consume_token(COMMA);
  4901. label_156: while (true) {
  4902. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4903. case S:
  4904. ;
  4905. break;
  4906. default:
  4907. jj_la1[227] = jj_gen;
  4908. break label_156;
  4909. }
  4910. jj_consume_token(S);
  4911. }
  4912. {
  4913. if (true) {
  4914. return LexicalUnitImpl.createComma(n.beginLine,
  4915. n.beginColumn, prev);
  4916. }
  4917. }
  4918. break;
  4919. case DIV:
  4920. n = jj_consume_token(DIV);
  4921. label_157: while (true) {
  4922. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4923. case S:
  4924. ;
  4925. break;
  4926. default:
  4927. jj_la1[228] = jj_gen;
  4928. break label_157;
  4929. }
  4930. jj_consume_token(S);
  4931. }
  4932. {
  4933. if (true) {
  4934. return LexicalUnitImpl.createSlash(n.beginLine,
  4935. n.beginColumn, prev);
  4936. }
  4937. }
  4938. break;
  4939. case ANY:
  4940. n = jj_consume_token(ANY);
  4941. label_158: while (true) {
  4942. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4943. case S:
  4944. ;
  4945. break;
  4946. default:
  4947. jj_la1[229] = jj_gen;
  4948. break label_158;
  4949. }
  4950. jj_consume_token(S);
  4951. }
  4952. {
  4953. if (true) {
  4954. return LexicalUnitImpl.createMultiply(n.beginLine,
  4955. n.beginColumn, prev);
  4956. }
  4957. }
  4958. break;
  4959. case MOD:
  4960. n = jj_consume_token(MOD);
  4961. label_159: while (true) {
  4962. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4963. case S:
  4964. ;
  4965. break;
  4966. default:
  4967. jj_la1[230] = jj_gen;
  4968. break label_159;
  4969. }
  4970. jj_consume_token(S);
  4971. }
  4972. {
  4973. if (true) {
  4974. return LexicalUnitImpl.createModulo(n.beginLine,
  4975. n.beginColumn, prev);
  4976. }
  4977. }
  4978. break;
  4979. case PLUS:
  4980. n = jj_consume_token(PLUS);
  4981. label_160: while (true) {
  4982. jj_consume_token(S);
  4983. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  4984. case S:
  4985. ;
  4986. break;
  4987. default:
  4988. jj_la1[231] = jj_gen;
  4989. break label_160;
  4990. }
  4991. }
  4992. {
  4993. if (true) {
  4994. return LexicalUnitImpl.createAdd(n.beginLine,
  4995. n.beginColumn, prev);
  4996. }
  4997. }
  4998. break;
  4999. case MINUS:
  5000. n = jj_consume_token(MINUS);
  5001. label_161: while (true) {
  5002. jj_consume_token(S);
  5003. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  5004. case S:
  5005. ;
  5006. break;
  5007. default:
  5008. jj_la1[232] = jj_gen;
  5009. break label_161;
  5010. }
  5011. }
  5012. {
  5013. if (true) {
  5014. return LexicalUnitImpl.createMinus(n.beginLine,
  5015. n.beginColumn, prev);
  5016. }
  5017. }
  5018. break;
  5019. default:
  5020. jj_la1[233] = jj_gen;
  5021. jj_consume_token(-1);
  5022. throw new ParseException();
  5023. }
  5024. throw new Error("Missing return statement in function");
  5025. }
  5026. /**
  5027. * @exception ParseException
  5028. * exception during the parse
  5029. */
  5030. final public LexicalUnitImpl expr() throws ParseException {
  5031. LexicalUnitImpl first, res;
  5032. char op;
  5033. first = term(null);
  5034. res = first;
  5035. label_162: while (true) {
  5036. if (jj_2_8(2)) {
  5037. ;
  5038. } else {
  5039. break label_162;
  5040. }
  5041. if (jj_2_9(2)) {
  5042. res = operator(res);
  5043. } else {
  5044. ;
  5045. }
  5046. res = term(res);
  5047. }
  5048. {
  5049. if (true) {
  5050. return first;
  5051. }
  5052. }
  5053. throw new Error("Missing return statement in function");
  5054. }
  5055. /**
  5056. * @exception ParseException
  5057. * exception during the parse
  5058. */
  5059. final public char unaryOperator() throws ParseException {
  5060. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  5061. case MINUS:
  5062. jj_consume_token(MINUS);
  5063. {
  5064. if (true) {
  5065. return '-';
  5066. }
  5067. }
  5068. break;
  5069. case PLUS:
  5070. jj_consume_token(PLUS);
  5071. {
  5072. if (true) {
  5073. return '+';
  5074. }
  5075. }
  5076. break;
  5077. default:
  5078. jj_la1[234] = jj_gen;
  5079. jj_consume_token(-1);
  5080. throw new ParseException();
  5081. }
  5082. throw new Error("Missing return statement in function");
  5083. }
  5084. /**
  5085. * @exception ParseException
  5086. * exception during the parse
  5087. */
  5088. final public LexicalUnitImpl term(LexicalUnitImpl prev)
  5089. throws ParseException {
  5090. LexicalUnitImpl result = null;
  5091. Token n = null;
  5092. char op = ' ';
  5093. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  5094. case PLUS:
  5095. case MINUS:
  5096. case DOT:
  5097. case STRING:
  5098. case IDENT:
  5099. case NUMBER:
  5100. case URL:
  5101. case PERCENTAGE:
  5102. case PT:
  5103. case MM:
  5104. case CM:
  5105. case PC:
  5106. case IN:
  5107. case PX:
  5108. case EMS:
  5109. case LEM:
  5110. case REM:
  5111. case EXS:
  5112. case DEG:
  5113. case RAD:
  5114. case GRAD:
  5115. case MS:
  5116. case SECOND:
  5117. case HZ:
  5118. case KHZ:
  5119. case DIMEN:
  5120. case HASH:
  5121. case UNICODERANGE:
  5122. case FUNCTION:
  5123. result = nonVariableTerm(prev);
  5124. break;
  5125. case VARIABLE:
  5126. result = variableTerm(prev);
  5127. break;
  5128. default:
  5129. jj_la1[235] = jj_gen;
  5130. jj_consume_token(-1);
  5131. throw new ParseException();
  5132. }
  5133. {
  5134. if (true) {
  5135. return result;
  5136. }
  5137. }
  5138. throw new Error("Missing return statement in function");
  5139. }
  5140. final public LexicalUnitImpl variableTerm(LexicalUnitImpl prev)
  5141. throws ParseException {
  5142. LexicalUnitImpl result = null;
  5143. String varName = "";
  5144. varName = variableName();
  5145. result = LexicalUnitImpl.createVariable(token.beginLine,
  5146. token.beginColumn, prev, varName);
  5147. {
  5148. if (true) {
  5149. return result;
  5150. }
  5151. }
  5152. throw new Error("Missing return statement in function");
  5153. }
  5154. final public LexicalUnitImpl nonVariableTerm(LexicalUnitImpl prev)
  5155. throws ParseException {
  5156. LexicalUnitImpl result = null;
  5157. Token n = null;
  5158. char op = ' ';
  5159. String varName;
  5160. String s = "";
  5161. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  5162. case PLUS:
  5163. case MINUS:
  5164. case NUMBER:
  5165. case PERCENTAGE:
  5166. case PT:
  5167. case MM:
  5168. case CM:
  5169. case PC:
  5170. case IN:
  5171. case PX:
  5172. case EMS:
  5173. case LEM:
  5174. case REM:
  5175. case EXS:
  5176. case DEG:
  5177. case RAD:
  5178. case GRAD:
  5179. case MS:
  5180. case SECOND:
  5181. case HZ:
  5182. case KHZ:
  5183. case DIMEN:
  5184. case FUNCTION:
  5185. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  5186. case PLUS:
  5187. case MINUS:
  5188. op = unaryOperator();
  5189. break;
  5190. default:
  5191. jj_la1[236] = jj_gen;
  5192. ;
  5193. }
  5194. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  5195. case NUMBER:
  5196. n = jj_consume_token(NUMBER);
  5197. result = LexicalUnitImpl.createNumber(n.beginLine,
  5198. n.beginColumn, prev, number(op, n, 0));
  5199. break;
  5200. case PERCENTAGE:
  5201. n = jj_consume_token(PERCENTAGE);
  5202. result = LexicalUnitImpl.createPercentage(n.beginLine,
  5203. n.beginColumn, prev, number(op, n, 1));
  5204. break;
  5205. case PT:
  5206. n = jj_consume_token(PT);
  5207. result = LexicalUnitImpl.createPT(n.beginLine, n.beginColumn,
  5208. prev, number(op, n, 2));
  5209. break;
  5210. case CM:
  5211. n = jj_consume_token(CM);
  5212. result = LexicalUnitImpl.createCM(n.beginLine, n.beginColumn,
  5213. prev, number(op, n, 2));
  5214. break;
  5215. case MM:
  5216. n = jj_consume_token(MM);
  5217. result = LexicalUnitImpl.createMM(n.beginLine, n.beginColumn,
  5218. prev, number(op, n, 2));
  5219. break;
  5220. case PC:
  5221. n = jj_consume_token(PC);
  5222. result = LexicalUnitImpl.createPC(n.beginLine, n.beginColumn,
  5223. prev, number(op, n, 2));
  5224. break;
  5225. case IN:
  5226. n = jj_consume_token(IN);
  5227. result = LexicalUnitImpl.createIN(n.beginLine, n.beginColumn,
  5228. prev, number(op, n, 2));
  5229. break;
  5230. case PX:
  5231. n = jj_consume_token(PX);
  5232. result = LexicalUnitImpl.createPX(n.beginLine, n.beginColumn,
  5233. prev, number(op, n, 2));
  5234. break;
  5235. case EMS:
  5236. n = jj_consume_token(EMS);
  5237. result = LexicalUnitImpl.createEMS(n.beginLine, n.beginColumn,
  5238. prev, number(op, n, 2));
  5239. break;
  5240. case LEM:
  5241. n = jj_consume_token(LEM);
  5242. result = LexicalUnitImpl.createLEM(n.beginLine, n.beginColumn,
  5243. prev, number(op, n, 3));
  5244. break;
  5245. case REM:
  5246. n = jj_consume_token(REM);
  5247. result = LexicalUnitImpl.createREM(n.beginLine, n.beginColumn,
  5248. prev, number(op, n, 3));
  5249. break;
  5250. case EXS:
  5251. n = jj_consume_token(EXS);
  5252. result = LexicalUnitImpl.createEXS(n.beginLine, n.beginColumn,
  5253. prev, number(op, n, 2));
  5254. break;
  5255. case DEG:
  5256. n = jj_consume_token(DEG);
  5257. result = LexicalUnitImpl.createDEG(n.beginLine, n.beginColumn,
  5258. prev, number(op, n, 3));
  5259. break;
  5260. case RAD:
  5261. n = jj_consume_token(RAD);
  5262. result = LexicalUnitImpl.createRAD(n.beginLine, n.beginColumn,
  5263. prev, number(op, n, 3));
  5264. break;
  5265. case GRAD:
  5266. n = jj_consume_token(GRAD);
  5267. result = LexicalUnitImpl.createGRAD(n.beginLine, n.beginColumn,
  5268. prev, number(op, n, 3));
  5269. break;
  5270. case SECOND:
  5271. n = jj_consume_token(SECOND);
  5272. result = LexicalUnitImpl.createS(n.beginLine, n.beginColumn,
  5273. prev, number(op, n, 1));
  5274. break;
  5275. case MS:
  5276. n = jj_consume_token(MS);
  5277. result = LexicalUnitImpl.createMS(n.beginLine, n.beginColumn,
  5278. prev, number(op, n, 2));
  5279. break;
  5280. case HZ:
  5281. n = jj_consume_token(HZ);
  5282. result = LexicalUnitImpl.createHZ(n.beginLine, n.beginColumn,
  5283. prev, number(op, n, 2));
  5284. break;
  5285. case KHZ:
  5286. n = jj_consume_token(KHZ);
  5287. result = LexicalUnitImpl.createKHZ(n.beginLine, n.beginColumn,
  5288. prev, number(op, n, 3));
  5289. break;
  5290. case DIMEN:
  5291. n = jj_consume_token(DIMEN);
  5292. s = n.image;
  5293. int i = 0;
  5294. while (i < s.length()
  5295. && (Character.isDigit(s.charAt(i)) || (s.charAt(i) == '.'))) {
  5296. i++;
  5297. }
  5298. result = LexicalUnitImpl.createDimen(n.beginLine,
  5299. n.beginColumn, prev, Float.valueOf(s.substring(0, i))
  5300. .floatValue(), s.substring(i));
  5301. break;
  5302. case FUNCTION:
  5303. result = function(op, prev);
  5304. break;
  5305. default:
  5306. jj_la1[237] = jj_gen;
  5307. jj_consume_token(-1);
  5308. throw new ParseException();
  5309. }
  5310. break;
  5311. case DOT:
  5312. case STRING:
  5313. case IDENT:
  5314. case URL:
  5315. case HASH:
  5316. case UNICODERANGE:
  5317. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  5318. case STRING:
  5319. n = jj_consume_token(STRING);
  5320. result = LexicalUnitImpl.createString(n.beginLine,
  5321. n.beginColumn, prev,
  5322. convertStringIndex(n.image, 1, n.image.length() - 1));
  5323. break;
  5324. case DOT:
  5325. case IDENT:
  5326. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  5327. case DOT:
  5328. jj_consume_token(DOT);
  5329. s += ".";
  5330. break;
  5331. default:
  5332. jj_la1[238] = jj_gen;
  5333. ;
  5334. }
  5335. n = jj_consume_token(IDENT);
  5336. s += convertIdent(n.image);
  5337. if ("inherit".equals(s)) {
  5338. result = LexicalUnitImpl.createInherit(n.beginLine,
  5339. n.beginColumn, prev);
  5340. } else {
  5341. result = LexicalUnitImpl.createIdent(n.beginLine,
  5342. n.beginColumn, prev, convertIdent(n.image));
  5343. }
  5344. /*
  5345. * / Auto correction code used in the CSS Validator but must not
  5346. * be used by a conformant CSS2 parser. Common error : H1 {
  5347. * color : black background : white }
  5348. *
  5349. * Token t = getToken(1); Token semicolon = new Token();
  5350. * semicolon.kind = SEMICOLON; semicolon.image = ";"; if (t.kind
  5351. * == COLON) { // @@SEEME. (generate a warning?) // @@SEEME if
  5352. * expression is a single ident, generate an error ?
  5353. * rejectToken(semicolon);
  5354. *
  5355. * result = prev; } /
  5356. */
  5357. break;
  5358. case HASH:
  5359. result = hexcolor(prev);
  5360. break;
  5361. case URL:
  5362. result = url(prev);
  5363. break;
  5364. case UNICODERANGE:
  5365. result = unicode(prev);
  5366. break;
  5367. default:
  5368. jj_la1[239] = jj_gen;
  5369. jj_consume_token(-1);
  5370. throw new ParseException();
  5371. }
  5372. break;
  5373. default:
  5374. jj_la1[240] = jj_gen;
  5375. jj_consume_token(-1);
  5376. throw new ParseException();
  5377. }
  5378. label_163: while (true) {
  5379. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  5380. case S:
  5381. ;
  5382. break;
  5383. default:
  5384. jj_la1[241] = jj_gen;
  5385. break label_163;
  5386. }
  5387. jj_consume_token(S);
  5388. }
  5389. {
  5390. if (true) {
  5391. return result;
  5392. }
  5393. }
  5394. throw new Error("Missing return statement in function");
  5395. }
  5396. /**
  5397. * Handle all CSS2 functions.
  5398. *
  5399. * @exception ParseException
  5400. * exception during the parse
  5401. */
  5402. final public LexicalUnitImpl function(char operator, LexicalUnitImpl prev)
  5403. throws ParseException {
  5404. Token n;
  5405. LexicalUnit params = null;
  5406. n = jj_consume_token(FUNCTION);
  5407. label_164: while (true) {
  5408. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  5409. case S:
  5410. ;
  5411. break;
  5412. default:
  5413. jj_la1[242] = jj_gen;
  5414. break label_164;
  5415. }
  5416. jj_consume_token(S);
  5417. }
  5418. String fname = convertIdent(n.image);
  5419. if ("alpha(".equals(fname)) {
  5420. String body = skipStatementUntilSemiColon();
  5421. {
  5422. if (true) {
  5423. return LexicalUnitImpl.createIdent(n.beginLine,
  5424. n.beginColumn, null, "alpha(" + body);
  5425. }
  5426. }
  5427. } else if ("expression(".equals(fname)) {
  5428. String body = skipStatementUntilSemiColon();
  5429. {
  5430. if (true) {
  5431. return LexicalUnitImpl.createIdent(n.beginLine,
  5432. n.beginColumn, null, "expression(" + body);
  5433. }
  5434. }
  5435. }
  5436. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  5437. case PLUS:
  5438. case MINUS:
  5439. case DOT:
  5440. case STRING:
  5441. case IDENT:
  5442. case NUMBER:
  5443. case URL:
  5444. case VARIABLE:
  5445. case PERCENTAGE:
  5446. case PT:
  5447. case MM:
  5448. case CM:
  5449. case PC:
  5450. case IN:
  5451. case PX:
  5452. case EMS:
  5453. case LEM:
  5454. case REM:
  5455. case EXS:
  5456. case DEG:
  5457. case RAD:
  5458. case GRAD:
  5459. case MS:
  5460. case SECOND:
  5461. case HZ:
  5462. case KHZ:
  5463. case DIMEN:
  5464. case HASH:
  5465. case UNICODERANGE:
  5466. case FUNCTION:
  5467. params = expr();
  5468. break;
  5469. default:
  5470. jj_la1[243] = jj_gen;
  5471. ;
  5472. }
  5473. jj_consume_token(RPARAN);
  5474. if (operator != ' ') {
  5475. {
  5476. if (true) {
  5477. throw new CSSParseException(
  5478. "invalid operator before a function.", getLocator());
  5479. }
  5480. }
  5481. }
  5482. String f = convertIdent(n.image);
  5483. LexicalUnitImpl l = (LexicalUnitImpl) params;
  5484. boolean loop = true;
  5485. if ("rgb(".equals(f)) {
  5486. // this is a RGB declaration (e.g. rgb(255, 50%, 0) )
  5487. int i = 0;
  5488. while (loop && l != null && i < 5) {
  5489. switch (i) {
  5490. case 0:
  5491. case 2:
  5492. case 4:
  5493. if ((l.getLexicalUnitType() != LexicalUnit.SAC_INTEGER)
  5494. && (l.getLexicalUnitType() != LexicalUnit.SAC_PERCENTAGE)) {
  5495. loop = false;
  5496. }
  5497. break;
  5498. case 1:
  5499. case 3:
  5500. if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) {
  5501. loop = false;
  5502. }
  5503. break;
  5504. default: {
  5505. if (true) {
  5506. throw new ParseException("implementation error");
  5507. }
  5508. }
  5509. }
  5510. if (loop) {
  5511. l = l.getNextLexicalUnit();
  5512. i++;
  5513. }
  5514. }
  5515. if ((i == 5) && loop && (l == null)) {
  5516. {
  5517. if (true) {
  5518. return LexicalUnitImpl.createRGBColor(n.beginLine,
  5519. n.beginColumn, prev, params);
  5520. }
  5521. }
  5522. } else {
  5523. if (errorHandler != null) {
  5524. String errorText;
  5525. Locator loc;
  5526. if (i < 5) {
  5527. if (params == null) {
  5528. loc = new LocatorImpl(this, n.beginLine,
  5529. n.beginColumn - 1);
  5530. errorText = "not enough parameters.";
  5531. } else if (l == null) {
  5532. loc = new LocatorImpl(this, n.beginLine,
  5533. n.beginColumn - 1);
  5534. errorText = "not enough parameters: "
  5535. + params.toString();
  5536. } else {
  5537. loc = new LocatorImpl(this, l.getLineNumber(),
  5538. l.getColumnNumber());
  5539. errorText = "invalid parameter: " + l.toString();
  5540. }
  5541. } else {
  5542. loc = new LocatorImpl(this, l.getLineNumber(),
  5543. l.getColumnNumber());
  5544. errorText = "too many parameters: " + l.toString();
  5545. }
  5546. errorHandler.error(new CSSParseException(errorText, loc));
  5547. }
  5548. {
  5549. if (true) {
  5550. throw new JumpException();
  5551. }
  5552. }
  5553. }
  5554. } else if ("counter".equals(f)) {
  5555. int i = 0;
  5556. while (loop && l != null && i < 3) {
  5557. switch (i) {
  5558. case 0:
  5559. case 2:
  5560. if (l.getLexicalUnitType() != LexicalUnit.SAC_IDENT) {
  5561. loop = false;
  5562. }
  5563. break;
  5564. case 1:
  5565. if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) {
  5566. loop = false;
  5567. }
  5568. break;
  5569. default: {
  5570. if (true) {
  5571. throw new ParseException("implementation error");
  5572. }
  5573. }
  5574. }
  5575. l = l.getNextLexicalUnit();
  5576. i++;
  5577. }
  5578. if (((i == 1) || (i == 3)) && loop && (l == null)) {
  5579. {
  5580. if (true) {
  5581. return LexicalUnitImpl.createCounter(n.beginLine,
  5582. n.beginColumn, prev, params);
  5583. }
  5584. }
  5585. }
  5586. } else if ("counters(".equals(f)) {
  5587. int i = 0;
  5588. while (loop && l != null && i < 5) {
  5589. switch (i) {
  5590. case 0:
  5591. case 4:
  5592. if (l.getLexicalUnitType() != LexicalUnit.SAC_IDENT) {
  5593. loop = false;
  5594. }
  5595. break;
  5596. case 2:
  5597. if (l.getLexicalUnitType() != LexicalUnit.SAC_STRING_VALUE) {
  5598. loop = false;
  5599. }
  5600. break;
  5601. case 1:
  5602. case 3:
  5603. if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) {
  5604. loop = false;
  5605. }
  5606. break;
  5607. default: {
  5608. if (true) {
  5609. throw new ParseException("implementation error");
  5610. }
  5611. }
  5612. }
  5613. l = l.getNextLexicalUnit();
  5614. i++;
  5615. }
  5616. if (((i == 3) || (i == 5)) && loop && (l == null)) {
  5617. {
  5618. if (true) {
  5619. return LexicalUnitImpl.createCounters(n.beginLine,
  5620. n.beginColumn, prev, params);
  5621. }
  5622. }
  5623. }
  5624. } else if ("attr(".equals(f)) {
  5625. if ((l != null) && (l.getNextLexicalUnit() == null)
  5626. && (l.getLexicalUnitType() == LexicalUnit.SAC_IDENT)) {
  5627. {
  5628. if (true) {
  5629. return LexicalUnitImpl.createAttr(l.getLineNumber(),
  5630. l.getColumnNumber(), prev, l.getStringValue());
  5631. }
  5632. }
  5633. }
  5634. } else if ("rect(".equals(f)) {
  5635. int i = 0;
  5636. while (loop && l != null && i < 7) {
  5637. switch (i) {
  5638. case 0:
  5639. case 2:
  5640. case 4:
  5641. case 6:
  5642. switch (l.getLexicalUnitType()) {
  5643. case LexicalUnit.SAC_INTEGER:
  5644. if (l.getIntegerValue() != 0) {
  5645. loop = false;
  5646. }
  5647. break;
  5648. case LexicalUnit.SAC_IDENT:
  5649. if (!l.getStringValue().equals("auto")) {
  5650. loop = false;
  5651. }
  5652. break;
  5653. case LexicalUnit.SAC_EM:
  5654. case LexicalUnit.SAC_EX:
  5655. case LexicalUnit.SAC_PIXEL:
  5656. case LexicalUnit.SAC_CENTIMETER:
  5657. case LexicalUnit.SAC_MILLIMETER:
  5658. case LexicalUnit.SAC_INCH:
  5659. case LexicalUnit.SAC_POINT:
  5660. case LexicalUnit.SAC_PICA:
  5661. // nothing
  5662. break;
  5663. default:
  5664. loop = false;
  5665. }
  5666. break;
  5667. case 1:
  5668. case 3:
  5669. case 5:
  5670. if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) {
  5671. loop = false;
  5672. }
  5673. break;
  5674. default: {
  5675. if (true) {
  5676. throw new ParseException("implementation error");
  5677. }
  5678. }
  5679. }
  5680. l = l.getNextLexicalUnit();
  5681. i++;
  5682. }
  5683. if ((i == 7) && loop && (l == null)) {
  5684. {
  5685. if (true) {
  5686. return LexicalUnitImpl.createRect(n.beginLine,
  5687. n.beginColumn, prev, params);
  5688. }
  5689. }
  5690. }
  5691. }
  5692. {
  5693. if (true) {
  5694. return LexicalUnitImpl.createFunction(n.beginLine,
  5695. n.beginColumn, prev, f.substring(0, f.length() - 1),
  5696. params);
  5697. }
  5698. }
  5699. throw new Error("Missing return statement in function");
  5700. }
  5701. final public LexicalUnitImpl unicode(LexicalUnitImpl prev)
  5702. throws ParseException {
  5703. Token n;
  5704. n = jj_consume_token(UNICODERANGE);
  5705. LexicalUnitImpl params = null;
  5706. String s = n.image.substring(2);
  5707. int index = s.indexOf('-');
  5708. if (index == -1) {
  5709. params = LexicalUnitImpl.createInteger(n.beginLine, n.beginColumn,
  5710. params, Integer.parseInt(s, 16));
  5711. } else {
  5712. String s1 = s.substring(0, index);
  5713. String s2 = s.substring(index);
  5714. params = LexicalUnitImpl.createInteger(n.beginLine, n.beginColumn,
  5715. params, Integer.parseInt(s1, 16));
  5716. params = LexicalUnitImpl.createInteger(n.beginLine, n.beginColumn,
  5717. params, Integer.parseInt(s2, 16));
  5718. }
  5719. {
  5720. if (true) {
  5721. return LexicalUnitImpl.createUnicodeRange(n.beginLine,
  5722. n.beginColumn, prev, params);
  5723. }
  5724. }
  5725. throw new Error("Missing return statement in function");
  5726. }
  5727. final public LexicalUnitImpl url(LexicalUnitImpl prev)
  5728. throws ParseException {
  5729. Token n;
  5730. n = jj_consume_token(URL);
  5731. String urlname = n.image.substring(4, n.image.length() - 1).trim();
  5732. {
  5733. if (true) {
  5734. return LexicalUnitImpl.createURL(n.beginLine, n.beginColumn,
  5735. prev, urlname);
  5736. }
  5737. }
  5738. throw new Error("Missing return statement in function");
  5739. }
  5740. /**
  5741. * @exception ParseException
  5742. * exception during the parse
  5743. */
  5744. final public LexicalUnitImpl hexcolor(LexicalUnitImpl prev)
  5745. throws ParseException {
  5746. Token n;
  5747. n = jj_consume_token(HASH);
  5748. int r;
  5749. LexicalUnitImpl first, params = null;
  5750. String s = n.image.substring(1);
  5751. if (s.length() != 3 && s.length() != 6) {
  5752. first = null;
  5753. {
  5754. if (true) {
  5755. throw new CSSParseException(
  5756. "invalid hexadecimal notation for RGB: " + s,
  5757. getLocator());
  5758. }
  5759. }
  5760. }
  5761. {
  5762. if (true) {
  5763. return LexicalUnitImpl.createIdent(n.beginLine, n.beginColumn,
  5764. prev, n.image);
  5765. }
  5766. }
  5767. throw new Error("Missing return statement in function");
  5768. }
  5769. float number(char operator, Token n, int lengthUnit) throws ParseException {
  5770. String image = n.image;
  5771. float f = 0;
  5772. if (lengthUnit != 0) {
  5773. image = image.substring(0, image.length() - lengthUnit);
  5774. }
  5775. f = Float.valueOf(image).floatValue();
  5776. return (operator == '-') ? -f : f;
  5777. }
  5778. String skipStatementUntilSemiColon() throws ParseException {
  5779. int[] semicolon = { SEMICOLON };
  5780. return skipStatementUntil(semicolon);
  5781. }
  5782. String skipStatementUntilLeftBrace() throws ParseException {
  5783. int[] lBrace = { LBRACE };
  5784. return skipStatementUntil(lBrace);
  5785. }
  5786. String skipStatementUntilRightParan() throws ParseException {
  5787. int[] rParan = { RPARAN };
  5788. return skipStatementUntil(rParan);
  5789. }
  5790. String skipStatementUntil(int[] symbols) throws ParseException {
  5791. StringBuffer s = new StringBuffer();
  5792. boolean stop = false;
  5793. Token tok;
  5794. while (!stop) {
  5795. tok = getToken(1);
  5796. if (tok.kind == EOF) {
  5797. return null;
  5798. }
  5799. for (int sym : symbols) {
  5800. if (tok.kind == sym) {
  5801. stop = true;
  5802. break;
  5803. }
  5804. }
  5805. if (!stop) {
  5806. if (tok.image != null) {
  5807. s.append(tok.image);
  5808. }
  5809. getNextToken();
  5810. }
  5811. }
  5812. return s.toString().trim();
  5813. }
  5814. String skipStatement() throws ParseException {
  5815. StringBuffer s = new StringBuffer();
  5816. Token tok = getToken(0);
  5817. if (tok.image != null) {
  5818. s.append(tok.image);
  5819. }
  5820. while (true) {
  5821. tok = getToken(1);
  5822. if (tok.kind == EOF) {
  5823. return null;
  5824. }
  5825. s.append(tok.image);
  5826. if (tok.kind == LBRACE) {
  5827. getNextToken();
  5828. s.append(skip_to_matching_brace());
  5829. getNextToken();
  5830. tok = getToken(1);
  5831. break;
  5832. } else if (tok.kind == RBRACE) {
  5833. getNextToken();
  5834. tok = getToken(1);
  5835. break;
  5836. } else if (tok.kind == SEMICOLON) {
  5837. getNextToken();
  5838. tok = getToken(1);
  5839. break;
  5840. }
  5841. getNextToken();
  5842. }
  5843. // skip white space
  5844. while (true) {
  5845. if (tok.kind != S) {
  5846. break;
  5847. }
  5848. tok = getNextToken();
  5849. tok = getToken(1);
  5850. }
  5851. return s.toString().trim();
  5852. }
  5853. String skip_to_matching_brace() throws ParseException {
  5854. StringBuffer s = new StringBuffer();
  5855. Token tok;
  5856. int nesting = 1;
  5857. while (true) {
  5858. tok = getToken(1);
  5859. if (tok.kind == EOF) {
  5860. break;
  5861. }
  5862. s.append(tok.image);
  5863. if (tok.kind == LBRACE) {
  5864. nesting++;
  5865. } else if (tok.kind == RBRACE) {
  5866. nesting--;
  5867. if (nesting == 0) {
  5868. break;
  5869. }
  5870. }
  5871. getNextToken();
  5872. }
  5873. return s.toString();
  5874. }
  5875. String convertStringIndex(String s, int start, int len)
  5876. throws ParseException {
  5877. StringBuffer buf = new StringBuffer(len);
  5878. int index = start;
  5879. while (index < len) {
  5880. char c = s.charAt(index);
  5881. if (c == '\u005c\u005c') {
  5882. if (++index < len) {
  5883. c = s.charAt(index);
  5884. switch (c) {
  5885. case '0':
  5886. case '1':
  5887. case '2':
  5888. case '3':
  5889. case '4':
  5890. case '5':
  5891. case '6':
  5892. case '7':
  5893. case '8':
  5894. case '9':
  5895. case 'a':
  5896. case 'b':
  5897. case 'c':
  5898. case 'd':
  5899. case 'e':
  5900. case 'f':
  5901. case 'A':
  5902. case 'B':
  5903. case 'C':
  5904. case 'D':
  5905. case 'E':
  5906. case 'F':
  5907. buf.append('\u005c\u005c');
  5908. while (index < len) {
  5909. buf.append(s.charAt(index++));
  5910. }
  5911. break;
  5912. case '\u005cn':
  5913. case '\u005cf':
  5914. break;
  5915. case '\u005cr':
  5916. if (index + 1 < len) {
  5917. if (s.charAt(index + 1) == '\u005cn') {
  5918. index++;
  5919. }
  5920. }
  5921. break;
  5922. default:
  5923. buf.append(c);
  5924. }
  5925. } else {
  5926. throw new CSSParseException("invalid string " + s,
  5927. getLocator());
  5928. }
  5929. } else {
  5930. buf.append(c);
  5931. }
  5932. index++;
  5933. }
  5934. return buf.toString();
  5935. }
  5936. String convertIdent(String s) throws ParseException {
  5937. return convertStringIndex(s, 0, s.length());
  5938. }
  5939. String convertString(String s) throws ParseException {
  5940. return convertStringIndex(s, 0, s.length());
  5941. }
  5942. void comments() throws ParseException {
  5943. if (token.specialToken != null) {
  5944. Token tmp_t = token.specialToken;
  5945. while (tmp_t.specialToken != null) {
  5946. tmp_t = tmp_t.specialToken;
  5947. }
  5948. while (tmp_t != null) {
  5949. documentHandler.comment(tmp_t.image);
  5950. tmp_t = tmp_t.next;
  5951. }
  5952. }
  5953. }
  5954. void rejectToken(Token t) throws ParseException {
  5955. Token fakeToken = new Token();
  5956. t.next = token;
  5957. fakeToken.next = t;
  5958. token = fakeToken;
  5959. }
  5960. String skipAfterExpression() throws ParseException {
  5961. Token t = getToken(1);
  5962. StringBuffer s = new StringBuffer();
  5963. s.append(getToken(0).image);
  5964. while ((t.kind != RBRACE) && (t.kind != SEMICOLON) && (t.kind != EOF)) {
  5965. s.append(t.image);
  5966. getNextToken();
  5967. t = getToken(1);
  5968. }
  5969. return s.toString();
  5970. }
  5971. /**
  5972. * The following functions are useful for a DOM CSS implementation only and
  5973. * are not part of the general CSS2 parser.
  5974. */
  5975. final public void _parseRule() throws ParseException {
  5976. String ret = null;
  5977. label_165: while (true) {
  5978. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  5979. case S:
  5980. ;
  5981. break;
  5982. default:
  5983. jj_la1[244] = jj_gen;
  5984. break label_165;
  5985. }
  5986. jj_consume_token(S);
  5987. }
  5988. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  5989. case IMPORT_SYM:
  5990. importDeclaration();
  5991. break;
  5992. case DEBUG_SYM:
  5993. case WARN_SYM:
  5994. debuggingDirective();
  5995. break;
  5996. case PLUS:
  5997. case PRECEDES:
  5998. case SIBLING:
  5999. case LBRACKET:
  6000. case ANY:
  6001. case PARENT:
  6002. case DOT:
  6003. case COLON:
  6004. case INTERPOLATION:
  6005. case IDENT:
  6006. case HASH:
  6007. styleRule();
  6008. break;
  6009. case MEDIA_SYM:
  6010. media();
  6011. break;
  6012. case PAGE_SYM:
  6013. page();
  6014. break;
  6015. case FONT_FACE_SYM:
  6016. fontFace();
  6017. break;
  6018. default:
  6019. jj_la1[245] = jj_gen;
  6020. ret = skipStatement();
  6021. if ((ret == null) || (ret.length() == 0)) {
  6022. {
  6023. if (true) {
  6024. return;
  6025. }
  6026. }
  6027. }
  6028. if (ret.charAt(0) == '@') {
  6029. documentHandler.unrecognizedRule(ret);
  6030. } else {
  6031. {
  6032. if (true) {
  6033. throw new CSSParseException("unrecognize rule: " + ret,
  6034. getLocator());
  6035. }
  6036. }
  6037. }
  6038. }
  6039. }
  6040. final public void _parseImportRule() throws ParseException {
  6041. label_166: while (true) {
  6042. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  6043. case S:
  6044. ;
  6045. break;
  6046. default:
  6047. jj_la1[246] = jj_gen;
  6048. break label_166;
  6049. }
  6050. jj_consume_token(S);
  6051. }
  6052. importDeclaration();
  6053. }
  6054. final public void _parseMediaRule() throws ParseException {
  6055. label_167: while (true) {
  6056. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  6057. case S:
  6058. ;
  6059. break;
  6060. default:
  6061. jj_la1[247] = jj_gen;
  6062. break label_167;
  6063. }
  6064. jj_consume_token(S);
  6065. }
  6066. media();
  6067. }
  6068. final public void _parseDeclarationBlock() throws ParseException {
  6069. label_168: while (true) {
  6070. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  6071. case S:
  6072. ;
  6073. break;
  6074. default:
  6075. jj_la1[248] = jj_gen;
  6076. break label_168;
  6077. }
  6078. jj_consume_token(S);
  6079. }
  6080. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  6081. case INTERPOLATION:
  6082. case IDENT:
  6083. declaration();
  6084. break;
  6085. default:
  6086. jj_la1[249] = jj_gen;
  6087. ;
  6088. }
  6089. label_169: while (true) {
  6090. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  6091. case SEMICOLON:
  6092. ;
  6093. break;
  6094. default:
  6095. jj_la1[250] = jj_gen;
  6096. break label_169;
  6097. }
  6098. jj_consume_token(SEMICOLON);
  6099. label_170: while (true) {
  6100. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  6101. case S:
  6102. ;
  6103. break;
  6104. default:
  6105. jj_la1[251] = jj_gen;
  6106. break label_170;
  6107. }
  6108. jj_consume_token(S);
  6109. }
  6110. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  6111. case INTERPOLATION:
  6112. case IDENT:
  6113. declaration();
  6114. break;
  6115. default:
  6116. jj_la1[252] = jj_gen;
  6117. ;
  6118. }
  6119. }
  6120. }
  6121. final public ArrayList<String> _parseSelectors() throws ParseException {
  6122. ArrayList<String> p = null;
  6123. try {
  6124. label_171: while (true) {
  6125. switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
  6126. case S:
  6127. ;
  6128. break;
  6129. default:
  6130. jj_la1[253] = jj_gen;
  6131. break label_171;
  6132. }
  6133. jj_consume_token(S);
  6134. }
  6135. p = selectorList();
  6136. {
  6137. if (true) {
  6138. return p;
  6139. }
  6140. }
  6141. } catch (ThrowedParseException e) {
  6142. {
  6143. if (true) {
  6144. throw (ParseException) e.e.fillInStackTrace();
  6145. }
  6146. }
  6147. }
  6148. throw new Error("Missing return statement in function");
  6149. }
  6150. private boolean jj_2_1(int xla) {
  6151. jj_la = xla;
  6152. jj_lastpos = jj_scanpos = token;
  6153. try {
  6154. return !jj_3_1();
  6155. } catch (LookaheadSuccess ls) {
  6156. return true;
  6157. } finally {
  6158. jj_save(0, xla);
  6159. }
  6160. }
  6161. private boolean jj_2_2(int xla) {
  6162. jj_la = xla;
  6163. jj_lastpos = jj_scanpos = token;
  6164. try {
  6165. return !jj_3_2();
  6166. } catch (LookaheadSuccess ls) {
  6167. return true;
  6168. } finally {
  6169. jj_save(1, xla);
  6170. }
  6171. }
  6172. private boolean jj_2_3(int xla) {
  6173. jj_la = xla;
  6174. jj_lastpos = jj_scanpos = token;
  6175. try {
  6176. return !jj_3_3();
  6177. } catch (LookaheadSuccess ls) {
  6178. return true;
  6179. } finally {
  6180. jj_save(2, xla);
  6181. }
  6182. }
  6183. private boolean jj_2_4(int xla) {
  6184. jj_la = xla;
  6185. jj_lastpos = jj_scanpos = token;
  6186. try {
  6187. return !jj_3_4();
  6188. } catch (LookaheadSuccess ls) {
  6189. return true;
  6190. } finally {
  6191. jj_save(3, xla);
  6192. }
  6193. }
  6194. private boolean jj_2_5(int xla) {
  6195. jj_la = xla;
  6196. jj_lastpos = jj_scanpos = token;
  6197. try {
  6198. return !jj_3_5();
  6199. } catch (LookaheadSuccess ls) {
  6200. return true;
  6201. } finally {
  6202. jj_save(4, xla);
  6203. }
  6204. }
  6205. private boolean jj_2_6(int xla) {
  6206. jj_la = xla;
  6207. jj_lastpos = jj_scanpos = token;
  6208. try {
  6209. return !jj_3_6();
  6210. } catch (LookaheadSuccess ls) {
  6211. return true;
  6212. } finally {
  6213. jj_save(5, xla);
  6214. }
  6215. }
  6216. private boolean jj_2_7(int xla) {
  6217. jj_la = xla;
  6218. jj_lastpos = jj_scanpos = token;
  6219. try {
  6220. return !jj_3_7();
  6221. } catch (LookaheadSuccess ls) {
  6222. return true;
  6223. } finally {
  6224. jj_save(6, xla);
  6225. }
  6226. }
  6227. private boolean jj_2_8(int xla) {
  6228. jj_la = xla;
  6229. jj_lastpos = jj_scanpos = token;
  6230. try {
  6231. return !jj_3_8();
  6232. } catch (LookaheadSuccess ls) {
  6233. return true;
  6234. } finally {
  6235. jj_save(7, xla);
  6236. }
  6237. }
  6238. private boolean jj_2_9(int xla) {
  6239. jj_la = xla;
  6240. jj_lastpos = jj_scanpos = token;
  6241. try {
  6242. return !jj_3_9();
  6243. } catch (LookaheadSuccess ls) {
  6244. return true;
  6245. } finally {
  6246. jj_save(8, xla);
  6247. }
  6248. }
  6249. private boolean jj_3R_182() {
  6250. if (jj_scan_token(VARIABLE)) {
  6251. return true;
  6252. }
  6253. Token xsp;
  6254. while (true) {
  6255. xsp = jj_scanpos;
  6256. if (jj_scan_token(1)) {
  6257. jj_scanpos = xsp;
  6258. break;
  6259. }
  6260. }
  6261. return false;
  6262. }
  6263. private boolean jj_3R_261() {
  6264. if (jj_scan_token(PLUS)) {
  6265. return true;
  6266. }
  6267. return false;
  6268. }
  6269. private boolean jj_3R_251() {
  6270. Token xsp;
  6271. xsp = jj_scanpos;
  6272. if (jj_3R_260()) {
  6273. jj_scanpos = xsp;
  6274. if (jj_3R_261()) {
  6275. return true;
  6276. }
  6277. }
  6278. return false;
  6279. }
  6280. private boolean jj_3R_260() {
  6281. if (jj_scan_token(MINUS)) {
  6282. return true;
  6283. }
  6284. return false;
  6285. }
  6286. private boolean jj_3R_256() {
  6287. if (jj_scan_token(UNICODERANGE)) {
  6288. return true;
  6289. }
  6290. return false;
  6291. }
  6292. private boolean jj_3R_246() {
  6293. Token xsp;
  6294. xsp = jj_scanpos;
  6295. if (jj_3R_257()) {
  6296. jj_scanpos = xsp;
  6297. if (jj_3R_258()) {
  6298. return true;
  6299. }
  6300. }
  6301. return false;
  6302. }
  6303. private boolean jj_3R_257() {
  6304. if (jj_scan_token(IDENT)) {
  6305. return true;
  6306. }
  6307. return false;
  6308. }
  6309. private boolean jj_3R_198() {
  6310. Token xsp;
  6311. if (jj_3R_246()) {
  6312. return true;
  6313. }
  6314. while (true) {
  6315. xsp = jj_scanpos;
  6316. if (jj_3R_246()) {
  6317. jj_scanpos = xsp;
  6318. break;
  6319. }
  6320. }
  6321. while (true) {
  6322. xsp = jj_scanpos;
  6323. if (jj_scan_token(1)) {
  6324. jj_scanpos = xsp;
  6325. break;
  6326. }
  6327. }
  6328. return false;
  6329. }
  6330. private boolean jj_3_8() {
  6331. Token xsp;
  6332. xsp = jj_scanpos;
  6333. if (jj_3_9()) {
  6334. jj_scanpos = xsp;
  6335. }
  6336. if (jj_3R_180()) {
  6337. return true;
  6338. }
  6339. return false;
  6340. }
  6341. private boolean jj_3R_183() {
  6342. if (jj_3R_180()) {
  6343. return true;
  6344. }
  6345. Token xsp;
  6346. while (true) {
  6347. xsp = jj_scanpos;
  6348. if (jj_3_8()) {
  6349. jj_scanpos = xsp;
  6350. break;
  6351. }
  6352. }
  6353. return false;
  6354. }
  6355. private boolean jj_3R_184() {
  6356. if (jj_3R_209()) {
  6357. return true;
  6358. }
  6359. return false;
  6360. }
  6361. private boolean jj_3R_208() {
  6362. if (jj_scan_token(MINUS)) {
  6363. return true;
  6364. }
  6365. Token xsp;
  6366. if (jj_scan_token(1)) {
  6367. return true;
  6368. }
  6369. while (true) {
  6370. xsp = jj_scanpos;
  6371. if (jj_scan_token(1)) {
  6372. jj_scanpos = xsp;
  6373. break;
  6374. }
  6375. }
  6376. return false;
  6377. }
  6378. private boolean jj_3R_207() {
  6379. if (jj_scan_token(PLUS)) {
  6380. return true;
  6381. }
  6382. Token xsp;
  6383. if (jj_scan_token(1)) {
  6384. return true;
  6385. }
  6386. while (true) {
  6387. xsp = jj_scanpos;
  6388. if (jj_scan_token(1)) {
  6389. jj_scanpos = xsp;
  6390. break;
  6391. }
  6392. }
  6393. return false;
  6394. }
  6395. private boolean jj_3R_206() {
  6396. if (jj_scan_token(MOD)) {
  6397. return true;
  6398. }
  6399. Token xsp;
  6400. while (true) {
  6401. xsp = jj_scanpos;
  6402. if (jj_scan_token(1)) {
  6403. jj_scanpos = xsp;
  6404. break;
  6405. }
  6406. }
  6407. return false;
  6408. }
  6409. private boolean jj_3R_205() {
  6410. if (jj_scan_token(ANY)) {
  6411. return true;
  6412. }
  6413. Token xsp;
  6414. while (true) {
  6415. xsp = jj_scanpos;
  6416. if (jj_scan_token(1)) {
  6417. jj_scanpos = xsp;
  6418. break;
  6419. }
  6420. }
  6421. return false;
  6422. }
  6423. private boolean jj_3R_204() {
  6424. if (jj_scan_token(DIV)) {
  6425. return true;
  6426. }
  6427. Token xsp;
  6428. while (true) {
  6429. xsp = jj_scanpos;
  6430. if (jj_scan_token(1)) {
  6431. jj_scanpos = xsp;
  6432. break;
  6433. }
  6434. }
  6435. return false;
  6436. }
  6437. private boolean jj_3R_211() {
  6438. if (jj_3R_210()) {
  6439. return true;
  6440. }
  6441. return false;
  6442. }
  6443. private boolean jj_3R_210() {
  6444. Token xsp;
  6445. xsp = jj_scanpos;
  6446. if (jj_scan_token(20)) {
  6447. jj_scanpos = xsp;
  6448. if (jj_scan_token(24)) {
  6449. jj_scanpos = xsp;
  6450. if (jj_scan_token(25)) {
  6451. return true;
  6452. }
  6453. }
  6454. }
  6455. while (true) {
  6456. xsp = jj_scanpos;
  6457. if (jj_scan_token(1)) {
  6458. jj_scanpos = xsp;
  6459. break;
  6460. }
  6461. }
  6462. return false;
  6463. }
  6464. private boolean jj_3R_172() {
  6465. if (jj_3R_182()) {
  6466. return true;
  6467. }
  6468. if (jj_scan_token(COLON)) {
  6469. return true;
  6470. }
  6471. Token xsp;
  6472. while (true) {
  6473. xsp = jj_scanpos;
  6474. if (jj_scan_token(1)) {
  6475. jj_scanpos = xsp;
  6476. break;
  6477. }
  6478. }
  6479. if (jj_3R_183()) {
  6480. return true;
  6481. }
  6482. xsp = jj_scanpos;
  6483. if (jj_3R_184()) {
  6484. jj_scanpos = xsp;
  6485. }
  6486. if (jj_3R_185()) {
  6487. return true;
  6488. }
  6489. while (true) {
  6490. xsp = jj_scanpos;
  6491. if (jj_3R_185()) {
  6492. jj_scanpos = xsp;
  6493. break;
  6494. }
  6495. }
  6496. return false;
  6497. }
  6498. private boolean jj_3R_203() {
  6499. if (jj_scan_token(COMMA)) {
  6500. return true;
  6501. }
  6502. Token xsp;
  6503. while (true) {
  6504. xsp = jj_scanpos;
  6505. if (jj_scan_token(1)) {
  6506. jj_scanpos = xsp;
  6507. break;
  6508. }
  6509. }
  6510. return false;
  6511. }
  6512. private boolean jj_3R_181() {
  6513. Token xsp;
  6514. xsp = jj_scanpos;
  6515. if (jj_3R_203()) {
  6516. jj_scanpos = xsp;
  6517. if (jj_3R_204()) {
  6518. jj_scanpos = xsp;
  6519. if (jj_3R_205()) {
  6520. jj_scanpos = xsp;
  6521. if (jj_3R_206()) {
  6522. jj_scanpos = xsp;
  6523. if (jj_3R_207()) {
  6524. jj_scanpos = xsp;
  6525. if (jj_3R_208()) {
  6526. return true;
  6527. }
  6528. }
  6529. }
  6530. }
  6531. }
  6532. }
  6533. return false;
  6534. }
  6535. private boolean jj_3R_187() {
  6536. if (jj_scan_token(S)) {
  6537. return true;
  6538. }
  6539. Token xsp;
  6540. xsp = jj_scanpos;
  6541. if (jj_3R_211()) {
  6542. jj_scanpos = xsp;
  6543. }
  6544. return false;
  6545. }
  6546. private boolean jj_3R_186() {
  6547. if (jj_3R_210()) {
  6548. return true;
  6549. }
  6550. return false;
  6551. }
  6552. private boolean jj_3R_173() {
  6553. Token xsp;
  6554. xsp = jj_scanpos;
  6555. if (jj_3R_186()) {
  6556. jj_scanpos = xsp;
  6557. if (jj_3R_187()) {
  6558. return true;
  6559. }
  6560. }
  6561. return false;
  6562. }
  6563. private boolean jj_3R_209() {
  6564. if (jj_scan_token(GUARDED_SYM)) {
  6565. return true;
  6566. }
  6567. Token xsp;
  6568. while (true) {
  6569. xsp = jj_scanpos;
  6570. if (jj_scan_token(1)) {
  6571. jj_scanpos = xsp;
  6572. break;
  6573. }
  6574. }
  6575. return false;
  6576. }
  6577. private boolean jj_3R_193() {
  6578. if (jj_scan_token(VARIABLE)) {
  6579. return true;
  6580. }
  6581. Token xsp;
  6582. while (true) {
  6583. xsp = jj_scanpos;
  6584. if (jj_scan_token(1)) {
  6585. jj_scanpos = xsp;
  6586. break;
  6587. }
  6588. }
  6589. if (jj_scan_token(COLON)) {
  6590. return true;
  6591. }
  6592. while (true) {
  6593. xsp = jj_scanpos;
  6594. if (jj_scan_token(1)) {
  6595. jj_scanpos = xsp;
  6596. break;
  6597. }
  6598. }
  6599. return false;
  6600. }
  6601. private boolean jj_3R_175() {
  6602. Token xsp;
  6603. xsp = jj_scanpos;
  6604. if (jj_3R_193()) {
  6605. jj_scanpos = xsp;
  6606. }
  6607. if (jj_scan_token(CONTAINS)) {
  6608. return true;
  6609. }
  6610. while (true) {
  6611. xsp = jj_scanpos;
  6612. if (jj_scan_token(1)) {
  6613. jj_scanpos = xsp;
  6614. break;
  6615. }
  6616. }
  6617. if (true) {
  6618. jj_la = 0;
  6619. jj_scanpos = jj_lastpos;
  6620. return false;
  6621. }
  6622. return false;
  6623. }
  6624. private boolean jj_3R_213() {
  6625. if (jj_scan_token(HASH)) {
  6626. return true;
  6627. }
  6628. return false;
  6629. }
  6630. private boolean jj_3R_283() {
  6631. if (jj_scan_token(IDENT)) {
  6632. return true;
  6633. }
  6634. return false;
  6635. }
  6636. private boolean jj_3R_284() {
  6637. if (jj_scan_token(FUNCTION)) {
  6638. return true;
  6639. }
  6640. Token xsp;
  6641. while (true) {
  6642. xsp = jj_scanpos;
  6643. if (jj_scan_token(1)) {
  6644. jj_scanpos = xsp;
  6645. break;
  6646. }
  6647. }
  6648. if (true) {
  6649. jj_la = 0;
  6650. jj_scanpos = jj_lastpos;
  6651. return false;
  6652. }
  6653. return false;
  6654. }
  6655. private boolean jj_3R_282() {
  6656. if (jj_scan_token(COLON)) {
  6657. return true;
  6658. }
  6659. return false;
  6660. }
  6661. private boolean jj_3R_215() {
  6662. if (jj_scan_token(COLON)) {
  6663. return true;
  6664. }
  6665. Token xsp;
  6666. xsp = jj_scanpos;
  6667. if (jj_3R_282()) {
  6668. jj_scanpos = xsp;
  6669. }
  6670. xsp = jj_scanpos;
  6671. if (jj_3R_283()) {
  6672. jj_scanpos = xsp;
  6673. if (jj_3R_284()) {
  6674. return true;
  6675. }
  6676. }
  6677. return false;
  6678. }
  6679. private boolean jj_3_7() {
  6680. if (jj_3R_179()) {
  6681. return true;
  6682. }
  6683. return false;
  6684. }
  6685. private boolean jj_3R_303() {
  6686. if (jj_scan_token(STRING)) {
  6687. return true;
  6688. }
  6689. return false;
  6690. }
  6691. private boolean jj_3R_301() {
  6692. if (jj_scan_token(STARMATCH)) {
  6693. return true;
  6694. }
  6695. return false;
  6696. }
  6697. private boolean jj_3R_302() {
  6698. if (jj_scan_token(IDENT)) {
  6699. return true;
  6700. }
  6701. return false;
  6702. }
  6703. private boolean jj_3R_300() {
  6704. if (jj_scan_token(DOLLARMATCH)) {
  6705. return true;
  6706. }
  6707. return false;
  6708. }
  6709. private boolean jj_3R_299() {
  6710. if (jj_scan_token(CARETMATCH)) {
  6711. return true;
  6712. }
  6713. return false;
  6714. }
  6715. private boolean jj_3R_298() {
  6716. if (jj_scan_token(DASHMATCH)) {
  6717. return true;
  6718. }
  6719. return false;
  6720. }
  6721. private boolean jj_3R_297() {
  6722. if (jj_scan_token(INCLUDES)) {
  6723. return true;
  6724. }
  6725. return false;
  6726. }
  6727. private boolean jj_3R_264() {
  6728. if (jj_scan_token(INTERPOLATION)) {
  6729. return true;
  6730. }
  6731. return false;
  6732. }
  6733. private boolean jj_3R_296() {
  6734. if (jj_scan_token(EQ)) {
  6735. return true;
  6736. }
  6737. return false;
  6738. }
  6739. private boolean jj_3R_200() {
  6740. if (jj_scan_token(LBRACE)) {
  6741. return true;
  6742. }
  6743. return false;
  6744. }
  6745. private boolean jj_3R_289() {
  6746. Token xsp;
  6747. xsp = jj_scanpos;
  6748. if (jj_3R_296()) {
  6749. jj_scanpos = xsp;
  6750. if (jj_3R_297()) {
  6751. jj_scanpos = xsp;
  6752. if (jj_3R_298()) {
  6753. jj_scanpos = xsp;
  6754. if (jj_3R_299()) {
  6755. jj_scanpos = xsp;
  6756. if (jj_3R_300()) {
  6757. jj_scanpos = xsp;
  6758. if (jj_3R_301()) {
  6759. return true;
  6760. }
  6761. }
  6762. }
  6763. }
  6764. }
  6765. }
  6766. while (true) {
  6767. xsp = jj_scanpos;
  6768. if (jj_scan_token(1)) {
  6769. jj_scanpos = xsp;
  6770. break;
  6771. }
  6772. }
  6773. xsp = jj_scanpos;
  6774. if (jj_3R_302()) {
  6775. jj_scanpos = xsp;
  6776. if (jj_3R_303()) {
  6777. return true;
  6778. }
  6779. }
  6780. while (true) {
  6781. xsp = jj_scanpos;
  6782. if (jj_scan_token(1)) {
  6783. jj_scanpos = xsp;
  6784. break;
  6785. }
  6786. }
  6787. return false;
  6788. }
  6789. private boolean jj_3R_216() {
  6790. if (jj_scan_token(LBRACKET)) {
  6791. return true;
  6792. }
  6793. Token xsp;
  6794. while (true) {
  6795. xsp = jj_scanpos;
  6796. if (jj_scan_token(1)) {
  6797. jj_scanpos = xsp;
  6798. break;
  6799. }
  6800. }
  6801. if (jj_scan_token(IDENT)) {
  6802. return true;
  6803. }
  6804. while (true) {
  6805. xsp = jj_scanpos;
  6806. if (jj_scan_token(1)) {
  6807. jj_scanpos = xsp;
  6808. break;
  6809. }
  6810. }
  6811. xsp = jj_scanpos;
  6812. if (jj_3R_289()) {
  6813. jj_scanpos = xsp;
  6814. }
  6815. if (jj_scan_token(RBRACKET)) {
  6816. return true;
  6817. }
  6818. return false;
  6819. }
  6820. private boolean jj_3R_295() {
  6821. if (jj_scan_token(INTERPOLATION)) {
  6822. return true;
  6823. }
  6824. return false;
  6825. }
  6826. private boolean jj_3R_199() {
  6827. if (jj_3R_183()) {
  6828. return true;
  6829. }
  6830. return false;
  6831. }
  6832. private boolean jj_3R_250() {
  6833. if (jj_scan_token(PARENT)) {
  6834. return true;
  6835. }
  6836. return false;
  6837. }
  6838. private boolean jj_3R_249() {
  6839. if (jj_scan_token(ANY)) {
  6840. return true;
  6841. }
  6842. return false;
  6843. }
  6844. private boolean jj_3_6() {
  6845. if (jj_3R_178()) {
  6846. return true;
  6847. }
  6848. if (jj_scan_token(LBRACE)) {
  6849. return true;
  6850. }
  6851. return false;
  6852. }
  6853. private boolean jj_3R_179() {
  6854. if (jj_3R_198()) {
  6855. return true;
  6856. }
  6857. if (jj_scan_token(COLON)) {
  6858. return true;
  6859. }
  6860. Token xsp;
  6861. while (true) {
  6862. xsp = jj_scanpos;
  6863. if (jj_scan_token(1)) {
  6864. jj_scanpos = xsp;
  6865. break;
  6866. }
  6867. }
  6868. xsp = jj_scanpos;
  6869. if (jj_3R_199()) {
  6870. jj_scanpos = xsp;
  6871. if (jj_3R_200()) {
  6872. return true;
  6873. }
  6874. }
  6875. return false;
  6876. }
  6877. private boolean jj_3R_259() {
  6878. Token xsp;
  6879. xsp = jj_scanpos;
  6880. if (jj_3R_263()) {
  6881. jj_scanpos = xsp;
  6882. if (jj_3R_264()) {
  6883. return true;
  6884. }
  6885. }
  6886. return false;
  6887. }
  6888. private boolean jj_3R_263() {
  6889. if (jj_scan_token(IDENT)) {
  6890. return true;
  6891. }
  6892. return false;
  6893. }
  6894. private boolean jj_3R_212() {
  6895. Token xsp;
  6896. xsp = jj_scanpos;
  6897. if (jj_3R_248()) {
  6898. jj_scanpos = xsp;
  6899. if (jj_3R_249()) {
  6900. jj_scanpos = xsp;
  6901. if (jj_3R_250()) {
  6902. return true;
  6903. }
  6904. }
  6905. }
  6906. return false;
  6907. }
  6908. private boolean jj_3R_248() {
  6909. Token xsp;
  6910. if (jj_3R_259()) {
  6911. return true;
  6912. }
  6913. while (true) {
  6914. xsp = jj_scanpos;
  6915. if (jj_3R_259()) {
  6916. jj_scanpos = xsp;
  6917. break;
  6918. }
  6919. }
  6920. return false;
  6921. }
  6922. private boolean jj_3R_262() {
  6923. if (jj_3R_183()) {
  6924. return true;
  6925. }
  6926. return false;
  6927. }
  6928. private boolean jj_3R_176() {
  6929. if (jj_scan_token(COMMA)) {
  6930. return true;
  6931. }
  6932. Token xsp;
  6933. while (true) {
  6934. xsp = jj_scanpos;
  6935. if (jj_scan_token(1)) {
  6936. jj_scanpos = xsp;
  6937. break;
  6938. }
  6939. }
  6940. return false;
  6941. }
  6942. private boolean jj_3R_277() {
  6943. Token xsp;
  6944. xsp = jj_scanpos;
  6945. if (jj_3R_294()) {
  6946. jj_scanpos = xsp;
  6947. if (jj_3R_295()) {
  6948. return true;
  6949. }
  6950. }
  6951. return false;
  6952. }
  6953. private boolean jj_3R_294() {
  6954. if (jj_scan_token(IDENT)) {
  6955. return true;
  6956. }
  6957. return false;
  6958. }
  6959. private boolean jj_3R_293() {
  6960. if (jj_3R_215()) {
  6961. return true;
  6962. }
  6963. return false;
  6964. }
  6965. private boolean jj_3_5() {
  6966. Token xsp;
  6967. xsp = jj_scanpos;
  6968. if (jj_3R_176()) {
  6969. jj_scanpos = xsp;
  6970. }
  6971. if (jj_3R_177()) {
  6972. return true;
  6973. }
  6974. return false;
  6975. }
  6976. private boolean jj_3R_214() {
  6977. if (jj_scan_token(DOT)) {
  6978. return true;
  6979. }
  6980. Token xsp;
  6981. if (jj_3R_277()) {
  6982. return true;
  6983. }
  6984. while (true) {
  6985. xsp = jj_scanpos;
  6986. if (jj_3R_277()) {
  6987. jj_scanpos = xsp;
  6988. break;
  6989. }
  6990. }
  6991. return false;
  6992. }
  6993. private boolean jj_3R_252() {
  6994. if (jj_scan_token(FUNCTION)) {
  6995. return true;
  6996. }
  6997. Token xsp;
  6998. while (true) {
  6999. xsp = jj_scanpos;
  7000. if (jj_scan_token(1)) {
  7001. jj_scanpos = xsp;
  7002. break;
  7003. }
  7004. }
  7005. xsp = jj_scanpos;
  7006. if (jj_3R_262()) {
  7007. jj_scanpos = xsp;
  7008. }
  7009. if (jj_scan_token(RPARAN)) {
  7010. return true;
  7011. }
  7012. return false;
  7013. }
  7014. private boolean jj_3R_291() {
  7015. if (jj_3R_214()) {
  7016. return true;
  7017. }
  7018. return false;
  7019. }
  7020. private boolean jj_3R_286() {
  7021. if (jj_3R_214()) {
  7022. return true;
  7023. }
  7024. return false;
  7025. }
  7026. private boolean jj_3R_288() {
  7027. if (jj_3R_215()) {
  7028. return true;
  7029. }
  7030. return false;
  7031. }
  7032. private boolean jj_3R_276() {
  7033. if (jj_3R_215()) {
  7034. return true;
  7035. }
  7036. return false;
  7037. }
  7038. private boolean jj_3R_279() {
  7039. if (jj_3R_214()) {
  7040. return true;
  7041. }
  7042. return false;
  7043. }
  7044. private boolean jj_3R_281() {
  7045. if (jj_3R_215()) {
  7046. return true;
  7047. }
  7048. return false;
  7049. }
  7050. private boolean jj_3R_243() {
  7051. if (jj_3R_256()) {
  7052. return true;
  7053. }
  7054. return false;
  7055. }
  7056. private boolean jj_3R_242() {
  7057. if (jj_3R_255()) {
  7058. return true;
  7059. }
  7060. return false;
  7061. }
  7062. private boolean jj_3R_241() {
  7063. if (jj_3R_254()) {
  7064. return true;
  7065. }
  7066. return false;
  7067. }
  7068. private boolean jj_3R_292() {
  7069. if (jj_3R_216()) {
  7070. return true;
  7071. }
  7072. return false;
  7073. }
  7074. private boolean jj_3R_269() {
  7075. Token xsp;
  7076. xsp = jj_scanpos;
  7077. if (jj_3R_290()) {
  7078. jj_scanpos = xsp;
  7079. if (jj_3R_291()) {
  7080. jj_scanpos = xsp;
  7081. if (jj_3R_292()) {
  7082. jj_scanpos = xsp;
  7083. if (jj_3R_293()) {
  7084. return true;
  7085. }
  7086. }
  7087. }
  7088. }
  7089. return false;
  7090. }
  7091. private boolean jj_3R_290() {
  7092. if (jj_3R_213()) {
  7093. return true;
  7094. }
  7095. return false;
  7096. }
  7097. private boolean jj_3R_268() {
  7098. Token xsp;
  7099. xsp = jj_scanpos;
  7100. if (jj_3R_285()) {
  7101. jj_scanpos = xsp;
  7102. if (jj_3R_286()) {
  7103. jj_scanpos = xsp;
  7104. if (jj_3R_287()) {
  7105. jj_scanpos = xsp;
  7106. if (jj_3R_288()) {
  7107. return true;
  7108. }
  7109. }
  7110. }
  7111. }
  7112. return false;
  7113. }
  7114. private boolean jj_3R_285() {
  7115. if (jj_3R_213()) {
  7116. return true;
  7117. }
  7118. return false;
  7119. }
  7120. private boolean jj_3R_273() {
  7121. if (jj_3R_215()) {
  7122. return true;
  7123. }
  7124. return false;
  7125. }
  7126. private boolean jj_3R_267() {
  7127. Token xsp;
  7128. xsp = jj_scanpos;
  7129. if (jj_3R_278()) {
  7130. jj_scanpos = xsp;
  7131. if (jj_3R_279()) {
  7132. jj_scanpos = xsp;
  7133. if (jj_3R_280()) {
  7134. jj_scanpos = xsp;
  7135. if (jj_3R_281()) {
  7136. return true;
  7137. }
  7138. }
  7139. }
  7140. }
  7141. return false;
  7142. }
  7143. private boolean jj_3R_278() {
  7144. if (jj_3R_213()) {
  7145. return true;
  7146. }
  7147. return false;
  7148. }
  7149. private boolean jj_3R_287() {
  7150. if (jj_3R_216()) {
  7151. return true;
  7152. }
  7153. return false;
  7154. }
  7155. private boolean jj_3R_275() {
  7156. if (jj_3R_216()) {
  7157. return true;
  7158. }
  7159. return false;
  7160. }
  7161. private boolean jj_3R_280() {
  7162. if (jj_3R_216()) {
  7163. return true;
  7164. }
  7165. return false;
  7166. }
  7167. private boolean jj_3R_266() {
  7168. Token xsp;
  7169. xsp = jj_scanpos;
  7170. if (jj_3R_274()) {
  7171. jj_scanpos = xsp;
  7172. if (jj_3R_275()) {
  7173. jj_scanpos = xsp;
  7174. if (jj_3R_276()) {
  7175. return true;
  7176. }
  7177. }
  7178. }
  7179. return false;
  7180. }
  7181. private boolean jj_3R_271() {
  7182. if (jj_3R_214()) {
  7183. return true;
  7184. }
  7185. return false;
  7186. }
  7187. private boolean jj_3R_274() {
  7188. if (jj_3R_214()) {
  7189. return true;
  7190. }
  7191. return false;
  7192. }
  7193. private boolean jj_3R_192() {
  7194. if (jj_3R_216()) {
  7195. return true;
  7196. }
  7197. Token xsp;
  7198. while (true) {
  7199. xsp = jj_scanpos;
  7200. if (jj_3R_269()) {
  7201. jj_scanpos = xsp;
  7202. break;
  7203. }
  7204. }
  7205. return false;
  7206. }
  7207. private boolean jj_3R_191() {
  7208. if (jj_3R_215()) {
  7209. return true;
  7210. }
  7211. Token xsp;
  7212. while (true) {
  7213. xsp = jj_scanpos;
  7214. if (jj_3R_268()) {
  7215. jj_scanpos = xsp;
  7216. break;
  7217. }
  7218. }
  7219. return false;
  7220. }
  7221. private boolean jj_3R_272() {
  7222. if (jj_3R_216()) {
  7223. return true;
  7224. }
  7225. return false;
  7226. }
  7227. private boolean jj_3R_190() {
  7228. if (jj_3R_214()) {
  7229. return true;
  7230. }
  7231. Token xsp;
  7232. while (true) {
  7233. xsp = jj_scanpos;
  7234. if (jj_3R_267()) {
  7235. jj_scanpos = xsp;
  7236. break;
  7237. }
  7238. }
  7239. return false;
  7240. }
  7241. private boolean jj_3R_253() {
  7242. if (jj_scan_token(DOT)) {
  7243. return true;
  7244. }
  7245. return false;
  7246. }
  7247. private boolean jj_3R_189() {
  7248. if (jj_3R_213()) {
  7249. return true;
  7250. }
  7251. Token xsp;
  7252. while (true) {
  7253. xsp = jj_scanpos;
  7254. if (jj_3R_266()) {
  7255. jj_scanpos = xsp;
  7256. break;
  7257. }
  7258. }
  7259. return false;
  7260. }
  7261. private boolean jj_3R_265() {
  7262. Token xsp;
  7263. xsp = jj_scanpos;
  7264. if (jj_3R_270()) {
  7265. jj_scanpos = xsp;
  7266. if (jj_3R_271()) {
  7267. jj_scanpos = xsp;
  7268. if (jj_3R_272()) {
  7269. jj_scanpos = xsp;
  7270. if (jj_3R_273()) {
  7271. return true;
  7272. }
  7273. }
  7274. }
  7275. }
  7276. return false;
  7277. }
  7278. private boolean jj_3R_270() {
  7279. if (jj_3R_213()) {
  7280. return true;
  7281. }
  7282. return false;
  7283. }
  7284. private boolean jj_3R_240() {
  7285. Token xsp;
  7286. xsp = jj_scanpos;
  7287. if (jj_3R_253()) {
  7288. jj_scanpos = xsp;
  7289. }
  7290. if (jj_scan_token(IDENT)) {
  7291. return true;
  7292. }
  7293. return false;
  7294. }
  7295. private boolean jj_3R_188() {
  7296. if (jj_3R_212()) {
  7297. return true;
  7298. }
  7299. Token xsp;
  7300. while (true) {
  7301. xsp = jj_scanpos;
  7302. if (jj_3R_265()) {
  7303. jj_scanpos = xsp;
  7304. break;
  7305. }
  7306. }
  7307. return false;
  7308. }
  7309. private boolean jj_3R_174() {
  7310. Token xsp;
  7311. xsp = jj_scanpos;
  7312. if (jj_3R_188()) {
  7313. jj_scanpos = xsp;
  7314. if (jj_3R_189()) {
  7315. jj_scanpos = xsp;
  7316. if (jj_3R_190()) {
  7317. jj_scanpos = xsp;
  7318. if (jj_3R_191()) {
  7319. jj_scanpos = xsp;
  7320. if (jj_3R_192()) {
  7321. return true;
  7322. }
  7323. }
  7324. }
  7325. }
  7326. }
  7327. return false;
  7328. }
  7329. private boolean jj_3R_239() {
  7330. if (jj_scan_token(STRING)) {
  7331. return true;
  7332. }
  7333. return false;
  7334. }
  7335. private boolean jj_3R_238() {
  7336. if (jj_3R_252()) {
  7337. return true;
  7338. }
  7339. return false;
  7340. }
  7341. private boolean jj_3R_245() {
  7342. if (jj_3R_210()) {
  7343. return true;
  7344. }
  7345. if (jj_3R_174()) {
  7346. return true;
  7347. }
  7348. return false;
  7349. }
  7350. private boolean jj_3R_195() {
  7351. Token xsp;
  7352. xsp = jj_scanpos;
  7353. if (jj_3R_239()) {
  7354. jj_scanpos = xsp;
  7355. if (jj_3R_240()) {
  7356. jj_scanpos = xsp;
  7357. if (jj_3R_241()) {
  7358. jj_scanpos = xsp;
  7359. if (jj_3R_242()) {
  7360. jj_scanpos = xsp;
  7361. if (jj_3R_243()) {
  7362. return true;
  7363. }
  7364. }
  7365. }
  7366. }
  7367. }
  7368. return false;
  7369. }
  7370. private boolean jj_3R_237() {
  7371. if (jj_scan_token(DIMEN)) {
  7372. return true;
  7373. }
  7374. return false;
  7375. }
  7376. private boolean jj_3R_236() {
  7377. if (jj_scan_token(KHZ)) {
  7378. return true;
  7379. }
  7380. return false;
  7381. }
  7382. private boolean jj_3R_235() {
  7383. if (jj_scan_token(HZ)) {
  7384. return true;
  7385. }
  7386. return false;
  7387. }
  7388. private boolean jj_3R_234() {
  7389. if (jj_scan_token(MS)) {
  7390. return true;
  7391. }
  7392. return false;
  7393. }
  7394. private boolean jj_3R_233() {
  7395. if (jj_scan_token(SECOND)) {
  7396. return true;
  7397. }
  7398. return false;
  7399. }
  7400. private boolean jj_3R_232() {
  7401. if (jj_scan_token(GRAD)) {
  7402. return true;
  7403. }
  7404. return false;
  7405. }
  7406. private boolean jj_3R_231() {
  7407. if (jj_scan_token(RAD)) {
  7408. return true;
  7409. }
  7410. return false;
  7411. }
  7412. private boolean jj_3_2() {
  7413. if (jj_3R_173()) {
  7414. return true;
  7415. }
  7416. if (jj_3R_174()) {
  7417. return true;
  7418. }
  7419. return false;
  7420. }
  7421. private boolean jj_3R_230() {
  7422. if (jj_scan_token(DEG)) {
  7423. return true;
  7424. }
  7425. return false;
  7426. }
  7427. private boolean jj_3_1() {
  7428. if (jj_3R_172()) {
  7429. return true;
  7430. }
  7431. return false;
  7432. }
  7433. private boolean jj_3R_229() {
  7434. if (jj_scan_token(EXS)) {
  7435. return true;
  7436. }
  7437. return false;
  7438. }
  7439. private boolean jj_3R_197() {
  7440. if (jj_scan_token(COMMA)) {
  7441. return true;
  7442. }
  7443. Token xsp;
  7444. while (true) {
  7445. xsp = jj_scanpos;
  7446. if (jj_scan_token(1)) {
  7447. jj_scanpos = xsp;
  7448. break;
  7449. }
  7450. }
  7451. if (jj_3R_196()) {
  7452. return true;
  7453. }
  7454. return false;
  7455. }
  7456. private boolean jj_3R_244() {
  7457. if (jj_3R_174()) {
  7458. return true;
  7459. }
  7460. return false;
  7461. }
  7462. private boolean jj_3R_228() {
  7463. if (jj_scan_token(REM)) {
  7464. return true;
  7465. }
  7466. return false;
  7467. }
  7468. private boolean jj_3R_227() {
  7469. if (jj_scan_token(LEM)) {
  7470. return true;
  7471. }
  7472. return false;
  7473. }
  7474. private boolean jj_3R_196() {
  7475. Token xsp;
  7476. xsp = jj_scanpos;
  7477. if (jj_3R_244()) {
  7478. jj_scanpos = xsp;
  7479. if (jj_3R_245()) {
  7480. return true;
  7481. }
  7482. }
  7483. while (true) {
  7484. xsp = jj_scanpos;
  7485. if (jj_3_2()) {
  7486. jj_scanpos = xsp;
  7487. break;
  7488. }
  7489. }
  7490. while (true) {
  7491. xsp = jj_scanpos;
  7492. if (jj_scan_token(1)) {
  7493. jj_scanpos = xsp;
  7494. break;
  7495. }
  7496. }
  7497. return false;
  7498. }
  7499. private boolean jj_3R_226() {
  7500. if (jj_scan_token(EMS)) {
  7501. return true;
  7502. }
  7503. return false;
  7504. }
  7505. private boolean jj_3R_225() {
  7506. if (jj_scan_token(PX)) {
  7507. return true;
  7508. }
  7509. return false;
  7510. }
  7511. private boolean jj_3R_224() {
  7512. if (jj_scan_token(IN)) {
  7513. return true;
  7514. }
  7515. return false;
  7516. }
  7517. private boolean jj_3R_223() {
  7518. if (jj_scan_token(PC)) {
  7519. return true;
  7520. }
  7521. return false;
  7522. }
  7523. private boolean jj_3R_222() {
  7524. if (jj_scan_token(MM)) {
  7525. return true;
  7526. }
  7527. return false;
  7528. }
  7529. private boolean jj_3R_221() {
  7530. if (jj_scan_token(CM)) {
  7531. return true;
  7532. }
  7533. return false;
  7534. }
  7535. private boolean jj_3R_178() {
  7536. if (jj_3R_196()) {
  7537. return true;
  7538. }
  7539. Token xsp;
  7540. while (true) {
  7541. xsp = jj_scanpos;
  7542. if (jj_3R_197()) {
  7543. jj_scanpos = xsp;
  7544. break;
  7545. }
  7546. }
  7547. return false;
  7548. }
  7549. private boolean jj_3R_220() {
  7550. if (jj_scan_token(PT)) {
  7551. return true;
  7552. }
  7553. return false;
  7554. }
  7555. private boolean jj_3R_219() {
  7556. if (jj_scan_token(PERCENTAGE)) {
  7557. return true;
  7558. }
  7559. return false;
  7560. }
  7561. private boolean jj_3_4() {
  7562. if (jj_3R_175()) {
  7563. return true;
  7564. }
  7565. return false;
  7566. }
  7567. private boolean jj_3R_202() {
  7568. if (jj_3R_247()) {
  7569. return true;
  7570. }
  7571. return false;
  7572. }
  7573. private boolean jj_3R_218() {
  7574. if (jj_scan_token(NUMBER)) {
  7575. return true;
  7576. }
  7577. return false;
  7578. }
  7579. private boolean jj_3R_217() {
  7580. if (jj_3R_251()) {
  7581. return true;
  7582. }
  7583. return false;
  7584. }
  7585. private boolean jj_3R_194() {
  7586. Token xsp;
  7587. xsp = jj_scanpos;
  7588. if (jj_3R_217()) {
  7589. jj_scanpos = xsp;
  7590. }
  7591. xsp = jj_scanpos;
  7592. if (jj_3R_218()) {
  7593. jj_scanpos = xsp;
  7594. if (jj_3R_219()) {
  7595. jj_scanpos = xsp;
  7596. if (jj_3R_220()) {
  7597. jj_scanpos = xsp;
  7598. if (jj_3R_221()) {
  7599. jj_scanpos = xsp;
  7600. if (jj_3R_222()) {
  7601. jj_scanpos = xsp;
  7602. if (jj_3R_223()) {
  7603. jj_scanpos = xsp;
  7604. if (jj_3R_224()) {
  7605. jj_scanpos = xsp;
  7606. if (jj_3R_225()) {
  7607. jj_scanpos = xsp;
  7608. if (jj_3R_226()) {
  7609. jj_scanpos = xsp;
  7610. if (jj_3R_227()) {
  7611. jj_scanpos = xsp;
  7612. if (jj_3R_228()) {
  7613. jj_scanpos = xsp;
  7614. if (jj_3R_229()) {
  7615. jj_scanpos = xsp;
  7616. if (jj_3R_230()) {
  7617. jj_scanpos = xsp;
  7618. if (jj_3R_231()) {
  7619. jj_scanpos = xsp;
  7620. if (jj_3R_232()) {
  7621. jj_scanpos = xsp;
  7622. if (jj_3R_233()) {
  7623. jj_scanpos = xsp;
  7624. if (jj_3R_234()) {
  7625. jj_scanpos = xsp;
  7626. if (jj_3R_235()) {
  7627. jj_scanpos = xsp;
  7628. if (jj_3R_236()) {
  7629. jj_scanpos = xsp;
  7630. if (jj_3R_237()) {
  7631. jj_scanpos = xsp;
  7632. if (jj_3R_238()) {
  7633. return true;
  7634. }
  7635. }
  7636. }
  7637. }
  7638. }
  7639. }
  7640. }
  7641. }
  7642. }
  7643. }
  7644. }
  7645. }
  7646. }
  7647. }
  7648. }
  7649. }
  7650. }
  7651. }
  7652. }
  7653. }
  7654. }
  7655. return false;
  7656. }
  7657. private boolean jj_3R_177() {
  7658. Token xsp;
  7659. xsp = jj_scanpos;
  7660. if (jj_3R_194()) {
  7661. jj_scanpos = xsp;
  7662. if (jj_3R_195()) {
  7663. return true;
  7664. }
  7665. }
  7666. while (true) {
  7667. xsp = jj_scanpos;
  7668. if (jj_scan_token(1)) {
  7669. jj_scanpos = xsp;
  7670. break;
  7671. }
  7672. }
  7673. return false;
  7674. }
  7675. private boolean jj_3R_254() {
  7676. if (jj_scan_token(HASH)) {
  7677. return true;
  7678. }
  7679. return false;
  7680. }
  7681. private boolean jj_3R_247() {
  7682. if (jj_3R_182()) {
  7683. return true;
  7684. }
  7685. return false;
  7686. }
  7687. private boolean jj_3R_258() {
  7688. if (jj_scan_token(INTERPOLATION)) {
  7689. return true;
  7690. }
  7691. return false;
  7692. }
  7693. private boolean jj_3R_255() {
  7694. if (jj_scan_token(URL)) {
  7695. return true;
  7696. }
  7697. return false;
  7698. }
  7699. private boolean jj_3_3() {
  7700. if (jj_3R_172()) {
  7701. return true;
  7702. }
  7703. return false;
  7704. }
  7705. private boolean jj_3R_201() {
  7706. if (jj_3R_177()) {
  7707. return true;
  7708. }
  7709. return false;
  7710. }
  7711. private boolean jj_3R_180() {
  7712. Token xsp;
  7713. xsp = jj_scanpos;
  7714. if (jj_3R_201()) {
  7715. jj_scanpos = xsp;
  7716. if (jj_3R_202()) {
  7717. return true;
  7718. }
  7719. }
  7720. return false;
  7721. }
  7722. private boolean jj_3_9() {
  7723. if (jj_3R_181()) {
  7724. return true;
  7725. }
  7726. return false;
  7727. }
  7728. private boolean jj_3R_185() {
  7729. if (jj_scan_token(SEMICOLON)) {
  7730. return true;
  7731. }
  7732. Token xsp;
  7733. while (true) {
  7734. xsp = jj_scanpos;
  7735. if (jj_scan_token(1)) {
  7736. jj_scanpos = xsp;
  7737. break;
  7738. }
  7739. }
  7740. return false;
  7741. }
  7742. /** Generated Token Manager. */
  7743. public ParserTokenManager token_source;
  7744. /** Current token. */
  7745. public Token token;
  7746. /** Next token. */
  7747. public Token jj_nt;
  7748. private int jj_ntk;
  7749. private Token jj_scanpos, jj_lastpos;
  7750. private int jj_la;
  7751. private int jj_gen;
  7752. final private int[] jj_la1 = new int[254];
  7753. static private int[] jj_la1_0;
  7754. static private int[] jj_la1_1;
  7755. static private int[] jj_la1_2;
  7756. static private int[] jj_la1_3;
  7757. static {
  7758. jj_la1_init_0();
  7759. jj_la1_init_1();
  7760. jj_la1_init_2();
  7761. jj_la1_init_3();
  7762. }
  7763. private static void jj_la1_init_0() {
  7764. jj_la1_0 = new int[] { 0x0, 0xc02, 0xc02, 0x0, 0xc00, 0x2, 0x2, 0x2,
  7765. 0x53100000, 0x0, 0xc00, 0x2, 0xc00, 0x2, 0x0, 0x2, 0x0, 0x2,
  7766. 0x2, 0x0, 0x0, 0x2, 0x2, 0x0, 0x2, 0x0, 0x2, 0x2, 0x53100000,
  7767. 0x53100000, 0x2, 0x2, 0x2, 0x53f45400, 0x53f45400, 0x2,
  7768. 0x400000, 0x2, 0x2, 0x2, 0x2, 0x0, 0x0, 0x2, 0x0, 0x800000,
  7769. 0x2, 0x0, 0x2, 0x2, 0x2, 0x2, 0x0, 0x800000, 0x2, 0x0, 0x2,
  7770. 0xe45400, 0x3100000, 0x3100002, 0x3100000, 0x2, 0x2, 0x480002,
  7771. 0x480002, 0x2, 0x0, 0x0, 0x2, 0x2, 0x2, 0x2, 0x53100000,
  7772. 0x53100000, 0x2, 0x400000, 0x2, 0x53100000, 0x2, 0x10000000,
  7773. 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000,
  7774. 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x50000000,
  7775. 0x0, 0x0, 0x0, 0x0, 0x40000000, 0x2, 0x2, 0xfc000, 0x2, 0x0,
  7776. 0x2, 0xfc000, 0x0, 0x2, 0x0, 0x2, 0x0, 0x2, 0x800000, 0x0,
  7777. 0x53100000, 0x0, 0x4d380002, 0x2, 0x53100000, 0x2, 0x0, 0x2,
  7778. 0x4d380002, 0x0, 0x2, 0x53100000, 0x2, 0x4d380002, 0x2, 0x2,
  7779. 0x2, 0x0, 0x2, 0x53100000, 0x2, 0x2, 0x400000, 0x2, 0x2, 0x2,
  7780. 0x2, 0x0, 0x2, 0x53100000, 0x53100000, 0x2, 0x400000, 0x2, 0x2,
  7781. 0x2, 0x400000, 0x0, 0x0, 0x300000, 0x2, 0x0, 0x400000, 0x2,
  7782. 0x300000, 0x2, 0x0, 0x2, 0x0, 0x2, 0x800000, 0x2, 0x2, 0x0,
  7783. 0x2, 0x0, 0x2, 0x2, 0x2, 0x400000, 0x2, 0x2, 0x2, 0x2, 0x2,
  7784. 0x0, 0x2, 0x2, 0x2, 0x400000, 0x2, 0x2, 0x2, 0x0, 0x2, 0x2,
  7785. 0x2, 0x400000, 0x2, 0x2, 0x0, 0x2, 0x0, 0x2, 0x2, 0x2,
  7786. 0x400000, 0x0, 0x2, 0x2, 0x0, 0x2, 0x2, 0x2, 0x800000, 0x2,
  7787. 0x2, 0x0, 0x800000, 0x2, 0x0, 0x2, 0x0, 0x53100000, 0x2, 0x0,
  7788. 0x2, 0x0, 0x800000, 0x2, 0x0, 0x2, 0x301000, 0x2, 0x0, 0x2,
  7789. 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0xc8700000, 0x300000,
  7790. 0x300000, 0x300000, 0x0, 0x0, 0x0, 0x300000, 0x2, 0x2,
  7791. 0x300000, 0x2, 0x53100000, 0x2, 0x2, 0x2, 0x0, 0x800000, 0x2,
  7792. 0x0, 0x2, };
  7793. }
  7794. private static void jj_la1_init_1() {
  7795. jj_la1_1 = new int[] { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7796. 0x59800303, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7797. 0x200, 0x200, 0x0, 0x0, 0x480000, 0x0, 0x480000, 0x0, 0x0,
  7798. 0x59000303, 0x59000303, 0x0, 0x0, 0x0, 0x18000703, 0x18000703,
  7799. 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x100, 0x0, 0x200, 0x0, 0x0,
  7800. 0x200, 0x0, 0x0, 0x0, 0x0, 0x200, 0x0, 0x0, 0x200, 0x0, 0x400,
  7801. 0x0, 0x0, 0x0, 0x0, 0x0, 0x30a, 0x30a, 0x0, 0x200, 0x200, 0x0,
  7802. 0x0, 0x0, 0x0, 0x59000303, 0x59000303, 0x0, 0x0, 0x0, 0x303,
  7803. 0x0, 0x102, 0x102, 0x102, 0x102, 0x102, 0x102, 0x102, 0x102,
  7804. 0x102, 0x102, 0x303, 0x200, 0x200, 0x200, 0x200, 0x201, 0x0,
  7805. 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x100, 0x0, 0x0, 0x0, 0x0, 0x0,
  7806. 0x0, 0x40000000, 0x19000303, 0x0, 0xfc, 0x0, 0x19000303, 0x0,
  7807. 0x0, 0x0, 0xfc, 0x0, 0x0, 0x19000303, 0x0, 0xfc, 0x0, 0x0, 0x0,
  7808. 0x0, 0x0, 0x19000303, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200,
  7809. 0x0, 0x59000303, 0x59000303, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7810. 0x100, 0x100, 0x102, 0x0, 0x100, 0x0, 0x0, 0x102, 0x0, 0x100,
  7811. 0x0, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0,
  7812. 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0,
  7813. 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8,
  7814. 0x0, 0x0, 0x0, 0x0, 0x18000000, 0x0, 0x0, 0x180000, 0x0, 0x0,
  7815. 0x0, 0x0, 0x0, 0x0, 0x200, 0x0, 0x0, 0x200, 0x0, 0x18000000,
  7816. 0x303, 0x0, 0x0, 0x0, 0x200, 0x0, 0x0, 0x200, 0x0, 0x2, 0x0,
  7817. 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2,
  7818. 0x0, 0x0, 0x2, 0x2, 0x2, 0x0, 0x0, 0x2, 0x0, 0x18000303, 0x0,
  7819. 0x0, 0x0, 0x200, 0x0, 0x0, 0x200, 0x0, };
  7820. }
  7821. private static void jj_la1_init_2() {
  7822. jj_la1_2 = new int[] { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x201,
  7823. 0x2000, 0x0, 0x0, 0x0, 0x0, 0x1100, 0x0, 0x200, 0x0, 0x0,
  7824. 0x200, 0x200, 0x0, 0x0, 0x4000, 0x0, 0x4000, 0x0, 0x0, 0x2225,
  7825. 0x2225, 0x0, 0x0, 0x0, 0x5700, 0x5700, 0x0, 0x0, 0x0, 0x0, 0x0,
  7826. 0x0, 0x200, 0x0, 0x0, 0x200, 0x0, 0x0, 0x200, 0x0, 0x0, 0x0,
  7827. 0x0, 0x200, 0x0, 0x0, 0x200, 0x0, 0x5500, 0x0, 0x0, 0x0, 0x0,
  7828. 0x0, 0x700, 0x700, 0x0, 0x200, 0x200, 0x0, 0x0, 0x0, 0x0,
  7829. 0x2225, 0x2225, 0x0, 0x0, 0x0, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0,
  7830. 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200, 0x200, 0x200, 0x200,
  7831. 0x200, 0x200, 0x0, 0x0, 0x0, 0x0, 0x300, 0x0, 0x0, 0x0, 0x0,
  7832. 0x200, 0x0, 0x80, 0x0, 0x0, 0x1, 0x204, 0x2000, 0x2600, 0x0,
  7833. 0x2204, 0x0, 0x2, 0x0, 0x2600, 0x40, 0x0, 0x2204, 0x0, 0x2600,
  7834. 0x0, 0x0, 0x0, 0x2200, 0x0, 0x2204, 0x0, 0x0, 0x0, 0x0, 0x0,
  7835. 0x0, 0x0, 0x200, 0x0, 0x2205, 0x2205, 0x0, 0x0, 0x0, 0x0, 0x0,
  7836. 0x0, 0x2000, 0x2000, 0xfffff700, 0x0, 0x0, 0x0, 0x0,
  7837. 0xfffff700, 0x0, 0x0, 0x0, 0x2200, 0x0, 0x0, 0x0, 0x0, 0x0,
  7838. 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7839. 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7840. 0x0, 0x0, 0x2000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7841. 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200, 0x0, 0x0, 0x200, 0x0,
  7842. 0x0, 0x200, 0x0, 0x0, 0x0, 0x200, 0x0, 0x0, 0x200, 0x0,
  7843. 0xfffff700, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7844. 0x0, 0x0, 0xfffff700, 0x0, 0xffffc400, 0x0, 0x1300, 0xffffd700,
  7845. 0x0, 0x0, 0xfffff700, 0x0, 0x200, 0x0, 0x0, 0x0, 0x200, 0x0,
  7846. 0x0, 0x200, 0x0, };
  7847. }
  7848. private static void jj_la1_init_3() {
  7849. jj_la1_3 = new int[] { 0x10, 0x100, 0x100, 0x4, 0x100, 0x0, 0x0, 0x0,
  7850. 0xea, 0x0, 0x100, 0x0, 0x100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7851. 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8a, 0x8a, 0x0,
  7852. 0x0, 0x0, 0x188037e, 0x188037e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7853. 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7854. 0x0, 0x0, 0x0, 0x0, 0x188037c, 0x0, 0x0, 0x0, 0x0, 0x0,
  7855. 0x800000, 0x800000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8a,
  7856. 0x8a, 0x0, 0x0, 0x0, 0x2, 0x0, 0x2, 0x2, 0x0, 0x0, 0x2, 0x2,
  7857. 0x2, 0x2, 0x2, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7858. 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x800000, 0x0, 0x0, 0x0,
  7859. 0x0, 0x0, 0x8a, 0x0, 0x400000, 0x0, 0x8a, 0x0, 0x0, 0x0,
  7860. 0x400000, 0x0, 0x0, 0x8a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7861. 0x8a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x800000, 0x0, 0xea,
  7862. 0xea, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x880003, 0x0,
  7863. 0x0, 0x0, 0x0, 0x880003, 0x0, 0x0, 0x0, 0x800000, 0x0, 0x0,
  7864. 0x0, 0x0, 0x700000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7865. 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7866. 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7867. 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7868. 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x200, 0x0, 0x0, 0x0, 0x0,
  7869. 0x0, 0x0, 0x880003, 0x0, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
  7870. 0x0, 0x0, 0x0, 0x0, 0x880003, 0x0, 0x800001, 0x0, 0x80002,
  7871. 0x880003, 0x0, 0x0, 0x880003, 0x0, 0x6e, 0x0, 0x0, 0x0, 0x0,
  7872. 0x0, 0x0, 0x0, 0x0, };
  7873. }
  7874. final private JJCalls[] jj_2_rtns = new JJCalls[9];
  7875. private boolean jj_rescan = false;
  7876. private int jj_gc = 0;
  7877. /** Constructor with user supplied CharStream. */
  7878. public Parser(CharStream stream) {
  7879. token_source = new ParserTokenManager(stream);
  7880. token = new Token();
  7881. jj_ntk = -1;
  7882. jj_gen = 0;
  7883. for (int i = 0; i < 254; i++) {
  7884. jj_la1[i] = -1;
  7885. }
  7886. for (int i = 0; i < jj_2_rtns.length; i++) {
  7887. jj_2_rtns[i] = new JJCalls();
  7888. }
  7889. }
  7890. /** Reinitialise. */
  7891. public void ReInit(CharStream stream) {
  7892. token_source.ReInit(stream);
  7893. token = new Token();
  7894. jj_ntk = -1;
  7895. jj_gen = 0;
  7896. for (int i = 0; i < 254; i++) {
  7897. jj_la1[i] = -1;
  7898. }
  7899. for (int i = 0; i < jj_2_rtns.length; i++) {
  7900. jj_2_rtns[i] = new JJCalls();
  7901. }
  7902. }
  7903. /** Constructor with generated Token Manager. */
  7904. public Parser(ParserTokenManager tm) {
  7905. token_source = tm;
  7906. token = new Token();
  7907. jj_ntk = -1;
  7908. jj_gen = 0;
  7909. for (int i = 0; i < 254; i++) {
  7910. jj_la1[i] = -1;
  7911. }
  7912. for (int i = 0; i < jj_2_rtns.length; i++) {
  7913. jj_2_rtns[i] = new JJCalls();
  7914. }
  7915. }
  7916. /** Reinitialise. */
  7917. public void ReInit(ParserTokenManager tm) {
  7918. token_source = tm;
  7919. token = new Token();
  7920. jj_ntk = -1;
  7921. jj_gen = 0;
  7922. for (int i = 0; i < 254; i++) {
  7923. jj_la1[i] = -1;
  7924. }
  7925. for (int i = 0; i < jj_2_rtns.length; i++) {
  7926. jj_2_rtns[i] = new JJCalls();
  7927. }
  7928. }
  7929. private Token jj_consume_token(int kind) throws ParseException {
  7930. Token oldToken;
  7931. if ((oldToken = token).next != null) {
  7932. token = token.next;
  7933. } else {
  7934. token = token.next = token_source.getNextToken();
  7935. }
  7936. jj_ntk = -1;
  7937. if (token.kind == kind) {
  7938. jj_gen++;
  7939. if (++jj_gc > 100) {
  7940. jj_gc = 0;
  7941. for (int i = 0; i < jj_2_rtns.length; i++) {
  7942. JJCalls c = jj_2_rtns[i];
  7943. while (c != null) {
  7944. if (c.gen < jj_gen) {
  7945. c.first = null;
  7946. }
  7947. c = c.next;
  7948. }
  7949. }
  7950. }
  7951. return token;
  7952. }
  7953. token = oldToken;
  7954. jj_kind = kind;
  7955. throw generateParseException();
  7956. }
  7957. static private final class LookaheadSuccess extends java.lang.Error {
  7958. }
  7959. final private LookaheadSuccess jj_ls = new LookaheadSuccess();
  7960. private boolean jj_scan_token(int kind) {
  7961. if (jj_scanpos == jj_lastpos) {
  7962. jj_la--;
  7963. if (jj_scanpos.next == null) {
  7964. jj_lastpos = jj_scanpos = jj_scanpos.next = token_source
  7965. .getNextToken();
  7966. } else {
  7967. jj_lastpos = jj_scanpos = jj_scanpos.next;
  7968. }
  7969. } else {
  7970. jj_scanpos = jj_scanpos.next;
  7971. }
  7972. if (jj_rescan) {
  7973. int i = 0;
  7974. Token tok = token;
  7975. while (tok != null && tok != jj_scanpos) {
  7976. i++;
  7977. tok = tok.next;
  7978. }
  7979. if (tok != null) {
  7980. jj_add_error_token(kind, i);
  7981. }
  7982. }
  7983. if (jj_scanpos.kind != kind) {
  7984. return true;
  7985. }
  7986. if (jj_la == 0 && jj_scanpos == jj_lastpos) {
  7987. throw jj_ls;
  7988. }
  7989. return false;
  7990. }
  7991. /** Get the next Token. */
  7992. final public Token getNextToken() {
  7993. if (token.next != null) {
  7994. token = token.next;
  7995. } else {
  7996. token = token.next = token_source.getNextToken();
  7997. }
  7998. jj_ntk = -1;
  7999. jj_gen++;
  8000. return token;
  8001. }
  8002. /** Get the specific Token. */
  8003. final public Token getToken(int index) {
  8004. Token t = token;
  8005. for (int i = 0; i < index; i++) {
  8006. if (t.next != null) {
  8007. t = t.next;
  8008. } else {
  8009. t = t.next = token_source.getNextToken();
  8010. }
  8011. }
  8012. return t;
  8013. }
  8014. private int jj_ntk() {
  8015. if ((jj_nt = token.next) == null) {
  8016. return (jj_ntk = (token.next = token_source.getNextToken()).kind);
  8017. } else {
  8018. return (jj_ntk = jj_nt.kind);
  8019. }
  8020. }
  8021. private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();
  8022. private int[] jj_expentry;
  8023. private int jj_kind = -1;
  8024. private int[] jj_lasttokens = new int[100];
  8025. private int jj_endpos;
  8026. private void jj_add_error_token(int kind, int pos) {
  8027. if (pos >= 100) {
  8028. return;
  8029. }
  8030. if (pos == jj_endpos + 1) {
  8031. jj_lasttokens[jj_endpos++] = kind;
  8032. } else if (jj_endpos != 0) {
  8033. jj_expentry = new int[jj_endpos];
  8034. for (int i = 0; i < jj_endpos; i++) {
  8035. jj_expentry[i] = jj_lasttokens[i];
  8036. }
  8037. jj_entries_loop: for (java.util.Iterator<?> it = jj_expentries
  8038. .iterator(); it.hasNext();) {
  8039. int[] oldentry = (int[]) (it.next());
  8040. if (oldentry.length == jj_expentry.length) {
  8041. for (int i = 0; i < jj_expentry.length; i++) {
  8042. if (oldentry[i] != jj_expentry[i]) {
  8043. continue jj_entries_loop;
  8044. }
  8045. }
  8046. jj_expentries.add(jj_expentry);
  8047. break jj_entries_loop;
  8048. }
  8049. }
  8050. if (pos != 0) {
  8051. jj_lasttokens[(jj_endpos = pos) - 1] = kind;
  8052. }
  8053. }
  8054. }
  8055. /** Generate ParseException. */
  8056. public ParseException generateParseException() {
  8057. jj_expentries.clear();
  8058. boolean[] la1tokens = new boolean[121];
  8059. if (jj_kind >= 0) {
  8060. la1tokens[jj_kind] = true;
  8061. jj_kind = -1;
  8062. }
  8063. for (int i = 0; i < 254; i++) {
  8064. if (jj_la1[i] == jj_gen) {
  8065. for (int j = 0; j < 32; j++) {
  8066. if ((jj_la1_0[i] & (1 << j)) != 0) {
  8067. la1tokens[j] = true;
  8068. }
  8069. if ((jj_la1_1[i] & (1 << j)) != 0) {
  8070. la1tokens[32 + j] = true;
  8071. }
  8072. if ((jj_la1_2[i] & (1 << j)) != 0) {
  8073. la1tokens[64 + j] = true;
  8074. }
  8075. if ((jj_la1_3[i] & (1 << j)) != 0) {
  8076. la1tokens[96 + j] = true;
  8077. }
  8078. }
  8079. }
  8080. }
  8081. for (int i = 0; i < 121; i++) {
  8082. if (la1tokens[i]) {
  8083. jj_expentry = new int[1];
  8084. jj_expentry[0] = i;
  8085. jj_expentries.add(jj_expentry);
  8086. }
  8087. }
  8088. jj_endpos = 0;
  8089. jj_rescan_token();
  8090. jj_add_error_token(0, 0);
  8091. int[][] exptokseq = new int[jj_expentries.size()][];
  8092. for (int i = 0; i < jj_expentries.size(); i++) {
  8093. exptokseq[i] = jj_expentries.get(i);
  8094. }
  8095. return new ParseException(token, exptokseq, tokenImage);
  8096. }
  8097. /** Enable tracing. */
  8098. final public void enable_tracing() {
  8099. }
  8100. /** Disable tracing. */
  8101. final public void disable_tracing() {
  8102. }
  8103. private void jj_rescan_token() {
  8104. jj_rescan = true;
  8105. for (int i = 0; i < 9; i++) {
  8106. try {
  8107. JJCalls p = jj_2_rtns[i];
  8108. do {
  8109. if (p.gen > jj_gen) {
  8110. jj_la = p.arg;
  8111. jj_lastpos = jj_scanpos = p.first;
  8112. switch (i) {
  8113. case 0:
  8114. jj_3_1();
  8115. break;
  8116. case 1:
  8117. jj_3_2();
  8118. break;
  8119. case 2:
  8120. jj_3_3();
  8121. break;
  8122. case 3:
  8123. jj_3_4();
  8124. break;
  8125. case 4:
  8126. jj_3_5();
  8127. break;
  8128. case 5:
  8129. jj_3_6();
  8130. break;
  8131. case 6:
  8132. jj_3_7();
  8133. break;
  8134. case 7:
  8135. jj_3_8();
  8136. break;
  8137. case 8:
  8138. jj_3_9();
  8139. break;
  8140. }
  8141. }
  8142. p = p.next;
  8143. } while (p != null);
  8144. } catch (LookaheadSuccess ls) {
  8145. }
  8146. }
  8147. jj_rescan = false;
  8148. }
  8149. private void jj_save(int index, int xla) {
  8150. JJCalls p = jj_2_rtns[index];
  8151. while (p.gen > jj_gen) {
  8152. if (p.next == null) {
  8153. p = p.next = new JJCalls();
  8154. break;
  8155. }
  8156. p = p.next;
  8157. }
  8158. p.gen = jj_gen + xla - jj_la;
  8159. p.first = token;
  8160. p.arg = xla;
  8161. }
  8162. static final class JJCalls {
  8163. int gen;
  8164. Token first;
  8165. int arg;
  8166. JJCalls next;
  8167. }
  8168. }