1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674 |
- // Code generated from tools/goctl/api/parser/g4/ApiParser.g4 by ANTLR 4.9. DO NOT EDIT.
- package api // ApiParser
- import (
- "fmt"
- "reflect"
- "strconv"
- "github.com/zeromicro/antlr"
- )
- // Suppress unused import errors
- var (
- _ = fmt.Printf
- _ = reflect.Copy
- _ = strconv.Itoa
- )
- var parserATN = []uint16{
- 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 25, 348,
- 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7,
- 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13,
- 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9,
- 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23,
- 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4,
- 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34,
- 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 3, 2, 7,
- 2, 78, 10, 2, 12, 2, 14, 2, 81, 11, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5,
- 3, 88, 10, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 5, 5, 98,
- 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 6, 7, 108, 10, 7,
- 13, 7, 14, 7, 109, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 10, 3,
- 10, 3, 10, 3, 10, 6, 10, 123, 10, 10, 13, 10, 14, 10, 124, 3, 10, 3, 10,
- 3, 11, 3, 11, 5, 11, 131, 10, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3,
- 13, 3, 13, 3, 13, 7, 13, 141, 10, 13, 12, 13, 14, 13, 144, 11, 13, 3, 13,
- 3, 13, 3, 14, 3, 14, 5, 14, 150, 10, 14, 3, 15, 3, 15, 5, 15, 154, 10,
- 15, 3, 16, 3, 16, 3, 16, 5, 16, 159, 10, 16, 3, 16, 3, 16, 7, 16, 163,
- 10, 16, 12, 16, 14, 16, 166, 11, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17,
- 5, 17, 173, 10, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 5, 18, 180, 10,
- 18, 3, 18, 3, 18, 7, 18, 184, 10, 18, 12, 18, 14, 18, 187, 11, 18, 3, 18,
- 3, 18, 3, 19, 3, 19, 3, 19, 5, 19, 194, 10, 19, 3, 19, 3, 19, 3, 20, 3,
- 20, 3, 20, 5, 20, 201, 10, 20, 3, 21, 3, 21, 3, 21, 3, 21, 5, 21, 207,
- 10, 21, 3, 22, 5, 22, 210, 10, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3,
- 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 222, 10, 23, 3, 24, 3, 24, 3, 24,
- 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3,
- 26, 3, 26, 3, 26, 3, 27, 5, 27, 241, 10, 27, 3, 27, 3, 27, 3, 28, 3, 28,
- 3, 28, 6, 28, 248, 10, 28, 13, 28, 14, 28, 249, 3, 28, 3, 28, 3, 29, 3,
- 29, 3, 29, 3, 29, 3, 29, 7, 29, 259, 10, 29, 12, 29, 14, 29, 262, 11, 29,
- 3, 29, 3, 29, 3, 30, 5, 30, 267, 10, 30, 3, 30, 3, 30, 5, 30, 271, 10,
- 30, 3, 30, 3, 30, 3, 31, 3, 31, 5, 31, 277, 10, 31, 3, 31, 6, 31, 280,
- 10, 31, 13, 31, 14, 31, 281, 3, 31, 5, 31, 285, 10, 31, 3, 31, 5, 31, 288,
- 10, 31, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 5, 33, 297, 10,
- 33, 3, 33, 5, 33, 300, 10, 33, 3, 33, 5, 33, 303, 10, 33, 3, 34, 3, 34,
- 5, 34, 307, 10, 34, 3, 34, 3, 34, 3, 35, 3, 35, 5, 35, 313, 10, 35, 3,
- 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 5, 37, 323, 10, 37,
- 6, 37, 325, 10, 37, 13, 37, 14, 37, 326, 3, 38, 3, 38, 3, 38, 3, 38, 7,
- 38, 333, 10, 38, 12, 38, 14, 38, 336, 11, 38, 3, 38, 3, 38, 3, 38, 3, 38,
- 5, 38, 342, 10, 38, 6, 38, 344, 10, 38, 13, 38, 14, 38, 345, 3, 38, 2,
- 2, 39, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34,
- 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70,
- 72, 74, 2, 2, 2, 357, 2, 79, 3, 2, 2, 2, 4, 87, 3, 2, 2, 2, 6, 89, 3, 2,
- 2, 2, 8, 97, 3, 2, 2, 2, 10, 99, 3, 2, 2, 2, 12, 103, 3, 2, 2, 2, 14, 113,
- 3, 2, 2, 2, 16, 115, 3, 2, 2, 2, 18, 118, 3, 2, 2, 2, 20, 130, 3, 2, 2,
- 2, 22, 132, 3, 2, 2, 2, 24, 136, 3, 2, 2, 2, 26, 149, 3, 2, 2, 2, 28, 153,
- 3, 2, 2, 2, 30, 155, 3, 2, 2, 2, 32, 169, 3, 2, 2, 2, 34, 176, 3, 2, 2,
- 2, 36, 190, 3, 2, 2, 2, 38, 200, 3, 2, 2, 2, 40, 202, 3, 2, 2, 2, 42, 209,
- 3, 2, 2, 2, 44, 221, 3, 2, 2, 2, 46, 223, 3, 2, 2, 2, 48, 227, 3, 2, 2,
- 2, 50, 235, 3, 2, 2, 2, 52, 240, 3, 2, 2, 2, 54, 244, 3, 2, 2, 2, 56, 253,
- 3, 2, 2, 2, 58, 266, 3, 2, 2, 2, 60, 274, 3, 2, 2, 2, 62, 289, 3, 2, 2,
- 2, 64, 292, 3, 2, 2, 2, 66, 304, 3, 2, 2, 2, 68, 310, 3, 2, 2, 2, 70, 316,
- 3, 2, 2, 2, 72, 324, 3, 2, 2, 2, 74, 343, 3, 2, 2, 2, 76, 78, 5, 4, 3,
- 2, 77, 76, 3, 2, 2, 2, 78, 81, 3, 2, 2, 2, 79, 77, 3, 2, 2, 2, 79, 80,
- 3, 2, 2, 2, 80, 3, 3, 2, 2, 2, 81, 79, 3, 2, 2, 2, 82, 88, 5, 6, 4, 2,
- 83, 88, 5, 8, 5, 2, 84, 88, 5, 18, 10, 2, 85, 88, 5, 20, 11, 2, 86, 88,
- 5, 52, 27, 2, 87, 82, 3, 2, 2, 2, 87, 83, 3, 2, 2, 2, 87, 84, 3, 2, 2,
- 2, 87, 85, 3, 2, 2, 2, 87, 86, 3, 2, 2, 2, 88, 5, 3, 2, 2, 2, 89, 90, 8,
- 4, 1, 2, 90, 91, 7, 25, 2, 2, 91, 92, 7, 3, 2, 2, 92, 93, 8, 4, 1, 2, 93,
- 94, 7, 22, 2, 2, 94, 7, 3, 2, 2, 2, 95, 98, 5, 10, 6, 2, 96, 98, 5, 12,
- 7, 2, 97, 95, 3, 2, 2, 2, 97, 96, 3, 2, 2, 2, 98, 9, 3, 2, 2, 2, 99, 100,
- 8, 6, 1, 2, 100, 101, 7, 25, 2, 2, 101, 102, 5, 16, 9, 2, 102, 11, 3, 2,
- 2, 2, 103, 104, 8, 7, 1, 2, 104, 105, 7, 25, 2, 2, 105, 107, 7, 4, 2, 2,
- 106, 108, 5, 14, 8, 2, 107, 106, 3, 2, 2, 2, 108, 109, 3, 2, 2, 2, 109,
- 107, 3, 2, 2, 2, 109, 110, 3, 2, 2, 2, 110, 111, 3, 2, 2, 2, 111, 112,
- 7, 5, 2, 2, 112, 13, 3, 2, 2, 2, 113, 114, 5, 16, 9, 2, 114, 15, 3, 2,
- 2, 2, 115, 116, 8, 9, 1, 2, 116, 117, 7, 22, 2, 2, 117, 17, 3, 2, 2, 2,
- 118, 119, 8, 10, 1, 2, 119, 120, 7, 25, 2, 2, 120, 122, 7, 4, 2, 2, 121,
- 123, 5, 70, 36, 2, 122, 121, 3, 2, 2, 2, 123, 124, 3, 2, 2, 2, 124, 122,
- 3, 2, 2, 2, 124, 125, 3, 2, 2, 2, 125, 126, 3, 2, 2, 2, 126, 127, 7, 5,
- 2, 2, 127, 19, 3, 2, 2, 2, 128, 131, 5, 22, 12, 2, 129, 131, 5, 24, 13,
- 2, 130, 128, 3, 2, 2, 2, 130, 129, 3, 2, 2, 2, 131, 21, 3, 2, 2, 2, 132,
- 133, 8, 12, 1, 2, 133, 134, 7, 25, 2, 2, 134, 135, 5, 26, 14, 2, 135, 23,
- 3, 2, 2, 2, 136, 137, 8, 13, 1, 2, 137, 138, 7, 25, 2, 2, 138, 142, 7,
- 4, 2, 2, 139, 141, 5, 28, 15, 2, 140, 139, 3, 2, 2, 2, 141, 144, 3, 2,
- 2, 2, 142, 140, 3, 2, 2, 2, 142, 143, 3, 2, 2, 2, 143, 145, 3, 2, 2, 2,
- 144, 142, 3, 2, 2, 2, 145, 146, 7, 5, 2, 2, 146, 25, 3, 2, 2, 2, 147, 150,
- 5, 30, 16, 2, 148, 150, 5, 32, 17, 2, 149, 147, 3, 2, 2, 2, 149, 148, 3,
- 2, 2, 2, 150, 27, 3, 2, 2, 2, 151, 154, 5, 34, 18, 2, 152, 154, 5, 36,
- 19, 2, 153, 151, 3, 2, 2, 2, 153, 152, 3, 2, 2, 2, 154, 29, 3, 2, 2, 2,
- 155, 156, 8, 16, 1, 2, 156, 158, 7, 25, 2, 2, 157, 159, 7, 25, 2, 2, 158,
- 157, 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 160, 3, 2, 2, 2, 160, 164,
- 7, 6, 2, 2, 161, 163, 5, 38, 20, 2, 162, 161, 3, 2, 2, 2, 163, 166, 3,
- 2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 167, 3, 2, 2,
- 2, 166, 164, 3, 2, 2, 2, 167, 168, 7, 7, 2, 2, 168, 31, 3, 2, 2, 2, 169,
- 170, 8, 17, 1, 2, 170, 172, 7, 25, 2, 2, 171, 173, 7, 3, 2, 2, 172, 171,
- 3, 2, 2, 2, 172, 173, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174, 175, 5, 44,
- 23, 2, 175, 33, 3, 2, 2, 2, 176, 177, 8, 18, 1, 2, 177, 179, 7, 25, 2,
- 2, 178, 180, 7, 25, 2, 2, 179, 178, 3, 2, 2, 2, 179, 180, 3, 2, 2, 2, 180,
- 181, 3, 2, 2, 2, 181, 185, 7, 6, 2, 2, 182, 184, 5, 38, 20, 2, 183, 182,
- 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 185, 186, 3, 2,
- 2, 2, 186, 188, 3, 2, 2, 2, 187, 185, 3, 2, 2, 2, 188, 189, 7, 7, 2, 2,
- 189, 35, 3, 2, 2, 2, 190, 191, 8, 19, 1, 2, 191, 193, 7, 25, 2, 2, 192,
- 194, 7, 3, 2, 2, 193, 192, 3, 2, 2, 2, 193, 194, 3, 2, 2, 2, 194, 195,
- 3, 2, 2, 2, 195, 196, 5, 44, 23, 2, 196, 37, 3, 2, 2, 2, 197, 198, 6, 20,
- 2, 2, 198, 201, 5, 40, 21, 2, 199, 201, 5, 42, 22, 2, 200, 197, 3, 2, 2,
- 2, 200, 199, 3, 2, 2, 2, 201, 39, 3, 2, 2, 2, 202, 203, 8, 21, 1, 2, 203,
- 204, 7, 25, 2, 2, 204, 206, 5, 44, 23, 2, 205, 207, 7, 23, 2, 2, 206, 205,
- 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 41, 3, 2, 2, 2, 208, 210, 7, 8,
- 2, 2, 209, 208, 3, 2, 2, 2, 209, 210, 3, 2, 2, 2, 210, 211, 3, 2, 2, 2,
- 211, 212, 7, 25, 2, 2, 212, 43, 3, 2, 2, 2, 213, 214, 8, 23, 1, 2, 214,
- 222, 7, 25, 2, 2, 215, 222, 5, 48, 25, 2, 216, 222, 5, 50, 26, 2, 217,
- 222, 7, 17, 2, 2, 218, 222, 7, 9, 2, 2, 219, 222, 5, 46, 24, 2, 220, 222,
- 5, 30, 16, 2, 221, 213, 3, 2, 2, 2, 221, 215, 3, 2, 2, 2, 221, 216, 3,
- 2, 2, 2, 221, 217, 3, 2, 2, 2, 221, 218, 3, 2, 2, 2, 221, 219, 3, 2, 2,
- 2, 221, 220, 3, 2, 2, 2, 222, 45, 3, 2, 2, 2, 223, 224, 7, 8, 2, 2, 224,
- 225, 8, 24, 1, 2, 225, 226, 7, 25, 2, 2, 226, 47, 3, 2, 2, 2, 227, 228,
- 8, 25, 1, 2, 228, 229, 7, 25, 2, 2, 229, 230, 7, 10, 2, 2, 230, 231, 8,
- 25, 1, 2, 231, 232, 7, 25, 2, 2, 232, 233, 7, 11, 2, 2, 233, 234, 5, 44,
- 23, 2, 234, 49, 3, 2, 2, 2, 235, 236, 7, 10, 2, 2, 236, 237, 7, 11, 2,
- 2, 237, 238, 5, 44, 23, 2, 238, 51, 3, 2, 2, 2, 239, 241, 5, 54, 28, 2,
- 240, 239, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242,
- 243, 5, 56, 29, 2, 243, 53, 3, 2, 2, 2, 244, 245, 7, 18, 2, 2, 245, 247,
- 7, 4, 2, 2, 246, 248, 5, 70, 36, 2, 247, 246, 3, 2, 2, 2, 248, 249, 3,
- 2, 2, 2, 249, 247, 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 250, 251, 3, 2, 2,
- 2, 251, 252, 7, 5, 2, 2, 252, 55, 3, 2, 2, 2, 253, 254, 8, 29, 1, 2, 254,
- 255, 7, 25, 2, 2, 255, 256, 5, 72, 37, 2, 256, 260, 7, 6, 2, 2, 257, 259,
- 5, 58, 30, 2, 258, 257, 3, 2, 2, 2, 259, 262, 3, 2, 2, 2, 260, 258, 3,
- 2, 2, 2, 260, 261, 3, 2, 2, 2, 261, 263, 3, 2, 2, 2, 262, 260, 3, 2, 2,
- 2, 263, 264, 7, 7, 2, 2, 264, 57, 3, 2, 2, 2, 265, 267, 5, 60, 31, 2, 266,
- 265, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 270, 3, 2, 2, 2, 268, 271,
- 5, 54, 28, 2, 269, 271, 5, 62, 32, 2, 270, 268, 3, 2, 2, 2, 270, 269, 3,
- 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 273, 5, 64, 33, 2, 273, 59, 3, 2, 2,
- 2, 274, 276, 7, 15, 2, 2, 275, 277, 7, 4, 2, 2, 276, 275, 3, 2, 2, 2, 276,
- 277, 3, 2, 2, 2, 277, 284, 3, 2, 2, 2, 278, 280, 5, 70, 36, 2, 279, 278,
- 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2,
- 2, 2, 282, 285, 3, 2, 2, 2, 283, 285, 7, 22, 2, 2, 284, 279, 3, 2, 2, 2,
- 284, 283, 3, 2, 2, 2, 285, 287, 3, 2, 2, 2, 286, 288, 7, 5, 2, 2, 287,
- 286, 3, 2, 2, 2, 287, 288, 3, 2, 2, 2, 288, 61, 3, 2, 2, 2, 289, 290, 7,
- 16, 2, 2, 290, 291, 7, 25, 2, 2, 291, 63, 3, 2, 2, 2, 292, 293, 8, 33,
- 1, 2, 293, 294, 7, 25, 2, 2, 294, 296, 5, 74, 38, 2, 295, 297, 5, 66, 34,
- 2, 296, 295, 3, 2, 2, 2, 296, 297, 3, 2, 2, 2, 297, 299, 3, 2, 2, 2, 298,
- 300, 7, 25, 2, 2, 299, 298, 3, 2, 2, 2, 299, 300, 3, 2, 2, 2, 300, 302,
- 3, 2, 2, 2, 301, 303, 5, 68, 35, 2, 302, 301, 3, 2, 2, 2, 302, 303, 3,
- 2, 2, 2, 303, 65, 3, 2, 2, 2, 304, 306, 7, 4, 2, 2, 305, 307, 7, 25, 2,
- 2, 306, 305, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 308, 3, 2, 2, 2, 308,
- 309, 7, 5, 2, 2, 309, 67, 3, 2, 2, 2, 310, 312, 7, 4, 2, 2, 311, 313, 5,
- 44, 23, 2, 312, 311, 3, 2, 2, 2, 312, 313, 3, 2, 2, 2, 313, 314, 3, 2,
- 2, 2, 314, 315, 7, 5, 2, 2, 315, 69, 3, 2, 2, 2, 316, 317, 7, 25, 2, 2,
- 317, 318, 8, 36, 1, 2, 318, 319, 7, 24, 2, 2, 319, 71, 3, 2, 2, 2, 320,
- 322, 7, 25, 2, 2, 321, 323, 7, 12, 2, 2, 322, 321, 3, 2, 2, 2, 322, 323,
- 3, 2, 2, 2, 323, 325, 3, 2, 2, 2, 324, 320, 3, 2, 2, 2, 325, 326, 3, 2,
- 2, 2, 326, 324, 3, 2, 2, 2, 326, 327, 3, 2, 2, 2, 327, 73, 3, 2, 2, 2,
- 328, 329, 7, 13, 2, 2, 329, 334, 7, 25, 2, 2, 330, 331, 7, 12, 2, 2, 331,
- 333, 7, 25, 2, 2, 332, 330, 3, 2, 2, 2, 333, 336, 3, 2, 2, 2, 334, 332,
- 3, 2, 2, 2, 334, 335, 3, 2, 2, 2, 335, 344, 3, 2, 2, 2, 336, 334, 3, 2,
- 2, 2, 337, 338, 7, 14, 2, 2, 338, 341, 7, 25, 2, 2, 339, 340, 7, 12, 2,
- 2, 340, 342, 7, 25, 2, 2, 341, 339, 3, 2, 2, 2, 341, 342, 3, 2, 2, 2, 342,
- 344, 3, 2, 2, 2, 343, 328, 3, 2, 2, 2, 343, 337, 3, 2, 2, 2, 344, 345,
- 3, 2, 2, 2, 345, 343, 3, 2, 2, 2, 345, 346, 3, 2, 2, 2, 346, 75, 3, 2,
- 2, 2, 41, 79, 87, 97, 109, 124, 130, 142, 149, 153, 158, 164, 172, 179,
- 185, 193, 200, 206, 209, 221, 240, 249, 260, 266, 270, 276, 281, 284, 287,
- 296, 299, 302, 306, 312, 322, 326, 334, 341, 343, 345,
- }
- var literalNames = []string{
- "", "'='", "'('", "')'", "'{'", "'}'", "'*'", "'time.Time'", "'['", "']'",
- "'-'", "'/'", "'/:'", "'@doc'", "'@handler'", "'interface{}'", "'@server'",
- }
- var symbolicNames = []string{
- "", "", "", "", "", "", "", "", "", "", "", "", "", "ATDOC", "ATHANDLER",
- "INTERFACE", "ATSERVER", "WS", "COMMENT", "LINE_COMMENT", "STRING", "RAW_STRING",
- "LINE_VALUE", "ID",
- }
- var ruleNames = []string{
- "api", "spec", "syntaxLit", "importSpec", "importLit", "importBlock", "importBlockValue",
- "importValue", "infoSpec", "typeSpec", "typeLit", "typeBlock", "typeLitBody",
- "typeBlockBody", "typeStruct", "typeAlias", "typeBlockStruct", "typeBlockAlias",
- "field", "normalField", "anonymousFiled", "dataType", "pointerType", "mapType",
- "arrayType", "serviceSpec", "atServer", "serviceApi", "serviceRoute", "atDoc",
- "atHandler", "route", "body", "replybody", "kvLit", "serviceName", "path",
- }
- type ApiParserParser struct {
- *antlr.BaseParser
- }
- // NewApiParserParser produces a new parser instance for the optional input antlr.TokenStream.
- //
- // The *ApiParserParser instance produced may be reused by calling the SetInputStream method.
- // The initial parser configuration is expensive to construct, and the object is not thread-safe;
- // however, if used within a Golang sync.Pool, the construction cost amortizes well and the
- // objects can be used in a thread-safe manner.
- func NewApiParserParser(input antlr.TokenStream) *ApiParserParser {
- this := new(ApiParserParser)
- deserializer := antlr.NewATNDeserializer(nil)
- deserializedATN := deserializer.DeserializeFromUInt16(parserATN)
- decisionToDFA := make([]*antlr.DFA, len(deserializedATN.DecisionToState))
- for index, ds := range deserializedATN.DecisionToState {
- decisionToDFA[index] = antlr.NewDFA(ds, index)
- }
- this.BaseParser = antlr.NewBaseParser(input)
- this.Interpreter = antlr.NewParserATNSimulator(this, deserializedATN, decisionToDFA, antlr.NewPredictionContextCache())
- this.RuleNames = ruleNames
- this.LiteralNames = literalNames
- this.SymbolicNames = symbolicNames
- this.GrammarFileName = "ApiParser.g4"
- return this
- }
- // ApiParserParser tokens.
- const (
- ApiParserParserEOF = antlr.TokenEOF
- ApiParserParserT__0 = 1
- ApiParserParserT__1 = 2
- ApiParserParserT__2 = 3
- ApiParserParserT__3 = 4
- ApiParserParserT__4 = 5
- ApiParserParserT__5 = 6
- ApiParserParserT__6 = 7
- ApiParserParserT__7 = 8
- ApiParserParserT__8 = 9
- ApiParserParserT__9 = 10
- ApiParserParserT__10 = 11
- ApiParserParserT__11 = 12
- ApiParserParserATDOC = 13
- ApiParserParserATHANDLER = 14
- ApiParserParserINTERFACE = 15
- ApiParserParserATSERVER = 16
- ApiParserParserWS = 17
- ApiParserParserCOMMENT = 18
- ApiParserParserLINE_COMMENT = 19
- ApiParserParserSTRING = 20
- ApiParserParserRAW_STRING = 21
- ApiParserParserLINE_VALUE = 22
- ApiParserParserID = 23
- )
- // ApiParserParser rules.
- const (
- ApiParserParserRULE_api = 0
- ApiParserParserRULE_spec = 1
- ApiParserParserRULE_syntaxLit = 2
- ApiParserParserRULE_importSpec = 3
- ApiParserParserRULE_importLit = 4
- ApiParserParserRULE_importBlock = 5
- ApiParserParserRULE_importBlockValue = 6
- ApiParserParserRULE_importValue = 7
- ApiParserParserRULE_infoSpec = 8
- ApiParserParserRULE_typeSpec = 9
- ApiParserParserRULE_typeLit = 10
- ApiParserParserRULE_typeBlock = 11
- ApiParserParserRULE_typeLitBody = 12
- ApiParserParserRULE_typeBlockBody = 13
- ApiParserParserRULE_typeStruct = 14
- ApiParserParserRULE_typeAlias = 15
- ApiParserParserRULE_typeBlockStruct = 16
- ApiParserParserRULE_typeBlockAlias = 17
- ApiParserParserRULE_field = 18
- ApiParserParserRULE_normalField = 19
- ApiParserParserRULE_anonymousFiled = 20
- ApiParserParserRULE_dataType = 21
- ApiParserParserRULE_pointerType = 22
- ApiParserParserRULE_mapType = 23
- ApiParserParserRULE_arrayType = 24
- ApiParserParserRULE_serviceSpec = 25
- ApiParserParserRULE_atServer = 26
- ApiParserParserRULE_serviceApi = 27
- ApiParserParserRULE_serviceRoute = 28
- ApiParserParserRULE_atDoc = 29
- ApiParserParserRULE_atHandler = 30
- ApiParserParserRULE_route = 31
- ApiParserParserRULE_body = 32
- ApiParserParserRULE_replybody = 33
- ApiParserParserRULE_kvLit = 34
- ApiParserParserRULE_serviceName = 35
- ApiParserParserRULE_path = 36
- )
- // IApiContext is an interface to support dynamic dispatch.
- type IApiContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // IsApiContext differentiates from other interfaces.
- IsApiContext()
- }
- type ApiContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- }
- func NewEmptyApiContext() *ApiContext {
- p := new(ApiContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_api
- return p
- }
- func (*ApiContext) IsApiContext() {}
- func NewApiContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ApiContext {
- p := new(ApiContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_api
- return p
- }
- func (s *ApiContext) GetParser() antlr.Parser { return s.parser }
- func (s *ApiContext) AllSpec() []ISpecContext {
- ts := s.GetTypedRuleContexts(reflect.TypeOf((*ISpecContext)(nil)).Elem())
- tst := make([]ISpecContext, len(ts))
- for i, t := range ts {
- if t != nil {
- tst[i] = t.(ISpecContext)
- }
- }
- return tst
- }
- func (s *ApiContext) Spec(i int) ISpecContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*ISpecContext)(nil)).Elem(), i)
- if t == nil {
- return nil
- }
- return t.(ISpecContext)
- }
- func (s *ApiContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *ApiContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *ApiContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitApi(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) Api() (localctx IApiContext) {
- localctx = NewApiContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 0, ApiParserParserRULE_api)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- p.SetState(77)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- for _la == ApiParserParserATSERVER || _la == ApiParserParserID {
- {
- p.SetState(74)
- p.Spec()
- }
- p.SetState(79)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- }
- return localctx
- }
- // ISpecContext is an interface to support dynamic dispatch.
- type ISpecContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // IsSpecContext differentiates from other interfaces.
- IsSpecContext()
- }
- type SpecContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- }
- func NewEmptySpecContext() *SpecContext {
- p := new(SpecContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_spec
- return p
- }
- func (*SpecContext) IsSpecContext() {}
- func NewSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SpecContext {
- p := new(SpecContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_spec
- return p
- }
- func (s *SpecContext) GetParser() antlr.Parser { return s.parser }
- func (s *SpecContext) SyntaxLit() ISyntaxLitContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*ISyntaxLitContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(ISyntaxLitContext)
- }
- func (s *SpecContext) ImportSpec() IImportSpecContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IImportSpecContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IImportSpecContext)
- }
- func (s *SpecContext) InfoSpec() IInfoSpecContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IInfoSpecContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IInfoSpecContext)
- }
- func (s *SpecContext) TypeSpec() ITypeSpecContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeSpecContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(ITypeSpecContext)
- }
- func (s *SpecContext) ServiceSpec() IServiceSpecContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IServiceSpecContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IServiceSpecContext)
- }
- func (s *SpecContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *SpecContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *SpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitSpec(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) Spec() (localctx ISpecContext) {
- localctx = NewSpecContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 2, ApiParserParserRULE_spec)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.SetState(85)
- p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 1, p.GetParserRuleContext()) {
- case 1:
- p.EnterOuterAlt(localctx, 1)
- {
- p.SetState(80)
- p.SyntaxLit()
- }
- case 2:
- p.EnterOuterAlt(localctx, 2)
- {
- p.SetState(81)
- p.ImportSpec()
- }
- case 3:
- p.EnterOuterAlt(localctx, 3)
- {
- p.SetState(82)
- p.InfoSpec()
- }
- case 4:
- p.EnterOuterAlt(localctx, 4)
- {
- p.SetState(83)
- p.TypeSpec()
- }
- case 5:
- p.EnterOuterAlt(localctx, 5)
- {
- p.SetState(84)
- p.ServiceSpec()
- }
- }
- return localctx
- }
- // ISyntaxLitContext is an interface to support dynamic dispatch.
- type ISyntaxLitContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetSyntaxToken returns the syntaxToken token.
- GetSyntaxToken() antlr.Token
- // GetAssign returns the assign token.
- GetAssign() antlr.Token
- // GetVersion returns the version token.
- GetVersion() antlr.Token
- // SetSyntaxToken sets the syntaxToken token.
- SetSyntaxToken(antlr.Token)
- // SetAssign sets the assign token.
- SetAssign(antlr.Token)
- // SetVersion sets the version token.
- SetVersion(antlr.Token)
- // IsSyntaxLitContext differentiates from other interfaces.
- IsSyntaxLitContext()
- }
- type SyntaxLitContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- syntaxToken antlr.Token
- assign antlr.Token
- version antlr.Token
- }
- func NewEmptySyntaxLitContext() *SyntaxLitContext {
- p := new(SyntaxLitContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_syntaxLit
- return p
- }
- func (*SyntaxLitContext) IsSyntaxLitContext() {}
- func NewSyntaxLitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SyntaxLitContext {
- p := new(SyntaxLitContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_syntaxLit
- return p
- }
- func (s *SyntaxLitContext) GetParser() antlr.Parser { return s.parser }
- func (s *SyntaxLitContext) GetSyntaxToken() antlr.Token { return s.syntaxToken }
- func (s *SyntaxLitContext) GetAssign() antlr.Token { return s.assign }
- func (s *SyntaxLitContext) GetVersion() antlr.Token { return s.version }
- func (s *SyntaxLitContext) SetSyntaxToken(v antlr.Token) { s.syntaxToken = v }
- func (s *SyntaxLitContext) SetAssign(v antlr.Token) { s.assign = v }
- func (s *SyntaxLitContext) SetVersion(v antlr.Token) { s.version = v }
- func (s *SyntaxLitContext) ID() antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, 0)
- }
- func (s *SyntaxLitContext) STRING() antlr.TerminalNode {
- return s.GetToken(ApiParserParserSTRING, 0)
- }
- func (s *SyntaxLitContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *SyntaxLitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *SyntaxLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitSyntaxLit(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) SyntaxLit() (localctx ISyntaxLitContext) {
- localctx = NewSyntaxLitContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 4, ApiParserParserRULE_syntaxLit)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- match(p, "syntax")
- {
- p.SetState(88)
- _m := p.Match(ApiParserParserID)
- localctx.(*SyntaxLitContext).syntaxToken = _m
- }
- {
- p.SetState(89)
- _m := p.Match(ApiParserParserT__0)
- localctx.(*SyntaxLitContext).assign = _m
- }
- checkVersion(p)
- {
- p.SetState(91)
- _m := p.Match(ApiParserParserSTRING)
- localctx.(*SyntaxLitContext).version = _m
- }
- return localctx
- }
- // IImportSpecContext is an interface to support dynamic dispatch.
- type IImportSpecContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // IsImportSpecContext differentiates from other interfaces.
- IsImportSpecContext()
- }
- type ImportSpecContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- }
- func NewEmptyImportSpecContext() *ImportSpecContext {
- p := new(ImportSpecContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_importSpec
- return p
- }
- func (*ImportSpecContext) IsImportSpecContext() {}
- func NewImportSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ImportSpecContext {
- p := new(ImportSpecContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_importSpec
- return p
- }
- func (s *ImportSpecContext) GetParser() antlr.Parser { return s.parser }
- func (s *ImportSpecContext) ImportLit() IImportLitContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IImportLitContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IImportLitContext)
- }
- func (s *ImportSpecContext) ImportBlock() IImportBlockContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IImportBlockContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IImportBlockContext)
- }
- func (s *ImportSpecContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *ImportSpecContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *ImportSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitImportSpec(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) ImportSpec() (localctx IImportSpecContext) {
- localctx = NewImportSpecContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 6, ApiParserParserRULE_importSpec)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.SetState(95)
- p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 2, p.GetParserRuleContext()) {
- case 1:
- p.EnterOuterAlt(localctx, 1)
- {
- p.SetState(93)
- p.ImportLit()
- }
- case 2:
- p.EnterOuterAlt(localctx, 2)
- {
- p.SetState(94)
- p.ImportBlock()
- }
- }
- return localctx
- }
- // IImportLitContext is an interface to support dynamic dispatch.
- type IImportLitContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetImportToken returns the importToken token.
- GetImportToken() antlr.Token
- // SetImportToken sets the importToken token.
- SetImportToken(antlr.Token)
- // IsImportLitContext differentiates from other interfaces.
- IsImportLitContext()
- }
- type ImportLitContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- importToken antlr.Token
- }
- func NewEmptyImportLitContext() *ImportLitContext {
- p := new(ImportLitContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_importLit
- return p
- }
- func (*ImportLitContext) IsImportLitContext() {}
- func NewImportLitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ImportLitContext {
- p := new(ImportLitContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_importLit
- return p
- }
- func (s *ImportLitContext) GetParser() antlr.Parser { return s.parser }
- func (s *ImportLitContext) GetImportToken() antlr.Token { return s.importToken }
- func (s *ImportLitContext) SetImportToken(v antlr.Token) { s.importToken = v }
- func (s *ImportLitContext) ImportValue() IImportValueContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IImportValueContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IImportValueContext)
- }
- func (s *ImportLitContext) ID() antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, 0)
- }
- func (s *ImportLitContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *ImportLitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *ImportLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitImportLit(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) ImportLit() (localctx IImportLitContext) {
- localctx = NewImportLitContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 8, ApiParserParserRULE_importLit)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- match(p, "import")
- {
- p.SetState(98)
- _m := p.Match(ApiParserParserID)
- localctx.(*ImportLitContext).importToken = _m
- }
- {
- p.SetState(99)
- p.ImportValue()
- }
- return localctx
- }
- // IImportBlockContext is an interface to support dynamic dispatch.
- type IImportBlockContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetImportToken returns the importToken token.
- GetImportToken() antlr.Token
- // SetImportToken sets the importToken token.
- SetImportToken(antlr.Token)
- // IsImportBlockContext differentiates from other interfaces.
- IsImportBlockContext()
- }
- type ImportBlockContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- importToken antlr.Token
- }
- func NewEmptyImportBlockContext() *ImportBlockContext {
- p := new(ImportBlockContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_importBlock
- return p
- }
- func (*ImportBlockContext) IsImportBlockContext() {}
- func NewImportBlockContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ImportBlockContext {
- p := new(ImportBlockContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_importBlock
- return p
- }
- func (s *ImportBlockContext) GetParser() antlr.Parser { return s.parser }
- func (s *ImportBlockContext) GetImportToken() antlr.Token { return s.importToken }
- func (s *ImportBlockContext) SetImportToken(v antlr.Token) { s.importToken = v }
- func (s *ImportBlockContext) ID() antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, 0)
- }
- func (s *ImportBlockContext) AllImportBlockValue() []IImportBlockValueContext {
- ts := s.GetTypedRuleContexts(reflect.TypeOf((*IImportBlockValueContext)(nil)).Elem())
- tst := make([]IImportBlockValueContext, len(ts))
- for i, t := range ts {
- if t != nil {
- tst[i] = t.(IImportBlockValueContext)
- }
- }
- return tst
- }
- func (s *ImportBlockContext) ImportBlockValue(i int) IImportBlockValueContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IImportBlockValueContext)(nil)).Elem(), i)
- if t == nil {
- return nil
- }
- return t.(IImportBlockValueContext)
- }
- func (s *ImportBlockContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *ImportBlockContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *ImportBlockContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitImportBlock(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) ImportBlock() (localctx IImportBlockContext) {
- localctx = NewImportBlockContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 10, ApiParserParserRULE_importBlock)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- match(p, "import")
- {
- p.SetState(102)
- _m := p.Match(ApiParserParserID)
- localctx.(*ImportBlockContext).importToken = _m
- }
- {
- p.SetState(103)
- p.Match(ApiParserParserT__1)
- }
- p.SetState(105)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- for ok := true; ok; ok = _la == ApiParserParserSTRING {
- {
- p.SetState(104)
- p.ImportBlockValue()
- }
- p.SetState(107)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- }
- {
- p.SetState(109)
- p.Match(ApiParserParserT__2)
- }
- return localctx
- }
- // IImportBlockValueContext is an interface to support dynamic dispatch.
- type IImportBlockValueContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // IsImportBlockValueContext differentiates from other interfaces.
- IsImportBlockValueContext()
- }
- type ImportBlockValueContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- }
- func NewEmptyImportBlockValueContext() *ImportBlockValueContext {
- p := new(ImportBlockValueContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_importBlockValue
- return p
- }
- func (*ImportBlockValueContext) IsImportBlockValueContext() {}
- func NewImportBlockValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ImportBlockValueContext {
- p := new(ImportBlockValueContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_importBlockValue
- return p
- }
- func (s *ImportBlockValueContext) GetParser() antlr.Parser { return s.parser }
- func (s *ImportBlockValueContext) ImportValue() IImportValueContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IImportValueContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IImportValueContext)
- }
- func (s *ImportBlockValueContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *ImportBlockValueContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *ImportBlockValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitImportBlockValue(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) ImportBlockValue() (localctx IImportBlockValueContext) {
- localctx = NewImportBlockValueContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 12, ApiParserParserRULE_importBlockValue)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- {
- p.SetState(111)
- p.ImportValue()
- }
- return localctx
- }
- // IImportValueContext is an interface to support dynamic dispatch.
- type IImportValueContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // IsImportValueContext differentiates from other interfaces.
- IsImportValueContext()
- }
- type ImportValueContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- }
- func NewEmptyImportValueContext() *ImportValueContext {
- p := new(ImportValueContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_importValue
- return p
- }
- func (*ImportValueContext) IsImportValueContext() {}
- func NewImportValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ImportValueContext {
- p := new(ImportValueContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_importValue
- return p
- }
- func (s *ImportValueContext) GetParser() antlr.Parser { return s.parser }
- func (s *ImportValueContext) STRING() antlr.TerminalNode {
- return s.GetToken(ApiParserParserSTRING, 0)
- }
- func (s *ImportValueContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *ImportValueContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *ImportValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitImportValue(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) ImportValue() (localctx IImportValueContext) {
- localctx = NewImportValueContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 14, ApiParserParserRULE_importValue)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- checkImportValue(p)
- {
- p.SetState(114)
- p.Match(ApiParserParserSTRING)
- }
- return localctx
- }
- // IInfoSpecContext is an interface to support dynamic dispatch.
- type IInfoSpecContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetInfoToken returns the infoToken token.
- GetInfoToken() antlr.Token
- // GetLp returns the lp token.
- GetLp() antlr.Token
- // GetRp returns the rp token.
- GetRp() antlr.Token
- // SetInfoToken sets the infoToken token.
- SetInfoToken(antlr.Token)
- // SetLp sets the lp token.
- SetLp(antlr.Token)
- // SetRp sets the rp token.
- SetRp(antlr.Token)
- // IsInfoSpecContext differentiates from other interfaces.
- IsInfoSpecContext()
- }
- type InfoSpecContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- infoToken antlr.Token
- lp antlr.Token
- rp antlr.Token
- }
- func NewEmptyInfoSpecContext() *InfoSpecContext {
- p := new(InfoSpecContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_infoSpec
- return p
- }
- func (*InfoSpecContext) IsInfoSpecContext() {}
- func NewInfoSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *InfoSpecContext {
- p := new(InfoSpecContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_infoSpec
- return p
- }
- func (s *InfoSpecContext) GetParser() antlr.Parser { return s.parser }
- func (s *InfoSpecContext) GetInfoToken() antlr.Token { return s.infoToken }
- func (s *InfoSpecContext) GetLp() antlr.Token { return s.lp }
- func (s *InfoSpecContext) GetRp() antlr.Token { return s.rp }
- func (s *InfoSpecContext) SetInfoToken(v antlr.Token) { s.infoToken = v }
- func (s *InfoSpecContext) SetLp(v antlr.Token) { s.lp = v }
- func (s *InfoSpecContext) SetRp(v antlr.Token) { s.rp = v }
- func (s *InfoSpecContext) ID() antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, 0)
- }
- func (s *InfoSpecContext) AllKvLit() []IKvLitContext {
- ts := s.GetTypedRuleContexts(reflect.TypeOf((*IKvLitContext)(nil)).Elem())
- tst := make([]IKvLitContext, len(ts))
- for i, t := range ts {
- if t != nil {
- tst[i] = t.(IKvLitContext)
- }
- }
- return tst
- }
- func (s *InfoSpecContext) KvLit(i int) IKvLitContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IKvLitContext)(nil)).Elem(), i)
- if t == nil {
- return nil
- }
- return t.(IKvLitContext)
- }
- func (s *InfoSpecContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *InfoSpecContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *InfoSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitInfoSpec(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) InfoSpec() (localctx IInfoSpecContext) {
- localctx = NewInfoSpecContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 16, ApiParserParserRULE_infoSpec)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- match(p, "info")
- {
- p.SetState(117)
- _m := p.Match(ApiParserParserID)
- localctx.(*InfoSpecContext).infoToken = _m
- }
- {
- p.SetState(118)
- _m := p.Match(ApiParserParserT__1)
- localctx.(*InfoSpecContext).lp = _m
- }
- p.SetState(120)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- for ok := true; ok; ok = _la == ApiParserParserID {
- {
- p.SetState(119)
- p.KvLit()
- }
- p.SetState(122)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- }
- {
- p.SetState(124)
- _m := p.Match(ApiParserParserT__2)
- localctx.(*InfoSpecContext).rp = _m
- }
- return localctx
- }
- // ITypeSpecContext is an interface to support dynamic dispatch.
- type ITypeSpecContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // IsTypeSpecContext differentiates from other interfaces.
- IsTypeSpecContext()
- }
- type TypeSpecContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- }
- func NewEmptyTypeSpecContext() *TypeSpecContext {
- p := new(TypeSpecContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_typeSpec
- return p
- }
- func (*TypeSpecContext) IsTypeSpecContext() {}
- func NewTypeSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeSpecContext {
- p := new(TypeSpecContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_typeSpec
- return p
- }
- func (s *TypeSpecContext) GetParser() antlr.Parser { return s.parser }
- func (s *TypeSpecContext) TypeLit() ITypeLitContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeLitContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(ITypeLitContext)
- }
- func (s *TypeSpecContext) TypeBlock() ITypeBlockContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeBlockContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(ITypeBlockContext)
- }
- func (s *TypeSpecContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *TypeSpecContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *TypeSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitTypeSpec(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) TypeSpec() (localctx ITypeSpecContext) {
- localctx = NewTypeSpecContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 18, ApiParserParserRULE_typeSpec)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.SetState(128)
- p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 5, p.GetParserRuleContext()) {
- case 1:
- p.EnterOuterAlt(localctx, 1)
- {
- p.SetState(126)
- p.TypeLit()
- }
- case 2:
- p.EnterOuterAlt(localctx, 2)
- {
- p.SetState(127)
- p.TypeBlock()
- }
- }
- return localctx
- }
- // ITypeLitContext is an interface to support dynamic dispatch.
- type ITypeLitContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetTypeToken returns the typeToken token.
- GetTypeToken() antlr.Token
- // SetTypeToken sets the typeToken token.
- SetTypeToken(antlr.Token)
- // IsTypeLitContext differentiates from other interfaces.
- IsTypeLitContext()
- }
- type TypeLitContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- typeToken antlr.Token
- }
- func NewEmptyTypeLitContext() *TypeLitContext {
- p := new(TypeLitContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_typeLit
- return p
- }
- func (*TypeLitContext) IsTypeLitContext() {}
- func NewTypeLitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeLitContext {
- p := new(TypeLitContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_typeLit
- return p
- }
- func (s *TypeLitContext) GetParser() antlr.Parser { return s.parser }
- func (s *TypeLitContext) GetTypeToken() antlr.Token { return s.typeToken }
- func (s *TypeLitContext) SetTypeToken(v antlr.Token) { s.typeToken = v }
- func (s *TypeLitContext) TypeLitBody() ITypeLitBodyContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeLitBodyContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(ITypeLitBodyContext)
- }
- func (s *TypeLitContext) ID() antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, 0)
- }
- func (s *TypeLitContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *TypeLitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *TypeLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitTypeLit(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) TypeLit() (localctx ITypeLitContext) {
- localctx = NewTypeLitContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 20, ApiParserParserRULE_typeLit)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- match(p, "type")
- {
- p.SetState(131)
- _m := p.Match(ApiParserParserID)
- localctx.(*TypeLitContext).typeToken = _m
- }
- {
- p.SetState(132)
- p.TypeLitBody()
- }
- return localctx
- }
- // ITypeBlockContext is an interface to support dynamic dispatch.
- type ITypeBlockContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetTypeToken returns the typeToken token.
- GetTypeToken() antlr.Token
- // GetLp returns the lp token.
- GetLp() antlr.Token
- // GetRp returns the rp token.
- GetRp() antlr.Token
- // SetTypeToken sets the typeToken token.
- SetTypeToken(antlr.Token)
- // SetLp sets the lp token.
- SetLp(antlr.Token)
- // SetRp sets the rp token.
- SetRp(antlr.Token)
- // IsTypeBlockContext differentiates from other interfaces.
- IsTypeBlockContext()
- }
- type TypeBlockContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- typeToken antlr.Token
- lp antlr.Token
- rp antlr.Token
- }
- func NewEmptyTypeBlockContext() *TypeBlockContext {
- p := new(TypeBlockContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_typeBlock
- return p
- }
- func (*TypeBlockContext) IsTypeBlockContext() {}
- func NewTypeBlockContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeBlockContext {
- p := new(TypeBlockContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_typeBlock
- return p
- }
- func (s *TypeBlockContext) GetParser() antlr.Parser { return s.parser }
- func (s *TypeBlockContext) GetTypeToken() antlr.Token { return s.typeToken }
- func (s *TypeBlockContext) GetLp() antlr.Token { return s.lp }
- func (s *TypeBlockContext) GetRp() antlr.Token { return s.rp }
- func (s *TypeBlockContext) SetTypeToken(v antlr.Token) { s.typeToken = v }
- func (s *TypeBlockContext) SetLp(v antlr.Token) { s.lp = v }
- func (s *TypeBlockContext) SetRp(v antlr.Token) { s.rp = v }
- func (s *TypeBlockContext) ID() antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, 0)
- }
- func (s *TypeBlockContext) AllTypeBlockBody() []ITypeBlockBodyContext {
- ts := s.GetTypedRuleContexts(reflect.TypeOf((*ITypeBlockBodyContext)(nil)).Elem())
- tst := make([]ITypeBlockBodyContext, len(ts))
- for i, t := range ts {
- if t != nil {
- tst[i] = t.(ITypeBlockBodyContext)
- }
- }
- return tst
- }
- func (s *TypeBlockContext) TypeBlockBody(i int) ITypeBlockBodyContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeBlockBodyContext)(nil)).Elem(), i)
- if t == nil {
- return nil
- }
- return t.(ITypeBlockBodyContext)
- }
- func (s *TypeBlockContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *TypeBlockContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *TypeBlockContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitTypeBlock(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) TypeBlock() (localctx ITypeBlockContext) {
- localctx = NewTypeBlockContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 22, ApiParserParserRULE_typeBlock)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- match(p, "type")
- {
- p.SetState(135)
- _m := p.Match(ApiParserParserID)
- localctx.(*TypeBlockContext).typeToken = _m
- }
- {
- p.SetState(136)
- _m := p.Match(ApiParserParserT__1)
- localctx.(*TypeBlockContext).lp = _m
- }
- p.SetState(140)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- for _la == ApiParserParserID {
- {
- p.SetState(137)
- p.TypeBlockBody()
- }
- p.SetState(142)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- }
- {
- p.SetState(143)
- _m := p.Match(ApiParserParserT__2)
- localctx.(*TypeBlockContext).rp = _m
- }
- return localctx
- }
- // ITypeLitBodyContext is an interface to support dynamic dispatch.
- type ITypeLitBodyContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // IsTypeLitBodyContext differentiates from other interfaces.
- IsTypeLitBodyContext()
- }
- type TypeLitBodyContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- }
- func NewEmptyTypeLitBodyContext() *TypeLitBodyContext {
- p := new(TypeLitBodyContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_typeLitBody
- return p
- }
- func (*TypeLitBodyContext) IsTypeLitBodyContext() {}
- func NewTypeLitBodyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeLitBodyContext {
- p := new(TypeLitBodyContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_typeLitBody
- return p
- }
- func (s *TypeLitBodyContext) GetParser() antlr.Parser { return s.parser }
- func (s *TypeLitBodyContext) TypeStruct() ITypeStructContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeStructContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(ITypeStructContext)
- }
- func (s *TypeLitBodyContext) TypeAlias() ITypeAliasContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeAliasContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(ITypeAliasContext)
- }
- func (s *TypeLitBodyContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *TypeLitBodyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *TypeLitBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitTypeLitBody(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) TypeLitBody() (localctx ITypeLitBodyContext) {
- localctx = NewTypeLitBodyContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 24, ApiParserParserRULE_typeLitBody)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.SetState(147)
- p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 7, p.GetParserRuleContext()) {
- case 1:
- p.EnterOuterAlt(localctx, 1)
- {
- p.SetState(145)
- p.TypeStruct()
- }
- case 2:
- p.EnterOuterAlt(localctx, 2)
- {
- p.SetState(146)
- p.TypeAlias()
- }
- }
- return localctx
- }
- // ITypeBlockBodyContext is an interface to support dynamic dispatch.
- type ITypeBlockBodyContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // IsTypeBlockBodyContext differentiates from other interfaces.
- IsTypeBlockBodyContext()
- }
- type TypeBlockBodyContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- }
- func NewEmptyTypeBlockBodyContext() *TypeBlockBodyContext {
- p := new(TypeBlockBodyContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_typeBlockBody
- return p
- }
- func (*TypeBlockBodyContext) IsTypeBlockBodyContext() {}
- func NewTypeBlockBodyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeBlockBodyContext {
- p := new(TypeBlockBodyContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_typeBlockBody
- return p
- }
- func (s *TypeBlockBodyContext) GetParser() antlr.Parser { return s.parser }
- func (s *TypeBlockBodyContext) TypeBlockStruct() ITypeBlockStructContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeBlockStructContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(ITypeBlockStructContext)
- }
- func (s *TypeBlockBodyContext) TypeBlockAlias() ITypeBlockAliasContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeBlockAliasContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(ITypeBlockAliasContext)
- }
- func (s *TypeBlockBodyContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *TypeBlockBodyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *TypeBlockBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitTypeBlockBody(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) TypeBlockBody() (localctx ITypeBlockBodyContext) {
- localctx = NewTypeBlockBodyContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 26, ApiParserParserRULE_typeBlockBody)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.SetState(151)
- p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 8, p.GetParserRuleContext()) {
- case 1:
- p.EnterOuterAlt(localctx, 1)
- {
- p.SetState(149)
- p.TypeBlockStruct()
- }
- case 2:
- p.EnterOuterAlt(localctx, 2)
- {
- p.SetState(150)
- p.TypeBlockAlias()
- }
- }
- return localctx
- }
- // ITypeStructContext is an interface to support dynamic dispatch.
- type ITypeStructContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetStructName returns the structName token.
- GetStructName() antlr.Token
- // GetStructToken returns the structToken token.
- GetStructToken() antlr.Token
- // GetLbrace returns the lbrace token.
- GetLbrace() antlr.Token
- // GetRbrace returns the rbrace token.
- GetRbrace() antlr.Token
- // SetStructName sets the structName token.
- SetStructName(antlr.Token)
- // SetStructToken sets the structToken token.
- SetStructToken(antlr.Token)
- // SetLbrace sets the lbrace token.
- SetLbrace(antlr.Token)
- // SetRbrace sets the rbrace token.
- SetRbrace(antlr.Token)
- // IsTypeStructContext differentiates from other interfaces.
- IsTypeStructContext()
- }
- type TypeStructContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- structName antlr.Token
- structToken antlr.Token
- lbrace antlr.Token
- rbrace antlr.Token
- }
- func NewEmptyTypeStructContext() *TypeStructContext {
- p := new(TypeStructContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_typeStruct
- return p
- }
- func (*TypeStructContext) IsTypeStructContext() {}
- func NewTypeStructContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeStructContext {
- p := new(TypeStructContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_typeStruct
- return p
- }
- func (s *TypeStructContext) GetParser() antlr.Parser { return s.parser }
- func (s *TypeStructContext) GetStructName() antlr.Token { return s.structName }
- func (s *TypeStructContext) GetStructToken() antlr.Token { return s.structToken }
- func (s *TypeStructContext) GetLbrace() antlr.Token { return s.lbrace }
- func (s *TypeStructContext) GetRbrace() antlr.Token { return s.rbrace }
- func (s *TypeStructContext) SetStructName(v antlr.Token) { s.structName = v }
- func (s *TypeStructContext) SetStructToken(v antlr.Token) { s.structToken = v }
- func (s *TypeStructContext) SetLbrace(v antlr.Token) { s.lbrace = v }
- func (s *TypeStructContext) SetRbrace(v antlr.Token) { s.rbrace = v }
- func (s *TypeStructContext) AllID() []antlr.TerminalNode {
- return s.GetTokens(ApiParserParserID)
- }
- func (s *TypeStructContext) ID(i int) antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, i)
- }
- func (s *TypeStructContext) AllField() []IFieldContext {
- ts := s.GetTypedRuleContexts(reflect.TypeOf((*IFieldContext)(nil)).Elem())
- tst := make([]IFieldContext, len(ts))
- for i, t := range ts {
- if t != nil {
- tst[i] = t.(IFieldContext)
- }
- }
- return tst
- }
- func (s *TypeStructContext) Field(i int) IFieldContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IFieldContext)(nil)).Elem(), i)
- if t == nil {
- return nil
- }
- return t.(IFieldContext)
- }
- func (s *TypeStructContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *TypeStructContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *TypeStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitTypeStruct(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) TypeStruct() (localctx ITypeStructContext) {
- localctx = NewTypeStructContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 28, ApiParserParserRULE_typeStruct)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- var _alt int
- p.EnterOuterAlt(localctx, 1)
- checkKeyword(p)
- {
- p.SetState(154)
- _m := p.Match(ApiParserParserID)
- localctx.(*TypeStructContext).structName = _m
- }
- p.SetState(156)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- if _la == ApiParserParserID {
- {
- p.SetState(155)
- _m := p.Match(ApiParserParserID)
- localctx.(*TypeStructContext).structToken = _m
- }
- }
- {
- p.SetState(158)
- _m := p.Match(ApiParserParserT__3)
- localctx.(*TypeStructContext).lbrace = _m
- }
- p.SetState(162)
- p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 10, p.GetParserRuleContext())
- for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
- if _alt == 1 {
- {
- p.SetState(159)
- p.Field()
- }
- }
- p.SetState(164)
- p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 10, p.GetParserRuleContext())
- }
- {
- p.SetState(165)
- _m := p.Match(ApiParserParserT__4)
- localctx.(*TypeStructContext).rbrace = _m
- }
- return localctx
- }
- // ITypeAliasContext is an interface to support dynamic dispatch.
- type ITypeAliasContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetAlias returns the alias token.
- GetAlias() antlr.Token
- // GetAssign returns the assign token.
- GetAssign() antlr.Token
- // SetAlias sets the alias token.
- SetAlias(antlr.Token)
- // SetAssign sets the assign token.
- SetAssign(antlr.Token)
- // IsTypeAliasContext differentiates from other interfaces.
- IsTypeAliasContext()
- }
- type TypeAliasContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- alias antlr.Token
- assign antlr.Token
- }
- func NewEmptyTypeAliasContext() *TypeAliasContext {
- p := new(TypeAliasContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_typeAlias
- return p
- }
- func (*TypeAliasContext) IsTypeAliasContext() {}
- func NewTypeAliasContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeAliasContext {
- p := new(TypeAliasContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_typeAlias
- return p
- }
- func (s *TypeAliasContext) GetParser() antlr.Parser { return s.parser }
- func (s *TypeAliasContext) GetAlias() antlr.Token { return s.alias }
- func (s *TypeAliasContext) GetAssign() antlr.Token { return s.assign }
- func (s *TypeAliasContext) SetAlias(v antlr.Token) { s.alias = v }
- func (s *TypeAliasContext) SetAssign(v antlr.Token) { s.assign = v }
- func (s *TypeAliasContext) DataType() IDataTypeContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IDataTypeContext)
- }
- func (s *TypeAliasContext) ID() antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, 0)
- }
- func (s *TypeAliasContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *TypeAliasContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *TypeAliasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitTypeAlias(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) TypeAlias() (localctx ITypeAliasContext) {
- localctx = NewTypeAliasContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 30, ApiParserParserRULE_typeAlias)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- checkKeyword(p)
- {
- p.SetState(168)
- _m := p.Match(ApiParserParserID)
- localctx.(*TypeAliasContext).alias = _m
- }
- p.SetState(170)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- if _la == ApiParserParserT__0 {
- {
- p.SetState(169)
- _m := p.Match(ApiParserParserT__0)
- localctx.(*TypeAliasContext).assign = _m
- }
- }
- {
- p.SetState(172)
- p.DataType()
- }
- return localctx
- }
- // ITypeBlockStructContext is an interface to support dynamic dispatch.
- type ITypeBlockStructContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetStructName returns the structName token.
- GetStructName() antlr.Token
- // GetStructToken returns the structToken token.
- GetStructToken() antlr.Token
- // GetLbrace returns the lbrace token.
- GetLbrace() antlr.Token
- // GetRbrace returns the rbrace token.
- GetRbrace() antlr.Token
- // SetStructName sets the structName token.
- SetStructName(antlr.Token)
- // SetStructToken sets the structToken token.
- SetStructToken(antlr.Token)
- // SetLbrace sets the lbrace token.
- SetLbrace(antlr.Token)
- // SetRbrace sets the rbrace token.
- SetRbrace(antlr.Token)
- // IsTypeBlockStructContext differentiates from other interfaces.
- IsTypeBlockStructContext()
- }
- type TypeBlockStructContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- structName antlr.Token
- structToken antlr.Token
- lbrace antlr.Token
- rbrace antlr.Token
- }
- func NewEmptyTypeBlockStructContext() *TypeBlockStructContext {
- p := new(TypeBlockStructContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_typeBlockStruct
- return p
- }
- func (*TypeBlockStructContext) IsTypeBlockStructContext() {}
- func NewTypeBlockStructContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeBlockStructContext {
- p := new(TypeBlockStructContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_typeBlockStruct
- return p
- }
- func (s *TypeBlockStructContext) GetParser() antlr.Parser { return s.parser }
- func (s *TypeBlockStructContext) GetStructName() antlr.Token { return s.structName }
- func (s *TypeBlockStructContext) GetStructToken() antlr.Token { return s.structToken }
- func (s *TypeBlockStructContext) GetLbrace() antlr.Token { return s.lbrace }
- func (s *TypeBlockStructContext) GetRbrace() antlr.Token { return s.rbrace }
- func (s *TypeBlockStructContext) SetStructName(v antlr.Token) { s.structName = v }
- func (s *TypeBlockStructContext) SetStructToken(v antlr.Token) { s.structToken = v }
- func (s *TypeBlockStructContext) SetLbrace(v antlr.Token) { s.lbrace = v }
- func (s *TypeBlockStructContext) SetRbrace(v antlr.Token) { s.rbrace = v }
- func (s *TypeBlockStructContext) AllID() []antlr.TerminalNode {
- return s.GetTokens(ApiParserParserID)
- }
- func (s *TypeBlockStructContext) ID(i int) antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, i)
- }
- func (s *TypeBlockStructContext) AllField() []IFieldContext {
- ts := s.GetTypedRuleContexts(reflect.TypeOf((*IFieldContext)(nil)).Elem())
- tst := make([]IFieldContext, len(ts))
- for i, t := range ts {
- if t != nil {
- tst[i] = t.(IFieldContext)
- }
- }
- return tst
- }
- func (s *TypeBlockStructContext) Field(i int) IFieldContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IFieldContext)(nil)).Elem(), i)
- if t == nil {
- return nil
- }
- return t.(IFieldContext)
- }
- func (s *TypeBlockStructContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *TypeBlockStructContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *TypeBlockStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitTypeBlockStruct(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) TypeBlockStruct() (localctx ITypeBlockStructContext) {
- localctx = NewTypeBlockStructContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 32, ApiParserParserRULE_typeBlockStruct)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- var _alt int
- p.EnterOuterAlt(localctx, 1)
- checkKeyword(p)
- {
- p.SetState(175)
- _m := p.Match(ApiParserParserID)
- localctx.(*TypeBlockStructContext).structName = _m
- }
- p.SetState(177)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- if _la == ApiParserParserID {
- {
- p.SetState(176)
- _m := p.Match(ApiParserParserID)
- localctx.(*TypeBlockStructContext).structToken = _m
- }
- }
- {
- p.SetState(179)
- _m := p.Match(ApiParserParserT__3)
- localctx.(*TypeBlockStructContext).lbrace = _m
- }
- p.SetState(183)
- p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 13, p.GetParserRuleContext())
- for _alt != 2 && _alt != antlr.ATNInvalidAltNumber {
- if _alt == 1 {
- {
- p.SetState(180)
- p.Field()
- }
- }
- p.SetState(185)
- p.GetErrorHandler().Sync(p)
- _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 13, p.GetParserRuleContext())
- }
- {
- p.SetState(186)
- _m := p.Match(ApiParserParserT__4)
- localctx.(*TypeBlockStructContext).rbrace = _m
- }
- return localctx
- }
- // ITypeBlockAliasContext is an interface to support dynamic dispatch.
- type ITypeBlockAliasContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetAlias returns the alias token.
- GetAlias() antlr.Token
- // GetAssign returns the assign token.
- GetAssign() antlr.Token
- // SetAlias sets the alias token.
- SetAlias(antlr.Token)
- // SetAssign sets the assign token.
- SetAssign(antlr.Token)
- // IsTypeBlockAliasContext differentiates from other interfaces.
- IsTypeBlockAliasContext()
- }
- type TypeBlockAliasContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- alias antlr.Token
- assign antlr.Token
- }
- func NewEmptyTypeBlockAliasContext() *TypeBlockAliasContext {
- p := new(TypeBlockAliasContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_typeBlockAlias
- return p
- }
- func (*TypeBlockAliasContext) IsTypeBlockAliasContext() {}
- func NewTypeBlockAliasContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeBlockAliasContext {
- p := new(TypeBlockAliasContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_typeBlockAlias
- return p
- }
- func (s *TypeBlockAliasContext) GetParser() antlr.Parser { return s.parser }
- func (s *TypeBlockAliasContext) GetAlias() antlr.Token { return s.alias }
- func (s *TypeBlockAliasContext) GetAssign() antlr.Token { return s.assign }
- func (s *TypeBlockAliasContext) SetAlias(v antlr.Token) { s.alias = v }
- func (s *TypeBlockAliasContext) SetAssign(v antlr.Token) { s.assign = v }
- func (s *TypeBlockAliasContext) DataType() IDataTypeContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IDataTypeContext)
- }
- func (s *TypeBlockAliasContext) ID() antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, 0)
- }
- func (s *TypeBlockAliasContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *TypeBlockAliasContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *TypeBlockAliasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitTypeBlockAlias(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) TypeBlockAlias() (localctx ITypeBlockAliasContext) {
- localctx = NewTypeBlockAliasContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 34, ApiParserParserRULE_typeBlockAlias)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- checkKeyword(p)
- {
- p.SetState(189)
- _m := p.Match(ApiParserParserID)
- localctx.(*TypeBlockAliasContext).alias = _m
- }
- p.SetState(191)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- if _la == ApiParserParserT__0 {
- {
- p.SetState(190)
- _m := p.Match(ApiParserParserT__0)
- localctx.(*TypeBlockAliasContext).assign = _m
- }
- }
- {
- p.SetState(193)
- p.DataType()
- }
- return localctx
- }
- // IFieldContext is an interface to support dynamic dispatch.
- type IFieldContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // IsFieldContext differentiates from other interfaces.
- IsFieldContext()
- }
- type FieldContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- }
- func NewEmptyFieldContext() *FieldContext {
- p := new(FieldContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_field
- return p
- }
- func (*FieldContext) IsFieldContext() {}
- func NewFieldContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FieldContext {
- p := new(FieldContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_field
- return p
- }
- func (s *FieldContext) GetParser() antlr.Parser { return s.parser }
- func (s *FieldContext) NormalField() INormalFieldContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*INormalFieldContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(INormalFieldContext)
- }
- func (s *FieldContext) AnonymousFiled() IAnonymousFiledContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IAnonymousFiledContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IAnonymousFiledContext)
- }
- func (s *FieldContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *FieldContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *FieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitField(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) Field() (localctx IFieldContext) {
- localctx = NewFieldContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 36, ApiParserParserRULE_field)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.SetState(198)
- p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 15, p.GetParserRuleContext()) {
- case 1:
- p.EnterOuterAlt(localctx, 1)
- p.SetState(195)
- if !(isNormal(p)) {
- panic(antlr.NewFailedPredicateException(p, "isNormal(p)", ""))
- }
- {
- p.SetState(196)
- p.NormalField()
- }
- case 2:
- p.EnterOuterAlt(localctx, 2)
- {
- p.SetState(197)
- p.AnonymousFiled()
- }
- }
- return localctx
- }
- // INormalFieldContext is an interface to support dynamic dispatch.
- type INormalFieldContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetFieldName returns the fieldName token.
- GetFieldName() antlr.Token
- // GetTag returns the tag token.
- GetTag() antlr.Token
- // SetFieldName sets the fieldName token.
- SetFieldName(antlr.Token)
- // SetTag sets the tag token.
- SetTag(antlr.Token)
- // IsNormalFieldContext differentiates from other interfaces.
- IsNormalFieldContext()
- }
- type NormalFieldContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- fieldName antlr.Token
- tag antlr.Token
- }
- func NewEmptyNormalFieldContext() *NormalFieldContext {
- p := new(NormalFieldContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_normalField
- return p
- }
- func (*NormalFieldContext) IsNormalFieldContext() {}
- func NewNormalFieldContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NormalFieldContext {
- p := new(NormalFieldContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_normalField
- return p
- }
- func (s *NormalFieldContext) GetParser() antlr.Parser { return s.parser }
- func (s *NormalFieldContext) GetFieldName() antlr.Token { return s.fieldName }
- func (s *NormalFieldContext) GetTag() antlr.Token { return s.tag }
- func (s *NormalFieldContext) SetFieldName(v antlr.Token) { s.fieldName = v }
- func (s *NormalFieldContext) SetTag(v antlr.Token) { s.tag = v }
- func (s *NormalFieldContext) DataType() IDataTypeContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IDataTypeContext)
- }
- func (s *NormalFieldContext) ID() antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, 0)
- }
- func (s *NormalFieldContext) RAW_STRING() antlr.TerminalNode {
- return s.GetToken(ApiParserParserRAW_STRING, 0)
- }
- func (s *NormalFieldContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *NormalFieldContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *NormalFieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitNormalField(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) NormalField() (localctx INormalFieldContext) {
- localctx = NewNormalFieldContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 38, ApiParserParserRULE_normalField)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- checkKeyword(p)
- {
- p.SetState(201)
- _m := p.Match(ApiParserParserID)
- localctx.(*NormalFieldContext).fieldName = _m
- }
- {
- p.SetState(202)
- p.DataType()
- }
- p.SetState(204)
- p.GetErrorHandler().Sync(p)
- if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 16, p.GetParserRuleContext()) == 1 {
- {
- p.SetState(203)
- _m := p.Match(ApiParserParserRAW_STRING)
- localctx.(*NormalFieldContext).tag = _m
- }
- }
- return localctx
- }
- // IAnonymousFiledContext is an interface to support dynamic dispatch.
- type IAnonymousFiledContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetStar returns the star token.
- GetStar() antlr.Token
- // SetStar sets the star token.
- SetStar(antlr.Token)
- // IsAnonymousFiledContext differentiates from other interfaces.
- IsAnonymousFiledContext()
- }
- type AnonymousFiledContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- star antlr.Token
- }
- func NewEmptyAnonymousFiledContext() *AnonymousFiledContext {
- p := new(AnonymousFiledContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_anonymousFiled
- return p
- }
- func (*AnonymousFiledContext) IsAnonymousFiledContext() {}
- func NewAnonymousFiledContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AnonymousFiledContext {
- p := new(AnonymousFiledContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_anonymousFiled
- return p
- }
- func (s *AnonymousFiledContext) GetParser() antlr.Parser { return s.parser }
- func (s *AnonymousFiledContext) GetStar() antlr.Token { return s.star }
- func (s *AnonymousFiledContext) SetStar(v antlr.Token) { s.star = v }
- func (s *AnonymousFiledContext) ID() antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, 0)
- }
- func (s *AnonymousFiledContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *AnonymousFiledContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *AnonymousFiledContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitAnonymousFiled(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) AnonymousFiled() (localctx IAnonymousFiledContext) {
- localctx = NewAnonymousFiledContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 40, ApiParserParserRULE_anonymousFiled)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- p.SetState(207)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- if _la == ApiParserParserT__5 {
- {
- p.SetState(206)
- _m := p.Match(ApiParserParserT__5)
- localctx.(*AnonymousFiledContext).star = _m
- }
- }
- {
- p.SetState(209)
- p.Match(ApiParserParserID)
- }
- return localctx
- }
- // IDataTypeContext is an interface to support dynamic dispatch.
- type IDataTypeContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetInter returns the inter token.
- GetInter() antlr.Token
- // GetTime returns the time token.
- GetTime() antlr.Token
- // SetInter sets the inter token.
- SetInter(antlr.Token)
- // SetTime sets the time token.
- SetTime(antlr.Token)
- // IsDataTypeContext differentiates from other interfaces.
- IsDataTypeContext()
- }
- type DataTypeContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- inter antlr.Token
- time antlr.Token
- }
- func NewEmptyDataTypeContext() *DataTypeContext {
- p := new(DataTypeContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_dataType
- return p
- }
- func (*DataTypeContext) IsDataTypeContext() {}
- func NewDataTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DataTypeContext {
- p := new(DataTypeContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_dataType
- return p
- }
- func (s *DataTypeContext) GetParser() antlr.Parser { return s.parser }
- func (s *DataTypeContext) GetInter() antlr.Token { return s.inter }
- func (s *DataTypeContext) GetTime() antlr.Token { return s.time }
- func (s *DataTypeContext) SetInter(v antlr.Token) { s.inter = v }
- func (s *DataTypeContext) SetTime(v antlr.Token) { s.time = v }
- func (s *DataTypeContext) ID() antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, 0)
- }
- func (s *DataTypeContext) MapType() IMapTypeContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IMapTypeContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IMapTypeContext)
- }
- func (s *DataTypeContext) ArrayType() IArrayTypeContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IArrayTypeContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IArrayTypeContext)
- }
- func (s *DataTypeContext) INTERFACE() antlr.TerminalNode {
- return s.GetToken(ApiParserParserINTERFACE, 0)
- }
- func (s *DataTypeContext) PointerType() IPointerTypeContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IPointerTypeContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IPointerTypeContext)
- }
- func (s *DataTypeContext) TypeStruct() ITypeStructContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeStructContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(ITypeStructContext)
- }
- func (s *DataTypeContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *DataTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *DataTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitDataType(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) DataType() (localctx IDataTypeContext) {
- localctx = NewDataTypeContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 42, ApiParserParserRULE_dataType)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.SetState(219)
- p.GetErrorHandler().Sync(p)
- switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 18, p.GetParserRuleContext()) {
- case 1:
- p.EnterOuterAlt(localctx, 1)
- isInterface(p)
- {
- p.SetState(212)
- p.Match(ApiParserParserID)
- }
- case 2:
- p.EnterOuterAlt(localctx, 2)
- {
- p.SetState(213)
- p.MapType()
- }
- case 3:
- p.EnterOuterAlt(localctx, 3)
- {
- p.SetState(214)
- p.ArrayType()
- }
- case 4:
- p.EnterOuterAlt(localctx, 4)
- {
- p.SetState(215)
- _m := p.Match(ApiParserParserINTERFACE)
- localctx.(*DataTypeContext).inter = _m
- }
- case 5:
- p.EnterOuterAlt(localctx, 5)
- {
- p.SetState(216)
- _m := p.Match(ApiParserParserT__6)
- localctx.(*DataTypeContext).time = _m
- }
- case 6:
- p.EnterOuterAlt(localctx, 6)
- {
- p.SetState(217)
- p.PointerType()
- }
- case 7:
- p.EnterOuterAlt(localctx, 7)
- {
- p.SetState(218)
- p.TypeStruct()
- }
- }
- return localctx
- }
- // IPointerTypeContext is an interface to support dynamic dispatch.
- type IPointerTypeContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetStar returns the star token.
- GetStar() antlr.Token
- // SetStar sets the star token.
- SetStar(antlr.Token)
- // IsPointerTypeContext differentiates from other interfaces.
- IsPointerTypeContext()
- }
- type PointerTypeContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- star antlr.Token
- }
- func NewEmptyPointerTypeContext() *PointerTypeContext {
- p := new(PointerTypeContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_pointerType
- return p
- }
- func (*PointerTypeContext) IsPointerTypeContext() {}
- func NewPointerTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PointerTypeContext {
- p := new(PointerTypeContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_pointerType
- return p
- }
- func (s *PointerTypeContext) GetParser() antlr.Parser { return s.parser }
- func (s *PointerTypeContext) GetStar() antlr.Token { return s.star }
- func (s *PointerTypeContext) SetStar(v antlr.Token) { s.star = v }
- func (s *PointerTypeContext) ID() antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, 0)
- }
- func (s *PointerTypeContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *PointerTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *PointerTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitPointerType(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) PointerType() (localctx IPointerTypeContext) {
- localctx = NewPointerTypeContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 44, ApiParserParserRULE_pointerType)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- {
- p.SetState(221)
- _m := p.Match(ApiParserParserT__5)
- localctx.(*PointerTypeContext).star = _m
- }
- checkKeyword(p)
- {
- p.SetState(223)
- p.Match(ApiParserParserID)
- }
- return localctx
- }
- // IMapTypeContext is an interface to support dynamic dispatch.
- type IMapTypeContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetMapToken returns the mapToken token.
- GetMapToken() antlr.Token
- // GetLbrack returns the lbrack token.
- GetLbrack() antlr.Token
- // GetKey returns the key token.
- GetKey() antlr.Token
- // GetRbrack returns the rbrack token.
- GetRbrack() antlr.Token
- // SetMapToken sets the mapToken token.
- SetMapToken(antlr.Token)
- // SetLbrack sets the lbrack token.
- SetLbrack(antlr.Token)
- // SetKey sets the key token.
- SetKey(antlr.Token)
- // SetRbrack sets the rbrack token.
- SetRbrack(antlr.Token)
- // GetValue returns the value rule contexts.
- GetValue() IDataTypeContext
- // SetValue sets the value rule contexts.
- SetValue(IDataTypeContext)
- // IsMapTypeContext differentiates from other interfaces.
- IsMapTypeContext()
- }
- type MapTypeContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- mapToken antlr.Token
- lbrack antlr.Token
- key antlr.Token
- rbrack antlr.Token
- value IDataTypeContext
- }
- func NewEmptyMapTypeContext() *MapTypeContext {
- p := new(MapTypeContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_mapType
- return p
- }
- func (*MapTypeContext) IsMapTypeContext() {}
- func NewMapTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MapTypeContext {
- p := new(MapTypeContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_mapType
- return p
- }
- func (s *MapTypeContext) GetParser() antlr.Parser { return s.parser }
- func (s *MapTypeContext) GetMapToken() antlr.Token { return s.mapToken }
- func (s *MapTypeContext) GetLbrack() antlr.Token { return s.lbrack }
- func (s *MapTypeContext) GetKey() antlr.Token { return s.key }
- func (s *MapTypeContext) GetRbrack() antlr.Token { return s.rbrack }
- func (s *MapTypeContext) SetMapToken(v antlr.Token) { s.mapToken = v }
- func (s *MapTypeContext) SetLbrack(v antlr.Token) { s.lbrack = v }
- func (s *MapTypeContext) SetKey(v antlr.Token) { s.key = v }
- func (s *MapTypeContext) SetRbrack(v antlr.Token) { s.rbrack = v }
- func (s *MapTypeContext) GetValue() IDataTypeContext { return s.value }
- func (s *MapTypeContext) SetValue(v IDataTypeContext) { s.value = v }
- func (s *MapTypeContext) AllID() []antlr.TerminalNode {
- return s.GetTokens(ApiParserParserID)
- }
- func (s *MapTypeContext) ID(i int) antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, i)
- }
- func (s *MapTypeContext) DataType() IDataTypeContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IDataTypeContext)
- }
- func (s *MapTypeContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *MapTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *MapTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitMapType(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) MapType() (localctx IMapTypeContext) {
- localctx = NewMapTypeContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 46, ApiParserParserRULE_mapType)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- match(p, "map")
- {
- p.SetState(226)
- _m := p.Match(ApiParserParserID)
- localctx.(*MapTypeContext).mapToken = _m
- }
- {
- p.SetState(227)
- _m := p.Match(ApiParserParserT__7)
- localctx.(*MapTypeContext).lbrack = _m
- }
- checkKey(p)
- {
- p.SetState(229)
- _m := p.Match(ApiParserParserID)
- localctx.(*MapTypeContext).key = _m
- }
- {
- p.SetState(230)
- _m := p.Match(ApiParserParserT__8)
- localctx.(*MapTypeContext).rbrack = _m
- }
- {
- p.SetState(231)
- _x := p.DataType()
- localctx.(*MapTypeContext).value = _x
- }
- return localctx
- }
- // IArrayTypeContext is an interface to support dynamic dispatch.
- type IArrayTypeContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetLbrack returns the lbrack token.
- GetLbrack() antlr.Token
- // GetRbrack returns the rbrack token.
- GetRbrack() antlr.Token
- // SetLbrack sets the lbrack token.
- SetLbrack(antlr.Token)
- // SetRbrack sets the rbrack token.
- SetRbrack(antlr.Token)
- // IsArrayTypeContext differentiates from other interfaces.
- IsArrayTypeContext()
- }
- type ArrayTypeContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- lbrack antlr.Token
- rbrack antlr.Token
- }
- func NewEmptyArrayTypeContext() *ArrayTypeContext {
- p := new(ArrayTypeContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_arrayType
- return p
- }
- func (*ArrayTypeContext) IsArrayTypeContext() {}
- func NewArrayTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArrayTypeContext {
- p := new(ArrayTypeContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_arrayType
- return p
- }
- func (s *ArrayTypeContext) GetParser() antlr.Parser { return s.parser }
- func (s *ArrayTypeContext) GetLbrack() antlr.Token { return s.lbrack }
- func (s *ArrayTypeContext) GetRbrack() antlr.Token { return s.rbrack }
- func (s *ArrayTypeContext) SetLbrack(v antlr.Token) { s.lbrack = v }
- func (s *ArrayTypeContext) SetRbrack(v antlr.Token) { s.rbrack = v }
- func (s *ArrayTypeContext) DataType() IDataTypeContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IDataTypeContext)
- }
- func (s *ArrayTypeContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *ArrayTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *ArrayTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitArrayType(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) ArrayType() (localctx IArrayTypeContext) {
- localctx = NewArrayTypeContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 48, ApiParserParserRULE_arrayType)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- {
- p.SetState(233)
- _m := p.Match(ApiParserParserT__7)
- localctx.(*ArrayTypeContext).lbrack = _m
- }
- {
- p.SetState(234)
- _m := p.Match(ApiParserParserT__8)
- localctx.(*ArrayTypeContext).rbrack = _m
- }
- {
- p.SetState(235)
- p.DataType()
- }
- return localctx
- }
- // IServiceSpecContext is an interface to support dynamic dispatch.
- type IServiceSpecContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // IsServiceSpecContext differentiates from other interfaces.
- IsServiceSpecContext()
- }
- type ServiceSpecContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- }
- func NewEmptyServiceSpecContext() *ServiceSpecContext {
- p := new(ServiceSpecContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_serviceSpec
- return p
- }
- func (*ServiceSpecContext) IsServiceSpecContext() {}
- func NewServiceSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ServiceSpecContext {
- p := new(ServiceSpecContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_serviceSpec
- return p
- }
- func (s *ServiceSpecContext) GetParser() antlr.Parser { return s.parser }
- func (s *ServiceSpecContext) ServiceApi() IServiceApiContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IServiceApiContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IServiceApiContext)
- }
- func (s *ServiceSpecContext) AtServer() IAtServerContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IAtServerContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IAtServerContext)
- }
- func (s *ServiceSpecContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *ServiceSpecContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *ServiceSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitServiceSpec(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) ServiceSpec() (localctx IServiceSpecContext) {
- localctx = NewServiceSpecContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 50, ApiParserParserRULE_serviceSpec)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- p.SetState(238)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- if _la == ApiParserParserATSERVER {
- {
- p.SetState(237)
- p.AtServer()
- }
- }
- {
- p.SetState(240)
- p.ServiceApi()
- }
- return localctx
- }
- // IAtServerContext is an interface to support dynamic dispatch.
- type IAtServerContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetLp returns the lp token.
- GetLp() antlr.Token
- // GetRp returns the rp token.
- GetRp() antlr.Token
- // SetLp sets the lp token.
- SetLp(antlr.Token)
- // SetRp sets the rp token.
- SetRp(antlr.Token)
- // IsAtServerContext differentiates from other interfaces.
- IsAtServerContext()
- }
- type AtServerContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- lp antlr.Token
- rp antlr.Token
- }
- func NewEmptyAtServerContext() *AtServerContext {
- p := new(AtServerContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_atServer
- return p
- }
- func (*AtServerContext) IsAtServerContext() {}
- func NewAtServerContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AtServerContext {
- p := new(AtServerContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_atServer
- return p
- }
- func (s *AtServerContext) GetParser() antlr.Parser { return s.parser }
- func (s *AtServerContext) GetLp() antlr.Token { return s.lp }
- func (s *AtServerContext) GetRp() antlr.Token { return s.rp }
- func (s *AtServerContext) SetLp(v antlr.Token) { s.lp = v }
- func (s *AtServerContext) SetRp(v antlr.Token) { s.rp = v }
- func (s *AtServerContext) ATSERVER() antlr.TerminalNode {
- return s.GetToken(ApiParserParserATSERVER, 0)
- }
- func (s *AtServerContext) AllKvLit() []IKvLitContext {
- ts := s.GetTypedRuleContexts(reflect.TypeOf((*IKvLitContext)(nil)).Elem())
- tst := make([]IKvLitContext, len(ts))
- for i, t := range ts {
- if t != nil {
- tst[i] = t.(IKvLitContext)
- }
- }
- return tst
- }
- func (s *AtServerContext) KvLit(i int) IKvLitContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IKvLitContext)(nil)).Elem(), i)
- if t == nil {
- return nil
- }
- return t.(IKvLitContext)
- }
- func (s *AtServerContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *AtServerContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *AtServerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitAtServer(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) AtServer() (localctx IAtServerContext) {
- localctx = NewAtServerContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 52, ApiParserParserRULE_atServer)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- {
- p.SetState(242)
- p.Match(ApiParserParserATSERVER)
- }
- {
- p.SetState(243)
- _m := p.Match(ApiParserParserT__1)
- localctx.(*AtServerContext).lp = _m
- }
- p.SetState(245)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- for ok := true; ok; ok = _la == ApiParserParserID {
- {
- p.SetState(244)
- p.KvLit()
- }
- p.SetState(247)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- }
- {
- p.SetState(249)
- _m := p.Match(ApiParserParserT__2)
- localctx.(*AtServerContext).rp = _m
- }
- return localctx
- }
- // IServiceApiContext is an interface to support dynamic dispatch.
- type IServiceApiContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetServiceToken returns the serviceToken token.
- GetServiceToken() antlr.Token
- // GetLbrace returns the lbrace token.
- GetLbrace() antlr.Token
- // GetRbrace returns the rbrace token.
- GetRbrace() antlr.Token
- // SetServiceToken sets the serviceToken token.
- SetServiceToken(antlr.Token)
- // SetLbrace sets the lbrace token.
- SetLbrace(antlr.Token)
- // SetRbrace sets the rbrace token.
- SetRbrace(antlr.Token)
- // IsServiceApiContext differentiates from other interfaces.
- IsServiceApiContext()
- }
- type ServiceApiContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- serviceToken antlr.Token
- lbrace antlr.Token
- rbrace antlr.Token
- }
- func NewEmptyServiceApiContext() *ServiceApiContext {
- p := new(ServiceApiContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_serviceApi
- return p
- }
- func (*ServiceApiContext) IsServiceApiContext() {}
- func NewServiceApiContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ServiceApiContext {
- p := new(ServiceApiContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_serviceApi
- return p
- }
- func (s *ServiceApiContext) GetParser() antlr.Parser { return s.parser }
- func (s *ServiceApiContext) GetServiceToken() antlr.Token { return s.serviceToken }
- func (s *ServiceApiContext) GetLbrace() antlr.Token { return s.lbrace }
- func (s *ServiceApiContext) GetRbrace() antlr.Token { return s.rbrace }
- func (s *ServiceApiContext) SetServiceToken(v antlr.Token) { s.serviceToken = v }
- func (s *ServiceApiContext) SetLbrace(v antlr.Token) { s.lbrace = v }
- func (s *ServiceApiContext) SetRbrace(v antlr.Token) { s.rbrace = v }
- func (s *ServiceApiContext) ServiceName() IServiceNameContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IServiceNameContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IServiceNameContext)
- }
- func (s *ServiceApiContext) ID() antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, 0)
- }
- func (s *ServiceApiContext) AllServiceRoute() []IServiceRouteContext {
- ts := s.GetTypedRuleContexts(reflect.TypeOf((*IServiceRouteContext)(nil)).Elem())
- tst := make([]IServiceRouteContext, len(ts))
- for i, t := range ts {
- if t != nil {
- tst[i] = t.(IServiceRouteContext)
- }
- }
- return tst
- }
- func (s *ServiceApiContext) ServiceRoute(i int) IServiceRouteContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IServiceRouteContext)(nil)).Elem(), i)
- if t == nil {
- return nil
- }
- return t.(IServiceRouteContext)
- }
- func (s *ServiceApiContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *ServiceApiContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *ServiceApiContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitServiceApi(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) ServiceApi() (localctx IServiceApiContext) {
- localctx = NewServiceApiContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 54, ApiParserParserRULE_serviceApi)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- match(p, "service")
- {
- p.SetState(252)
- _m := p.Match(ApiParserParserID)
- localctx.(*ServiceApiContext).serviceToken = _m
- }
- {
- p.SetState(253)
- p.ServiceName()
- }
- {
- p.SetState(254)
- _m := p.Match(ApiParserParserT__3)
- localctx.(*ServiceApiContext).lbrace = _m
- }
- p.SetState(258)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- for ((_la)&-(0x1f+1)) == 0 && ((1<<uint(_la))&((1<<ApiParserParserATDOC)|(1<<ApiParserParserATHANDLER)|(1<<ApiParserParserATSERVER))) != 0 {
- {
- p.SetState(255)
- p.ServiceRoute()
- }
- p.SetState(260)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- }
- {
- p.SetState(261)
- _m := p.Match(ApiParserParserT__4)
- localctx.(*ServiceApiContext).rbrace = _m
- }
- return localctx
- }
- // IServiceRouteContext is an interface to support dynamic dispatch.
- type IServiceRouteContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // IsServiceRouteContext differentiates from other interfaces.
- IsServiceRouteContext()
- }
- type ServiceRouteContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- }
- func NewEmptyServiceRouteContext() *ServiceRouteContext {
- p := new(ServiceRouteContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_serviceRoute
- return p
- }
- func (*ServiceRouteContext) IsServiceRouteContext() {}
- func NewServiceRouteContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ServiceRouteContext {
- p := new(ServiceRouteContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_serviceRoute
- return p
- }
- func (s *ServiceRouteContext) GetParser() antlr.Parser { return s.parser }
- func (s *ServiceRouteContext) Route() IRouteContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IRouteContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IRouteContext)
- }
- func (s *ServiceRouteContext) AtServer() IAtServerContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IAtServerContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IAtServerContext)
- }
- func (s *ServiceRouteContext) AtHandler() IAtHandlerContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IAtHandlerContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IAtHandlerContext)
- }
- func (s *ServiceRouteContext) AtDoc() IAtDocContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IAtDocContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IAtDocContext)
- }
- func (s *ServiceRouteContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *ServiceRouteContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *ServiceRouteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitServiceRoute(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) ServiceRoute() (localctx IServiceRouteContext) {
- localctx = NewServiceRouteContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 56, ApiParserParserRULE_serviceRoute)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- p.SetState(264)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- if _la == ApiParserParserATDOC {
- {
- p.SetState(263)
- p.AtDoc()
- }
- }
- p.SetState(268)
- p.GetErrorHandler().Sync(p)
- switch p.GetTokenStream().LA(1) {
- case ApiParserParserATSERVER:
- {
- p.SetState(266)
- p.AtServer()
- }
- case ApiParserParserATHANDLER:
- {
- p.SetState(267)
- p.AtHandler()
- }
- default:
- panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
- }
- {
- p.SetState(270)
- p.Route()
- }
- return localctx
- }
- // IAtDocContext is an interface to support dynamic dispatch.
- type IAtDocContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetLp returns the lp token.
- GetLp() antlr.Token
- // GetRp returns the rp token.
- GetRp() antlr.Token
- // SetLp sets the lp token.
- SetLp(antlr.Token)
- // SetRp sets the rp token.
- SetRp(antlr.Token)
- // IsAtDocContext differentiates from other interfaces.
- IsAtDocContext()
- }
- type AtDocContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- lp antlr.Token
- rp antlr.Token
- }
- func NewEmptyAtDocContext() *AtDocContext {
- p := new(AtDocContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_atDoc
- return p
- }
- func (*AtDocContext) IsAtDocContext() {}
- func NewAtDocContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AtDocContext {
- p := new(AtDocContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_atDoc
- return p
- }
- func (s *AtDocContext) GetParser() antlr.Parser { return s.parser }
- func (s *AtDocContext) GetLp() antlr.Token { return s.lp }
- func (s *AtDocContext) GetRp() antlr.Token { return s.rp }
- func (s *AtDocContext) SetLp(v antlr.Token) { s.lp = v }
- func (s *AtDocContext) SetRp(v antlr.Token) { s.rp = v }
- func (s *AtDocContext) ATDOC() antlr.TerminalNode {
- return s.GetToken(ApiParserParserATDOC, 0)
- }
- func (s *AtDocContext) STRING() antlr.TerminalNode {
- return s.GetToken(ApiParserParserSTRING, 0)
- }
- func (s *AtDocContext) AllKvLit() []IKvLitContext {
- ts := s.GetTypedRuleContexts(reflect.TypeOf((*IKvLitContext)(nil)).Elem())
- tst := make([]IKvLitContext, len(ts))
- for i, t := range ts {
- if t != nil {
- tst[i] = t.(IKvLitContext)
- }
- }
- return tst
- }
- func (s *AtDocContext) KvLit(i int) IKvLitContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IKvLitContext)(nil)).Elem(), i)
- if t == nil {
- return nil
- }
- return t.(IKvLitContext)
- }
- func (s *AtDocContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *AtDocContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *AtDocContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitAtDoc(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) AtDoc() (localctx IAtDocContext) {
- localctx = NewAtDocContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 58, ApiParserParserRULE_atDoc)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- {
- p.SetState(272)
- p.Match(ApiParserParserATDOC)
- }
- p.SetState(274)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- if _la == ApiParserParserT__1 {
- {
- p.SetState(273)
- _m := p.Match(ApiParserParserT__1)
- localctx.(*AtDocContext).lp = _m
- }
- }
- p.SetState(282)
- p.GetErrorHandler().Sync(p)
- switch p.GetTokenStream().LA(1) {
- case ApiParserParserID:
- p.SetState(277)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- for ok := true; ok; ok = _la == ApiParserParserID {
- {
- p.SetState(276)
- p.KvLit()
- }
- p.SetState(279)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- }
- case ApiParserParserSTRING:
- {
- p.SetState(281)
- p.Match(ApiParserParserSTRING)
- }
- default:
- panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
- }
- p.SetState(285)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- if _la == ApiParserParserT__2 {
- {
- p.SetState(284)
- _m := p.Match(ApiParserParserT__2)
- localctx.(*AtDocContext).rp = _m
- }
- }
- return localctx
- }
- // IAtHandlerContext is an interface to support dynamic dispatch.
- type IAtHandlerContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // IsAtHandlerContext differentiates from other interfaces.
- IsAtHandlerContext()
- }
- type AtHandlerContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- }
- func NewEmptyAtHandlerContext() *AtHandlerContext {
- p := new(AtHandlerContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_atHandler
- return p
- }
- func (*AtHandlerContext) IsAtHandlerContext() {}
- func NewAtHandlerContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AtHandlerContext {
- p := new(AtHandlerContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_atHandler
- return p
- }
- func (s *AtHandlerContext) GetParser() antlr.Parser { return s.parser }
- func (s *AtHandlerContext) ATHANDLER() antlr.TerminalNode {
- return s.GetToken(ApiParserParserATHANDLER, 0)
- }
- func (s *AtHandlerContext) ID() antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, 0)
- }
- func (s *AtHandlerContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *AtHandlerContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *AtHandlerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitAtHandler(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) AtHandler() (localctx IAtHandlerContext) {
- localctx = NewAtHandlerContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 60, ApiParserParserRULE_atHandler)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- {
- p.SetState(287)
- p.Match(ApiParserParserATHANDLER)
- }
- {
- p.SetState(288)
- p.Match(ApiParserParserID)
- }
- return localctx
- }
- // IRouteContext is an interface to support dynamic dispatch.
- type IRouteContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetHttpMethod returns the httpMethod token.
- GetHttpMethod() antlr.Token
- // GetReturnToken returns the returnToken token.
- GetReturnToken() antlr.Token
- // SetHttpMethod sets the httpMethod token.
- SetHttpMethod(antlr.Token)
- // SetReturnToken sets the returnToken token.
- SetReturnToken(antlr.Token)
- // GetRequest returns the request rule contexts.
- GetRequest() IBodyContext
- // GetResponse returns the response rule contexts.
- GetResponse() IReplybodyContext
- // SetRequest sets the request rule contexts.
- SetRequest(IBodyContext)
- // SetResponse sets the response rule contexts.
- SetResponse(IReplybodyContext)
- // IsRouteContext differentiates from other interfaces.
- IsRouteContext()
- }
- type RouteContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- httpMethod antlr.Token
- request IBodyContext
- returnToken antlr.Token
- response IReplybodyContext
- }
- func NewEmptyRouteContext() *RouteContext {
- p := new(RouteContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_route
- return p
- }
- func (*RouteContext) IsRouteContext() {}
- func NewRouteContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RouteContext {
- p := new(RouteContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_route
- return p
- }
- func (s *RouteContext) GetParser() antlr.Parser { return s.parser }
- func (s *RouteContext) GetHttpMethod() antlr.Token { return s.httpMethod }
- func (s *RouteContext) GetReturnToken() antlr.Token { return s.returnToken }
- func (s *RouteContext) SetHttpMethod(v antlr.Token) { s.httpMethod = v }
- func (s *RouteContext) SetReturnToken(v antlr.Token) { s.returnToken = v }
- func (s *RouteContext) GetRequest() IBodyContext { return s.request }
- func (s *RouteContext) GetResponse() IReplybodyContext { return s.response }
- func (s *RouteContext) SetRequest(v IBodyContext) { s.request = v }
- func (s *RouteContext) SetResponse(v IReplybodyContext) { s.response = v }
- func (s *RouteContext) Path() IPathContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IPathContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IPathContext)
- }
- func (s *RouteContext) AllID() []antlr.TerminalNode {
- return s.GetTokens(ApiParserParserID)
- }
- func (s *RouteContext) ID(i int) antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, i)
- }
- func (s *RouteContext) Body() IBodyContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IBodyContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IBodyContext)
- }
- func (s *RouteContext) Replybody() IReplybodyContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IReplybodyContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IReplybodyContext)
- }
- func (s *RouteContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *RouteContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *RouteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitRoute(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) Route() (localctx IRouteContext) {
- localctx = NewRouteContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 62, ApiParserParserRULE_route)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- checkHTTPMethod(p)
- {
- p.SetState(291)
- _m := p.Match(ApiParserParserID)
- localctx.(*RouteContext).httpMethod = _m
- }
- {
- p.SetState(292)
- p.Path()
- }
- p.SetState(294)
- p.GetErrorHandler().Sync(p)
- if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 28, p.GetParserRuleContext()) == 1 {
- {
- p.SetState(293)
- _x := p.Body()
- localctx.(*RouteContext).request = _x
- }
- }
- p.SetState(297)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- if _la == ApiParserParserID {
- {
- p.SetState(296)
- _m := p.Match(ApiParserParserID)
- localctx.(*RouteContext).returnToken = _m
- }
- }
- p.SetState(300)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- if _la == ApiParserParserT__1 {
- {
- p.SetState(299)
- _x := p.Replybody()
- localctx.(*RouteContext).response = _x
- }
- }
- return localctx
- }
- // IBodyContext is an interface to support dynamic dispatch.
- type IBodyContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetLp returns the lp token.
- GetLp() antlr.Token
- // GetRp returns the rp token.
- GetRp() antlr.Token
- // SetLp sets the lp token.
- SetLp(antlr.Token)
- // SetRp sets the rp token.
- SetRp(antlr.Token)
- // IsBodyContext differentiates from other interfaces.
- IsBodyContext()
- }
- type BodyContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- lp antlr.Token
- rp antlr.Token
- }
- func NewEmptyBodyContext() *BodyContext {
- p := new(BodyContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_body
- return p
- }
- func (*BodyContext) IsBodyContext() {}
- func NewBodyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BodyContext {
- p := new(BodyContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_body
- return p
- }
- func (s *BodyContext) GetParser() antlr.Parser { return s.parser }
- func (s *BodyContext) GetLp() antlr.Token { return s.lp }
- func (s *BodyContext) GetRp() antlr.Token { return s.rp }
- func (s *BodyContext) SetLp(v antlr.Token) { s.lp = v }
- func (s *BodyContext) SetRp(v antlr.Token) { s.rp = v }
- func (s *BodyContext) ID() antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, 0)
- }
- func (s *BodyContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *BodyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *BodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitBody(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) Body() (localctx IBodyContext) {
- localctx = NewBodyContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 64, ApiParserParserRULE_body)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- {
- p.SetState(302)
- _m := p.Match(ApiParserParserT__1)
- localctx.(*BodyContext).lp = _m
- }
- p.SetState(304)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- if _la == ApiParserParserID {
- {
- p.SetState(303)
- p.Match(ApiParserParserID)
- }
- }
- {
- p.SetState(306)
- _m := p.Match(ApiParserParserT__2)
- localctx.(*BodyContext).rp = _m
- }
- return localctx
- }
- // IReplybodyContext is an interface to support dynamic dispatch.
- type IReplybodyContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetLp returns the lp token.
- GetLp() antlr.Token
- // GetRp returns the rp token.
- GetRp() antlr.Token
- // SetLp sets the lp token.
- SetLp(antlr.Token)
- // SetRp sets the rp token.
- SetRp(antlr.Token)
- // IsReplybodyContext differentiates from other interfaces.
- IsReplybodyContext()
- }
- type ReplybodyContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- lp antlr.Token
- rp antlr.Token
- }
- func NewEmptyReplybodyContext() *ReplybodyContext {
- p := new(ReplybodyContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_replybody
- return p
- }
- func (*ReplybodyContext) IsReplybodyContext() {}
- func NewReplybodyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ReplybodyContext {
- p := new(ReplybodyContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_replybody
- return p
- }
- func (s *ReplybodyContext) GetParser() antlr.Parser { return s.parser }
- func (s *ReplybodyContext) GetLp() antlr.Token { return s.lp }
- func (s *ReplybodyContext) GetRp() antlr.Token { return s.rp }
- func (s *ReplybodyContext) SetLp(v antlr.Token) { s.lp = v }
- func (s *ReplybodyContext) SetRp(v antlr.Token) { s.rp = v }
- func (s *ReplybodyContext) DataType() IDataTypeContext {
- t := s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
- if t == nil {
- return nil
- }
- return t.(IDataTypeContext)
- }
- func (s *ReplybodyContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *ReplybodyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *ReplybodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitReplybody(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) Replybody() (localctx IReplybodyContext) {
- localctx = NewReplybodyContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 66, ApiParserParserRULE_replybody)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- {
- p.SetState(308)
- _m := p.Match(ApiParserParserT__1)
- localctx.(*ReplybodyContext).lp = _m
- }
- p.SetState(310)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- if ((_la)&-(0x1f+1)) == 0 && ((1<<uint(_la))&((1<<ApiParserParserT__5)|(1<<ApiParserParserT__6)|(1<<ApiParserParserT__7)|(1<<ApiParserParserINTERFACE)|(1<<ApiParserParserID))) != 0 {
- {
- p.SetState(309)
- p.DataType()
- }
- }
- {
- p.SetState(312)
- _m := p.Match(ApiParserParserT__2)
- localctx.(*ReplybodyContext).rp = _m
- }
- return localctx
- }
- // IKvLitContext is an interface to support dynamic dispatch.
- type IKvLitContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // GetKey returns the key token.
- GetKey() antlr.Token
- // GetValue returns the value token.
- GetValue() antlr.Token
- // SetKey sets the key token.
- SetKey(antlr.Token)
- // SetValue sets the value token.
- SetValue(antlr.Token)
- // IsKvLitContext differentiates from other interfaces.
- IsKvLitContext()
- }
- type KvLitContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- key antlr.Token
- value antlr.Token
- }
- func NewEmptyKvLitContext() *KvLitContext {
- p := new(KvLitContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_kvLit
- return p
- }
- func (*KvLitContext) IsKvLitContext() {}
- func NewKvLitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *KvLitContext {
- p := new(KvLitContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_kvLit
- return p
- }
- func (s *KvLitContext) GetParser() antlr.Parser { return s.parser }
- func (s *KvLitContext) GetKey() antlr.Token { return s.key }
- func (s *KvLitContext) GetValue() antlr.Token { return s.value }
- func (s *KvLitContext) SetKey(v antlr.Token) { s.key = v }
- func (s *KvLitContext) SetValue(v antlr.Token) { s.value = v }
- func (s *KvLitContext) ID() antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, 0)
- }
- func (s *KvLitContext) LINE_VALUE() antlr.TerminalNode {
- return s.GetToken(ApiParserParserLINE_VALUE, 0)
- }
- func (s *KvLitContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *KvLitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *KvLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitKvLit(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) KvLit() (localctx IKvLitContext) {
- localctx = NewKvLitContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 68, ApiParserParserRULE_kvLit)
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- {
- p.SetState(314)
- _m := p.Match(ApiParserParserID)
- localctx.(*KvLitContext).key = _m
- }
- checkKeyValue(p)
- {
- p.SetState(316)
- _m := p.Match(ApiParserParserLINE_VALUE)
- localctx.(*KvLitContext).value = _m
- }
- return localctx
- }
- // IServiceNameContext is an interface to support dynamic dispatch.
- type IServiceNameContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // IsServiceNameContext differentiates from other interfaces.
- IsServiceNameContext()
- }
- type ServiceNameContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- }
- func NewEmptyServiceNameContext() *ServiceNameContext {
- p := new(ServiceNameContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_serviceName
- return p
- }
- func (*ServiceNameContext) IsServiceNameContext() {}
- func NewServiceNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ServiceNameContext {
- p := new(ServiceNameContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_serviceName
- return p
- }
- func (s *ServiceNameContext) GetParser() antlr.Parser { return s.parser }
- func (s *ServiceNameContext) AllID() []antlr.TerminalNode {
- return s.GetTokens(ApiParserParserID)
- }
- func (s *ServiceNameContext) ID(i int) antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, i)
- }
- func (s *ServiceNameContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *ServiceNameContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *ServiceNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitServiceName(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) ServiceName() (localctx IServiceNameContext) {
- localctx = NewServiceNameContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 70, ApiParserParserRULE_serviceName)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- p.SetState(322)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- for ok := true; ok; ok = _la == ApiParserParserID {
- {
- p.SetState(318)
- p.Match(ApiParserParserID)
- }
- p.SetState(320)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- if _la == ApiParserParserT__9 {
- {
- p.SetState(319)
- p.Match(ApiParserParserT__9)
- }
- }
- p.SetState(324)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- }
- return localctx
- }
- // IPathContext is an interface to support dynamic dispatch.
- type IPathContext interface {
- antlr.ParserRuleContext
- // GetParser returns the parser.
- GetParser() antlr.Parser
- // IsPathContext differentiates from other interfaces.
- IsPathContext()
- }
- type PathContext struct {
- *antlr.BaseParserRuleContext
- parser antlr.Parser
- }
- func NewEmptyPathContext() *PathContext {
- p := new(PathContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
- p.RuleIndex = ApiParserParserRULE_path
- return p
- }
- func (*PathContext) IsPathContext() {}
- func NewPathContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PathContext {
- p := new(PathContext)
- p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
- p.parser = parser
- p.RuleIndex = ApiParserParserRULE_path
- return p
- }
- func (s *PathContext) GetParser() antlr.Parser { return s.parser }
- func (s *PathContext) AllID() []antlr.TerminalNode {
- return s.GetTokens(ApiParserParserID)
- }
- func (s *PathContext) ID(i int) antlr.TerminalNode {
- return s.GetToken(ApiParserParserID, i)
- }
- func (s *PathContext) GetRuleContext() antlr.RuleContext {
- return s
- }
- func (s *PathContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
- return antlr.TreesStringTree(s, ruleNames, recog)
- }
- func (s *PathContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
- switch t := visitor.(type) {
- case ApiParserVisitor:
- return t.VisitPath(s)
- default:
- return t.VisitChildren(s)
- }
- }
- func (p *ApiParserParser) Path() (localctx IPathContext) {
- localctx = NewPathContext(p, p.GetParserRuleContext(), p.GetState())
- p.EnterRule(localctx, 72, ApiParserParserRULE_path)
- var _la int
- defer func() {
- p.ExitRule()
- }()
- defer func() {
- if err := recover(); err != nil {
- if v, ok := err.(antlr.RecognitionException); ok {
- localctx.SetException(v)
- p.GetErrorHandler().ReportError(p, v)
- p.GetErrorHandler().Recover(p, v)
- } else {
- panic(err)
- }
- }
- }()
- p.EnterOuterAlt(localctx, 1)
- p.SetState(341)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- for ok := true; ok; ok = _la == ApiParserParserT__10 || _la == ApiParserParserT__11 {
- p.SetState(341)
- p.GetErrorHandler().Sync(p)
- switch p.GetTokenStream().LA(1) {
- case ApiParserParserT__10:
- {
- p.SetState(326)
- p.Match(ApiParserParserT__10)
- }
- {
- p.SetState(327)
- p.Match(ApiParserParserID)
- }
- p.SetState(332)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- for _la == ApiParserParserT__9 {
- {
- p.SetState(328)
- p.Match(ApiParserParserT__9)
- }
- {
- p.SetState(329)
- p.Match(ApiParserParserID)
- }
- p.SetState(334)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- }
- case ApiParserParserT__11:
- {
- p.SetState(335)
- p.Match(ApiParserParserT__11)
- }
- {
- p.SetState(336)
- p.Match(ApiParserParserID)
- }
- p.SetState(339)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- if _la == ApiParserParserT__9 {
- {
- p.SetState(337)
- p.Match(ApiParserParserT__9)
- }
- {
- p.SetState(338)
- p.Match(ApiParserParserID)
- }
- }
- default:
- panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
- }
- p.SetState(343)
- p.GetErrorHandler().Sync(p)
- _la = p.GetTokenStream().LA(1)
- }
- return localctx
- }
- func (p *ApiParserParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool {
- switch ruleIndex {
- case 18:
- var t *FieldContext = nil
- if localctx != nil {
- t = localctx.(*FieldContext)
- }
- return p.Field_Sempred(t, predIndex)
- default:
- panic("No predicate with index: " + fmt.Sprint(ruleIndex))
- }
- }
- func (p *ApiParserParser) Field_Sempred(localctx antlr.RuleContext, predIndex int) bool {
- switch predIndex {
- case 0:
- return isNormal(p)
- default:
- panic("No predicate with index: " + fmt.Sprint(predIndex))
- }
- }
|