1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524 |
- /*
- * Copyright 2000-2013 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
- /* Generated By:JavaCC: Do not edit this line. Parser.java */
- package com.vaadin.sass.internal.parser;
-
- import java.io.*;
- import java.net.*;
- import java.util.ArrayList;
- import java.util.Locale;
- import java.util.Map;
- import java.util.UUID;
-
- import org.w3c.css.sac.ConditionFactory;
- import org.w3c.css.sac.Condition;
- import org.w3c.css.sac.SelectorFactory;
- import org.w3c.css.sac.SelectorList;
- import org.w3c.css.sac.Selector;
- import org.w3c.css.sac.SimpleSelector;
- import org.w3c.css.sac.DocumentHandler;
- import org.w3c.css.sac.InputSource;
- import org.w3c.css.sac.ErrorHandler;
- import org.w3c.css.sac.CSSException;
- import org.w3c.css.sac.CSSParseException;
- import org.w3c.css.sac.Locator;
- import org.w3c.css.sac.LexicalUnit;
-
- import org.w3c.flute.parser.selectors.SelectorFactoryImpl;
- import org.w3c.flute.parser.selectors.ConditionFactoryImpl;
-
- import org.w3c.flute.util.Encoding;
-
- import com.vaadin.sass.internal.handler.*;
-
- import com.vaadin.sass.internal.tree.*;
-
- /**
- * A CSS2 parser
- *
- * @author Philippe Le H�garet
- * @version $Revision: 1.15 $
- */
- public class Parser implements org.w3c.css.sac.Parser, ParserConstants {
-
- // replaces all \t, \n, etc with this StringBuffer.
- static final StringBuilder SPACE = new StringBuilder(" ");
-
- // the document handler for the parser
- protected SCSSDocumentHandlerImpl documentHandler;
- // the error handler for the parser
- protected ErrorHandler errorHandler;
- // the input source for the parser
- protected InputSource source;
-
- protected ConditionFactory conditionFactory;
- protected SelectorFactory selectorFactory;
-
- // temporary place holder for pseudo-element ...
- private String pseudoElt;
-
- /**
- * Creates a new Parser
- */
- public Parser() {
- this((CharStream) null);
- }
-
- /**
- * @@TODO
- * @exception CSSException
- * Not yet implemented
- */
- public void setLocale(Locale locale) throws CSSException {
- throw new CSSException(CSSException.SAC_NOT_SUPPORTED_ERR);
- }
-
- public InputSource getInputSource() {
- return source;
- }
-
- /**
- * Set the document handler for this parser
- */
- public void setDocumentHandler(DocumentHandler handler) {
- documentHandler = (SCSSDocumentHandlerImpl) handler;
- }
-
- public void setSelectorFactory(SelectorFactory selectorFactory) {
- this.selectorFactory = selectorFactory;
- }
-
- public void setConditionFactory(ConditionFactory conditionFactory) {
- this.conditionFactory = conditionFactory;
- }
-
- /**
- * Set the error handler for this parser
- */
- public void setErrorHandler(ErrorHandler error) {
- errorHandler = error;
- }
-
- /**
- * Main parse methods
- *
- * @param source
- * the source of the style sheet.
- * @exception IOException
- * the source can't be parsed.
- * @exception CSSException
- * the source is not CSS valid.
- */
- public void parseStyleSheet(InputSource source) throws CSSException,
- IOException {
- this.source = source;
- ReInit(getCharStreamWithLurk(source));
- if (selectorFactory == null) {
- selectorFactory = new SelectorFactoryImpl();
- }
- if (conditionFactory == null) {
- conditionFactory = new ConditionFactoryImpl();
- }
-
- parserUnit();
- }
-
- /**
- * Convenient method for URIs.
- *
- * @param systemId
- * the fully resolved URI of the style sheet.
- * @exception IOException
- * the source can't be parsed.
- * @exception CSSException
- * the source is not CSS valid.
- */
- public void parseStyleSheet(String systemId) throws CSSException,
- IOException {
- parseStyleSheet(new InputSource(systemId));
- }
-
- /**
- * This method parses only one rule (style rule or at-rule, except
- * @charset).
- *
- * @param source
- * the source of the rule.
- * @exception IOException
- * the source can't be parsed.
- * @exception CSSException
- * the source is not CSS valid.
- */
- public void parseRule(InputSource source) throws CSSException, IOException {
- this.source = source;
- ReInit(getCharStreamWithLurk(source));
-
- if (selectorFactory == null) {
- selectorFactory = new SelectorFactoryImpl();
- }
- if (conditionFactory == null) {
- conditionFactory = new ConditionFactoryImpl();
- }
- _parseRule();
- }
-
- /**
- * This method parses a style declaration (including the surrounding curly
- * braces).
- *
- * @param source
- * the source of the style declaration.
- * @exception IOException
- * the source can't be parsed.
- * @exception CSSException
- * the source is not CSS valid.
- */
- public void parseStyleDeclaration(InputSource source) throws CSSException,
- IOException {
- this.source = source;
- ReInit(getCharStreamWithLurk(source));
-
- if (selectorFactory == null) {
- selectorFactory = new SelectorFactoryImpl();
- }
- if (conditionFactory == null) {
- conditionFactory = new ConditionFactoryImpl();
- }
- _parseDeclarationBlock();
- }
-
- /**
- * This methods returns "http://www.w3.org/TR/REC-CSS2".
- *
- * @return the string "http://www.w3.org/TR/REC-CSS2".
- */
- public String getParserVersion() {
- return "http://www.w3.org/TR/REC-CSS2";
- }
-
- /**
- * Parse methods used by DOM Level 2 implementation.
- */
- public void parseImportRule(InputSource source) throws CSSException,
- IOException {
- this.source = source;
- ReInit(getCharStreamWithLurk(source));
-
- if (selectorFactory == null) {
- selectorFactory = new SelectorFactoryImpl();
- }
- if (conditionFactory == null) {
- conditionFactory = new ConditionFactoryImpl();
- }
- _parseImportRule();
- }
-
- public void parseMediaRule(InputSource source) throws CSSException,
- IOException {
- this.source = source;
- ReInit(getCharStreamWithLurk(source));
-
- if (selectorFactory == null) {
- selectorFactory = new SelectorFactoryImpl();
- }
- if (conditionFactory == null) {
- conditionFactory = new ConditionFactoryImpl();
- }
- _parseMediaRule();
- }
-
- public SelectorList parseSelectors(InputSource source) throws CSSException,
- IOException {
- this.source = source;
- ReInit(getCharStreamWithLurk(source));
-
- return null;
- }
-
- public LexicalUnit parsePropertyValue(InputSource source)
- throws CSSException, IOException {
- this.source = source;
- ReInit(getCharStreamWithLurk(source));
-
- return expr();
- }
-
- public boolean parsePriority(InputSource source) throws CSSException,
- IOException {
- this.source = source;
- ReInit(getCharStreamWithLurk(source));
-
- return prio();
- }
-
- /**
- * Convert the source into a Reader. Used only by DOM Level 2 parser
- * methods.
- */
- private Reader getReader(InputSource source) throws IOException {
- if (source.getCharacterStream() != null) {
- return source.getCharacterStream();
- } else if (source.getByteStream() != null) {
- // My DOM level 2 implementation doesn't use this case.
- if (source.getEncoding() == null) {
- // unknown encoding, use ASCII as default.
- return new InputStreamReader(source.getByteStream(), "ASCII");
- } else {
- return new InputStreamReader(source.getByteStream(),
- source.getEncoding());
- }
- } else {
- // systemId
- // @@TODO
- throw new CSSException("not yet implemented");
- }
- }
-
- /**
- * Convert the source into a CharStream with encoding informations. The
- * encoding can be found in the InputSource or in the CSS document. Since
- * this method marks the reader and make a reset after looking for the
- * charset declaration, you'll find the charset declaration into the stream.
- */
- private CharStream getCharStreamWithLurk(InputSource source)
- throws CSSException, IOException {
- if (source.getCharacterStream() != null) {
- // all encoding are supposed to be resolved by the user
- // return the reader
- return new Generic_CharStream(source.getCharacterStream(), 1, 1);
- } else if (source.getByteStream() == null) {
- // @@CONTINUE ME. see also getReader() with systemId
- try {
- source.setByteStream(new URL(source.getURI()).openStream());
- } catch (Exception e) {
- try {
- source.setByteStream(new FileInputStream(source.getURI()));
- } catch (IOException ex) {
- throw new CSSException("invalid url ?");
- }
- }
- }
- // use UTF-8 as the default encoding.
- String encoding = source.getEncoding();
- InputStream input = source.getByteStream();
- if (!input.markSupported()) {
- // If mark is not supported, wrap it in a stream which supports mark
- input = new BufferedInputStream(input);
- source.setByteStream(input);
- }
- // Mark either the original stream or the wrapped stream
- input.mark(100);
- if (encoding == null) {
- encoding = "ASCII";
-
- char c = ' ';
-
- c = (char) input.read();
-
- if (c == '@') {
- // hum, is it a charset ?
- int size = 100;
- byte[] buf = new byte[size];
- input.read(buf, 0, 7);
- String keyword = new String(buf, 0, 7);
- if (keyword.equals("charset")) {
- // Yes, this is the charset declaration !
-
- // here I don't use the right declaration : white space are
- // ' '.
- while ((c = (char) input.read()) == ' ') {
- // find the first quote
- }
- char endChar = c;
- int i = 0;
-
- if ((endChar != '"') && (endChar != '\u005c'')) {
- // hum this is not a quote.
- throw new CSSException("invalid charset declaration");
- }
-
- while ((c = (char) input.read()) != endChar) {
- buf[i++] = (byte) c;
- if (i == size) {
- byte[] old = buf;
- buf = new byte[size + 100];
- System.arraycopy(old, 0, buf, 0, size);
- size += 100;
- }
- }
- while ((c = (char) input.read()) == ' ') {
- // find the next relevant character
- }
- if (c != ';') {
- // no semi colon at the end ?
- throw new CSSException("invalid charset declaration: "
- + "missing semi colon");
- }
- encoding = new String(buf, 0, i);
- if (source.getEncoding() != null) {
- // compare the two encoding informations.
- // For example, I don't accept to have ASCII and after
- // UTF-8.
- // Is it really good ? That is the question.
- if (!encoding.equals(source.getEncoding())) {
- throw new CSSException(
- "invalid encoding information.");
- }
- }
- } // else no charset declaration available
- }
- }
- // ok set the real encoding of this source.
- source.setEncoding(encoding);
- // set the real reader of this source.
- source.setCharacterStream(new InputStreamReader(source.getByteStream(),
- Encoding.getJavaEncoding(encoding)));
- // reset the stream (leave the charset declaration in the stream).
- input.reset();
-
- return new Generic_CharStream(source.getCharacterStream(), 1, 1);
- }
-
- private LocatorImpl currentLocator;
-
- private Locator getLocator() {
- if (currentLocator == null) {
- currentLocator = new LocatorImpl(this);
- return currentLocator;
- }
- return currentLocator.reInit(this);
- }
-
- private LocatorImpl getLocator(Token save) {
- if (currentLocator == null) {
- currentLocator = new LocatorImpl(this, save);
- return currentLocator;
- }
- return currentLocator.reInit(this, save);
- }
-
- private void reportError(Locator l, Exception e) {
- if (errorHandler != null) {
- if (e instanceof ParseException) {
- // construct a clean error message.
- ParseException pe = (ParseException) e;
- if (pe.specialConstructor) {
- StringBuffer errorM = new StringBuffer();
- if (pe.currentToken != null) {
- errorM.append("encountered \u005c"").append(
- pe.currentToken.next);
- }
- errorM.append('"');
- if (pe.expectedTokenSequences.length != 0) {
- errorM.append(". Was expecting one of: ");
- for (int i = 0; i < pe.expectedTokenSequences.length; i++) {
- for (int j = 0; j < pe.expectedTokenSequences[i].length; j++) {
- int kind = pe.expectedTokenSequences[i][j];
- if (kind != S) {
- errorM.append(pe.tokenImage[kind]);
- errorM.append(' ');
- }
- }
- }
- }
- errorHandler.error(new CSSParseException(errorM.toString(),
- l, e));
- } else {
- errorHandler.error(new CSSParseException(e.getMessage(), l,
- e));
- }
- } else if (e == null) {
- errorHandler.error(new CSSParseException("error", l, null));
- } else {
- errorHandler.error(new CSSParseException(e.getMessage(), l, e));
- }
- }
- }
-
- private void reportWarningSkipText(Locator l, String text) {
- if (errorHandler != null && text != null) {
- errorHandler.warning(new CSSParseException("Skipping: " + text, l));
- }
- }
-
- /*
- * The grammar of CSS2
- */
-
- /**
- * The main entry for the parser.
- *
- * @exception ParseException
- * exception during the parse
- */
- final public void parserUnit() throws ParseException {
- try {
- documentHandler.startDocument(source);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case CHARSET_SYM:
- charset();
- break;
- default:
- jj_la1[0] = jj_gen;
- ;
- }
- label_1: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- case CDO:
- case CDC:
- case ATKEYWORD:
- ;
- break;
- default:
- jj_la1[1] = jj_gen;
- break label_1;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- jj_consume_token(S);
- comments();
- break;
- case CDO:
- case CDC:
- case ATKEYWORD:
- ignoreStatement();
- break;
- default:
- jj_la1[2] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- label_2: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IMPORT_SYM:
- ;
- break;
- default:
- jj_la1[3] = jj_gen;
- break label_2;
- }
- importDeclaration();
- label_3: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case CDO:
- case CDC:
- case ATKEYWORD:
- ;
- break;
- default:
- jj_la1[4] = jj_gen;
- break label_3;
- }
- ignoreStatement();
- label_4: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[5] = jj_gen;
- break label_4;
- }
- jj_consume_token(S);
- }
- }
- }
- afterImportDeclaration();
- jj_consume_token(0);
- } finally {
- documentHandler.endDocument(source);
- }
- }
-
- final public void charset() throws ParseException {
- Token n;
- try {
- jj_consume_token(CHARSET_SYM);
- label_5: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[6] = jj_gen;
- break label_5;
- }
- jj_consume_token(S);
- }
- n = jj_consume_token(STRING);
- label_6: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[7] = jj_gen;
- break label_6;
- }
- jj_consume_token(S);
- }
- jj_consume_token(SEMICOLON);
- } catch (ParseException e) {
- reportError(getLocator(e.currentToken.next), e);
- skipStatement();
- // reportWarningSkipText(getLocator(), skipStatement());
-
- } catch (Exception e) {
- reportError(getLocator(), e);
- skipStatement();
- // reportWarningSkipText(getLocator(), skipStatement());
-
- }
- }
-
- final public void afterImportDeclaration() throws ParseException {
- String ret;
- Locator l;
- label_7: while (true) {
- ;
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case DEBUG_SYM:
- case WARN_SYM:
- debuggingDirective();
- break;
- case MIXIN_SYM:
- mixinDirective();
- break;
- case EACH_SYM:
- case IF_SYM:
- controlDirective();
- break;
- case INCLUDE_SYM:
- includeDirective();
- break;
- case PLUS:
- case PRECEDES:
- case SIBLING:
- case LBRACKET:
- case ANY:
- case PARENT:
- case DOT:
- case COLON:
- case INTERPOLATION:
- case IDENT:
- case HASH:
- styleRule();
- break;
- case MEDIA_SYM:
- media();
- break;
- case PAGE_SYM:
- page();
- break;
- case FONT_FACE_SYM:
- fontFace();
- break;
- case KEY_FRAME_SYM:
- keyframes();
- break;
- default:
- jj_la1[8] = jj_gen;
- if (jj_2_1(2147483647)) {
- variable();
- } else {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case VARIABLE:
- listModifyDirective();
- break;
- default:
- jj_la1[9] = jj_gen;
- l = getLocator();
- ret = skipStatement();
- if ((ret == null) || (ret.length() == 0)) {
- {
- if (true) {
- return;
- }
- }
- }
- if (ret.charAt(0) == '@') {
- documentHandler.unrecognizedRule(ret);
- } else {
- reportWarningSkipText(l, ret);
- }
- }
- }
- }
- label_8: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case CDO:
- case CDC:
- case ATKEYWORD:
- ;
- break;
- default:
- jj_la1[10] = jj_gen;
- break label_8;
- }
- ignoreStatement();
- label_9: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[11] = jj_gen;
- break label_9;
- }
- jj_consume_token(S);
- }
- }
- }
- }
-
- final public void ignoreStatement() throws ParseException {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case CDO:
- jj_consume_token(CDO);
- break;
- case CDC:
- jj_consume_token(CDC);
- break;
- case ATKEYWORD:
- atRuleDeclaration();
- break;
- default:
- jj_la1[12] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
-
- /**
- * The import statement
- *
- * @exception ParseException
- * exception during the parse
- */
- final public void importDeclaration() throws ParseException {
- Token n;
- String uri;
- MediaListImpl ml = new MediaListImpl();
- boolean isURL = false;
- try {
- jj_consume_token(IMPORT_SYM);
- label_10: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[13] = jj_gen;
- break label_10;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case STRING:
- n = jj_consume_token(STRING);
- uri = convertStringIndex(n.image, 1, n.image.length() - 1);
- break;
- case URL:
- n = jj_consume_token(URL);
- isURL = true;
- uri = n.image.substring(4, n.image.length() - 1).trim();
- if ((uri.charAt(0) == '"') || (uri.charAt(0) == '\u005c'')) {
- uri = uri.substring(1, uri.length() - 1);
- }
- break;
- default:
- jj_la1[14] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- label_11: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[15] = jj_gen;
- break label_11;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IDENT:
- mediaStatement(ml);
- break;
- default:
- jj_la1[16] = jj_gen;
- ;
- }
- jj_consume_token(SEMICOLON);
- label_12: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[17] = jj_gen;
- break label_12;
- }
- jj_consume_token(S);
- }
- if (ml.getLength() == 0) {
- // see section 6.3 of the CSS2 recommandation.
- ml.addItem("all");
- }
- documentHandler.importStyle(uri, ml, isURL);
- } catch (ParseException e) {
- reportError(getLocator(), e);
- skipStatement();
- // reportWarningSkipText(getLocator(), skipStatement());
-
- }
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public void keyframes() throws ParseException {
- Token n;
- boolean start = false;
- String keyframeName = null;
- String animationname = "";
- try {
- n = jj_consume_token(KEY_FRAME_SYM);
- label_13: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[18] = jj_gen;
- break label_13;
- }
- jj_consume_token(S);
- }
- keyframeName = n.image;
- label_14: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IDENT:
- n = jj_consume_token(IDENT);
- animationname += n.image;
- break;
- case INTERPOLATION:
- n = jj_consume_token(INTERPOLATION);
- animationname += n.image;
- break;
- default:
- jj_la1[19] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- ;
- break;
- default:
- jj_la1[20] = jj_gen;
- break label_14;
- }
- }
- label_15: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[21] = jj_gen;
- break label_15;
- }
- jj_consume_token(S);
- }
- start = true;
- documentHandler.startKeyFrames(keyframeName, animationname);
- jj_consume_token(LBRACE);
- label_16: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[22] = jj_gen;
- break label_16;
- }
- jj_consume_token(S);
- }
- label_17: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case TO:
- case FROM:
- case PERCENTAGE:
- ;
- break;
- default:
- jj_la1[23] = jj_gen;
- break label_17;
- }
- keyframeSelector();
- }
- jj_consume_token(RBRACE);
- label_18: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[24] = jj_gen;
- break label_18;
- }
- jj_consume_token(S);
- }
- } catch (ParseException e) {
- reportError(getLocator(), e);
- skipStatement();
- } finally {
- if (start) {
- documentHandler.endKeyFrames();
- }
- }
- }
-
- final public void keyframeSelector() throws ParseException {
- Token n;
- boolean start = false;
- try {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case FROM:
- n = jj_consume_token(FROM);
- break;
- case TO:
- n = jj_consume_token(TO);
- break;
- case PERCENTAGE:
- n = jj_consume_token(PERCENTAGE);
- break;
- default:
- jj_la1[25] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- label_19: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[26] = jj_gen;
- break label_19;
- }
- jj_consume_token(S);
- }
- jj_consume_token(LBRACE);
- label_20: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[27] = jj_gen;
- break label_20;
- }
- jj_consume_token(S);
- }
- start = true;
- documentHandler.startKeyframeSelector(n.image);
- label_21: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case PRECEDES:
- case SIBLING:
- case LBRACKET:
- case ANY:
- case PARENT:
- case DOT:
- case COLON:
- case INTERPOLATION:
- case INCLUDE_SYM:
- case DEBUG_SYM:
- case WARN_SYM:
- case EACH_SYM:
- case IF_SYM:
- case EXTEND_SYM:
- case MICROSOFT_RULE:
- case IDENT:
- case VARIABLE:
- case HASH:
- case MEDIA_SYM:
- case KEY_FRAME_SYM:
- ;
- break;
- default:
- jj_la1[28] = jj_gen;
- break label_21;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case PRECEDES:
- case SIBLING:
- case LBRACKET:
- case ANY:
- case PARENT:
- case DOT:
- case COLON:
- case INTERPOLATION:
- case INCLUDE_SYM:
- case DEBUG_SYM:
- case WARN_SYM:
- case EXTEND_SYM:
- case IDENT:
- case VARIABLE:
- case HASH:
- case MEDIA_SYM:
- case KEY_FRAME_SYM:
- ifContentStatement();
- break;
- case EACH_SYM:
- case IF_SYM:
- controlDirective();
- break;
- case MICROSOFT_RULE:
- microsoftExtension();
- break;
- default:
- jj_la1[29] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- jj_consume_token(RBRACE);
- label_22: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[30] = jj_gen;
- break label_22;
- }
- jj_consume_token(S);
- }
- } catch (ThrowedParseException e) {
- if (errorHandler != null) {
- LocatorImpl li = new LocatorImpl(this,
- e.e.currentToken.next.beginLine,
- e.e.currentToken.next.beginColumn - 1);
- reportError(li, e.e);
- }
- } catch (ParseException e) {
- reportError(getLocator(), e);
- skipStatement();
- // reportWarningSkipText(getLocator(), skipStatement());
-
- } catch (TokenMgrError e) {
- reportWarningSkipText(getLocator(), skipStatement());
- } finally {
- if (start) {
- documentHandler.endKeyframeSelector();
- }
- }
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public void media() throws ParseException {
- boolean start = false;
- String ret;
- MediaListImpl ml = new MediaListImpl();
- try {
- jj_consume_token(MEDIA_SYM);
- label_23: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[31] = jj_gen;
- break label_23;
- }
- jj_consume_token(S);
- }
- mediaStatement(ml);
- start = true;
- documentHandler.startMedia(ml);
- jj_consume_token(LBRACE);
- label_24: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[32] = jj_gen;
- break label_24;
- }
- jj_consume_token(S);
- }
- label_25: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case CDO:
- case LBRACE:
- case DASHMATCH:
- case INCLUDES:
- case PLUS:
- case MINUS:
- case COMMA:
- case SEMICOLON:
- case PRECEDES:
- case SIBLING:
- case LBRACKET:
- case ANY:
- case PARENT:
- case DOT:
- case COLON:
- case INTERPOLATION:
- case NONASCII:
- case DEBUG_SYM:
- case WARN_SYM:
- case STRING:
- case IDENT:
- case NUMBER:
- case URL:
- case PERCENTAGE:
- case HASH:
- case IMPORT_SYM:
- case MEDIA_SYM:
- case CHARSET_SYM:
- case PAGE_SYM:
- case FONT_FACE_SYM:
- case ATKEYWORD:
- case IMPORTANT_SYM:
- case UNICODERANGE:
- case FUNCTION:
- case UNKNOWN:
- ;
- break;
- default:
- jj_la1[33] = jj_gen;
- break label_25;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case DEBUG_SYM:
- case WARN_SYM:
- debuggingDirective();
- break;
- case PLUS:
- case PRECEDES:
- case SIBLING:
- case LBRACKET:
- case ANY:
- case PARENT:
- case DOT:
- case COLON:
- case INTERPOLATION:
- case IDENT:
- case HASH:
- styleRule();
- break;
- case CDO:
- case LBRACE:
- case DASHMATCH:
- case INCLUDES:
- case MINUS:
- case COMMA:
- case SEMICOLON:
- case NONASCII:
- case STRING:
- case NUMBER:
- case URL:
- case PERCENTAGE:
- case IMPORT_SYM:
- case MEDIA_SYM:
- case CHARSET_SYM:
- case PAGE_SYM:
- case FONT_FACE_SYM:
- case ATKEYWORD:
- case IMPORTANT_SYM:
- case UNICODERANGE:
- case FUNCTION:
- case UNKNOWN:
- skipUnknownRule();
- break;
- default:
- jj_la1[34] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- jj_consume_token(RBRACE);
- label_26: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[35] = jj_gen;
- break label_26;
- }
- jj_consume_token(S);
- }
- } catch (ParseException e) {
- reportError(getLocator(), e);
- skipStatement();
- // reportWarningSkipText(getLocator(), skipStatement());
-
- } finally {
- if (start) {
- documentHandler.endMedia(ml);
- }
- }
- }
-
- final public void mediaStatement(MediaListImpl ml) throws ParseException {
- String m;
- m = medium();
- label_27: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- jj_la1[36] = jj_gen;
- break label_27;
- }
- jj_consume_token(COMMA);
- label_28: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[37] = jj_gen;
- break label_28;
- }
- jj_consume_token(S);
- }
- ml.addItem(m);
- m = medium();
- }
- ml.addItem(m);
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public String medium() throws ParseException {
- Token n;
- n = jj_consume_token(IDENT);
- label_29: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[38] = jj_gen;
- break label_29;
- }
- jj_consume_token(S);
- }
- {
- if (true) {
- return convertIdent(n.image);
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public void page() throws ParseException {
- boolean start = false;
- Token n = null;
- String page = null;
- String pseudo = null;
- try {
- jj_consume_token(PAGE_SYM);
- label_30: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[39] = jj_gen;
- break label_30;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IDENT:
- n = jj_consume_token(IDENT);
- label_31: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[40] = jj_gen;
- break label_31;
- }
- jj_consume_token(S);
- }
- break;
- default:
- jj_la1[41] = jj_gen;
- ;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COLON:
- pseudo = pseudo_page();
- break;
- default:
- jj_la1[42] = jj_gen;
- ;
- }
- if (n != null) {
- page = convertIdent(n.image);
- }
- jj_consume_token(LBRACE);
- label_32: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[43] = jj_gen;
- break label_32;
- }
- jj_consume_token(S);
- }
- start = true;
- documentHandler.startPage(page, pseudo);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- declaration();
- break;
- default:
- jj_la1[44] = jj_gen;
- ;
- }
- label_33: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case SEMICOLON:
- ;
- break;
- default:
- jj_la1[45] = jj_gen;
- break label_33;
- }
- jj_consume_token(SEMICOLON);
- label_34: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[46] = jj_gen;
- break label_34;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- declaration();
- break;
- default:
- jj_la1[47] = jj_gen;
- ;
- }
- }
- jj_consume_token(RBRACE);
- label_35: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[48] = jj_gen;
- break label_35;
- }
- jj_consume_token(S);
- }
- } catch (ParseException e) {
- if (errorHandler != null) {
- LocatorImpl li = new LocatorImpl(this,
- e.currentToken.next.beginLine,
- e.currentToken.next.beginColumn - 1);
- reportError(li, e);
- skipStatement();
- // reportWarningSkipText(li, skipStatement());
- } else {
- skipStatement();
- }
- } finally {
- if (start) {
- documentHandler.endPage(page, pseudo);
- }
- }
- }
-
- final public String pseudo_page() throws ParseException {
- Token n;
- jj_consume_token(COLON);
- n = jj_consume_token(IDENT);
- label_36: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[49] = jj_gen;
- break label_36;
- }
- jj_consume_token(S);
- }
- {
- if (true) {
- return convertIdent(n.image);
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public void fontFace() throws ParseException {
- boolean start = false;
- try {
- jj_consume_token(FONT_FACE_SYM);
- label_37: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[50] = jj_gen;
- break label_37;
- }
- jj_consume_token(S);
- }
- jj_consume_token(LBRACE);
- label_38: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[51] = jj_gen;
- break label_38;
- }
- jj_consume_token(S);
- }
- start = true;
- documentHandler.startFontFace();
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- declaration();
- break;
- default:
- jj_la1[52] = jj_gen;
- ;
- }
- label_39: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case SEMICOLON:
- ;
- break;
- default:
- jj_la1[53] = jj_gen;
- break label_39;
- }
- jj_consume_token(SEMICOLON);
- label_40: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[54] = jj_gen;
- break label_40;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- declaration();
- break;
- default:
- jj_la1[55] = jj_gen;
- ;
- }
- }
- jj_consume_token(RBRACE);
- label_41: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[56] = jj_gen;
- break label_41;
- }
- jj_consume_token(S);
- }
- } catch (ParseException e) {
- reportError(getLocator(), e);
- skipStatement();
- // reportWarningSkipText(getLocator(), skipStatement());
-
- } finally {
- if (start) {
- documentHandler.endFontFace();
- }
- }
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public void atRuleDeclaration() throws ParseException {
- Token n;
- String ret;
- n = jj_consume_token(ATKEYWORD);
- ret = skipStatement();
- if ((ret != null) && (ret.charAt(0) == '@')) {
- documentHandler.unrecognizedRule(ret);
- } else {
- reportWarningSkipText(getLocator(), ret);
- }
- }
-
- final public void skipUnknownRule() throws ParseException {
- Token n;
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case ATKEYWORD:
- n = jj_consume_token(ATKEYWORD);
- break;
- case CDO:
- n = jj_consume_token(CDO);
- break;
- case CHARSET_SYM:
- n = jj_consume_token(CHARSET_SYM);
- break;
- case COMMA:
- n = jj_consume_token(COMMA);
- break;
- case DASHMATCH:
- n = jj_consume_token(DASHMATCH);
- break;
- case FONT_FACE_SYM:
- n = jj_consume_token(FONT_FACE_SYM);
- break;
- case FUNCTION:
- n = jj_consume_token(FUNCTION);
- break;
- case IMPORTANT_SYM:
- n = jj_consume_token(IMPORTANT_SYM);
- break;
- case IMPORT_SYM:
- n = jj_consume_token(IMPORT_SYM);
- break;
- case INCLUDES:
- n = jj_consume_token(INCLUDES);
- break;
- case LBRACE:
- n = jj_consume_token(LBRACE);
- break;
- case MEDIA_SYM:
- n = jj_consume_token(MEDIA_SYM);
- break;
- case NONASCII:
- n = jj_consume_token(NONASCII);
- break;
- case NUMBER:
- n = jj_consume_token(NUMBER);
- break;
- case PAGE_SYM:
- n = jj_consume_token(PAGE_SYM);
- break;
- case PERCENTAGE:
- n = jj_consume_token(PERCENTAGE);
- break;
- case STRING:
- n = jj_consume_token(STRING);
- break;
- case UNICODERANGE:
- n = jj_consume_token(UNICODERANGE);
- break;
- case URL:
- n = jj_consume_token(URL);
- break;
- case SEMICOLON:
- n = jj_consume_token(SEMICOLON);
- break;
- case MINUS:
- n = jj_consume_token(MINUS);
- break;
- case UNKNOWN:
- n = jj_consume_token(UNKNOWN);
- break;
- default:
- jj_la1[57] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- String ret;
- Locator loc = getLocator();
- ret = skipStatement();
- if ((ret != null) && (n.image.charAt(0) == '@')) {
- documentHandler.unrecognizedRule(ret);
- } else {
- reportWarningSkipText(loc, ret);
- }
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public char combinator() throws ParseException {
- char connector = ' ';
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case PRECEDES:
- case SIBLING:
- connector = combinatorChar();
- break;
- case S:
- jj_consume_token(S);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case PRECEDES:
- case SIBLING:
- connector = combinatorChar();
- break;
- default:
- jj_la1[58] = jj_gen;
- ;
- }
- break;
- default:
- jj_la1[59] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- {
- if (true) {
- return connector;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- /** to refactor combinator and reuse in selector(). */
- final public char combinatorChar() throws ParseException {
- Token t;
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- t = jj_consume_token(PLUS);
- break;
- case PRECEDES:
- t = jj_consume_token(PRECEDES);
- break;
- case SIBLING:
- t = jj_consume_token(SIBLING);
- break;
- default:
- jj_la1[60] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- label_42: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[61] = jj_gen;
- break label_42;
- }
- jj_consume_token(S);
- }
- {
- if (true) {
- return t.image.charAt(0);
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public void microsoftExtension() throws ParseException {
- Token n;
- String name = "";
- String value = "";
- // This is not really taking the syntax of filter rules into account
- n = jj_consume_token(MICROSOFT_RULE);
- label_43: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[62] = jj_gen;
- break label_43;
- }
- jj_consume_token(S);
- }
- name = n.image;
- jj_consume_token(COLON);
- label_44: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IDENT:
- n = jj_consume_token(IDENT);
- value += n.image;
- break;
- case NUMBER:
- n = jj_consume_token(NUMBER);
- value += n.image;
- break;
- case STRING:
- n = jj_consume_token(STRING);
- value += n.image;
- break;
- case COMMA:
- n = jj_consume_token(COMMA);
- value += n.image;
- break;
- case INTERPOLATION:
- n = jj_consume_token(INTERPOLATION);
- value += n.image;
- break;
- case COLON:
- n = jj_consume_token(COLON);
- value += n.image;
- break;
- case FUNCTION:
- n = jj_consume_token(FUNCTION);
- value += n.image;
- break;
- case RPARAN:
- n = jj_consume_token(RPARAN);
- value += n.image;
- break;
- case EQ:
- n = jj_consume_token(EQ);
- value += n.image;
- break;
- case DOT:
- n = jj_consume_token(DOT);
- value += n.image;
- break;
- case S:
- n = jj_consume_token(S);
- if (value.lastIndexOf(' ') != value.length() - 1) {
- value += n.image;
- }
- break;
- default:
- jj_la1[63] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- case EQ:
- case COMMA:
- case DOT:
- case RPARAN:
- case COLON:
- case INTERPOLATION:
- case STRING:
- case IDENT:
- case NUMBER:
- case FUNCTION:
- ;
- break;
- default:
- jj_la1[64] = jj_gen;
- break label_44;
- }
- }
- jj_consume_token(SEMICOLON);
- label_45: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[65] = jj_gen;
- break label_45;
- }
- jj_consume_token(S);
- }
- documentHandler.microsoftDirective(name, value);
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public String property() throws ParseException {
- Token t;
- String s = "";
- label_46: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IDENT:
- t = jj_consume_token(IDENT);
- s += t.image;
- break;
- case INTERPOLATION:
- t = jj_consume_token(INTERPOLATION);
- s += t.image;
- break;
- default:
- jj_la1[66] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- ;
- break;
- default:
- jj_la1[67] = jj_gen;
- break label_46;
- }
- }
- label_47: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[68] = jj_gen;
- break label_47;
- }
- jj_consume_token(S);
- }
- {
- if (true) {
- return s;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public String variableName() throws ParseException {
- Token n;
- n = jj_consume_token(VARIABLE);
- label_48: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[69] = jj_gen;
- break label_48;
- }
- jj_consume_token(S);
- }
- {
- if (true) {
- return convertIdent(n.image.substring(1));
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public String functionName() throws ParseException {
- Token n;
- n = jj_consume_token(FUNCTION);
- label_49: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[70] = jj_gen;
- break label_49;
- }
- jj_consume_token(S);
- }
- {
- if (true) {
- return convertIdent(n.image.substring(0, n.image.length() - 1));
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public void styleRule() throws ParseException {
- boolean start = false;
- ArrayList<String> l = null;
- Token save;
- Locator loc;
- try {
- l = selectorList();
- save = token;
- jj_consume_token(LBRACE);
- label_50: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[71] = jj_gen;
- break label_50;
- }
- jj_consume_token(S);
- }
- start = true;
- documentHandler.startSelector(l);
- label_51: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case PRECEDES:
- case SIBLING:
- case LBRACKET:
- case ANY:
- case PARENT:
- case DOT:
- case COLON:
- case INTERPOLATION:
- case INCLUDE_SYM:
- case DEBUG_SYM:
- case WARN_SYM:
- case EACH_SYM:
- case IF_SYM:
- case EXTEND_SYM:
- case MICROSOFT_RULE:
- case IDENT:
- case VARIABLE:
- case HASH:
- case MEDIA_SYM:
- case KEY_FRAME_SYM:
- ;
- break;
- default:
- jj_la1[72] = jj_gen;
- break label_51;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case PRECEDES:
- case SIBLING:
- case LBRACKET:
- case ANY:
- case PARENT:
- case DOT:
- case COLON:
- case INTERPOLATION:
- case INCLUDE_SYM:
- case DEBUG_SYM:
- case WARN_SYM:
- case EXTEND_SYM:
- case IDENT:
- case VARIABLE:
- case HASH:
- case MEDIA_SYM:
- case KEY_FRAME_SYM:
- ifContentStatement();
- break;
- case EACH_SYM:
- case IF_SYM:
- controlDirective();
- break;
- case MICROSOFT_RULE:
- microsoftExtension();
- break;
- default:
- jj_la1[73] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- jj_consume_token(RBRACE);
- label_52: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[74] = jj_gen;
- break label_52;
- }
- jj_consume_token(S);
- }
- } catch (ThrowedParseException e) {
- if (errorHandler != null) {
- LocatorImpl li = new LocatorImpl(this,
- e.e.currentToken.next.beginLine,
- e.e.currentToken.next.beginColumn - 1);
- reportError(li, e.e);
- }
- } catch (ParseException e) {
- reportError(getLocator(), e);
- skipStatement();
- // reportWarningSkipText(getLocator(), skipStatement());
-
- } catch (TokenMgrError e) {
- reportWarningSkipText(getLocator(), skipStatement());
- } finally {
- if (start) {
- documentHandler.endSelector();
- }
- }
- }
-
- final public ArrayList<String> selectorList() throws ParseException {
- ArrayList<String> selectors = new ArrayList<String>();
- String selector;
- selector = selector();
- label_53: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- jj_la1[75] = jj_gen;
- break label_53;
- }
- jj_consume_token(COMMA);
- label_54: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[76] = jj_gen;
- break label_54;
- }
- jj_consume_token(S);
- }
- selectors.add(selector);
- selector = selector();
- }
- selectors.add(selector);
- {
- if (true) {
- return selectors;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public String selector() throws ParseException {
- String selector = null;
- char comb;
- try {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case LBRACKET:
- case ANY:
- case PARENT:
- case DOT:
- case COLON:
- case INTERPOLATION:
- case IDENT:
- case HASH:
- selector = simple_selector(null, ' ');
- break;
- case PLUS:
- case PRECEDES:
- case SIBLING:
- comb = combinatorChar();
- selector = simple_selector(selector, comb);
- break;
- default:
- jj_la1[77] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- label_55: while (true) {
- if (jj_2_2(2)) {
- ;
- } else {
- break label_55;
- }
- comb = combinator();
- selector = simple_selector(selector, comb);
- }
- label_56: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[78] = jj_gen;
- break label_56;
- }
- jj_consume_token(S);
- }
- {
- if (true) {
- return selector;
- }
- }
- } catch (ParseException e) {
- /*
- * Token t = getToken(1); StringBuffer s = new StringBuffer();
- * s.append(getToken(0).image); while ((t.kind != COMMA) && (t.kind
- * != SEMICOLON) && (t.kind != LBRACE) && (t.kind != EOF)) {
- * s.append(t.image); getNextToken(); t = getToken(1); }
- * reportWarningSkipText(getLocator(), s.toString());
- */
- Token t = getToken(1);
- while ((t.kind != COMMA) && (t.kind != SEMICOLON)
- && (t.kind != LBRACE) && (t.kind != EOF)) {
- getNextToken();
- t = getToken(1);
- }
-
- {
- if (true) {
- throw new ThrowedParseException(e);
- }
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public String simple_selector(String selector, char comb)
- throws ParseException {
- String simple_current = null;
- String cond = null;
-
- pseudoElt = null;
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case ANY:
- case PARENT:
- case INTERPOLATION:
- case IDENT:
- simple_current = element_name();
- label_57: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case LBRACKET:
- case DOT:
- case COLON:
- case HASH:
- ;
- break;
- default:
- jj_la1[79] = jj_gen;
- break label_57;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case HASH:
- cond = hash(cond);
- break;
- case DOT:
- cond = _class(cond);
- break;
- case LBRACKET:
- cond = attrib(cond);
- break;
- case COLON:
- cond = pseudo(cond);
- break;
- default:
- jj_la1[80] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- break;
- case HASH:
- cond = hash(cond);
- label_58: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case LBRACKET:
- case DOT:
- case COLON:
- ;
- break;
- default:
- jj_la1[81] = jj_gen;
- break label_58;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case DOT:
- cond = _class(cond);
- break;
- case LBRACKET:
- cond = attrib(cond);
- break;
- case COLON:
- cond = pseudo(cond);
- break;
- default:
- jj_la1[82] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- break;
- case DOT:
- cond = _class(cond);
- label_59: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case LBRACKET:
- case DOT:
- case COLON:
- case HASH:
- ;
- break;
- default:
- jj_la1[83] = jj_gen;
- break label_59;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case HASH:
- cond = hash(cond);
- break;
- case DOT:
- cond = _class(cond);
- break;
- case LBRACKET:
- cond = attrib(cond);
- break;
- case COLON:
- cond = pseudo(cond);
- break;
- default:
- jj_la1[84] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- break;
- case COLON:
- cond = pseudo(cond);
- label_60: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case LBRACKET:
- case DOT:
- case COLON:
- case HASH:
- ;
- break;
- default:
- jj_la1[85] = jj_gen;
- break label_60;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case HASH:
- cond = hash(cond);
- break;
- case DOT:
- cond = _class(cond);
- break;
- case LBRACKET:
- cond = attrib(cond);
- break;
- case COLON:
- cond = pseudo(cond);
- break;
- default:
- jj_la1[86] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- break;
- case LBRACKET:
- cond = attrib(cond);
- label_61: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case LBRACKET:
- case DOT:
- case COLON:
- case HASH:
- ;
- break;
- default:
- jj_la1[87] = jj_gen;
- break label_61;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case HASH:
- cond = hash(cond);
- break;
- case DOT:
- cond = _class(cond);
- break;
- case LBRACKET:
- cond = attrib(cond);
- break;
- case COLON:
- cond = pseudo(cond);
- break;
- default:
- jj_la1[88] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- break;
- default:
- jj_la1[89] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- if (simple_current == null) {
- simple_current = "";
- }
- if (cond != null) {
- simple_current = simple_current + cond;
- }
- StringBuilder builder = new StringBuilder();
- switch (comb) {
- case ' ':
- if (selector != null) {
- builder.append(selector).append(" ");
- }
- break;
- case '+':
- case '>':
- case '~':
- if (selector != null) {
- builder.append(selector).append(" ");
- }
- builder.append(comb).append(" ");
- break;
- default: {
- if (true) {
- throw new ParseException("invalid state. send a bug report");
- }
- }
- }
- builder.append(simple_current);
- selector = builder.toString();
-
- if (pseudoElt != null) {
- selector = selector + pseudoElt;
- }
- {
- if (true) {
- return selector;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public String _class(String pred) throws ParseException {
- Token t;
- String s = ".";
- jj_consume_token(DOT);
- label_62: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IDENT:
- t = jj_consume_token(IDENT);
- s += t.image;
- break;
- case INTERPOLATION:
- t = jj_consume_token(INTERPOLATION);
- s += t.image;
- break;
- default:
- jj_la1[90] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- ;
- break;
- default:
- jj_la1[91] = jj_gen;
- break label_62;
- }
- }
- if (pred == null) {
- {
- if (true) {
- return s;
- }
- }
- } else {
- {
- if (true) {
- return pred + s;
- }
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public String element_name() throws ParseException {
- Token t;
- String s = "";
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- label_63: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IDENT:
- t = jj_consume_token(IDENT);
- s += t.image;
- break;
- case INTERPOLATION:
- t = jj_consume_token(INTERPOLATION);
- s += t.image;
- break;
- default:
- jj_la1[92] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- ;
- break;
- default:
- jj_la1[93] = jj_gen;
- break label_63;
- }
- }
- {
- if (true) {
- return s;
- }
- }
- break;
- case ANY:
- jj_consume_token(ANY);
- {
- if (true) {
- return "*";
- }
- }
- break;
- case PARENT:
- jj_consume_token(PARENT);
- {
- if (true) {
- return "&";
- }
- }
- break;
- default:
- jj_la1[94] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- throw new Error("Missing return statement in function");
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public String attrib(String pred) throws ParseException {
- int cases = 0;
- Token att = null;
- Token val = null;
- String attValue = null;
- jj_consume_token(LBRACKET);
- label_64: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[95] = jj_gen;
- break label_64;
- }
- jj_consume_token(S);
- }
- att = jj_consume_token(IDENT);
- label_65: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[96] = jj_gen;
- break label_65;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case DASHMATCH:
- case CARETMATCH:
- case DOLLARMATCH:
- case STARMATCH:
- case INCLUDES:
- case EQ:
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case EQ:
- jj_consume_token(EQ);
- cases = 1;
- break;
- case INCLUDES:
- jj_consume_token(INCLUDES);
- cases = 2;
- break;
- case DASHMATCH:
- jj_consume_token(DASHMATCH);
- cases = 3;
- break;
- case CARETMATCH:
- jj_consume_token(CARETMATCH);
- cases = 4;
- break;
- case DOLLARMATCH:
- jj_consume_token(DOLLARMATCH);
- cases = 5;
- break;
- case STARMATCH:
- jj_consume_token(STARMATCH);
- cases = 6;
- break;
- default:
- jj_la1[97] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- label_66: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[98] = jj_gen;
- break label_66;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IDENT:
- val = jj_consume_token(IDENT);
- attValue = val.image;
- break;
- case STRING:
- val = jj_consume_token(STRING);
- attValue = val.image;
- break;
- default:
- jj_la1[99] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- label_67: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[100] = jj_gen;
- break label_67;
- }
- jj_consume_token(S);
- }
- break;
- default:
- jj_la1[101] = jj_gen;
- ;
- }
- jj_consume_token(RBRACKET);
- String name = convertIdent(att.image);
- String c;
- switch (cases) {
- case 0:
- c = name;
- break;
- case 1:
- c = name + "=" + attValue;
- break;
- case 2:
- c = name + "~=" + attValue;
- break;
- case 3:
- c = name + "|=" + attValue;
- break;
- case 4:
- c = name + "^=" + attValue;
- break;
- case 5:
- c = name + "$=" + attValue;
- break;
- case 6:
- c = name + "*=" + attValue;
- break;
- default:
- // never reached.
- c = null;
- }
- c = "[" + c + "]";
- if (pred == null) {
- {
- if (true) {
- return c;
- }
- }
- } else {
- {
- if (true) {
- return pred + c;
- }
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public String pseudo(String pred) throws ParseException {
- Token n;
- Token param;
- String d;
- boolean isPseudoElement = false;
- jj_consume_token(COLON);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COLON:
- jj_consume_token(COLON);
- isPseudoElement = true;
- break;
- default:
- jj_la1[102] = jj_gen;
- ;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IDENT:
- n = jj_consume_token(IDENT);
- String s = ":" + convertIdent(n.image);
- if (isPseudoElement) {
- if (pseudoElt != null) {
- {
- if (true) {
- throw new CSSParseException(
- "duplicate pseudo element definition " + s,
- getLocator());
- }
- }
- } else {
- pseudoElt = ":" + s;
- {
- if (true) {
- return pred;
- }
- }
- }
- } else {
- String c = s;
- if (pred == null) {
- {
- if (true) {
- return c;
- }
- }
- } else {
- {
- if (true) {
- return pred + c;
- }
- }
- }
- }
- break;
- case FUNCTION:
- n = jj_consume_token(FUNCTION);
- label_68: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[103] = jj_gen;
- break label_68;
- }
- jj_consume_token(S);
- }
- d = skipStatementUntilRightParan();
- jj_consume_token(RPARAN);
- // accept anything between function and a right parenthesis
- String f = convertIdent(n.image);
- String colons = isPseudoElement ? "::" : ":";
- String pseudofn = colons + f + d + ")";
- if (pred == null) {
- {
- if (true) {
- return pseudofn;
- }
- }
- } else {
- {
- if (true) {
- return pred + pseudofn;
- }
- }
- }
- break;
- default:
- jj_la1[104] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- throw new Error("Missing return statement in function");
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public String hash(String pred) throws ParseException {
- Token n;
- n = jj_consume_token(HASH);
- String d = n.image;
- if (pred == null) {
- {
- if (true) {
- return d;
- }
- }
- } else {
- {
- if (true) {
- return pred + d;
- }
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public void variable() throws ParseException {
- String name;
- LexicalUnitImpl exp = null;
- boolean guarded = false;
- String raw;
- try {
- name = variableName();
- jj_consume_token(COLON);
- label_69: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[105] = jj_gen;
- break label_69;
- }
- jj_consume_token(S);
- }
- exp = expr();
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case GUARDED_SYM:
- guarded = guarded();
- break;
- default:
- jj_la1[106] = jj_gen;
- ;
- }
- label_70: while (true) {
- jj_consume_token(SEMICOLON);
- label_71: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[107] = jj_gen;
- break label_71;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case SEMICOLON:
- ;
- break;
- default:
- jj_la1[108] = jj_gen;
- break label_70;
- }
- }
- documentHandler.variable(name, exp, guarded);
- } catch (JumpException e) {
- skipAfterExpression();
- } catch (NumberFormatException e) {
- if (errorHandler != null) {
- errorHandler.error(new CSSParseException("Invalid number "
- + e.getMessage(), getLocator(), e));
- }
- reportWarningSkipText(getLocator(), skipAfterExpression());
- } catch (ParseException e) {
- if (errorHandler != null) {
- if (e.currentToken != null) {
- LocatorImpl li = new LocatorImpl(this,
- e.currentToken.next.beginLine,
- e.currentToken.next.beginColumn - 1);
- reportError(li, e);
- } else {
- reportError(getLocator(), e);
- }
- skipAfterExpression();
- } else {
- skipAfterExpression();
- }
- }
- }
-
- final public void controlDirective() throws ParseException {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IF_SYM:
- ifDirective();
- break;
- case EACH_SYM:
- eachDirective();
- break;
- default:
- jj_la1[109] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
-
- final public void ifContentStatement() throws ParseException {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INCLUDE_SYM:
- includeDirective();
- break;
- case MEDIA_SYM:
- media();
- break;
- case EXTEND_SYM:
- extendDirective();
- break;
- case PLUS:
- case PRECEDES:
- case SIBLING:
- case LBRACKET:
- case ANY:
- case PARENT:
- case DOT:
- case COLON:
- case INTERPOLATION:
- case DEBUG_SYM:
- case WARN_SYM:
- case IDENT:
- case HASH:
- styleRuleOrDeclarationOrNestedProperties();
- break;
- case KEY_FRAME_SYM:
- keyframes();
- break;
- default:
- jj_la1[110] = jj_gen;
- if (jj_2_3(2147483647)) {
- variable();
- } else {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case VARIABLE:
- listModifyDirective();
- break;
- default:
- jj_la1[111] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- }
- }
-
- final public void ifDirective() throws ParseException {
- Token n = null;
- String s = null;
- String evaluator = "";
- jj_consume_token(IF_SYM);
- label_72: while (true) {
- s = booleanExpressionToken();
- evaluator += s;
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- case EQ:
- case PLUS:
- case MINUS:
- case PRECEDES:
- case SUCCEEDS:
- case DIV:
- case ANY:
- case LPARAN:
- case RPARAN:
- case COMPARE:
- case OR:
- case AND:
- case NOT_EQ:
- case IDENT:
- case NUMBER:
- case VARIABLE:
- case CONTAINS:
- ;
- break;
- default:
- jj_la1[112] = jj_gen;
- break label_72;
- }
- }
- jj_consume_token(LBRACE);
- label_73: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[113] = jj_gen;
- break label_73;
- }
- jj_consume_token(S);
- }
- documentHandler.startIfElseDirective();
- documentHandler.ifDirective(evaluator);
- label_74: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case PRECEDES:
- case SIBLING:
- case LBRACKET:
- case ANY:
- case PARENT:
- case DOT:
- case COLON:
- case INTERPOLATION:
- case INCLUDE_SYM:
- case DEBUG_SYM:
- case WARN_SYM:
- case EXTEND_SYM:
- case IDENT:
- case VARIABLE:
- case HASH:
- case MEDIA_SYM:
- case KEY_FRAME_SYM:
- ;
- break;
- default:
- jj_la1[114] = jj_gen;
- break label_74;
- }
- ifContentStatement();
- }
- jj_consume_token(RBRACE);
- label_75: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[115] = jj_gen;
- break label_75;
- }
- jj_consume_token(S);
- }
- label_76: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case ELSE_SYM:
- ;
- break;
- default:
- jj_la1[116] = jj_gen;
- break label_76;
- }
- elseDirective();
- }
- documentHandler.endIfElseDirective();
- }
-
- final public void elseDirective() throws ParseException {
- String evaluator = "";
- Token n = null;
- String s = null;
- jj_consume_token(ELSE_SYM);
- label_77: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[117] = jj_gen;
- break label_77;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IF:
- jj_consume_token(IF);
- label_78: while (true) {
- s = booleanExpressionToken();
- evaluator += s;
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- case EQ:
- case PLUS:
- case MINUS:
- case PRECEDES:
- case SUCCEEDS:
- case DIV:
- case ANY:
- case LPARAN:
- case RPARAN:
- case COMPARE:
- case OR:
- case AND:
- case NOT_EQ:
- case IDENT:
- case NUMBER:
- case VARIABLE:
- case CONTAINS:
- ;
- break;
- default:
- jj_la1[118] = jj_gen;
- break label_78;
- }
- }
- break;
- default:
- jj_la1[119] = jj_gen;
- ;
- }
- jj_consume_token(LBRACE);
- label_79: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[120] = jj_gen;
- break label_79;
- }
- jj_consume_token(S);
- }
- if (!evaluator.trim().equals("")) {
- documentHandler.ifDirective(evaluator);
- } else {
- documentHandler.elseDirective();
- }
- label_80: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case PRECEDES:
- case SIBLING:
- case LBRACKET:
- case ANY:
- case PARENT:
- case DOT:
- case COLON:
- case INTERPOLATION:
- case INCLUDE_SYM:
- case DEBUG_SYM:
- case WARN_SYM:
- case EXTEND_SYM:
- case IDENT:
- case VARIABLE:
- case HASH:
- case MEDIA_SYM:
- case KEY_FRAME_SYM:
- ;
- break;
- default:
- jj_la1[121] = jj_gen;
- break label_80;
- }
- ifContentStatement();
- }
- jj_consume_token(RBRACE);
- label_81: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[122] = jj_gen;
- break label_81;
- }
- jj_consume_token(S);
- }
- }
-
- final public String booleanExpressionToken() throws ParseException {
- Token n = null;
- String s = null;
- if (jj_2_4(2147483647)) {
- s = containsDirective();
- } else {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case VARIABLE:
- n = jj_consume_token(VARIABLE);
- break;
- case IDENT:
- n = jj_consume_token(IDENT);
- break;
- case NUMBER:
- n = jj_consume_token(NUMBER);
- break;
- case LPARAN:
- n = jj_consume_token(LPARAN);
- break;
- case RPARAN:
- n = jj_consume_token(RPARAN);
- break;
- case PLUS:
- n = jj_consume_token(PLUS);
- break;
- case MINUS:
- n = jj_consume_token(MINUS);
- break;
- case DIV:
- n = jj_consume_token(DIV);
- break;
- case ANY:
- n = jj_consume_token(ANY);
- break;
- case COMPARE:
- n = jj_consume_token(COMPARE);
- break;
- case EQ:
- n = jj_consume_token(EQ);
- break;
- case PRECEDES:
- n = jj_consume_token(PRECEDES);
- break;
- case SUCCEEDS:
- n = jj_consume_token(SUCCEEDS);
- break;
- case OR:
- n = jj_consume_token(OR);
- break;
- case AND:
- n = jj_consume_token(AND);
- break;
- case S:
- n = jj_consume_token(S);
- break;
- case NOT_EQ:
- n = jj_consume_token(NOT_EQ);
- break;
- default:
- jj_la1[123] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- if (n != null) {
- {
- if (true) {
- return n.image;
- }
- }
- } else {
- {
- if (true) {
- return s;
- }
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public void eachDirective() throws ParseException {
- Token var;
- ArrayList<String> list = null;
- String listVariable = null;
- jj_consume_token(EACH_SYM);
- label_82: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[124] = jj_gen;
- break label_82;
- }
- jj_consume_token(S);
- }
- var = jj_consume_token(VARIABLE);
- label_83: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[125] = jj_gen;
- break label_83;
- }
- jj_consume_token(S);
- }
- jj_consume_token(EACH_IN);
- label_84: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[126] = jj_gen;
- break label_84;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IDENT:
- list = stringList();
- documentHandler.startEachDirective(var.image, list);
- break;
- case VARIABLE:
- listVariable = variableName();
- documentHandler.startEachDirective(var.image, listVariable);
- break;
- default:
- jj_la1[127] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- jj_consume_token(LBRACE);
- label_85: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[128] = jj_gen;
- break label_85;
- }
- jj_consume_token(S);
- }
- label_86: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case PRECEDES:
- case SIBLING:
- case LBRACKET:
- case ANY:
- case PARENT:
- case DOT:
- case COLON:
- case INTERPOLATION:
- case INCLUDE_SYM:
- case DEBUG_SYM:
- case WARN_SYM:
- case EXTEND_SYM:
- case IDENT:
- case VARIABLE:
- case HASH:
- case MEDIA_SYM:
- case KEY_FRAME_SYM:
- ;
- break;
- default:
- jj_la1[129] = jj_gen;
- break label_86;
- }
- ifContentStatement();
- }
- jj_consume_token(RBRACE);
- label_87: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[130] = jj_gen;
- break label_87;
- }
- jj_consume_token(S);
- }
- documentHandler.endEachDirective();
- }
-
- final public ArrayList<String> stringList() throws ParseException {
- ArrayList<String> strings = new ArrayList<String>();
- Token input;
- input = jj_consume_token(IDENT);
- label_88: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[131] = jj_gen;
- break label_88;
- }
- jj_consume_token(S);
- }
- strings.add(input.image);
- label_89: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- jj_la1[132] = jj_gen;
- break label_89;
- }
- jj_consume_token(COMMA);
- label_90: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[133] = jj_gen;
- break label_90;
- }
- jj_consume_token(S);
- }
- input = jj_consume_token(IDENT);
- strings.add(input.image);
- label_91: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[134] = jj_gen;
- break label_91;
- }
- jj_consume_token(S);
- }
- }
- {
- if (true) {
- return strings;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public void mixinDirective() throws ParseException {
- String name;
- ArrayList<VariableNode> args = null;
- String body;
- jj_consume_token(MIXIN_SYM);
- label_92: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[135] = jj_gen;
- break label_92;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- name = property();
- break;
- case FUNCTION:
- name = functionName();
- args = arglist();
- jj_consume_token(RPARAN);
- label_93: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[136] = jj_gen;
- break label_93;
- }
- jj_consume_token(S);
- }
- break;
- default:
- jj_la1[137] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- jj_consume_token(LBRACE);
- label_94: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[138] = jj_gen;
- break label_94;
- }
- jj_consume_token(S);
- }
- documentHandler.startMixinDirective(name, args);
- label_95: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case PRECEDES:
- case SIBLING:
- case LBRACKET:
- case ANY:
- case PARENT:
- case DOT:
- case COLON:
- case INTERPOLATION:
- case INCLUDE_SYM:
- case DEBUG_SYM:
- case WARN_SYM:
- case EACH_SYM:
- case IF_SYM:
- case EXTEND_SYM:
- case IDENT:
- case VARIABLE:
- case HASH:
- case MEDIA_SYM:
- case PAGE_SYM:
- case FONT_FACE_SYM:
- case KEY_FRAME_SYM:
- ;
- break;
- default:
- jj_la1[139] = jj_gen;
- break label_95;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case PRECEDES:
- case SIBLING:
- case LBRACKET:
- case ANY:
- case PARENT:
- case DOT:
- case COLON:
- case INTERPOLATION:
- case INCLUDE_SYM:
- case DEBUG_SYM:
- case WARN_SYM:
- case EXTEND_SYM:
- case IDENT:
- case VARIABLE:
- case HASH:
- case MEDIA_SYM:
- case KEY_FRAME_SYM:
- ifContentStatement();
- break;
- case EACH_SYM:
- case IF_SYM:
- controlDirective();
- break;
- case FONT_FACE_SYM:
- fontFace();
- break;
- case PAGE_SYM:
- page();
- break;
- default:
- jj_la1[140] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- jj_consume_token(RBRACE);
- label_96: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[141] = jj_gen;
- break label_96;
- }
- jj_consume_token(S);
- }
- documentHandler.endMixinDirective(name, args);
- }
-
- final public ArrayList<VariableNode> arglist() throws ParseException {
- ArrayList<VariableNode> args = new ArrayList<VariableNode>();
- VariableNode arg;
- boolean hasNonOptionalArgument = false;
- arg = mixinArg();
- label_97: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- jj_la1[142] = jj_gen;
- break label_97;
- }
- jj_consume_token(COMMA);
- label_98: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[143] = jj_gen;
- break label_98;
- }
- jj_consume_token(S);
- }
- hasNonOptionalArgument = checkMixinForNonOptionalArguments(arg,
- hasNonOptionalArgument);
- args.add(arg);
- arg = mixinArg();
- }
- hasNonOptionalArgument = checkMixinForNonOptionalArguments(arg,
- hasNonOptionalArgument);
- args.add(arg);
- {
- if (true) {
- return args;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- boolean checkMixinForNonOptionalArguments(VariableNode arg,
- boolean hasNonOptionalArguments) throws ParseException {
- boolean currentArgHasArguments = arg.getExpr() != null
- && arg.getExpr().getLexicalUnitType() == LexicalUnitImpl.SCSS_VARIABLE
- && arg.getExpr().getNextLexicalUnit() != null;
-
- if (currentArgHasArguments) {
- if (hasNonOptionalArguments) {
- throw new ParseException("Sass Error: Required argument $"
- + arg.getName()
- + " must come before any optional arguments.");
- }
- return hasNonOptionalArguments;
- } else {
- return true;
- }
- }
-
- final public VariableNode mixinArg() throws ParseException {
- String name;
- Token variable = null;
- LexicalUnitImpl first = null;
- LexicalUnitImpl prev = null;
- LexicalUnitImpl next = null;
- name = variableName();
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COLON:
- case VARIABLE:
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COLON:
- jj_consume_token(COLON);
- label_99: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[144] = jj_gen;
- break label_99;
- }
- jj_consume_token(S);
- }
- first = nonVariableTerm(null);
- prev = first;
- label_100: while (true) {
- if (jj_2_5(3)) {
- ;
- } else {
- break label_100;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COMMA:
- jj_consume_token(COMMA);
- label_101: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[145] = jj_gen;
- break label_101;
- }
- jj_consume_token(S);
- }
- break;
- default:
- jj_la1[146] = jj_gen;
- ;
- }
- prev = nonVariableTerm(prev);
- }
- break;
- case VARIABLE:
- variable = jj_consume_token(VARIABLE);
- first = LexicalUnitImpl.createVariable(token.beginLine,
- token.beginColumn, prev, variable.image);
- break;
- default:
- jj_la1[147] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- break;
- default:
- jj_la1[148] = jj_gen;
- ;
- }
- VariableNode arg = new VariableNode(name, first, false);
- {
- if (true) {
- return arg;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public ArrayList<LexicalUnitImpl> argValuelist()
- throws ParseException {
- ArrayList<LexicalUnitImpl> args = new ArrayList<LexicalUnitImpl>();
- LexicalUnitImpl first = null;
- LexicalUnitImpl next = null;
- LexicalUnitImpl prev = null;
- first = term(null);
- args.add(first);
- prev = first;
- label_102: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case MINUS:
- case DOT:
- case COLON:
- case STRING:
- case IDENT:
- case NUMBER:
- case URL:
- case VARIABLE:
- case PERCENTAGE:
- case PT:
- case MM:
- case CM:
- case PC:
- case IN:
- case PX:
- case EMS:
- case LEM:
- case REM:
- case EXS:
- case DEG:
- case RAD:
- case GRAD:
- case MS:
- case SECOND:
- case HZ:
- case KHZ:
- case DIMEN:
- case HASH:
- case UNICODERANGE:
- case FUNCTION:
- ;
- break;
- default:
- jj_la1[149] = jj_gen;
- break label_102;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COLON:
- jj_consume_token(COLON);
- label_103: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[150] = jj_gen;
- break label_103;
- }
- jj_consume_token(S);
- }
- break;
- default:
- jj_la1[151] = jj_gen;
- ;
- }
- next = term(prev);
- prev.setNextLexicalUnit(next);
- prev = next;
- }
- label_104: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- jj_la1[152] = jj_gen;
- break label_104;
- }
- jj_consume_token(COMMA);
- label_105: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[153] = jj_gen;
- break label_105;
- }
- jj_consume_token(S);
- }
- first = term(null);
- args.add(first);
- prev = first;
- label_106: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case MINUS:
- case DOT:
- case COLON:
- case STRING:
- case IDENT:
- case NUMBER:
- case URL:
- case VARIABLE:
- case PERCENTAGE:
- case PT:
- case MM:
- case CM:
- case PC:
- case IN:
- case PX:
- case EMS:
- case LEM:
- case REM:
- case EXS:
- case DEG:
- case RAD:
- case GRAD:
- case MS:
- case SECOND:
- case HZ:
- case KHZ:
- case DIMEN:
- case HASH:
- case UNICODERANGE:
- case FUNCTION:
- ;
- break;
- default:
- jj_la1[154] = jj_gen;
- break label_106;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COLON:
- jj_consume_token(COLON);
- label_107: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[155] = jj_gen;
- break label_107;
- }
- jj_consume_token(S);
- }
- break;
- default:
- jj_la1[156] = jj_gen;
- ;
- }
- next = term(prev);
- prev.setNextLexicalUnit(next);
- prev = next;
- }
- }
- {
- if (true) {
- return args;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public void includeDirective() throws ParseException {
- String name;
- ArrayList<LexicalUnitImpl> args = null;
- jj_consume_token(INCLUDE_SYM);
- label_108: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[157] = jj_gen;
- break label_108;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- name = property();
- break;
- case VARIABLE:
- name = variableName();
- name = "$" + name;
- break;
- case FUNCTION:
- name = functionName();
- args = argValuelist();
- jj_consume_token(RPARAN);
- break;
- default:
- jj_la1[158] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- label_109: while (true) {
- jj_consume_token(SEMICOLON);
- label_110: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[159] = jj_gen;
- break label_110;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case SEMICOLON:
- ;
- break;
- default:
- jj_la1[160] = jj_gen;
- break label_109;
- }
- }
- documentHandler.includeDirective(name, args);
- }
-
- final public String interpolation() throws ParseException {
- Token n;
- n = jj_consume_token(INTERPOLATION);
- {
- if (true) {
- return n.image;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public void listModifyDirective() throws ParseException {
- String list = null;
- String remove = null;
- String separator = null;
- String variable = null;
- Token n = null;
- Token type = null;
- // refactor, remove those 3 LOOKAHEAD(5).
- n = jj_consume_token(VARIABLE);
- variable = n.image;
- label_111: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[161] = jj_gen;
- break label_111;
- }
- jj_consume_token(S);
- }
- jj_consume_token(COLON);
- label_112: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[162] = jj_gen;
- break label_112;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case APPEND:
- type = jj_consume_token(APPEND);
- break;
- case REMOVE:
- type = jj_consume_token(REMOVE);
- break;
- case CONTAINS:
- type = jj_consume_token(CONTAINS);
- break;
- default:
- jj_la1[163] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- label_113: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[164] = jj_gen;
- break label_113;
- }
- jj_consume_token(S);
- }
- list = listModifyDirectiveArgs(0);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case RPARAN:
- jj_consume_token(RPARAN);
- break;
- default:
- jj_la1[165] = jj_gen;
- ;
- }
- jj_consume_token(COMMA);
- label_114: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[166] = jj_gen;
- break label_114;
- }
- jj_consume_token(S);
- }
- remove = listModifyDirectiveArgs(1);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COMMA:
- jj_consume_token(COMMA);
- label_115: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[167] = jj_gen;
- break label_115;
- }
- jj_consume_token(S);
- }
- n = jj_consume_token(IDENT);
- separator = n.image;
- label_116: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[168] = jj_gen;
- break label_116;
- }
- jj_consume_token(S);
- }
- break;
- default:
- jj_la1[169] = jj_gen;
- ;
- }
- jj_consume_token(RPARAN);
- switch (type.kind) {
- case APPEND:
- documentHandler.appendDirective(variable, list, remove, separator);
- break;
- case REMOVE:
- documentHandler.removeDirective(variable, list, remove, separator);
- break;
- case CONTAINS:
- if (variable == null) {
- variable = "$var_" + UUID.randomUUID();
- }
- documentHandler
- .containsDirective(variable, list, remove, separator);
- break;
- default:
- break;
- }
- label_117: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[170] = jj_gen;
- break label_117;
- }
- jj_consume_token(S);
- }
- jj_consume_token(SEMICOLON);
- label_118: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[171] = jj_gen;
- break label_118;
- }
- jj_consume_token(S);
- }
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public void appendDirective() throws ParseException {
- String list = null;
- String remove = null;
- String separator = null;
- String variable = null;
- Token n = null;
- n = jj_consume_token(VARIABLE);
- variable = n.image;
- label_119: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[172] = jj_gen;
- break label_119;
- }
- jj_consume_token(S);
- }
- jj_consume_token(COLON);
- label_120: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[173] = jj_gen;
- break label_120;
- }
- jj_consume_token(S);
- }
- jj_consume_token(APPEND);
- label_121: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[174] = jj_gen;
- break label_121;
- }
- jj_consume_token(S);
- }
- list = listModifyDirectiveArgs(0);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case RPARAN:
- jj_consume_token(RPARAN);
- break;
- default:
- jj_la1[175] = jj_gen;
- ;
- }
- jj_consume_token(COMMA);
- label_122: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[176] = jj_gen;
- break label_122;
- }
- jj_consume_token(S);
- }
- remove = listModifyDirectiveArgs(1);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COMMA:
- jj_consume_token(COMMA);
- label_123: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[177] = jj_gen;
- break label_123;
- }
- jj_consume_token(S);
- }
- n = jj_consume_token(IDENT);
- separator = n.image;
- label_124: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[178] = jj_gen;
- break label_124;
- }
- jj_consume_token(S);
- }
- break;
- default:
- jj_la1[179] = jj_gen;
- ;
- }
- jj_consume_token(RPARAN);
- documentHandler.appendDirective(variable, list, remove, separator);
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public void removeDirective() throws ParseException {
- String list = null;
- String remove = null;
- String separator = null;
- String variable = null;
- Token n = null;
- n = jj_consume_token(VARIABLE);
- variable = n.image;
- label_125: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[180] = jj_gen;
- break label_125;
- }
- jj_consume_token(S);
- }
- jj_consume_token(COLON);
- label_126: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[181] = jj_gen;
- break label_126;
- }
- jj_consume_token(S);
- }
- jj_consume_token(REMOVE);
- label_127: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[182] = jj_gen;
- break label_127;
- }
- jj_consume_token(S);
- }
- list = listModifyDirectiveArgs(0);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case RPARAN:
- jj_consume_token(RPARAN);
- break;
- default:
- jj_la1[183] = jj_gen;
- ;
- }
- jj_consume_token(COMMA);
- label_128: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[184] = jj_gen;
- break label_128;
- }
- jj_consume_token(S);
- }
- remove = listModifyDirectiveArgs(1);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COMMA:
- jj_consume_token(COMMA);
- label_129: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[185] = jj_gen;
- break label_129;
- }
- jj_consume_token(S);
- }
- n = jj_consume_token(IDENT);
- separator = n.image;
- label_130: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[186] = jj_gen;
- break label_130;
- }
- jj_consume_token(S);
- }
- break;
- default:
- jj_la1[187] = jj_gen;
- ;
- }
- jj_consume_token(RPARAN);
- documentHandler.removeDirective(variable, list, remove, separator);
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public String containsDirective() throws ParseException {
- String list = null;
- String remove = null;
- String separator = null;
- String variable = null;
- Token n = null;
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case VARIABLE:
- n = jj_consume_token(VARIABLE);
- variable = n.image;
- label_131: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[188] = jj_gen;
- break label_131;
- }
- jj_consume_token(S);
- }
- jj_consume_token(COLON);
- label_132: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[189] = jj_gen;
- break label_132;
- }
- jj_consume_token(S);
- }
- break;
- default:
- jj_la1[190] = jj_gen;
- ;
- }
- jj_consume_token(CONTAINS);
- label_133: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[191] = jj_gen;
- break label_133;
- }
- jj_consume_token(S);
- }
- list = listModifyDirectiveArgs(0);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case RPARAN:
- jj_consume_token(RPARAN);
- break;
- default:
- jj_la1[192] = jj_gen;
- ;
- }
- jj_consume_token(COMMA);
- label_134: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[193] = jj_gen;
- break label_134;
- }
- jj_consume_token(S);
- }
- remove = listModifyDirectiveArgs(1);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COMMA:
- jj_consume_token(COMMA);
- label_135: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[194] = jj_gen;
- break label_135;
- }
- jj_consume_token(S);
- }
- n = jj_consume_token(IDENT);
- separator = n.image;
- label_136: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[195] = jj_gen;
- break label_136;
- }
- jj_consume_token(S);
- }
- break;
- default:
- jj_la1[196] = jj_gen;
- ;
- }
- jj_consume_token(RPARAN);
- /*
- * if it is not in the form like
- * "$contains : contains($items, .v-button);"for example in @if, like
- * "@if (contains(a b c, b))", then create a tempvariable for contains(a
- * b c, b);
- */
- if (variable == null) {
- variable = "$var_" + UUID.randomUUID();
- }
- documentHandler.containsDirective(variable, list, remove, separator);
- {
- if (true) {
- return variable;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- String listModifyDirectiveArgs(int nest) throws ParseException {
- String list = "";
- int nesting = nest;
- Token t = null;
-
- while (true) {
- t = getToken(1);
- String s = t.image;
- if (t.kind == VARIABLE || t.kind == IDENT) {
- list += s;
- } else if (s.toLowerCase().equals("auto")
- || s.toLowerCase().equals("space")
- || s.toLowerCase().equals("comma")) {
- int i = 2;
- Token temp = getToken(i);
- boolean isLast = true;
- while (temp.kind != SEMICOLON) {
- if (temp.kind != RPARAN || temp.kind != S) {
- isLast = false;
- }
- i++;
- temp = getToken(i);
- }
-
- if (isLast) {
- return list;
- }
- } else if (t.kind == STRING) {
- list += s.substring(1, s.length()).substring(0, s.length() - 2);
-
- } else if (t.kind == LPARAN) {
- nesting++;
- if (nesting > nest + 1) {
- throw new CSSParseException(
- "Only one ( ) pair per parameter allowed",
- getLocator());
- }
- } else if (t.kind == RPARAN) {
- nesting--;
- if (nesting == 0) {
- return list;
- }
- } else if (t.kind == COMMA) {
- if (nesting == nest) {
- return list;
- } else {
- list += ",";
- }
-
- } else if (t.kind == S) {
- list += " ";
- } else if (t.kind == LBRACE) {
- throw new CSSParseException("Invalid token,'{' found",
- getLocator());
- }
-
- getNextToken();
- }
- }
-
- final public Node returnDirective() throws ParseException {
- String raw;
- raw = skipStatement();
- {
- if (true) {
- return null;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public void debuggingDirective() throws ParseException {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case DEBUG_SYM:
- debugDirective();
- break;
- case WARN_SYM:
- warnDirective();
- break;
- default:
- jj_la1[197] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
-
- final public void debugDirective() throws ParseException {
- jj_consume_token(DEBUG_SYM);
- String content = skipStatementUntilSemiColon();
- // TODO should evaluate the content expression, call
- // documentHandler.debugDirective() etc.
- System.out.println(content);
- label_137: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[198] = jj_gen;
- break label_137;
- }
- jj_consume_token(S);
- }
- }
-
- final public void warnDirective() throws ParseException {
- jj_consume_token(WARN_SYM);
- String content = skipStatementUntilSemiColon();
- // TODO should evaluate the content expression, call
- // documentHandler.warnDirective() etc.
- System.err.println(content);
- label_138: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[199] = jj_gen;
- break label_138;
- }
- jj_consume_token(S);
- }
- }
-
- final public Node forDirective() throws ParseException {
- String var;
- String from;
- String to;
- boolean exclusive;
- String body;
- Token tok;
- var = variableName();
- int[] toThrough = { TO, THROUGH };
- from = skipStatementUntil(toThrough);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case TO:
- tok = jj_consume_token(TO);
- exclusive = true;
- break;
- case THROUGH:
- tok = jj_consume_token(THROUGH);
- exclusive = false;
- break;
- default:
- jj_la1[200] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- to = skipStatementUntilLeftBrace();
- label_139: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[201] = jj_gen;
- break label_139;
- }
- jj_consume_token(S);
- }
- body = skipStatement();
- {
- if (true) {
- return documentHandler.forDirective(var, from, to, exclusive,
- body);
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public Node whileDirective() throws ParseException {
- String condition;
- String body;
- condition = skipStatementUntilLeftBrace();
- body = skipStatement();
- {
- if (true) {
- return documentHandler.whileDirective(condition, body);
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public void extendDirective() throws ParseException {
- ArrayList<String> list;
- jj_consume_token(EXTEND_SYM);
- label_140: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[202] = jj_gen;
- break label_140;
- }
- jj_consume_token(S);
- }
- list = selectorList();
- label_141: while (true) {
- jj_consume_token(SEMICOLON);
- label_142: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[203] = jj_gen;
- break label_142;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case SEMICOLON:
- ;
- break;
- default:
- jj_la1[204] = jj_gen;
- break label_141;
- }
- }
- documentHandler.extendDirective(list);
- }
-
- Node importDirective() throws ParseException {
- return null;
- }
-
- Node charsetDirective() throws ParseException {
- return null;
- }
-
- Node mozDocumentDirective() throws ParseException {
- return null;
- }
-
- Node supportsDirective() throws ParseException {
- return null;
- }
-
- final public void nestedProperties() throws ParseException {
- String name;
- LexicalUnit exp;
- name = property();
- jj_consume_token(COLON);
- label_143: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[205] = jj_gen;
- break label_143;
- }
- jj_consume_token(S);
- }
- jj_consume_token(LBRACE);
- label_144: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[206] = jj_gen;
- break label_144;
- }
- jj_consume_token(S);
- }
- documentHandler.startNestedProperties(name);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- declaration();
- break;
- default:
- jj_la1[207] = jj_gen;
- ;
- }
- label_145: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case SEMICOLON:
- ;
- break;
- default:
- jj_la1[208] = jj_gen;
- break label_145;
- }
- jj_consume_token(SEMICOLON);
- label_146: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[209] = jj_gen;
- break label_146;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- declaration();
- break;
- default:
- jj_la1[210] = jj_gen;
- ;
- }
- }
- jj_consume_token(RBRACE);
- documentHandler.endNestedProperties(name);
- label_147: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[211] = jj_gen;
- break label_147;
- }
- jj_consume_token(S);
- }
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public void styleRuleOrDeclarationOrNestedProperties()
- throws ParseException {
- try {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case DEBUG_SYM:
- case WARN_SYM:
- debuggingDirective();
- break;
- default:
- jj_la1[212] = jj_gen;
- if (jj_2_6(2147483647)) {
- styleRule();
- } else if (jj_2_7(3)) {
- declarationOrNestedProperties();
- } else {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case PRECEDES:
- case SIBLING:
- case LBRACKET:
- case ANY:
- case PARENT:
- case DOT:
- case COLON:
- case INTERPOLATION:
- case IDENT:
- case HASH:
- styleRule();
- break;
- default:
- jj_la1[213] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- }
- } catch (JumpException e) {
- skipAfterExpression();
- // reportWarningSkipText(getLocator(), skipAfterExpression());
-
- } catch (ParseException e) {
- if (errorHandler != null) {
- if (e.currentToken != null) {
- LocatorImpl li = new LocatorImpl(this,
- e.currentToken.next.beginLine,
- e.currentToken.next.beginColumn - 1);
- reportError(li, e);
- } else {
- reportError(getLocator(), e);
- }
- skipAfterExpression();
- /*
- * LocatorImpl loc = (LocatorImpl) getLocator(); loc.column--;
- * reportWarningSkipText(loc, skipAfterExpression());
- */
- } else {
- skipAfterExpression();
- }
- }
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public void declarationOrNestedProperties() throws ParseException {
- boolean important = false;
- String name;
- LexicalUnitImpl exp;
- Token save;
- String comment = null;
- try {
- name = property();
- save = token;
- jj_consume_token(COLON);
- label_148: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[214] = jj_gen;
- break label_148;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case MINUS:
- case DOT:
- case STRING:
- case IDENT:
- case NUMBER:
- case URL:
- case VARIABLE:
- case PERCENTAGE:
- case PT:
- case MM:
- case CM:
- case PC:
- case IN:
- case PX:
- case EMS:
- case LEM:
- case REM:
- case EXS:
- case DEG:
- case RAD:
- case GRAD:
- case MS:
- case SECOND:
- case HZ:
- case KHZ:
- case DIMEN:
- case HASH:
- case UNICODERANGE:
- case FUNCTION:
- exp = expr();
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IMPORTANT_SYM:
- important = prio();
- break;
- default:
- jj_la1[215] = jj_gen;
- ;
- }
- Token next = getToken(1);
- if (next.kind == SEMICOLON || next.kind == RBRACE) {
- while (next.kind == SEMICOLON) {
- skipStatement();
- next = getToken(1);
- }
- if (token.specialToken != null) {
- documentHandler.property(name, exp, important,
- token.specialToken.image);
- } else {
- documentHandler.property(name, exp, important, null);
- }
- }
- break;
- case LBRACE:
- jj_consume_token(LBRACE);
- label_149: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[216] = jj_gen;
- break label_149;
- }
- jj_consume_token(S);
- }
- documentHandler.startNestedProperties(name);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- declaration();
- break;
- default:
- jj_la1[217] = jj_gen;
- ;
- }
- label_150: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case SEMICOLON:
- ;
- break;
- default:
- jj_la1[218] = jj_gen;
- break label_150;
- }
- jj_consume_token(SEMICOLON);
- label_151: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[219] = jj_gen;
- break label_151;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- declaration();
- break;
- default:
- jj_la1[220] = jj_gen;
- ;
- }
- }
- jj_consume_token(RBRACE);
- label_152: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[221] = jj_gen;
- break label_152;
- }
- jj_consume_token(S);
- }
- documentHandler.endNestedProperties(name);
- break;
- default:
- jj_la1[222] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (JumpException e) {
- skipAfterExpression();
- // reportWarningSkipText(getLocator(), skipAfterExpression());
-
- } catch (NumberFormatException e) {
- if (errorHandler != null) {
- errorHandler.error(new CSSParseException("Invalid number "
- + e.getMessage(), getLocator(), e));
- }
- reportWarningSkipText(getLocator(), skipAfterExpression());
- } catch (ParseException e) {
- if (errorHandler != null) {
- if (e.currentToken != null) {
- LocatorImpl li = new LocatorImpl(this,
- e.currentToken.next.beginLine,
- e.currentToken.next.beginColumn - 1);
- reportError(li, e);
- } else {
- reportError(getLocator(), e);
- }
- skipAfterExpression();
- /*
- * LocatorImpl loc = (LocatorImpl) getLocator(); loc.column--;
- * reportWarningSkipText(loc, skipAfterExpression());
- */
- } else {
- skipAfterExpression();
- }
- }
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public void declaration() throws ParseException {
- boolean important = false;
- String name;
- LexicalUnit exp;
- Token save;
- try {
- name = property();
- save = token;
- jj_consume_token(COLON);
- label_153: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[223] = jj_gen;
- break label_153;
- }
- jj_consume_token(S);
- }
- exp = expr();
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IMPORTANT_SYM:
- important = prio();
- break;
- default:
- jj_la1[224] = jj_gen;
- ;
- }
- documentHandler.property(name, exp, important);
- } catch (JumpException e) {
- skipAfterExpression();
- // reportWarningSkipText(getLocator(), skipAfterExpression());
-
- } catch (NumberFormatException e) {
- if (errorHandler != null) {
- errorHandler.error(new CSSParseException("Invalid number "
- + e.getMessage(), getLocator(), e));
- }
- reportWarningSkipText(getLocator(), skipAfterExpression());
- } catch (ParseException e) {
- if (errorHandler != null) {
- if (e.currentToken != null) {
- LocatorImpl li = new LocatorImpl(this,
- e.currentToken.next.beginLine,
- e.currentToken.next.beginColumn - 1);
- reportError(li, e);
- } else {
- reportError(getLocator(), e);
- }
- skipAfterExpression();
- /*
- * LocatorImpl loc = (LocatorImpl) getLocator(); loc.column--;
- * reportWarningSkipText(loc, skipAfterExpression());
- */
- } else {
- skipAfterExpression();
- }
- }
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public boolean prio() throws ParseException {
- jj_consume_token(IMPORTANT_SYM);
- label_154: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[225] = jj_gen;
- break label_154;
- }
- jj_consume_token(S);
- }
- {
- if (true) {
- return true;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public boolean guarded() throws ParseException {
- jj_consume_token(GUARDED_SYM);
- label_155: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[226] = jj_gen;
- break label_155;
- }
- jj_consume_token(S);
- }
- {
- if (true) {
- return true;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public LexicalUnitImpl operator(LexicalUnitImpl prev)
- throws ParseException {
- Token n;
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case COMMA:
- /*
- * (comments copied from basic_arithmetics.scss)supports: 1.
- * standard arithmetic operations (+, -, *, /, %) 2. / is treated as
- * css operator, unless one of its operands is variable or there is
- * another binary arithmetic operatorlimits: 1. cannot mix
- * arithmetic and css operations, e.g. "margin: 1px + 3px 2px" will
- * fail 2. space between add and minus operator and their following
- * operand is mandatory. e.g. "1 + 2" is valid, "1+2" is not 3.
- * parenthesis is not supported now.
- */
- n = jj_consume_token(COMMA);
- label_156: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[227] = jj_gen;
- break label_156;
- }
- jj_consume_token(S);
- }
- {
- if (true) {
- return LexicalUnitImpl.createComma(n.beginLine,
- n.beginColumn, prev);
- }
- }
- break;
- case DIV:
- n = jj_consume_token(DIV);
- label_157: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[228] = jj_gen;
- break label_157;
- }
- jj_consume_token(S);
- }
- {
- if (true) {
- return LexicalUnitImpl.createSlash(n.beginLine,
- n.beginColumn, prev);
- }
- }
- break;
- case ANY:
- n = jj_consume_token(ANY);
- label_158: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[229] = jj_gen;
- break label_158;
- }
- jj_consume_token(S);
- }
- {
- if (true) {
- return LexicalUnitImpl.createMultiply(n.beginLine,
- n.beginColumn, prev);
- }
- }
- break;
- case MOD:
- n = jj_consume_token(MOD);
- label_159: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[230] = jj_gen;
- break label_159;
- }
- jj_consume_token(S);
- }
- {
- if (true) {
- return LexicalUnitImpl.createModulo(n.beginLine,
- n.beginColumn, prev);
- }
- }
- break;
- case PLUS:
- n = jj_consume_token(PLUS);
- label_160: while (true) {
- jj_consume_token(S);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[231] = jj_gen;
- break label_160;
- }
- }
- {
- if (true) {
- return LexicalUnitImpl.createAdd(n.beginLine,
- n.beginColumn, prev);
- }
- }
- break;
- case MINUS:
- n = jj_consume_token(MINUS);
- label_161: while (true) {
- jj_consume_token(S);
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[232] = jj_gen;
- break label_161;
- }
- }
- {
- if (true) {
- return LexicalUnitImpl.createMinus(n.beginLine,
- n.beginColumn, prev);
- }
- }
- break;
- default:
- jj_la1[233] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- throw new Error("Missing return statement in function");
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public LexicalUnitImpl expr() throws ParseException {
- LexicalUnitImpl first, res;
- char op;
- first = term(null);
- res = first;
- label_162: while (true) {
- if (jj_2_8(2)) {
- ;
- } else {
- break label_162;
- }
- if (jj_2_9(2)) {
- res = operator(res);
- } else {
- ;
- }
- res = term(res);
- }
- {
- if (true) {
- return first;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public char unaryOperator() throws ParseException {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case MINUS:
- jj_consume_token(MINUS);
- {
- if (true) {
- return '-';
- }
- }
- break;
- case PLUS:
- jj_consume_token(PLUS);
- {
- if (true) {
- return '+';
- }
- }
- break;
- default:
- jj_la1[234] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- throw new Error("Missing return statement in function");
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public LexicalUnitImpl term(LexicalUnitImpl prev)
- throws ParseException {
- LexicalUnitImpl result = null;
- Token n = null;
- char op = ' ';
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case MINUS:
- case DOT:
- case STRING:
- case IDENT:
- case NUMBER:
- case URL:
- case PERCENTAGE:
- case PT:
- case MM:
- case CM:
- case PC:
- case IN:
- case PX:
- case EMS:
- case LEM:
- case REM:
- case EXS:
- case DEG:
- case RAD:
- case GRAD:
- case MS:
- case SECOND:
- case HZ:
- case KHZ:
- case DIMEN:
- case HASH:
- case UNICODERANGE:
- case FUNCTION:
- result = nonVariableTerm(prev);
- break;
- case VARIABLE:
- result = variableTerm(prev);
- break;
- default:
- jj_la1[235] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- {
- if (true) {
- return result;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public LexicalUnitImpl variableTerm(LexicalUnitImpl prev)
- throws ParseException {
- LexicalUnitImpl result = null;
- String varName = "";
- varName = variableName();
- result = LexicalUnitImpl.createVariable(token.beginLine,
- token.beginColumn, prev, varName);
- {
- if (true) {
- return result;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public LexicalUnitImpl nonVariableTerm(LexicalUnitImpl prev)
- throws ParseException {
- LexicalUnitImpl result = null;
- Token n = null;
- char op = ' ';
- String varName;
- String s = "";
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case MINUS:
- case NUMBER:
- case PERCENTAGE:
- case PT:
- case MM:
- case CM:
- case PC:
- case IN:
- case PX:
- case EMS:
- case LEM:
- case REM:
- case EXS:
- case DEG:
- case RAD:
- case GRAD:
- case MS:
- case SECOND:
- case HZ:
- case KHZ:
- case DIMEN:
- case FUNCTION:
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case MINUS:
- op = unaryOperator();
- break;
- default:
- jj_la1[236] = jj_gen;
- ;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case NUMBER:
- n = jj_consume_token(NUMBER);
- result = LexicalUnitImpl.createNumber(n.beginLine,
- n.beginColumn, prev, number(op, n, 0));
- break;
- case PERCENTAGE:
- n = jj_consume_token(PERCENTAGE);
- result = LexicalUnitImpl.createPercentage(n.beginLine,
- n.beginColumn, prev, number(op, n, 1));
- break;
- case PT:
- n = jj_consume_token(PT);
- result = LexicalUnitImpl.createPT(n.beginLine, n.beginColumn,
- prev, number(op, n, 2));
- break;
- case CM:
- n = jj_consume_token(CM);
- result = LexicalUnitImpl.createCM(n.beginLine, n.beginColumn,
- prev, number(op, n, 2));
- break;
- case MM:
- n = jj_consume_token(MM);
- result = LexicalUnitImpl.createMM(n.beginLine, n.beginColumn,
- prev, number(op, n, 2));
- break;
- case PC:
- n = jj_consume_token(PC);
- result = LexicalUnitImpl.createPC(n.beginLine, n.beginColumn,
- prev, number(op, n, 2));
- break;
- case IN:
- n = jj_consume_token(IN);
- result = LexicalUnitImpl.createIN(n.beginLine, n.beginColumn,
- prev, number(op, n, 2));
- break;
- case PX:
- n = jj_consume_token(PX);
- result = LexicalUnitImpl.createPX(n.beginLine, n.beginColumn,
- prev, number(op, n, 2));
- break;
- case EMS:
- n = jj_consume_token(EMS);
- result = LexicalUnitImpl.createEMS(n.beginLine, n.beginColumn,
- prev, number(op, n, 2));
- break;
- case LEM:
- n = jj_consume_token(LEM);
- result = LexicalUnitImpl.createLEM(n.beginLine, n.beginColumn,
- prev, number(op, n, 3));
- break;
- case REM:
- n = jj_consume_token(REM);
- result = LexicalUnitImpl.createREM(n.beginLine, n.beginColumn,
- prev, number(op, n, 3));
- break;
- case EXS:
- n = jj_consume_token(EXS);
- result = LexicalUnitImpl.createEXS(n.beginLine, n.beginColumn,
- prev, number(op, n, 2));
- break;
- case DEG:
- n = jj_consume_token(DEG);
- result = LexicalUnitImpl.createDEG(n.beginLine, n.beginColumn,
- prev, number(op, n, 3));
- break;
- case RAD:
- n = jj_consume_token(RAD);
- result = LexicalUnitImpl.createRAD(n.beginLine, n.beginColumn,
- prev, number(op, n, 3));
- break;
- case GRAD:
- n = jj_consume_token(GRAD);
- result = LexicalUnitImpl.createGRAD(n.beginLine, n.beginColumn,
- prev, number(op, n, 3));
- break;
- case SECOND:
- n = jj_consume_token(SECOND);
- result = LexicalUnitImpl.createS(n.beginLine, n.beginColumn,
- prev, number(op, n, 1));
- break;
- case MS:
- n = jj_consume_token(MS);
- result = LexicalUnitImpl.createMS(n.beginLine, n.beginColumn,
- prev, number(op, n, 2));
- break;
- case HZ:
- n = jj_consume_token(HZ);
- result = LexicalUnitImpl.createHZ(n.beginLine, n.beginColumn,
- prev, number(op, n, 2));
- break;
- case KHZ:
- n = jj_consume_token(KHZ);
- result = LexicalUnitImpl.createKHZ(n.beginLine, n.beginColumn,
- prev, number(op, n, 3));
- break;
- case DIMEN:
- n = jj_consume_token(DIMEN);
- s = n.image;
- int i = 0;
- while (i < s.length()
- && (Character.isDigit(s.charAt(i)) || (s.charAt(i) == '.'))) {
- i++;
- }
- result = LexicalUnitImpl.createDimen(n.beginLine,
- n.beginColumn, prev, Float.valueOf(s.substring(0, i))
- .floatValue(), s.substring(i));
- break;
- case FUNCTION:
- result = function(op, prev);
- break;
- default:
- jj_la1[237] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- break;
- case DOT:
- case STRING:
- case IDENT:
- case URL:
- case HASH:
- case UNICODERANGE:
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case STRING:
- n = jj_consume_token(STRING);
- result = LexicalUnitImpl.createString(n.beginLine,
- n.beginColumn, prev,
- convertStringIndex(n.image, 1, n.image.length() - 1));
- break;
- case DOT:
- case IDENT:
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case DOT:
- jj_consume_token(DOT);
- s += ".";
- break;
- default:
- jj_la1[238] = jj_gen;
- ;
- }
- n = jj_consume_token(IDENT);
- s += convertIdent(n.image);
- if ("inherit".equals(s)) {
- result = LexicalUnitImpl.createInherit(n.beginLine,
- n.beginColumn, prev);
- } else {
- result = LexicalUnitImpl.createIdent(n.beginLine,
- n.beginColumn, prev, convertIdent(n.image));
- }
-
- /*
- * / Auto correction code used in the CSS Validator but must not
- * be used by a conformant CSS2 parser. Common error : H1 {
- * color : black background : white }
- *
- * Token t = getToken(1); Token semicolon = new Token();
- * semicolon.kind = SEMICOLON; semicolon.image = ";"; if (t.kind
- * == COLON) { // @@SEEME. (generate a warning?) // @@SEEME if
- * expression is a single ident, generate an error ?
- * rejectToken(semicolon);
- *
- * result = prev; } /
- */
-
- break;
- case HASH:
- result = hexcolor(prev);
- break;
- case URL:
- result = url(prev);
- break;
- case UNICODERANGE:
- result = unicode(prev);
- break;
- default:
- jj_la1[239] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- break;
- default:
- jj_la1[240] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- label_163: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[241] = jj_gen;
- break label_163;
- }
- jj_consume_token(S);
- }
- {
- if (true) {
- return result;
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- /**
- * Handle all CSS2 functions.
- *
- * @exception ParseException
- * exception during the parse
- */
- final public LexicalUnitImpl function(char operator, LexicalUnitImpl prev)
- throws ParseException {
- Token n;
- LexicalUnit params = null;
- n = jj_consume_token(FUNCTION);
- label_164: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[242] = jj_gen;
- break label_164;
- }
- jj_consume_token(S);
- }
- String fname = convertIdent(n.image);
- if ("alpha(".equals(fname)) {
- String body = skipStatementUntilSemiColon();
- {
- if (true) {
- return LexicalUnitImpl.createIdent(n.beginLine,
- n.beginColumn, null, "alpha(" + body);
- }
- }
- } else if ("expression(".equals(fname)) {
- String body = skipStatementUntilSemiColon();
- {
- if (true) {
- return LexicalUnitImpl.createIdent(n.beginLine,
- n.beginColumn, null, "expression(" + body);
- }
- }
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case PLUS:
- case MINUS:
- case DOT:
- case STRING:
- case IDENT:
- case NUMBER:
- case URL:
- case VARIABLE:
- case PERCENTAGE:
- case PT:
- case MM:
- case CM:
- case PC:
- case IN:
- case PX:
- case EMS:
- case LEM:
- case REM:
- case EXS:
- case DEG:
- case RAD:
- case GRAD:
- case MS:
- case SECOND:
- case HZ:
- case KHZ:
- case DIMEN:
- case HASH:
- case UNICODERANGE:
- case FUNCTION:
- params = expr();
- break;
- default:
- jj_la1[243] = jj_gen;
- ;
- }
- jj_consume_token(RPARAN);
- if (operator != ' ') {
- {
- if (true) {
- throw new CSSParseException(
- "invalid operator before a function.", getLocator());
- }
- }
- }
- String f = convertIdent(n.image);
- LexicalUnitImpl l = (LexicalUnitImpl) params;
- boolean loop = true;
- if ("rgb(".equals(f)) {
- // this is a RGB declaration (e.g. rgb(255, 50%, 0) )
- int i = 0;
- while (loop && l != null && i < 5) {
- switch (i) {
- case 0:
- case 2:
- case 4:
- if ((l.getLexicalUnitType() != LexicalUnit.SAC_INTEGER)
- && (l.getLexicalUnitType() != LexicalUnit.SAC_PERCENTAGE)) {
- loop = false;
- }
- break;
- case 1:
- case 3:
- if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) {
- loop = false;
- }
- break;
- default: {
- if (true) {
- throw new ParseException("implementation error");
- }
- }
- }
- if (loop) {
- l = l.getNextLexicalUnit();
- i++;
- }
- }
- if ((i == 5) && loop && (l == null)) {
- {
- if (true) {
- return LexicalUnitImpl.createRGBColor(n.beginLine,
- n.beginColumn, prev, params);
- }
- }
- } else {
- if (errorHandler != null) {
- String errorText;
- Locator loc;
- if (i < 5) {
- if (params == null) {
- loc = new LocatorImpl(this, n.beginLine,
- n.beginColumn - 1);
- errorText = "not enough parameters.";
- } else if (l == null) {
- loc = new LocatorImpl(this, n.beginLine,
- n.beginColumn - 1);
- errorText = "not enough parameters: "
- + params.toString();
- } else {
- loc = new LocatorImpl(this, l.getLineNumber(),
- l.getColumnNumber());
- errorText = "invalid parameter: " + l.toString();
- }
- } else {
- loc = new LocatorImpl(this, l.getLineNumber(),
- l.getColumnNumber());
- errorText = "too many parameters: " + l.toString();
- }
- errorHandler.error(new CSSParseException(errorText, loc));
- }
-
- {
- if (true) {
- throw new JumpException();
- }
- }
- }
- } else if ("counter".equals(f)) {
- int i = 0;
- while (loop && l != null && i < 3) {
- switch (i) {
- case 0:
- case 2:
- if (l.getLexicalUnitType() != LexicalUnit.SAC_IDENT) {
- loop = false;
- }
- break;
- case 1:
- if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) {
- loop = false;
- }
- break;
- default: {
- if (true) {
- throw new ParseException("implementation error");
- }
- }
- }
- l = l.getNextLexicalUnit();
- i++;
- }
- if (((i == 1) || (i == 3)) && loop && (l == null)) {
- {
- if (true) {
- return LexicalUnitImpl.createCounter(n.beginLine,
- n.beginColumn, prev, params);
- }
- }
- }
-
- } else if ("counters(".equals(f)) {
-
- int i = 0;
- while (loop && l != null && i < 5) {
- switch (i) {
- case 0:
- case 4:
- if (l.getLexicalUnitType() != LexicalUnit.SAC_IDENT) {
- loop = false;
- }
- break;
- case 2:
- if (l.getLexicalUnitType() != LexicalUnit.SAC_STRING_VALUE) {
- loop = false;
- }
- break;
- case 1:
- case 3:
- if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) {
- loop = false;
- }
- break;
- default: {
- if (true) {
- throw new ParseException("implementation error");
- }
- }
- }
- l = l.getNextLexicalUnit();
- i++;
- }
- if (((i == 3) || (i == 5)) && loop && (l == null)) {
- {
- if (true) {
- return LexicalUnitImpl.createCounters(n.beginLine,
- n.beginColumn, prev, params);
- }
- }
- }
- } else if ("attr(".equals(f)) {
- if ((l != null) && (l.getNextLexicalUnit() == null)
- && (l.getLexicalUnitType() == LexicalUnit.SAC_IDENT)) {
- {
- if (true) {
- return LexicalUnitImpl.createAttr(l.getLineNumber(),
- l.getColumnNumber(), prev, l.getStringValue());
- }
- }
- }
- } else if ("rect(".equals(f)) {
- int i = 0;
- while (loop && l != null && i < 7) {
- switch (i) {
- case 0:
- case 2:
- case 4:
- case 6:
- switch (l.getLexicalUnitType()) {
- case LexicalUnit.SAC_INTEGER:
- if (l.getIntegerValue() != 0) {
- loop = false;
- }
- break;
- case LexicalUnit.SAC_IDENT:
- if (!l.getStringValue().equals("auto")) {
- loop = false;
- }
- break;
- case LexicalUnit.SAC_EM:
- case LexicalUnit.SAC_EX:
- case LexicalUnit.SAC_PIXEL:
- case LexicalUnit.SAC_CENTIMETER:
- case LexicalUnit.SAC_MILLIMETER:
- case LexicalUnit.SAC_INCH:
- case LexicalUnit.SAC_POINT:
- case LexicalUnit.SAC_PICA:
- // nothing
- break;
- default:
- loop = false;
- }
- break;
- case 1:
- case 3:
- case 5:
- if (l.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) {
- loop = false;
- }
- break;
- default: {
- if (true) {
- throw new ParseException("implementation error");
- }
- }
- }
- l = l.getNextLexicalUnit();
- i++;
- }
- if ((i == 7) && loop && (l == null)) {
- {
- if (true) {
- return LexicalUnitImpl.createRect(n.beginLine,
- n.beginColumn, prev, params);
- }
- }
- }
- }
- {
- if (true) {
- return LexicalUnitImpl.createFunction(n.beginLine,
- n.beginColumn, prev, f.substring(0, f.length() - 1),
- params);
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public LexicalUnitImpl unicode(LexicalUnitImpl prev)
- throws ParseException {
- Token n;
- n = jj_consume_token(UNICODERANGE);
- LexicalUnitImpl params = null;
- String s = n.image.substring(2);
- int index = s.indexOf('-');
- if (index == -1) {
- params = LexicalUnitImpl.createInteger(n.beginLine, n.beginColumn,
- params, Integer.parseInt(s, 16));
- } else {
- String s1 = s.substring(0, index);
- String s2 = s.substring(index);
-
- params = LexicalUnitImpl.createInteger(n.beginLine, n.beginColumn,
- params, Integer.parseInt(s1, 16));
- params = LexicalUnitImpl.createInteger(n.beginLine, n.beginColumn,
- params, Integer.parseInt(s2, 16));
- }
-
- {
- if (true) {
- return LexicalUnitImpl.createUnicodeRange(n.beginLine,
- n.beginColumn, prev, params);
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- final public LexicalUnitImpl url(LexicalUnitImpl prev)
- throws ParseException {
- Token n;
- n = jj_consume_token(URL);
- String urlname = n.image.substring(4, n.image.length() - 1).trim();
- {
- if (true) {
- return LexicalUnitImpl.createURL(n.beginLine, n.beginColumn,
- prev, urlname);
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- /**
- * @exception ParseException
- * exception during the parse
- */
- final public LexicalUnitImpl hexcolor(LexicalUnitImpl prev)
- throws ParseException {
- Token n;
- n = jj_consume_token(HASH);
- int r;
- LexicalUnitImpl first, params = null;
- String s = n.image.substring(1);
-
- if (s.length() != 3 && s.length() != 6) {
- first = null;
- {
- if (true) {
- throw new CSSParseException(
- "invalid hexadecimal notation for RGB: " + s,
- getLocator());
- }
- }
- }
- {
- if (true) {
- return LexicalUnitImpl.createIdent(n.beginLine, n.beginColumn,
- prev, n.image);
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- float number(char operator, Token n, int lengthUnit) throws ParseException {
- String image = n.image;
- float f = 0;
-
- if (lengthUnit != 0) {
- image = image.substring(0, image.length() - lengthUnit);
- }
- f = Float.valueOf(image).floatValue();
- return (operator == '-') ? -f : f;
- }
-
- String skipStatementUntilSemiColon() throws ParseException {
- int[] semicolon = { SEMICOLON };
- return skipStatementUntil(semicolon);
- }
-
- String skipStatementUntilLeftBrace() throws ParseException {
- int[] lBrace = { LBRACE };
- return skipStatementUntil(lBrace);
- }
-
- String skipStatementUntilRightParan() throws ParseException {
- int[] rParan = { RPARAN };
- return skipStatementUntil(rParan);
- }
-
- String skipStatementUntil(int[] symbols) throws ParseException {
- StringBuffer s = new StringBuffer();
- boolean stop = false;
- Token tok;
- while (!stop) {
- tok = getToken(1);
- if (tok.kind == EOF) {
- return null;
- }
- for (int sym : symbols) {
- if (tok.kind == sym) {
- stop = true;
- break;
- }
- }
- if (!stop) {
- if (tok.image != null) {
- s.append(tok.image);
- }
- getNextToken();
- }
- }
- return s.toString().trim();
- }
-
- String skipStatement() throws ParseException {
- StringBuffer s = new StringBuffer();
- Token tok = getToken(0);
- if (tok.image != null) {
- s.append(tok.image);
- }
- while (true) {
- tok = getToken(1);
- if (tok.kind == EOF) {
- return null;
- }
- s.append(tok.image);
- if (tok.kind == LBRACE) {
- getNextToken();
- s.append(skip_to_matching_brace());
- getNextToken();
- tok = getToken(1);
- break;
- } else if (tok.kind == RBRACE) {
- getNextToken();
- tok = getToken(1);
- break;
- } else if (tok.kind == SEMICOLON) {
- getNextToken();
- tok = getToken(1);
- break;
- }
- getNextToken();
- }
-
- // skip white space
- while (true) {
- if (tok.kind != S) {
- break;
- }
- tok = getNextToken();
- tok = getToken(1);
- }
-
- return s.toString().trim();
- }
-
- String skip_to_matching_brace() throws ParseException {
- StringBuffer s = new StringBuffer();
- Token tok;
- int nesting = 1;
- while (true) {
- tok = getToken(1);
- if (tok.kind == EOF) {
- break;
- }
- s.append(tok.image);
- if (tok.kind == LBRACE) {
- nesting++;
- } else if (tok.kind == RBRACE) {
- nesting--;
- if (nesting == 0) {
- break;
- }
- }
- getNextToken();
- }
- return s.toString();
- }
-
- String convertStringIndex(String s, int start, int len)
- throws ParseException {
- StringBuffer buf = new StringBuffer(len);
- int index = start;
-
- while (index < len) {
- char c = s.charAt(index);
- if (c == '\u005c\u005c') {
- if (++index < len) {
- c = s.charAt(index);
- switch (c) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- buf.append('\u005c\u005c');
- while (index < len) {
- buf.append(s.charAt(index++));
- }
- break;
- case '\u005cn':
- case '\u005cf':
- break;
- case '\u005cr':
- if (index + 1 < len) {
- if (s.charAt(index + 1) == '\u005cn') {
- index++;
- }
- }
- break;
- default:
- buf.append(c);
- }
- } else {
- throw new CSSParseException("invalid string " + s,
- getLocator());
- }
- } else {
- buf.append(c);
- }
- index++;
- }
-
- return buf.toString();
- }
-
- String convertIdent(String s) throws ParseException {
- return convertStringIndex(s, 0, s.length());
- }
-
- String convertString(String s) throws ParseException {
- return convertStringIndex(s, 0, s.length());
- }
-
- void comments() throws ParseException {
- if (token.specialToken != null) {
- Token tmp_t = token.specialToken;
- while (tmp_t.specialToken != null) {
- tmp_t = tmp_t.specialToken;
- }
- while (tmp_t != null) {
- documentHandler.comment(tmp_t.image);
- tmp_t = tmp_t.next;
- }
- }
- }
-
- void rejectToken(Token t) throws ParseException {
- Token fakeToken = new Token();
- t.next = token;
- fakeToken.next = t;
- token = fakeToken;
- }
-
- String skipAfterExpression() throws ParseException {
- Token t = getToken(1);
- StringBuffer s = new StringBuffer();
- s.append(getToken(0).image);
-
- while ((t.kind != RBRACE) && (t.kind != SEMICOLON) && (t.kind != EOF)) {
- s.append(t.image);
- getNextToken();
- t = getToken(1);
- }
-
- return s.toString();
- }
-
- /**
- * The following functions are useful for a DOM CSS implementation only and
- * are not part of the general CSS2 parser.
- */
- final public void _parseRule() throws ParseException {
- String ret = null;
- label_165: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[244] = jj_gen;
- break label_165;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case IMPORT_SYM:
- importDeclaration();
- break;
- case DEBUG_SYM:
- case WARN_SYM:
- debuggingDirective();
- break;
- case PLUS:
- case PRECEDES:
- case SIBLING:
- case LBRACKET:
- case ANY:
- case PARENT:
- case DOT:
- case COLON:
- case INTERPOLATION:
- case IDENT:
- case HASH:
- styleRule();
- break;
- case MEDIA_SYM:
- media();
- break;
- case PAGE_SYM:
- page();
- break;
- case FONT_FACE_SYM:
- fontFace();
- break;
- default:
- jj_la1[245] = jj_gen;
- ret = skipStatement();
- if ((ret == null) || (ret.length() == 0)) {
- {
- if (true) {
- return;
- }
- }
- }
- if (ret.charAt(0) == '@') {
- documentHandler.unrecognizedRule(ret);
- } else {
- {
- if (true) {
- throw new CSSParseException("unrecognize rule: " + ret,
- getLocator());
- }
- }
- }
- }
- }
-
- final public void _parseImportRule() throws ParseException {
- label_166: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[246] = jj_gen;
- break label_166;
- }
- jj_consume_token(S);
- }
- importDeclaration();
- }
-
- final public void _parseMediaRule() throws ParseException {
- label_167: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[247] = jj_gen;
- break label_167;
- }
- jj_consume_token(S);
- }
- media();
- }
-
- final public void _parseDeclarationBlock() throws ParseException {
- label_168: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[248] = jj_gen;
- break label_168;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- declaration();
- break;
- default:
- jj_la1[249] = jj_gen;
- ;
- }
- label_169: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case SEMICOLON:
- ;
- break;
- default:
- jj_la1[250] = jj_gen;
- break label_169;
- }
- jj_consume_token(SEMICOLON);
- label_170: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[251] = jj_gen;
- break label_170;
- }
- jj_consume_token(S);
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case INTERPOLATION:
- case IDENT:
- declaration();
- break;
- default:
- jj_la1[252] = jj_gen;
- ;
- }
- }
- }
-
- final public ArrayList<String> _parseSelectors() throws ParseException {
- ArrayList<String> p = null;
- try {
- label_171: while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case S:
- ;
- break;
- default:
- jj_la1[253] = jj_gen;
- break label_171;
- }
- jj_consume_token(S);
- }
- p = selectorList();
- {
- if (true) {
- return p;
- }
- }
- } catch (ThrowedParseException e) {
- {
- if (true) {
- throw (ParseException) e.e.fillInStackTrace();
- }
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- private boolean jj_2_1(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- try {
- return !jj_3_1();
- } catch (LookaheadSuccess ls) {
- return true;
- } finally {
- jj_save(0, xla);
- }
- }
-
- private boolean jj_2_2(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- try {
- return !jj_3_2();
- } catch (LookaheadSuccess ls) {
- return true;
- } finally {
- jj_save(1, xla);
- }
- }
-
- private boolean jj_2_3(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- try {
- return !jj_3_3();
- } catch (LookaheadSuccess ls) {
- return true;
- } finally {
- jj_save(2, xla);
- }
- }
-
- private boolean jj_2_4(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- try {
- return !jj_3_4();
- } catch (LookaheadSuccess ls) {
- return true;
- } finally {
- jj_save(3, xla);
- }
- }
-
- private boolean jj_2_5(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- try {
- return !jj_3_5();
- } catch (LookaheadSuccess ls) {
- return true;
- } finally {
- jj_save(4, xla);
- }
- }
-
- private boolean jj_2_6(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- try {
- return !jj_3_6();
- } catch (LookaheadSuccess ls) {
- return true;
- } finally {
- jj_save(5, xla);
- }
- }
-
- private boolean jj_2_7(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- try {
- return !jj_3_7();
- } catch (LookaheadSuccess ls) {
- return true;
- } finally {
- jj_save(6, xla);
- }
- }
-
- private boolean jj_2_8(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- try {
- return !jj_3_8();
- } catch (LookaheadSuccess ls) {
- return true;
- } finally {
- jj_save(7, xla);
- }
- }
-
- private boolean jj_2_9(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- try {
- return !jj_3_9();
- } catch (LookaheadSuccess ls) {
- return true;
- } finally {
- jj_save(8, xla);
- }
- }
-
- private boolean jj_3R_182() {
- if (jj_scan_token(VARIABLE)) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_261() {
- if (jj_scan_token(PLUS)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_251() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_260()) {
- jj_scanpos = xsp;
- if (jj_3R_261()) {
- return true;
- }
- }
- return false;
- }
-
- private boolean jj_3R_260() {
- if (jj_scan_token(MINUS)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_256() {
- if (jj_scan_token(UNICODERANGE)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_246() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_257()) {
- jj_scanpos = xsp;
- if (jj_3R_258()) {
- return true;
- }
- }
- return false;
- }
-
- private boolean jj_3R_257() {
- if (jj_scan_token(IDENT)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_198() {
- Token xsp;
- if (jj_3R_246()) {
- return true;
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_246()) {
- jj_scanpos = xsp;
- break;
- }
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3_8() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3_9()) {
- jj_scanpos = xsp;
- }
- if (jj_3R_180()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_183() {
- if (jj_3R_180()) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3_8()) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_184() {
- if (jj_3R_209()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_208() {
- if (jj_scan_token(MINUS)) {
- return true;
- }
- Token xsp;
- if (jj_scan_token(1)) {
- return true;
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_207() {
- if (jj_scan_token(PLUS)) {
- return true;
- }
- Token xsp;
- if (jj_scan_token(1)) {
- return true;
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_206() {
- if (jj_scan_token(MOD)) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_205() {
- if (jj_scan_token(ANY)) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_204() {
- if (jj_scan_token(DIV)) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_211() {
- if (jj_3R_210()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_210() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(20)) {
- jj_scanpos = xsp;
- if (jj_scan_token(24)) {
- jj_scanpos = xsp;
- if (jj_scan_token(25)) {
- return true;
- }
- }
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_172() {
- if (jj_3R_182()) {
- return true;
- }
- if (jj_scan_token(COLON)) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- if (jj_3R_183()) {
- return true;
- }
- xsp = jj_scanpos;
- if (jj_3R_184()) {
- jj_scanpos = xsp;
- }
- if (jj_3R_185()) {
- return true;
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_185()) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_203() {
- if (jj_scan_token(COMMA)) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_181() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_203()) {
- jj_scanpos = xsp;
- if (jj_3R_204()) {
- jj_scanpos = xsp;
- if (jj_3R_205()) {
- jj_scanpos = xsp;
- if (jj_3R_206()) {
- jj_scanpos = xsp;
- if (jj_3R_207()) {
- jj_scanpos = xsp;
- if (jj_3R_208()) {
- return true;
- }
- }
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_187() {
- if (jj_scan_token(S)) {
- return true;
- }
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_211()) {
- jj_scanpos = xsp;
- }
- return false;
- }
-
- private boolean jj_3R_186() {
- if (jj_3R_210()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_173() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_186()) {
- jj_scanpos = xsp;
- if (jj_3R_187()) {
- return true;
- }
- }
- return false;
- }
-
- private boolean jj_3R_209() {
- if (jj_scan_token(GUARDED_SYM)) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_193() {
- if (jj_scan_token(VARIABLE)) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- if (jj_scan_token(COLON)) {
- return true;
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_175() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_193()) {
- jj_scanpos = xsp;
- }
- if (jj_scan_token(CONTAINS)) {
- return true;
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- if (true) {
- jj_la = 0;
- jj_scanpos = jj_lastpos;
- return false;
- }
- return false;
- }
-
- private boolean jj_3R_213() {
- if (jj_scan_token(HASH)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_283() {
- if (jj_scan_token(IDENT)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_284() {
- if (jj_scan_token(FUNCTION)) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- if (true) {
- jj_la = 0;
- jj_scanpos = jj_lastpos;
- return false;
- }
- return false;
- }
-
- private boolean jj_3R_282() {
- if (jj_scan_token(COLON)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_215() {
- if (jj_scan_token(COLON)) {
- return true;
- }
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_282()) {
- jj_scanpos = xsp;
- }
- xsp = jj_scanpos;
- if (jj_3R_283()) {
- jj_scanpos = xsp;
- if (jj_3R_284()) {
- return true;
- }
- }
- return false;
- }
-
- private boolean jj_3_7() {
- if (jj_3R_179()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_303() {
- if (jj_scan_token(STRING)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_301() {
- if (jj_scan_token(STARMATCH)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_302() {
- if (jj_scan_token(IDENT)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_300() {
- if (jj_scan_token(DOLLARMATCH)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_299() {
- if (jj_scan_token(CARETMATCH)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_298() {
- if (jj_scan_token(DASHMATCH)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_297() {
- if (jj_scan_token(INCLUDES)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_264() {
- if (jj_scan_token(INTERPOLATION)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_296() {
- if (jj_scan_token(EQ)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_200() {
- if (jj_scan_token(LBRACE)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_289() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_296()) {
- jj_scanpos = xsp;
- if (jj_3R_297()) {
- jj_scanpos = xsp;
- if (jj_3R_298()) {
- jj_scanpos = xsp;
- if (jj_3R_299()) {
- jj_scanpos = xsp;
- if (jj_3R_300()) {
- jj_scanpos = xsp;
- if (jj_3R_301()) {
- return true;
- }
- }
- }
- }
- }
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- xsp = jj_scanpos;
- if (jj_3R_302()) {
- jj_scanpos = xsp;
- if (jj_3R_303()) {
- return true;
- }
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_216() {
- if (jj_scan_token(LBRACKET)) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- if (jj_scan_token(IDENT)) {
- return true;
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- xsp = jj_scanpos;
- if (jj_3R_289()) {
- jj_scanpos = xsp;
- }
- if (jj_scan_token(RBRACKET)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_295() {
- if (jj_scan_token(INTERPOLATION)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_199() {
- if (jj_3R_183()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_250() {
- if (jj_scan_token(PARENT)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_249() {
- if (jj_scan_token(ANY)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3_6() {
- if (jj_3R_178()) {
- return true;
- }
- if (jj_scan_token(LBRACE)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_179() {
- if (jj_3R_198()) {
- return true;
- }
- if (jj_scan_token(COLON)) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- xsp = jj_scanpos;
- if (jj_3R_199()) {
- jj_scanpos = xsp;
- if (jj_3R_200()) {
- return true;
- }
- }
- return false;
- }
-
- private boolean jj_3R_259() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_263()) {
- jj_scanpos = xsp;
- if (jj_3R_264()) {
- return true;
- }
- }
- return false;
- }
-
- private boolean jj_3R_263() {
- if (jj_scan_token(IDENT)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_212() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_248()) {
- jj_scanpos = xsp;
- if (jj_3R_249()) {
- jj_scanpos = xsp;
- if (jj_3R_250()) {
- return true;
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_248() {
- Token xsp;
- if (jj_3R_259()) {
- return true;
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_259()) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_262() {
- if (jj_3R_183()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_176() {
- if (jj_scan_token(COMMA)) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_277() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_294()) {
- jj_scanpos = xsp;
- if (jj_3R_295()) {
- return true;
- }
- }
- return false;
- }
-
- private boolean jj_3R_294() {
- if (jj_scan_token(IDENT)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_293() {
- if (jj_3R_215()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3_5() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_176()) {
- jj_scanpos = xsp;
- }
- if (jj_3R_177()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_214() {
- if (jj_scan_token(DOT)) {
- return true;
- }
- Token xsp;
- if (jj_3R_277()) {
- return true;
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_277()) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_252() {
- if (jj_scan_token(FUNCTION)) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- xsp = jj_scanpos;
- if (jj_3R_262()) {
- jj_scanpos = xsp;
- }
- if (jj_scan_token(RPARAN)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_291() {
- if (jj_3R_214()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_286() {
- if (jj_3R_214()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_288() {
- if (jj_3R_215()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_276() {
- if (jj_3R_215()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_279() {
- if (jj_3R_214()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_281() {
- if (jj_3R_215()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_243() {
- if (jj_3R_256()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_242() {
- if (jj_3R_255()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_241() {
- if (jj_3R_254()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_292() {
- if (jj_3R_216()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_269() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_290()) {
- jj_scanpos = xsp;
- if (jj_3R_291()) {
- jj_scanpos = xsp;
- if (jj_3R_292()) {
- jj_scanpos = xsp;
- if (jj_3R_293()) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_290() {
- if (jj_3R_213()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_268() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_285()) {
- jj_scanpos = xsp;
- if (jj_3R_286()) {
- jj_scanpos = xsp;
- if (jj_3R_287()) {
- jj_scanpos = xsp;
- if (jj_3R_288()) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_285() {
- if (jj_3R_213()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_273() {
- if (jj_3R_215()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_267() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_278()) {
- jj_scanpos = xsp;
- if (jj_3R_279()) {
- jj_scanpos = xsp;
- if (jj_3R_280()) {
- jj_scanpos = xsp;
- if (jj_3R_281()) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_278() {
- if (jj_3R_213()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_287() {
- if (jj_3R_216()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_275() {
- if (jj_3R_216()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_280() {
- if (jj_3R_216()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_266() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_274()) {
- jj_scanpos = xsp;
- if (jj_3R_275()) {
- jj_scanpos = xsp;
- if (jj_3R_276()) {
- return true;
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_271() {
- if (jj_3R_214()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_274() {
- if (jj_3R_214()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_192() {
- if (jj_3R_216()) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_269()) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_191() {
- if (jj_3R_215()) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_268()) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_272() {
- if (jj_3R_216()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_190() {
- if (jj_3R_214()) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_267()) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_253() {
- if (jj_scan_token(DOT)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_189() {
- if (jj_3R_213()) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_266()) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_265() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_270()) {
- jj_scanpos = xsp;
- if (jj_3R_271()) {
- jj_scanpos = xsp;
- if (jj_3R_272()) {
- jj_scanpos = xsp;
- if (jj_3R_273()) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_270() {
- if (jj_3R_213()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_240() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_253()) {
- jj_scanpos = xsp;
- }
- if (jj_scan_token(IDENT)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_188() {
- if (jj_3R_212()) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_265()) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_174() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_188()) {
- jj_scanpos = xsp;
- if (jj_3R_189()) {
- jj_scanpos = xsp;
- if (jj_3R_190()) {
- jj_scanpos = xsp;
- if (jj_3R_191()) {
- jj_scanpos = xsp;
- if (jj_3R_192()) {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_239() {
- if (jj_scan_token(STRING)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_238() {
- if (jj_3R_252()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_245() {
- if (jj_3R_210()) {
- return true;
- }
- if (jj_3R_174()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_195() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_239()) {
- jj_scanpos = xsp;
- if (jj_3R_240()) {
- jj_scanpos = xsp;
- if (jj_3R_241()) {
- jj_scanpos = xsp;
- if (jj_3R_242()) {
- jj_scanpos = xsp;
- if (jj_3R_243()) {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_237() {
- if (jj_scan_token(DIMEN)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_236() {
- if (jj_scan_token(KHZ)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_235() {
- if (jj_scan_token(HZ)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_234() {
- if (jj_scan_token(MS)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_233() {
- if (jj_scan_token(SECOND)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_232() {
- if (jj_scan_token(GRAD)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_231() {
- if (jj_scan_token(RAD)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3_2() {
- if (jj_3R_173()) {
- return true;
- }
- if (jj_3R_174()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_230() {
- if (jj_scan_token(DEG)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3_1() {
- if (jj_3R_172()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_229() {
- if (jj_scan_token(EXS)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_197() {
- if (jj_scan_token(COMMA)) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- if (jj_3R_196()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_244() {
- if (jj_3R_174()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_228() {
- if (jj_scan_token(REM)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_227() {
- if (jj_scan_token(LEM)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_196() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_244()) {
- jj_scanpos = xsp;
- if (jj_3R_245()) {
- return true;
- }
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_3_2()) {
- jj_scanpos = xsp;
- break;
- }
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_226() {
- if (jj_scan_token(EMS)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_225() {
- if (jj_scan_token(PX)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_224() {
- if (jj_scan_token(IN)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_223() {
- if (jj_scan_token(PC)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_222() {
- if (jj_scan_token(MM)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_221() {
- if (jj_scan_token(CM)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_178() {
- if (jj_3R_196()) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_197()) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_220() {
- if (jj_scan_token(PT)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_219() {
- if (jj_scan_token(PERCENTAGE)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3_4() {
- if (jj_3R_175()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_202() {
- if (jj_3R_247()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_218() {
- if (jj_scan_token(NUMBER)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_217() {
- if (jj_3R_251()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_194() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_217()) {
- jj_scanpos = xsp;
- }
- xsp = jj_scanpos;
- if (jj_3R_218()) {
- jj_scanpos = xsp;
- if (jj_3R_219()) {
- jj_scanpos = xsp;
- if (jj_3R_220()) {
- jj_scanpos = xsp;
- if (jj_3R_221()) {
- jj_scanpos = xsp;
- if (jj_3R_222()) {
- jj_scanpos = xsp;
- if (jj_3R_223()) {
- jj_scanpos = xsp;
- if (jj_3R_224()) {
- jj_scanpos = xsp;
- if (jj_3R_225()) {
- jj_scanpos = xsp;
- if (jj_3R_226()) {
- jj_scanpos = xsp;
- if (jj_3R_227()) {
- jj_scanpos = xsp;
- if (jj_3R_228()) {
- jj_scanpos = xsp;
- if (jj_3R_229()) {
- jj_scanpos = xsp;
- if (jj_3R_230()) {
- jj_scanpos = xsp;
- if (jj_3R_231()) {
- jj_scanpos = xsp;
- if (jj_3R_232()) {
- jj_scanpos = xsp;
- if (jj_3R_233()) {
- jj_scanpos = xsp;
- if (jj_3R_234()) {
- jj_scanpos = xsp;
- if (jj_3R_235()) {
- jj_scanpos = xsp;
- if (jj_3R_236()) {
- jj_scanpos = xsp;
- if (jj_3R_237()) {
- jj_scanpos = xsp;
- if (jj_3R_238()) {
- return true;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_177() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_194()) {
- jj_scanpos = xsp;
- if (jj_3R_195()) {
- return true;
- }
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- private boolean jj_3R_254() {
- if (jj_scan_token(HASH)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_247() {
- if (jj_3R_182()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_258() {
- if (jj_scan_token(INTERPOLATION)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_255() {
- if (jj_scan_token(URL)) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3_3() {
- if (jj_3R_172()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_201() {
- if (jj_3R_177()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_180() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_201()) {
- jj_scanpos = xsp;
- if (jj_3R_202()) {
- return true;
- }
- }
- return false;
- }
-
- private boolean jj_3_9() {
- if (jj_3R_181()) {
- return true;
- }
- return false;
- }
-
- private boolean jj_3R_185() {
- if (jj_scan_token(SEMICOLON)) {
- return true;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_scan_token(1)) {
- jj_scanpos = xsp;
- break;
- }
- }
- return false;
- }
-
- /** Generated Token Manager. */
- public ParserTokenManager token_source;
- /** Current token. */
- public Token token;
- /** Next token. */
- public Token jj_nt;
- private int jj_ntk;
- private Token jj_scanpos, jj_lastpos;
- private int jj_la;
- private int jj_gen;
- final private int[] jj_la1 = new int[254];
- static private int[] jj_la1_0;
- static private int[] jj_la1_1;
- static private int[] jj_la1_2;
- static private int[] jj_la1_3;
- static {
- jj_la1_init_0();
- jj_la1_init_1();
- jj_la1_init_2();
- jj_la1_init_3();
- }
-
- private static void jj_la1_init_0() {
- jj_la1_0 = new int[] { 0x0, 0xc02, 0xc02, 0x0, 0xc00, 0x2, 0x2, 0x2,
- 0x53100000, 0x0, 0xc00, 0x2, 0xc00, 0x2, 0x0, 0x2, 0x0, 0x2,
- 0x2, 0x0, 0x0, 0x2, 0x2, 0x0, 0x2, 0x0, 0x2, 0x2, 0x53100000,
- 0x53100000, 0x2, 0x2, 0x2, 0x53f45400, 0x53f45400, 0x2,
- 0x400000, 0x2, 0x2, 0x2, 0x2, 0x0, 0x0, 0x2, 0x0, 0x800000,
- 0x2, 0x0, 0x2, 0x2, 0x2, 0x2, 0x0, 0x800000, 0x2, 0x0, 0x2,
- 0xe45400, 0x3100000, 0x3100002, 0x3100000, 0x2, 0x2, 0x480002,
- 0x480002, 0x2, 0x0, 0x0, 0x2, 0x2, 0x2, 0x2, 0x53100000,
- 0x53100000, 0x2, 0x400000, 0x2, 0x53100000, 0x2, 0x10000000,
- 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000,
- 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x50000000,
- 0x0, 0x0, 0x0, 0x0, 0x40000000, 0x2, 0x2, 0xfc000, 0x2, 0x0,
- 0x2, 0xfc000, 0x0, 0x2, 0x0, 0x2, 0x0, 0x2, 0x800000, 0x0,
- 0x53100000, 0x0, 0x4d380002, 0x2, 0x53100000, 0x2, 0x0, 0x2,
- 0x4d380002, 0x0, 0x2, 0x53100000, 0x2, 0x4d380002, 0x2, 0x2,
- 0x2, 0x0, 0x2, 0x53100000, 0x2, 0x2, 0x400000, 0x2, 0x2, 0x2,
- 0x2, 0x0, 0x2, 0x53100000, 0x53100000, 0x2, 0x400000, 0x2, 0x2,
- 0x2, 0x400000, 0x0, 0x0, 0x300000, 0x2, 0x0, 0x400000, 0x2,
- 0x300000, 0x2, 0x0, 0x2, 0x0, 0x2, 0x800000, 0x2, 0x2, 0x0,
- 0x2, 0x0, 0x2, 0x2, 0x2, 0x400000, 0x2, 0x2, 0x2, 0x2, 0x2,
- 0x0, 0x2, 0x2, 0x2, 0x400000, 0x2, 0x2, 0x2, 0x0, 0x2, 0x2,
- 0x2, 0x400000, 0x2, 0x2, 0x0, 0x2, 0x0, 0x2, 0x2, 0x2,
- 0x400000, 0x0, 0x2, 0x2, 0x0, 0x2, 0x2, 0x2, 0x800000, 0x2,
- 0x2, 0x0, 0x800000, 0x2, 0x0, 0x2, 0x0, 0x53100000, 0x2, 0x0,
- 0x2, 0x0, 0x800000, 0x2, 0x0, 0x2, 0x301000, 0x2, 0x0, 0x2,
- 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0xc8700000, 0x300000,
- 0x300000, 0x300000, 0x0, 0x0, 0x0, 0x300000, 0x2, 0x2,
- 0x300000, 0x2, 0x53100000, 0x2, 0x2, 0x2, 0x0, 0x800000, 0x2,
- 0x0, 0x2, };
- }
-
- private static void jj_la1_init_1() {
- jj_la1_1 = new int[] { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x59800303, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x200, 0x200, 0x0, 0x0, 0x480000, 0x0, 0x480000, 0x0, 0x0,
- 0x59000303, 0x59000303, 0x0, 0x0, 0x0, 0x18000703, 0x18000703,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x100, 0x0, 0x200, 0x0, 0x0,
- 0x200, 0x0, 0x0, 0x0, 0x0, 0x200, 0x0, 0x0, 0x200, 0x0, 0x400,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x30a, 0x30a, 0x0, 0x200, 0x200, 0x0,
- 0x0, 0x0, 0x0, 0x59000303, 0x59000303, 0x0, 0x0, 0x0, 0x303,
- 0x0, 0x102, 0x102, 0x102, 0x102, 0x102, 0x102, 0x102, 0x102,
- 0x102, 0x102, 0x303, 0x200, 0x200, 0x200, 0x200, 0x201, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x100, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x40000000, 0x19000303, 0x0, 0xfc, 0x0, 0x19000303, 0x0,
- 0x0, 0x0, 0xfc, 0x0, 0x0, 0x19000303, 0x0, 0xfc, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x19000303, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200,
- 0x0, 0x59000303, 0x59000303, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x100, 0x100, 0x102, 0x0, 0x100, 0x0, 0x0, 0x102, 0x0, 0x100,
- 0x0, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8,
- 0x0, 0x0, 0x0, 0x0, 0x18000000, 0x0, 0x0, 0x180000, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x200, 0x0, 0x0, 0x200, 0x0, 0x18000000,
- 0x303, 0x0, 0x0, 0x0, 0x200, 0x0, 0x0, 0x200, 0x0, 0x2, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2,
- 0x0, 0x0, 0x2, 0x2, 0x2, 0x0, 0x0, 0x2, 0x0, 0x18000303, 0x0,
- 0x0, 0x0, 0x200, 0x0, 0x0, 0x200, 0x0, };
- }
-
- private static void jj_la1_init_2() {
- jj_la1_2 = new int[] { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x201,
- 0x2000, 0x0, 0x0, 0x0, 0x0, 0x1100, 0x0, 0x200, 0x0, 0x0,
- 0x200, 0x200, 0x0, 0x0, 0x4000, 0x0, 0x4000, 0x0, 0x0, 0x2225,
- 0x2225, 0x0, 0x0, 0x0, 0x5700, 0x5700, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x200, 0x0, 0x0, 0x200, 0x0, 0x0, 0x200, 0x0, 0x0, 0x0,
- 0x0, 0x200, 0x0, 0x0, 0x200, 0x0, 0x5500, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x700, 0x700, 0x0, 0x200, 0x200, 0x0, 0x0, 0x0, 0x0,
- 0x2225, 0x2225, 0x0, 0x0, 0x0, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200, 0x200, 0x200, 0x200,
- 0x200, 0x200, 0x0, 0x0, 0x0, 0x0, 0x300, 0x0, 0x0, 0x0, 0x0,
- 0x200, 0x0, 0x80, 0x0, 0x0, 0x1, 0x204, 0x2000, 0x2600, 0x0,
- 0x2204, 0x0, 0x2, 0x0, 0x2600, 0x40, 0x0, 0x2204, 0x0, 0x2600,
- 0x0, 0x0, 0x0, 0x2200, 0x0, 0x2204, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x200, 0x0, 0x2205, 0x2205, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x2000, 0x2000, 0xfffff700, 0x0, 0x0, 0x0, 0x0,
- 0xfffff700, 0x0, 0x0, 0x0, 0x2200, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x2000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x200, 0x0, 0x0, 0x200, 0x0,
- 0x0, 0x200, 0x0, 0x0, 0x0, 0x200, 0x0, 0x0, 0x200, 0x0,
- 0xfffff700, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0xfffff700, 0x0, 0xffffc400, 0x0, 0x1300, 0xffffd700,
- 0x0, 0x0, 0xfffff700, 0x0, 0x200, 0x0, 0x0, 0x0, 0x200, 0x0,
- 0x0, 0x200, 0x0, };
- }
-
- private static void jj_la1_init_3() {
- jj_la1_3 = new int[] { 0x10, 0x100, 0x100, 0x4, 0x100, 0x0, 0x0, 0x0,
- 0xea, 0x0, 0x100, 0x0, 0x100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8a, 0x8a, 0x0,
- 0x0, 0x0, 0x188037e, 0x188037e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x188037c, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x800000, 0x800000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8a,
- 0x8a, 0x0, 0x0, 0x0, 0x2, 0x0, 0x2, 0x2, 0x0, 0x0, 0x2, 0x2,
- 0x2, 0x2, 0x2, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x800000, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x8a, 0x0, 0x400000, 0x0, 0x8a, 0x0, 0x0, 0x0,
- 0x400000, 0x0, 0x0, 0x8a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x8a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x800000, 0x0, 0xea,
- 0xea, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x880003, 0x0,
- 0x0, 0x0, 0x0, 0x880003, 0x0, 0x0, 0x0, 0x800000, 0x0, 0x0,
- 0x0, 0x0, 0x700000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x200, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x880003, 0x0, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x880003, 0x0, 0x800001, 0x0, 0x80002,
- 0x880003, 0x0, 0x0, 0x880003, 0x0, 0x6e, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, };
- }
-
- final private JJCalls[] jj_2_rtns = new JJCalls[9];
- private boolean jj_rescan = false;
- private int jj_gc = 0;
-
- /** Constructor with user supplied CharStream. */
- public Parser(CharStream stream) {
- token_source = new ParserTokenManager(stream);
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 254; i++) {
- jj_la1[i] = -1;
- }
- for (int i = 0; i < jj_2_rtns.length; i++) {
- jj_2_rtns[i] = new JJCalls();
- }
- }
-
- /** Reinitialise. */
- public void ReInit(CharStream stream) {
- token_source.ReInit(stream);
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 254; i++) {
- jj_la1[i] = -1;
- }
- for (int i = 0; i < jj_2_rtns.length; i++) {
- jj_2_rtns[i] = new JJCalls();
- }
- }
-
- /** Constructor with generated Token Manager. */
- public Parser(ParserTokenManager tm) {
- token_source = tm;
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 254; i++) {
- jj_la1[i] = -1;
- }
- for (int i = 0; i < jj_2_rtns.length; i++) {
- jj_2_rtns[i] = new JJCalls();
- }
- }
-
- /** Reinitialise. */
- public void ReInit(ParserTokenManager tm) {
- token_source = tm;
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 254; i++) {
- jj_la1[i] = -1;
- }
- for (int i = 0; i < jj_2_rtns.length; i++) {
- jj_2_rtns[i] = new JJCalls();
- }
- }
-
- private Token jj_consume_token(int kind) throws ParseException {
- Token oldToken;
- if ((oldToken = token).next != null) {
- token = token.next;
- } else {
- token = token.next = token_source.getNextToken();
- }
- jj_ntk = -1;
- if (token.kind == kind) {
- jj_gen++;
- if (++jj_gc > 100) {
- jj_gc = 0;
- for (int i = 0; i < jj_2_rtns.length; i++) {
- JJCalls c = jj_2_rtns[i];
- while (c != null) {
- if (c.gen < jj_gen) {
- c.first = null;
- }
- c = c.next;
- }
- }
- }
- return token;
- }
- token = oldToken;
- jj_kind = kind;
- throw generateParseException();
- }
-
- static private final class LookaheadSuccess extends java.lang.Error {
- }
-
- final private LookaheadSuccess jj_ls = new LookaheadSuccess();
-
- private boolean jj_scan_token(int kind) {
- if (jj_scanpos == jj_lastpos) {
- jj_la--;
- if (jj_scanpos.next == null) {
- jj_lastpos = jj_scanpos = jj_scanpos.next = token_source
- .getNextToken();
- } else {
- jj_lastpos = jj_scanpos = jj_scanpos.next;
- }
- } else {
- jj_scanpos = jj_scanpos.next;
- }
- if (jj_rescan) {
- int i = 0;
- Token tok = token;
- while (tok != null && tok != jj_scanpos) {
- i++;
- tok = tok.next;
- }
- if (tok != null) {
- jj_add_error_token(kind, i);
- }
- }
- if (jj_scanpos.kind != kind) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- throw jj_ls;
- }
- return false;
- }
-
- /** Get the next Token. */
- final public Token getNextToken() {
- if (token.next != null) {
- token = token.next;
- } else {
- token = token.next = token_source.getNextToken();
- }
- jj_ntk = -1;
- jj_gen++;
- return token;
- }
-
- /** Get the specific Token. */
- final public Token getToken(int index) {
- Token t = token;
- for (int i = 0; i < index; i++) {
- if (t.next != null) {
- t = t.next;
- } else {
- t = t.next = token_source.getNextToken();
- }
- }
- return t;
- }
-
- private int jj_ntk() {
- if ((jj_nt = token.next) == null) {
- return (jj_ntk = (token.next = token_source.getNextToken()).kind);
- } else {
- return (jj_ntk = jj_nt.kind);
- }
- }
-
- private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();
- private int[] jj_expentry;
- private int jj_kind = -1;
- private int[] jj_lasttokens = new int[100];
- private int jj_endpos;
-
- private void jj_add_error_token(int kind, int pos) {
- if (pos >= 100) {
- return;
- }
- if (pos == jj_endpos + 1) {
- jj_lasttokens[jj_endpos++] = kind;
- } else if (jj_endpos != 0) {
- jj_expentry = new int[jj_endpos];
- for (int i = 0; i < jj_endpos; i++) {
- jj_expentry[i] = jj_lasttokens[i];
- }
- jj_entries_loop: for (java.util.Iterator<?> it = jj_expentries
- .iterator(); it.hasNext();) {
- int[] oldentry = (int[]) (it.next());
- if (oldentry.length == jj_expentry.length) {
- for (int i = 0; i < jj_expentry.length; i++) {
- if (oldentry[i] != jj_expentry[i]) {
- continue jj_entries_loop;
- }
- }
- jj_expentries.add(jj_expentry);
- break jj_entries_loop;
- }
- }
- if (pos != 0) {
- jj_lasttokens[(jj_endpos = pos) - 1] = kind;
- }
- }
- }
-
- /** Generate ParseException. */
- public ParseException generateParseException() {
- jj_expentries.clear();
- boolean[] la1tokens = new boolean[121];
- if (jj_kind >= 0) {
- la1tokens[jj_kind] = true;
- jj_kind = -1;
- }
- for (int i = 0; i < 254; i++) {
- if (jj_la1[i] == jj_gen) {
- for (int j = 0; j < 32; j++) {
- if ((jj_la1_0[i] & (1 << j)) != 0) {
- la1tokens[j] = true;
- }
- if ((jj_la1_1[i] & (1 << j)) != 0) {
- la1tokens[32 + j] = true;
- }
- if ((jj_la1_2[i] & (1 << j)) != 0) {
- la1tokens[64 + j] = true;
- }
- if ((jj_la1_3[i] & (1 << j)) != 0) {
- la1tokens[96 + j] = true;
- }
- }
- }
- }
- for (int i = 0; i < 121; i++) {
- if (la1tokens[i]) {
- jj_expentry = new int[1];
- jj_expentry[0] = i;
- jj_expentries.add(jj_expentry);
- }
- }
- jj_endpos = 0;
- jj_rescan_token();
- jj_add_error_token(0, 0);
- int[][] exptokseq = new int[jj_expentries.size()][];
- for (int i = 0; i < jj_expentries.size(); i++) {
- exptokseq[i] = jj_expentries.get(i);
- }
- return new ParseException(token, exptokseq, tokenImage);
- }
-
- /** Enable tracing. */
- final public void enable_tracing() {
- }
-
- /** Disable tracing. */
- final public void disable_tracing() {
- }
-
- private void jj_rescan_token() {
- jj_rescan = true;
- for (int i = 0; i < 9; i++) {
- try {
- JJCalls p = jj_2_rtns[i];
- do {
- if (p.gen > jj_gen) {
- jj_la = p.arg;
- jj_lastpos = jj_scanpos = p.first;
- switch (i) {
- case 0:
- jj_3_1();
- break;
- case 1:
- jj_3_2();
- break;
- case 2:
- jj_3_3();
- break;
- case 3:
- jj_3_4();
- break;
- case 4:
- jj_3_5();
- break;
- case 5:
- jj_3_6();
- break;
- case 6:
- jj_3_7();
- break;
- case 7:
- jj_3_8();
- break;
- case 8:
- jj_3_9();
- break;
- }
- }
- p = p.next;
- } while (p != null);
- } catch (LookaheadSuccess ls) {
- }
- }
- jj_rescan = false;
- }
-
- private void jj_save(int index, int xla) {
- JJCalls p = jj_2_rtns[index];
- while (p.gen > jj_gen) {
- if (p.next == null) {
- p = p.next = new JJCalls();
- break;
- }
- p = p.next;
- }
- p.gen = jj_gen + xla - jj_la;
- p.first = token;
- p.arg = xla;
- }
-
- static final class JJCalls {
- int gen;
- Token first;
- int arg;
- JJCalls next;
- }
-
- }
|