UNPKG

@sap/cds-compiler

Version:

CDS (Core Data Services) compiler and backends

2,134 lines 140 kB
// Parser generated by redepage v0.2.1 'use strict;' const { XsnSource, XsnArtifact, XsnName } = require( '../compiler/xsn-model' ) const AstBuildingParser = require('../parsers/AstBuildingParser') const keywords={ abstract:0, action:0, actions:0, all:1, and:0, annotate:0, annotation:0, any:1, array:0, as:1, asc:0, aspect:0, association:0, between:0, by:1, case:1, cast:1, columns:0, composition:0, context:0, cross:0, current:0, default:0, define:0, definitions:0, desc:0, distinct:1, element:0, elements:0, else:0, end:0, entity:0, enum:0, escape:0, event:0, exact:0, except:0, excluding:0, exists:1, extend:0, false:1, first:0, floating:0, following:0, from:1, full:0, function:0, group:0, having:0, in:1, inner:0, intersect:0, into:0, is:0, join:0, key:1, last:0, left:0, like:0, limit:0, localized:0, many:0, masked:0, minus:0, mixin:0, namespace:0, new:0, not:1, null:1, nulls:0, of:1, offset:0, on:1, one:0, or:0, order:0, outer:0, over:0, parameters:0, partition:0, preceding:0, projection:0, redirected:0, returns:0, right:0, row:0, rows:0, select:1, service:0, some:1, stored:0, then:0, to:0, true:1, type:0, unbounded:0, union:0, up:0, using:0, variable:0, view:0, virtual:0, when:1, where:1, with:1, } const table=[ 'start', { namespace:[2,16,,'namespaceRestriction'], using:[2,19], '@':[2,10,,,,'namespaceRestriction'],type:'@',view:'@',event:'@',action:'@',aspect:'@',define:'@',entity:'@',extend:'@',context:'@',service:'@',abstract:'@',annotate:'@',function:'@',annotation:'@', '':3 }, { ';':['c',1], EOF:3, Id:['g',1,,'afterBrace'],'@':'Id', }, ['m',0,'EOF'], 'artifactsBlock', ['m',6,'{',,'init','afterBrace'], {Id:[7,10],'@':'Id','':8}, { ';':['c',6], '}':8, Id:['g',6,,'afterBrace'],'@':'Id', }, ['m',0,'}',,,'afterBrace'], 'artifactDefOrExtend', {'@':[10,778],'':11}, { define:['ck',12], type:12,view:12,event:12,action:12,aspect:12,entity:12,context:12,service:12,abstract:12,function:12,annotation:12, extend:['ck',13,,'extensionRestriction'], annotate:['ck',14,,'extensionRestriction'], }, { service:[0,43], context:[0,48], annotation:[0,53,,'vocabularyRestriction'], type:[0,58], aspect:[0,63],abstract:'aspect', entity:[0,73], view:[0,89,,'hide_'], event:[0,101], action:[0,113], function:[0,119], }, { Id:[0,229], service:[0,251,1], context:[0,258,1,'hide_'], type:[0,265,1,'hide_'], aspect:[0,277,1,'hide_'],entity:'aspect', projection:[0,288,1,'hide_'], }, [0,216], 'namespaceDeclaration', ['mk',17,'namespace'], [0,35], 'usingDeclaration', ['mk',20,'using'], { from:['ck',21], Id:[22,31], '{':24, }, ['m',0,'String'], {from:['ck',23],'':0}, ['m',0,'String'], ['m',25,'{'], {Id:[26,31],'':27}, { ',':['c',25], '}':27, }, ['m',28,'}',,,'afterBrace'], {from:['ck',29],'':0}, ['m',0,'String'], 'usingProxy', [32,39], {as:['ck',33],'':0}, ['mi',0], 'namePath', ['mi',36], {'.':['c',37],'':0}, ['miA',36], 'simplePath', ['mi',40], {'.':['c',41],'':0}, ['miA',40], 'serviceDef', ['mk',44,'service',,,'vocabularyRestriction'], [45,35], {'@':[45,784],'':46}, {'{':[0,5],'':0}, 'contextDef', ['mk',49,'context',,,'vocabularyRestriction'], [50,35], {'@':[50,784],'':51}, {'{':[0,5],'':0}, 'annotationDef', ['mk',54,'annotation'], [55,35], {'@':[55,784],'':56}, [0,347], 'typeDef', ['mk',59,'type'], [60,35], {'@':[60,784],'':61}, [0,347], 'aspectDef', { aspect:['ck',65], abstract:['ck',64,,'hide_'], }, ['mk',65,'entity'], [66,35], {'@':[66,784],'':67}, { '{':[71,158], ':':['c',68], '':0 }, {Id:[69,39],'':70}, { ',':['c',68], '{':70, '':0 }, [71,158], {actions:[0,125],'':0}, 'entityDef', ['mk',74,'entity'], [75,35], {'@':[75,784],'':76}, {'(':[77,142],'':77}, { ':':['c',78], '{':81, as:['ck',82], }, {Id:79}, {Id:[80,39],'':81}, { ',':['c',79], '{':81, }, [87,158], { '(':[87,453],select:'(', projection:['g',83,,,'sloppy','afterBrace'], }, [84,447], {group:[85,611],where:'group',having:'group','':85}, {limit:[86,623],order:'limit','':86}, ['g',87,,,'normal','afterBrace'], {actions:[0,125],'':0}, 'viewDef', ['mk',90,'view'], [91,35], {'@':[91,784],'':92}, { '(':[98,142], with:['ck',93,,'hide_'], '':98 }, ['mk',94,'parameters'], [95,147], {',':['c',96],'':97}, [95,147], ['g',98], ['mk',99,'as'], [0,453], 'eventDef', ['mk',102,'event'], [103,35], {'@':[103,784],'':104}, { '{':[0,158], ':':['c',105], }, { '{':[0,158], Id:[106,39], projection:[0,447,1], }, {',':107,'{':107,'':111}, {',':['c',108],'':110}, {Id:[109,39],'':110}, { ',':['c',108], '{':110, }, [0,158], {'@':[111,778],'':0}, 'actionMainDef', ['mk',114,'action'], [115,35], {'@':[115,784],'':116}, [117,142], {returns:[0,154],'':0}, 'functionMainDef', ['mk',120,'function'], [121,35], {'@':[121,784],'':122}, [123,142], [0,154], 'actionsBlock', ['mk',126,'actions'], ['m',127,'{'], {Id:[128,131],'@':'Id','':129}, { ';':['c',127], '}':129, Id:['g',127,,'afterBrace'],'@':'Id', }, ['m',0,'}',,,'afterBrace'], 'boundActionFunctionDef', {'@':[131,778],'':132}, { action:['ck',133], function:['ck',137], }, ['mi',134], {'@':[134,784],'':135}, [136,142], {returns:[0,154],'':0}, ['mi',138], {'@':[138,784],'':139}, [140,142], [0,154], 'paramsList', ['m',143,'('], {Id:[144,147],'@':'Id','':145}, { ',':['c',143], ')':145, }, ['m',0,')'], 'paramDef', {'@':[147,778],'':148}, ['miA',149], {'@':[149,784],'':150}, { '{':[151,158], ':':['c',152], }, {not:[0,440],null:'not','':0}, [0,358], 'returnsSpec', ['mk',155,'returns',,'default','elementRestriction'], {'@':[155,778],'':156}, [0,358], 'elementsBlock', ['m',159,'{'], {Id:[160,163],'@':'Id','':161}, { ';':['c',159], '}':161, Id:['g',159,,'afterBrace'],'@':'Id', }, ['m',0,'}',,,'afterBrace'], 'elementDef', {'@':[163,778],'':164}, {virtual:['ck',165,1],'':165}, {key:['ck',166],'':166}, {masked:['ck',167,1,'hide_'],'':167}, {element:['ck',168,1,'hide_'],'':168}, ['mi',169,,,'elem','elementRestriction'], {'@':[169,784],'':170}, { '{':[171,158], ':':['c',172], '':173 }, {not:[173,440],null:'not','':173}, [173,358], {'=':['c',174,,'elementRestriction','calc'],'':0}, [175,651], {stored:['ck',176],'':176}, ['g',177], {'@':[177,778,,'elementRestriction','anno'],'':0}, 'enumSymbolsBlock', ['mk',180,'enum'], ['m',181,'{'], {Id:[182,185],'@':'Id','':183}, { ';':['c',181], '}':183, }, ['m',0,'}',,,'afterBrace'], 'enumSymbolDef', {'@':[185,778],'':186}, ['mi',187], {'@':[187,778],'':188}, {'=':['c',189],'':0}, { String:['c',191], Number:['c',191], '+':['c',190],'-':'+', Id:[191,775,,'hide_'],'#':'Id',QuotedLiteral:'Id', }, ['m',191,'Number'], ['g',192], {'@':[192,778],'':0}, 'foreignKeysBlock', ['m',195,'{'], {Id:[196,199],'@':'Id','':197}, { ',':['c',195], '}':197, }, ['m',0,'}'], 'foreignKeyDef', {'@':[199,778],'':200}, [201,39], {as:['ck',202],'':0}, ['mi',0], 'mixinElementDef', ['mi',205], ['m',206,':'], { association:['ck',207], composition:['ck',209], }, {'[':[208,428],'':208}, ['mk',211,'to'], {'[':[210,428],'':210}, ['mk',211,'of'], {one:['ck',212,1,'noRepeatedCardinality'],many:'one','':212}, [213,39], ['mk',214,'on'], [0,643], 'annotateArtifact', [217,35], { ':':['c',218], with:['ck',223], '':223 }, [219,35], {with:['ck',220],'':220}, ['g',221], {'@':[221,778],'':222}, {'{':[0,321],'':0}, ['g',224], {'@':[224,778],'':225}, {'(':[226,308],'':226}, { returns:[0,317], '{':[227,321], '':227 }, {actions:[0,296],'':0}, 'extendArtifact', [230,35], { ':':['c',231], with:['ck',240], '':237 }, [232,35], {with:['ck',233],'':233}, ['g',234], {'@':[234,778],'':235}, { elements:['ck',236], '{':236, enum:[0,179], '(':[0,419], '':0 }, [0,331], {'@':[237,778],'':238}, {'{':[239,331],'':0}, {actions:[0,125],'':0}, {'@':[240,778],'':241}, { Id:[242,39], elements:['ck',246,1], '{':246, actions:[0,125,1], enum:[0,179,1], '(':[0,419], columns:['ck',248,1], definitions:['ck',249,1], '':0 }, {',':['c',243],'':244}, [242,39], {'{':[245,331],'':245}, {actions:[0,125],'':0}, [247,331], {actions:[0,125],'':0}, [0,560], [0,5], 'extendService', ['mk',252,'service'], [253,35], {with:['ck',254],'':254}, ['g',255], {'@':[255,778],'':256}, {'{':[0,5],'':0}, 'extendContext', ['mk',259,'context'], [260,35], {with:['ck',261],'':261}, ['g',262], {'@':[262,778],'':263}, {'{':[0,5],'':0}, 'extendType', ['mk',266,'type'], [267,35], {with:['ck',270],'':268}, {'@':[268,778],'':269}, {'{':[0,331],'':0}, {'@':[270,778],'':271}, { Id:[272,39], elements:['ck',275,1], '{':275, enum:[0,179,1], '(':[0,419], '':0 }, {',':['c',273],'':274}, [272,39], {'{':[0,331],'':0}, [0,331], 'extendEntityOrAspect', {aspect:['ck',278],entity:'aspect'}, [279,35], {with:['ck',281],'':280}, {'@':[280,778],'':285}, {'@':[281,778],'':282}, { Id:[283,39], actions:['g',285,1], '':285 }, {',':['c',284],'':285}, [283,39], {'{':[286,331],'':286}, {actions:[0,125],'':0}, 'extendProjection', ['mk',289,'projection'], [290,35], {with:['ck',291],'':291}, ['g',292], {'@':[292,778],'':293}, {'{':[294,560],'':294}, {actions:[0,125],'':0}, 'annotateActionsBlock', ['mk',297,'actions'], ['m',298,'{'], {Id:[299,302],'@':'Id','':300}, { ';':['c',298], '}':300, Id:['g',298,,'afterBrace'],'@':'Id', }, ['m',0,'}',,,'afterBrace'], 'annotateBoundAction', {'@':[302,778],'':303}, ['mi',304], {'@':[304,778],'':305}, {'(':[306,308],'':306}, {returns:[0,317,1],'':0}, 'annotateParamsBlock', ['m',309,'('], {Id:[310,313],'@':'Id','':311}, { ',':['c',309], ')':311, }, ['m',0,')'], 'annotateParam', {'@':[313,778],'':314}, ['mi',315], {'@':[315,778],'':0}, 'annotateReturns', ['mk',318,'returns'], {'@':[318,778],'':319}, {'{':[0,321],'':0}, 'annotateElementsBlock', ['m',322,'{'], {Id:[323,326],'@':'Id','':324}, { ';':['c',322], '}':324, Id:['g',322,,'afterBrace'],'@':'Id', }, ['m',0,'}',,,'afterBrace'], 'annotateElement', {'@':[326,778],'':327}, ['mi',328], {'@':[328,778],'':329}, {'{':[0,321],'':0}, 'extendElementsBlock', ['m',332,'{'], {Id:[333,336],'@':'Id','':334}, { ';':['c',332], '}':334, Id:['g',332,,'afterBrace'],'@':'Id', }, ['m',0,'}',,,'afterBrace'], 'elementDefOrExtend', {'@':[336,778],'':337}, { Id:[0,163],'@':'Id',key:'Id', extend:['ck',338,1], }, {element:['ck',339,1],'':339}, ['mi',340], {with:['ck',343],'':341}, {'@':[341,778],'':342}, {'{':[0,331],'':0}, {'@':[343,778],'':344}, { elements:['ck',345], '{':345, enum:[0,179], '(':[0,419], '':0 }, [0,331], 'typeOrIncludesSpec', { '{':[348,158], ':':['c',349], }, {not:[0,440],null:'not','':0}, { projection:[0,447,1], '{':[0,358,1],many:'{',type:'{',array:'{',localized:'{',association:'{',composition:'{', Id:[350,39], }, { '(':[351,406],':':'(', '@':[0,359],not:'@',enum:'@',null:'@',default:'@', ',':352,'{':352, '':0 }, {'@':[0,359],not:'@',enum:'@',null:'@',default:'@','':0}, {',':['c',353],'':355}, {Id:[354,39],'':355}, { ',':['c',353], '{':355, }, [356,158], {not:[0,440],null:'not','':0}, 'typeExpression', { Id:[359,405], type:[359,397,1], localized:['ck',368,1], association:['ck',370,1,,'calc','elementRestriction'], composition:['ck',374,1,,'calc','elementRestriction'], array:['ck',378,1,,'calc','elementRestriction'], many:['ck',379,1,,'calc','elementRestriction'], '{':[385,158,,,'calc','elementRestriction'], }, ['g',360], {'@':[360,778],'':361}, {not:[362,440,,'elementRestriction','notNull'],null:'not','':363}, {'@':[362,778],'':363}, { enum:[364,179,,,'anno','elementRestriction'], '@':[0,394],not:'@',null:'@',default:'@', '':0 }, {not:[365,440,,'elementRestriction','notNull'],null:'not','':365}, {default:['ck',366,,'elementRestriction','default'],'':367}, [367,651], {not:[0,440,,'elementRestriction','notNull'],null:'not','':0}, [369,405], {'@':[0,394],not:'@',null:'@',default:'@','':0}, {'[':[371,428],'':371}, ['mk',372,'to'], {one:['ck',373,1,'noRepeatedCardinality'],many:'one','':373}, [0,387], {'[':[375,428],'':375}, ['mk',376,'of'], {one:['ck',377,1,'noRepeatedCardinality'],many:'one','':377}, { Id:[0,387], '{':[0,158], }, ['mk',379,'of'], { Id:[380,405], type:[380,397,1], '{':[384,158], }, {not:[381,440,,'elementRestriction','notNull'],null:'not','':381}, {enum:[384,179],'':382}, {'@':[382,778],'':383}, ['g',0,[]], {not:[0,440,,'elementRestriction','notNull'],null:'not','':0}, {not:[0,440],null:'not','':0}, 'typeAssocProperties', [388,39], {'@':[388,778],'':389}, { on:['ck',390], '{':[392,194], '@':[0,394],not:'@',null:'@',default:'@', '':0 }, [391,643], {'@':[391,778],'':0}, {'@':[0,394],not:'@',null:'@',default:'@','':0}, 'typeProperties', { '@':[394,778], not:[394,440,,'elementRestriction','notNull'],null:'not', default:['ck',395,,'elementRestriction','default'], '':0 }, [394,651], 'typeTypeOf', ['mk',398,'type'], ['mk',399,'of'], [400,39], {':':['c',401],'':0}, ['miA',402], {'.':['c',403],'':0}, ['miA',402], 'typeRefOptArgs', [406,39], { ':':['c',407], '(':['c',411], '':0 }, ['miA',408], {'.':['c',409],'':410}, ['miA',408], ['g',0,[]], { Number:['c',412], Id:415, }, {',':['c',413],'':414}, { Number:['c',412], floating:['ck',412],variable:'floating', ')':414, }, ['g',417], {Id:[416,424],'':417}, { ',':['c',415], ')':417, }, ['m',0,')'], 'typeNamedArgsList', ['m',420,'('], {Id:[421,424],'':422}, { ',':['c',420], ')':422, }, ['m',0,')'], 'typeNamedArg', ['mi',425], ['m',426,':'], { Number:['c',0], floating:['ck',0],variable:'floating', }, 'cardinality', ['m',429,'['], { '*':['c',430], Number:['c',432], '':434 }, {',':['c',431],'':434}, [434,436], { ',':['c',433], '..':[434,437], '':434 }, [434,436], ['m',0,']'], 'targetCardinality', { '*':['c',0], Number:['c',437], }, {'..':['c',438],'':0}, { '*':['c',0], Number:['c',0], }, 'nullability', { null:['ck',0], not:['ck',441], }, ['mk',0,'null'], 'queryEOF', [444,453], {';':['c',445],'':445}, ['m',0,'EOF'], 'projectionSpec', ['mk',448,'projection'], ['mk',449,'on'], [450,514], {'{':[451,560],'':451}, {excluding:[0,553],'':0}, 'queryExpression', { '(':['c',454], Id:[456,463], }, [455,453], ['m',456,')'], { intersect:['ck',457,,'precLeft_',4], minus:['ck',457,,'precLeft_',2],except:'minus', union:['ck',458,,'precLeft_',2], '':460 }, {distinct:['ck',459],'':459}, {all:['ck',459],distinct:'all','':459}, [456,453], {limit:['g',461,,'precPost_',0],order:'limit','':0}, [0,623], 'selectQuery', ['mk',464,'select'], { from:['ck',465], all:['ck',475],distinct:'all', Id:475,'#':475,'(':475,'*':475,'+':475,'-':475,':':475,'?':475,'@':475,'{':475,key:475,not:475,case:475,cast:475,null:475,true:475,false:475,Number:475,String:475,exists:475,QuotedLiteral:475, }, [466,483], {mixin:['ck',467],'':472}, ['m',468,'{'], {Id:[469,204],'':470}, { ';':['c',468], '}':470, }, ['m',471,'}'], ['mk',472,'into'], {all:['ck',473],distinct:'all','':473}, {'{':[474,560],'':474}, {excluding:[481,553],'':481}, ['g',476,,,'sqlStyle','inSelectItem'], { '*':['c',477], Id:[477,570],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id','@':'Id','{':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', }, {',':['c',478],'':479}, { '*':['c',477], Id:[477,570],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id','@':'Id','{':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', }, ['mk',480,'from'], [481,483], {group:[0,611],where:'group',having:'group','':0}, 'querySource', [484,488], {',':485,'':0}, {',':['c',486],'':0}, [485,488], 'tableExpression', { '(':[489,501], Id:[490,514], }, ['g',490], { cross:['ck',491], inner:['ck',494], full:['ck',493],left:'full',right:'full', join:['ck',496], '':0 }, ['mk',492,'join'], { '(':[490,501], Id:[490,514], }, {outer:['ck',494],'':494}, {one:[495,508],many:'one',exact:'one','':495}, ['mk',496,'join'], ['g',497], [498,488], ['mk',499,'on'], [490,643], 'tableOrQueryParens', ['m',502,'(',,,'queryOnLeft'], { '(':[503,501], Id:[504,488,,,'table','queryOnLeft'], select:[504,453], }, { full:[504,489,,,'table','queryOnLeft'],join:'full',left:'full',cross:'full',inner:'full',right:'full', limit:[504,456,,'queryOnLeft'],minus:'limit',order:'limit',union:'limit',except:'limit',intersect:'limit', '':504 }, ['m',505,')'], { as:['ck',506,,'queryOnLeft','table'], Id:['ci',0,,'queryOnLeft','tableWithoutAs'], '':0 }, ['mi',0], 'joinCardinality', { exact:['ck',509], one:509, many:['ck',510], }, ['mk',510,'one'], ['mk',511,'to'], { exact:['ck',512], one:512, many:['ck',0], }, ['mk',0,'one'], 'fromRefWithOptAlias', [515,521], {':':['c',516],'':517}, [517,521], { as:['ck',518], Id:['ci',0], '':519 }, ['mi',0], ['g',0,[]], 'fromPath', ['mi',522], {'(':[523,527],'[':'(','':523}, {'.':['c',524,,'notAfterEntityArgOrFilter'],'':0}, ['miA',525], {'(':[523,527],'[':'(','':523}, 'fromArgumentsAndFilter', {'(':['c',528],'':532}, {Id:529}, {Id:[530,534],'':531}, { ',':['c',529], ')':531, }, ['m',532,')'], {'[':[0,538],'':0}, 'fromNamedArgument', ['mi',535], ['m',536,':'], [0,651], 'cardinalityAndFilter', ['m',539,'['], {Number:['c',540,,'beforeColon'],'':541}, ['m',541,':'], [542,544], ['m',0,']'], 'filterClauses', { where:['ck',545], Id:545,'#':545,'(':545,'+':545,'-':545,':':545,'?':545,not:545,case:545,cast:545,null:545,true:545,false:545,Number:545,String:545,exists:545,QuotedLiteral:545, group:['g',546,1],limit:'group',order:'group',having:'group', '':546 }, [546,643], {group:['g',547,,'hide_'],'':548}, [548,617], {having:['ck',549,,'hide_'],'':550}, [550,643], {limit:['g',551,,'hide_'],order:'limit','':0}, [0,623], 'excludingClause', ['mk',554,'excluding'], ['m',555,'{'], {Id:556}, {Id:['ciA',557],'':558}, { ',':['c',556], '}':558, }, ['m',0,'}',,,'afterBrace'], 'selectItemsList', ['m',561,'{',,'top','inSelectItem'], { '*':['c',562], Id:[562,570],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id','@':'Id','{':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', '':563 }, { ',':['c',561], '}':563, }, ['m',0,'}',,,'afterBrace'], 'nestedSelectItemsList', ['m',566,'{',,,'inSelectItem'], { '*':['c',567], Id:[567,570],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id','@':'Id','{':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', '':568 }, { ',':['c',566], '}':568, }, ['m',0,'}',,,'afterBrace'], 'selectItemDef', {'@':[570,781],'':571}, {virtual:['ck',572,1,'modifierRestriction'],'':572}, ['g',573,,,'key','columnExpr'], {key:['ck',574,,'modifierRestriction'],'':574}, { '#':[575,651,1],'(':'#','+':'#','-':'#',':':'#','?':'#',new:'#',not:'#',case:'#',cast:'#',null:'#',true:'#',false:'#',Number:'#',String:'#',exists:'#',QuotedLiteral:'#', Id:[577,645], '{':[588,565], }, { as:['ck',576], Id:['ci',585], '':585 }, ['mi',585], { over:['ck',578], '*':[580,652],'+':'*','-':'*','/':'*','<':'*','=':'*','>':'*','?':'*','!=':'*','<=':'*','<>':'*','==':'*','>=':'*',in:'*',is:'*',or:'*','||':'*',and:'*',not:'*',like:'*',between:'*', as:['ck',582], Id:['ci',585,,,,'nestedExpand'], '.':['c',583], '':585 }, [579,739], {'*':[580,652],'+':'*','-':'*','/':'*','<':'*','=':'*','>':'*','?':'*','!=':'*','<=':'*','<>':'*','==':'*','>=':'*',in:'*',is:'*',or:'*','||':'*',and:'*',not:'*',like:'*',between:'*','':580}, { as:['ck',581], Id:['ci',585], '':585 }, ['mi',585], ['mi',585,,,,'nestedExpand'], { '{':[584,565], '*':['c',0], }, {excluding:[0,553],'':0}, {'{':['g',586,,'nestedExpand'],'':591}, [587,565], {excluding:[591,553],'':591}, {excluding:[589,553],'':589}, ['mk',590,'as'], ['mi',591], ['g',592,,,,'columnExpr'], {'@':[592,784],'':593}, {':':['c',594],'':0}, { type:[608,397,1], localized:['ck',595,1], Id:595, redirected:['ck',596,1], association:['ck',600,1,'columnExpr'], composition:['ck',602,1,'columnExpr'], }, [608,405], ['mk',597,'to'], [598,39], { on:['ck',599], '{':[608,194], '':608 }, [608,643], {'[':[601,428],'':601}, ['mk',604,'to'], {'[':[603,428],'':603}, ['mk',604,'of'], {one:['ck',605,1,'noRepeatedCardinality'],many:'one','':605}, [606,39], ['mk',607,'on'], [608,643], ['g',609], {'@':[609,778],'':0}, 'whereGroupByHaving', {where:['ck',612],'':613}, [613,643], {group:[614,617],'':614}, {having:['ck',615],'':0}, [0,643], 'groupByClause', ['mk',618,'group'], ['mk',619,'by'], [620,651], {',':['c',621],'':0}, [620,651], 'orderByLimitOffset', {order:[624,629],'':624}, {limit:['ck',625],'':0}, [626,651], {offset:['ck',627],'':0}, [0,651], 'orderByClause', ['mk',630,'order'], ['mk',631,'by'], [632,635], {',':['c',633],'':0}, [632,635], 'orderByExpression', [636,651], {asc:['ck',637],desc:'asc','':637}, {nulls:['ck',638],'':0}, {last:['ck',0],first:'last'}, 'conditionEOF', [641,651], ['m',0,'EOF'], 'condition', [0,651], 'valuePath', ['mi',646], {'(':[647,712],'[':'(','':647}, {'.':['c',648,,'isDotForPath'],'':0}, ['miA',649], {'(':[647,712],'[':'(','':647}, 'expression', { '(':[652,679], '#':[662,775],null:'#',true:'#',false:'#',Number:'#',String:'#',QuotedLiteral:'#', ':':['c',653], '?':['c',662,,'hide_'], Id:[655,645], new:[662,691,1], exists:['ck',658], case:[662,694], cast:[662,705], '+':['c',661,,'precRight_',30],'-':'+', not:['ck',661,,'precRight_',8], }, ['g',662], { Id:['ciA',654], Number:['c',662,,'hide_'], }, {'.':[662,647],'':662}, {over:['ck',656],'':657}, [657,739], ['g',662], { '(':['c',659], Id:[662,645], '?':['c',662,,'hide_'], }, [660,453], ['m',662,')'], [662,651], { '*':['c',666,,'precLeft_',24],'/':'*', '+':['c',666,,'precLeft_',22],'-':'+', '||':['c',666,,'precLeft_',20], and:['ck',666,,'precLeft_',4], or:['ck',666,,'precLeft_',2], '?':['c',663,,'precLeft_',0], '<':['c',665,,'precNone_',10],'=':'<','>':'<','!=':'<','<=':'<','<>':'<','>=':'<', '==':['c',666,,'precNone_',10], is:['ck',667,,'precNone_',10], not:['ck',669,,'isNegatedRelation','10'], in:['g',669,,'precNone_',10],like:'in',between:'in', '':0 }, [664,651], ['m',666,':'], {all:['ck',666],any:'all',some:'all','':666}, [677,651], {not:['ck',668],'':668}, ['mk',677,'null'], { between:['ck',670], in:['ck',673], like:['ck',674], }, [671,651], ['mk',672,'and'], [677,651], [677,651], [675,651], {escape:['ck',676],'':677}, [677,651], ['g',662], 'expressionOrQueryParens', ['m',680,'(',,,'queryOnLeft'], { '(':[681,679], Id:[683,651,,,'expr','queryOnLeft'],'#':'Id','+':'Id','-':'Id',':':'Id','?':'Id',not:'Id',case:'Id',cast:'Id',null:'Id',true:'Id',false:'Id',Number:'Id',String:'Id',exists:'Id',QuotedLiteral:'Id', select:[684,453], }, { '*':[682,652,,,'expr','queryOnLeft'],'+':'*','-':'*','/':'*','<':'*','=':'*','>':'*','?':'*','!=':'*','<=':'*','<>':'*','==':'*','>=':'*',in:'*',is:'*',or:'*','||':'*',and:'*',not:'*',like:'*',between:'*', ',':[684,686,,,'expr','queryOnLeft'], limit:[684,456,,'queryOnLeft'],minus:'limit',order:'limit',union:'limit',except:'limit',intersect:'limit', '':684 }, {',':[684,686],'':684}, {',':[684,686],'':684}, ['m',0,')'], 'continueExpressionslist', ['m',687,','], {Id:688,'#':688,'(':688,'+':688,'-':688,':':688,'?':688,not:688,case:688,cast:688,null:688,true:688,false:688,Number:688,String:688,exists:688,QuotedLiteral:688}, {Id:[689,651],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id',not:'Id',case:'Id',cast:'Id',null:'Id',true:'Id',false:'Id',Number:'Id',String:'Id',exists:'Id',QuotedLiteral:'Id','':0}, {',':['c',688],'':0}, 'newAndValuePath', ['mk',692,'new'], [0,645], 'caseExpression', ['mk',695,'case'], {Id:[696,651],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id',not:'Id',case:'Id',cast:'Id',null:'Id',true:'Id',false:'Id',Number:'Id',String:'Id',exists:'Id',QuotedLiteral:'Id','':696}, {when:697}, {when:['ck',698],'':701}, [699,651], ['mk',700,'then'], [697,651], {else:['ck',702],'':703}, [703,651], ['mk',0,'end'], 'castFunction', ['mk',706,'cast'], ['m',707,'('], [708,651], ['mk',709,'as'], [710,405], ['m',0,')'], 'argumentsAndFilter', {'(':['c',713,,,,'prepareSpecialFunction'],'':732}, {Id:['ciA',714,,'isNamedArg'],'':725}, { ':':['c',715], '=>':['c',720], }, [716,651], {',':['c',717],'':731}, { Id:['ciA',718], ')':731, }, ['m',719,':'], [716,651], [721,651], {',':['c',722],'':731}, { Id:['ciA',723], ')':731, }, ['m',724,'=>'], [721,651], {Id:[726,734],'#':'Id','(':'Id','*':'Id','+':'Id','-':'Id',':':'Id','?':'Id',Id_all:'Id',Number:'Id',String:'Id',QuotedLiteral:'Id',DeleteStarFromSet:'Id','':731}, {',':['c',727,,,,'nextFunctionArgument'],'':728}, { Id:[726,734],'#':'Id','(':'Id','*':'Id','+':'Id','-':'Id',':':'Id','?':'Id',not:'Id',case:'Id',cast:'Id',null:'Id',true:'Id',false:'Id',Id_all:'Id',Number:'Id',String:'Id',exists:'Id',QuotedLiteral:'Id',DeleteStarFromSet:'Id', ')':['g',728,1,'atRightParen'],order:')', }, {order:['ck',729],'':731}, ['mk',730,'by'], [731,754], ['m',732,')'], {'[':[0,538],'':0}, 'funcExpression', { ' lookahead':'lGenericIntroOrExpr', Id:[736,651],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', GenericExpr:['ckA',736], GenericIntro:['ckA',735], }, [736,651], { ' lookahead':'lGenericSeparator', GenericSeparator:['ckA',737], '':0 }, { ' lookahead':'lGenericExpr', Id:[736,651],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', GenericExpr:['ckA',736], }, 'overClause', ['m',740,'('], {partition:['ck',741],'':743}, ['mk',742,'by'], [743,750], {order:['ck',744],'':746}, ['mk',745,'by'], [746,754], {rows:['ck',747],'':748}, [748,763], ['m',0,')'], 'expressionsAsXpr', [751,651], {',':['c',752],'':0}, [751,651], 'orderByClauseAsXpr', [755,758], {',':['c',756],'':0}, [755,758], 'orderBySpecAsXpr', [759,651], {asc:['ck',760],desc:'asc','':760}, {nulls:['ck',761],'':0}, {last:['ck',0],first:'last'}, 'windowFrameClause', { unbounded:['ck',764], Number:['c',764], current:['ck',765], between:['ck',766], }, ['mk',0,'preceding'], ['mk',0,'row'], [767,770], ['mk',768,'and'], [0,770], 'windowFrameBoundSpec', { unbounded:['ck',771], Number:['c',771], current:['ck',773], }, { following:['ck',772], preceding:['ck',772], }, ['g',0,[]], ['mk',0,'row'], 'literalValue', { '#':['c',776], null:['ck',0], true:['ck',0],false:'true', Number:['c',0], String:['c',0], QuotedLiteral:['c',0], }, ['miA',0], 'annoAssignStd', ['m',779,'@',,,'annoInSameLine'], { '(':[0,787], Id:[0,792], }, 'annoAssignCol', ['m',782,'@'], { '(':[0,787], Id:[0,792], }, 'annoAssignMid', ['m',785,'@',,,'annoInSameLine'], { '(':[0,787], Id:[0,796], }, 'annoAssignParen', ['m',788,'(',,,'annoInSameLine'], {Id:[789,792],'':790}, { ',':['c',788], ')':790, }, ['m',0,')'], 'annoAssignBase', [793,796], {':':['c',794,,'annoInSameLine'],'':0}, [0,818], 'annoNamePath', ['miA',797], {'.':['c',798],'':800}, { Id:['ciA',797], '@':['c',799], }, ['miA',797], {'#':[0,809,,'annoInSameLine'],'':0}, 'annoPath', { Id:['ciA',804], '@':['c',803], }, ['miA',804], {'.':['c',805],'':807}, { Id:['ciA',804], '@':['c',806], }, ['miA',804], {'#':[0,809],'':0}, 'annoPathVariant', ['m',810,'#'], ['miA',811], {'.':['c',812],'':0}, ['miA',811], 'annoStructValue', [815,802], {':':['c',816],'':0}, [0,818], 'annoValue', { '#':[0,775],null:'#',true:'#',false:'#',Number:'#',String:'#',QuotedLiteral:'#', '+':['c',819],'-':'+', Id:[0,802],'@':'Id', '{':['c',820], '[':['c',824,,,,'arrayAnno'], '(':['c',831], }, ['m',0,'Number'], {Id:[821,814],'@':'Id','':822}, { ',':['c',820], '}':822, Id:['g',820,,'fail'],'@':'Id', }, ['g',823], ['m',0,'}'], { Id:[828,818],'#':'Id','(':'Id','+':'Id','-':'Id','@':'Id','[':'Id','{':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', '...':['c',825,,'arrayAnno','ellipsis'], '':829 }, {up:['ck',826],'':828}, ['mk',827,'to'], [828,818], { ',':['c',824], ']':829, }, ['g',830], ['m',0,']'], [832,643], ['m',0,')'], ] class CdlParser extends AstBuildingParser{ constructor(lexer,...args){super(lexer,keywords,table,...args)} start($,$next){ $.source??=new XsnSource( 'cdl' ) this.rule_(1,$next) { this.afterBrace( null, 'init' ); } for(;;)switch(this.s){ case 1:switch(this.lk()){ case'namespace':this.gc(3,'namespaceRestriction')&&this.namespaceDeclaration({source:$.source},2);continue case'using':this.usingDeclaration({source:$.source},2);continue case'@':case'type':case'view':case'event':case'action':case'aspect':case'define':case'entity':case'extend':case'context':case'service':case'abstract':case'annotate':case'function':case'annotation':if(this.artifactDefOrExtend({outer:$.source},2)){this.namespaceRestriction()}continue; default:this.s=3;continue } case 2:switch(this.l()){ case';':this.c(1);continue case'EOF':this.s=3;continue case'Id':case'@':if(this.ec('afterBrace')&&this.g(1)){ this.noAssignmentInSameLine(); }continue default:this.e();continue } case 3:if(this.m(0,'EOF')){ this.docComment( null ); }continue default:return this.exit_() } } artifactsBlock($,$next){ this.rule_(5,$next) for(;;)switch(this.s){ case 5:if(this.m(6,'{')){this.afterBrace(0,'init'); $.art.artifacts = this.createDict( $.start ); $.art.extensions = []; }continue case 6:switch(this.l()){ case'Id':case'@':this.artifactDefOrExtend({outer:$.art},7);continue default:this.s=8;continue } case 7:switch(this.l()){ case';':this.c(6);continue case'}':this.s=8;continue case'Id':case'@':if(this.ec('afterBrace')&&this.g(6)){ this.noAssignmentInSameLine(); }continue default:this.e();continue } case 8:if(this.m(0,'}')){this.afterBrace(); this.finalizeDictOrArray( $.art.artifacts ); }continue default:return this.exit_() } } artifactDefOrExtend($,$next){ let art=new XsnArtifact() this.rule_(10,$next) { art.location = this.startLocation(); this.docComment( art ); } for(;;)switch(this.s){ case 10:switch(this.l()){ case'@':this.annoAssignStd({art},10);continue default:this.s=11;continue } case 11:switch(this.lk()){ case'define':this.ck(12);continue case'type':case'view':case'event':case'action':case'aspect':case'entity':case'context':case'service':case'abstract':case'function':case'annotation':this.s=12;continue case'extend':if(this.ec('extensionRestriction')&&this.ck(13)){ art.kind = 'extend'; }continue case'annotate':this.ec('extensionRestriction')&&this.ck(14);continue default:this.e();continue } case 12:switch(this.lk()){ case'service':this.serviceDef({art,outer:$.outer},0);continue case'context':this.contextDef({art,outer:$.outer},0);continue case'annotation':this.ec('vocabularyRestriction')&&this.annotationDef({art,outer:$.outer},0);continue case'type':this.typeDef({art,outer:$.outer},0);continue case'aspect':case'abstract':this.aspectDef({art,outer:$.outer},0);continue case'entity':this.entityDef({art,outer:$.outer},0);continue case'view':this.viewDef({art,outer:$.outer},0);continue case'event':this.eventDef({art,outer:$.outer},0);continue case'action':this.actionMainDef({art,outer:$.outer},0);continue case'function':this.functionMainDef({art,outer:$.outer},0);continue default:this.e();continue } case 13:switch(this.lk()){ case'Id':this.extendArtifact({art,outer:$.outer},0);continue case'service':this.lP()&&this.extendService({art,outer:$.outer},0);continue case'context':this.lP()&&this.extendContext({art,outer:$.outer},0);continue case'type':this.lP()&&this.extendType({art,outer:$.outer},0);continue case'aspect':case'entity':this.lP()&&this.extendEntityOrAspect({art,outer:$.outer},0);continue case'projection':this.lP()&&this.extendProjection({art,outer:$.outer},0);continue default:this.ei();continue } case 14:this.annotateArtifact({art,outer:$.outer},0);continue default:return this.exit_() } } namespaceDeclaration($,$next){ let name;let _ this.rule_(16,$next) for(;;)switch(this.s){ case 16:this.mk(17,'namespace');continue case 17:if(this.namePath(_={category:'Namespace'},0)){name=_.name; $.source.namespace ??= { kind: 'namespace', name: name }; }continue default: this.attachLocation( $.source.namespace ) return this.exit_() } } usingDeclaration($,$next){ let decl={ kind: 'using' } this.rule_(19,$next) for(;;)switch(this.s){ case 19:this.mk(20,'using');continue case 20:switch(this.lk()){ case'from':this.ck(21);continue case'Id':this.usingProxy({outer:$.source,proxy:decl},22);continue case'{':this.s=24;{ $.source.usings.push( decl ); }continue default:this.ei();continue } case 21:if(this.m(0,'String')){ $.source.dependencies.push( this.quotedLiteral() ); }continue case 22:switch(this.lk()){ case'from':this.ck(23);continue default:this.gr([';']);continue } case 23:if(this.m(0,'String')){ $.source.dependencies.push( decl.fileDep = this.quotedLiteral() ); }continue case 24:if(this.m(25,'{')){ decl.usings = this.createArray(); }continue case 25:switch(this.l()){ case'Id':this.usingProxy({outer:decl,proxy:{ kind: 'using' }},26);continue default:this.s=27;continue } case 26:switch(this.l()){ case',':this.c(25);continue case'}':this.s=27;continue default:this.e();continue } case 27:if(this.m(28,'}')){this.afterBrace(); this.finalizeDictOrArray( decl.usings ); }continue case 28:switch(this.lk()){ case'from':this.ck(29);continue default:this.gr([';']);continue } case 29:if(this.m(0,'String')){ $.source.dependencies.push( decl.fileDep = this.quotedLiteral() ); }continue default: this.attachLocation( decl ) return this.exit_() } } usingProxy($,$next){ let extern;let _ this.rule_(31,$next) for(;;)switch(this.s){ case 31:if(this.simplePath(_={category:'global'},32)){extern=_.ref; $.proxy.extern = extern; $.outer.usings.push( $.proxy ); }continue case 32:switch(this.lk()){ case'as':this.ck(33);continue default:if(this.gr([])){ this.classifyImplicitName( 'Using' ); }continue } case 33:if(this.mi(0,'UsingAlias')){ $.proxy.name = this.identAst(); }continue default: this.attachLocation( $.proxy ) return this.exit_() } } namePath($,$next){ $.name??=new XsnName() this.rule_(35,$next) for(;;)switch(this.s){ case 35:if(this.mi(36,$.category)){ $.name.path = [ this.identAst() ]; }continue case 36:switch(this.l()){ case'.':this.c(37);continue default:this.gr(['@']);continue } case 37:if(this.miA(36,$.category)){ $.name.path.push( this.identAst() ); }continue default: this.attachLocation( $.name ) return this.exit_() } } simplePath($,$next){ $.ref??={} this.rule_(39,$next) for(;;)switch(this.s){ case 39:if(this.mi(40,$.category)){ $.ref.path = [ this.identAst() ]; }continue case 40:switch(this.l()){ case'.':this.c(41);continue default:this.gr([]);continue } case 41:if(this.miA(40,$.category)){ $.ref.path.push( this.identAst() ); }continue default: this.attachLocation( $.ref ) return this.exit_() } } serviceDef($,$next){ let name;let _ this.rule_(43,$next) for(;;)switch(this.s){ case 43:if(this.mk(44,'service')){this.vocabularyRestriction()}continue; case 44:if(this.namePath(_={category:'Service'},45)){name=_.name; this.addDef( $.art, $.outer, 'artifacts', 'service', name ); this.docComment( $.art ); }continue case 45:switch(this.l()){ case'@':this.annoAssignMid({art:$.art},45);continue default:this.s=46;continue } case 46:switch(this.l()){ case'{':this.artifactsBlock({art:$.art,start:undefined},0);continue default:this.gr([';']);continue } default: this.attachLocation( $.art ) return this.exit_() } } contextDef($,$next){ let name;let _ this.rule_(48,$next) for(;;)switch(this.s){ case 48:if(this.mk(49,'context')){this.vocabularyRestriction()}continue; case 49:if(this.namePath(_={category:'Context'},50)){name=_.name; this.addDef( $.art, $.outer, 'artifacts', 'context', name ); this.docComment( $.art ); }continue case 50:switch(this.l()){ case'@':this.annoAssignMid({art:$.art},50);continue default:this.s=51;continue } case 51:switch(this.l()){ case'{':this.artifactsBlock({art:$.art,start:undefined},0);continue default:this.gr([';']);continue } default: this.attachLocation( $.art ) return this.exit_() } } annotationDef($,$next){ let name;let _ this.rule_(53,$next) for(;;)switch(this.s){ case 53:this.mk(54,'annotation');continue case 54:if(this.namePath(_={category:'AnnoDef'},55)){name=_.name; this.addDef( $.art, $.outer, ($.outer.kind === 'source' ? 'vocabularies' : 'artifacts'), 'annotation', name ); this.docComment( $.art ); }continue case 55:switch(this.l()){ case'@':this.annoAssignMid({art:$.art},55);continue default:this.s=56;continue } case 56:this.typeOrIncludesSpec({art:$.art},0);continue default: this.attachLocation( $.art ) return this.exit_() } } typeDef($,$next){ let name;let _ this.rule_(58,$next) for(;;)switch(this.s){ case 58:this.mk(59,'type');continue case 59:if(this.namePath(_={category:'Type'},60)){name=_.name; this.addDef( $.art, $.outer, 'artifacts', 'type', name ); this.docComment( $.art ); }continue case 60:switch(this.l()){ case'@':this.annoAssignMid({art:$.art},60);continue default:this.s=61;continue } case 61:this.typeOrIncludesSpec({art:$.art},0);continue default: this.attachLocation( $.art ) return this.exit_() } } aspectDef($,$next){ let name;let incl;let _ this.rule_(63,$next) for(;;)switch(this.s){ case 63:switch(this.lk()){ case'aspect':this.ck(65);continue case'abstract':if(this.ck(64)){ this.warning( 'syntax-deprecated-abstract', this.combineLocation( this.lb(), this.la() ) ); }continue default:this.e();continue } case 64:this.mk(65,'entity');continue case 65:if(this.namePath(_={category:'Type'},66)){name=_.name; this.addDef( $.art, $.outer, 'artifacts', 'aspect', name ); this.docComment( $.art ); }continue case 66:switch(this.l()){ case'@':this.annoAssignMid({art:$.art},66);continue default:this.s=67;continue } case 67:switch(this.l()){ case'{':this.elementsBlock({art:$.art},71);continue case':':this.c(68);continue default:this.gr([';']);continue } case 68:switch(this.l()){ case'Id':if(this.simplePath(_={category:'artref'},69)){incl=_.ref; $.art.includes ??= []; $.art.includes.push( incl ); }continue default:this.s=70;continue } case 69:switch(this.l()){ case',':this.c(68);continue case'{':this.s=70;continue default:this.gr([';']);continue } case 70:this.elementsBlock({art:$.art},71);continue case 71:switch(this.lk()){ case'actions':this.actionsBlock({art:$.art},0);continue default:this.gr([';']);continue } default: this.attachLocation( $.art ) return this.exit_() } } entityDef($,$next){ let name;let incl;let query;let _ this.rule_(73,$next) for(;;)switch(this.s){ case 73:this.mk(74,'entity');continue case 74:if(this.namePath(_={category:'Entity'},75)){name=_.name; this.addDef( $.art, $.outer, 'artifacts', 'entity', name ); this.docComment( $.art ); }continue case 75:switch(this.l()){ case'@':this.annoAssignMid({art:$.art},75);continue default:this.s=76;continue } case 76:switch(this.l()){ case'(':this.paramsList({art:$.art},77);continue default:this.s=77;continue } case 77:switch(this.lk()){ case':':if(this.c(78)){ $.art.includes ??= []; }continue case'{':this.s=81;continue case'as':this.ck(82);continue default:this.e();continue } case 78:switch(this.lk()){ case'Id':this.s=79;continue default:this.ei();continue } case 79:switch(this.l()){ case'Id':if(this.simplePath(_={category:'artref'},80)){incl=_.ref; $.art.includes.push( incl ); }continue default:this.s=81;continue } case 80:switch(this.l()){ case',':this.c(79);continue case'{':this.s=81;continue default:this.e();continue } case 81:this.elementsBlock({art:$.art},87);continue case 82:switch(this.lk()){ case'(':case'select':if(this.queryExpression(_={},87)){query=_.expr; $.art.query = query; $.art.$syntax = 'entity'; }continue case'projection':this.s=83;{this.afterBrace(0,'sloppy')}continue; default:this.e();continue } case 83:if(this.projectionSpec(_={},84)){query=_.query; $.art.query = query; $.art.$syntax = 'projection'; }continue case 84:switch(this.lk()){ case'group':case'where':case'having':this.whereGroupByHaving({query},85);continue default:this.s=85;continue } case 85:switch(this.lk()){ case'limit':case'order':this.orderByLimitOffset({query},86);continue default:this.s=86;continue } case 86:this.s=87;{this.afterBrace(0,'normal'); ; }continue case 87:switch(this.lk()){ case'actions':this.actionsBlock({art:$.art},0);continue default:this.gr([';']);continue } default: this.attachLocation( $.art ) return this.exit_() } } viewDef($,$next){ let name;let query;let _ this.rule_(89,$next) for(;;)switch(this.s){ case 89:this.mk(90,'view');continue case 90:if(this.namePath(_={category:'Entity'},91)){name=_.name; this.addDef( $.art, $.outer, 'artifacts', 'entity', name ); this.docComment( $.art ); }continue case 91:switch(this.l()){ case'@':this.annoAssignMid({art:$.art},91);continue default:this.s=92;continue } case 92:switch(this.lk()){ case'(':this.paramsList({art:$.art},98);continue case'with':this.ck(93);continue default:this.s=98;continue } case 93:if(this.mk(94,'parameters')){ $.art.params = this.createDict(); }continue case 94:this.paramDef({outer:$.art},95);continue case 95:switch(this.l()){ case',':this.c(96);continue default:this.s=97;continue } case 96:this.paramDef({outer:$.art},95);continue case 97:this.s=98;{ this.finalizeDictOrArray( $.art.params ); }continue case 98:this.mk(99,'as');continue case 99:if(this.queryExpression(_={},0)){query=_.expr; $.art.query = query; $.art.$syntax = 'view'; }continue default: this.attachLocation( $.art ) return this.exit_() } } eventDef($,$next){ let name;let incl;let query;let _ this.rule_(101,$next) for(;;)switch(this.s){ case 101:this.mk(102,'event');continue case 102:if(this.namePath(_={category:'Event'},103)){name=_.name; this.addDef( $.art, $.outer, 'artifacts', 'event', name ); this.docComment( $.art ); }continue case 103:switch(this.l()){ case'@':this.annoAssignMid({art:$.art},103);continue default:this.s=104;continue } case 104:switch(this.l()){ case'{':this.elementsBlock({art:$.art},0);continue case':':this.c(105);continue default:this.e();continue } case 105:switch(this.lk()){ case'{':this.elementsBlock({art:$.art},0);continue case'Id':if(this.simplePath(_={category:'artref'},106)){incl=_.ref; $.art.type = incl; }continue case'projection':if(this.lP()&&this.projectionSpec(_={},0)){query=_.query; $.art.query = query; $.art.$syntax = 'projection'; }continue default:this.ei();continue } case 106:switch(this.l()){ case',':case'{':this.s=107;{ $.art.includes = [ $.art.type ]; delete $.art.type; }continue default:this.s=111;{ this.docComment( $.art ); }continue } case 107:switch(this.l()){ case',':this.c(108);continue default:this.s=110;continue } case 108:switch(this.l()){ case'Id':if(this.simplePath(_={category:'artref'},109)){incl=_.ref; $.art.includes.push( incl ); }continue default:this.s=110;continue } case 109:switch(this.l()){ case',':this.c(108);continue case'{':this.s=110;continue default:this.e();continue } case 110:this.elementsBlock({art:$.art},0);continue case 111:switch(this.l()){ case'@':this.annoAssignStd({art:$.art},111);continue default:this.gr([';']);continue } default: this.attachLocation( $.art ) return this.exit_() } } actionMainDef($,$next){ let name;let _ this.rule_(113,$next) for(;;)switch(this.s){ case 113:this.mk(114,'action');continue case 114:if(this.namePath(_={category:'Action'},115)){name=_.name; this.addDef( $.art, $.outer, 'artifacts', 'action', name ); this.docComment( $.art ); }continue case 115:switch(this.l()){ case'@':this.annoAssignMid({art:$.art},115);continue default:this.s=116;continue } case 116:this.paramsList({art:$.art},117);continue case 117:switch(this.lk()){ case'returns':this.returnsSpec({outer:$.art},0);continue default:this.gr([';']);continue } default: this.attachLocation( $.art ) return this.exit_() } } functionMainDef($,$next){ let name;let _ this.rule_(119,$next) for(;;)switch(this.s){ case 119:this.mk(120,'function');continue case 120:if(this.namePath(_={category:'Action'},121)){name=_.name; this.addDef( $.art, $.outer, 'artifacts', 'function', name ); this.docComment( $.art ); }continue case 121:switch(this.l()){ case'@':this.annoAssignMid({art:$.art},121);continue default:this.s=122;continue } case 122:this.paramsList({art:$.art},123);continue case 123:this.returnsSpec({outer:$.art},0);continue default: this.attachLocation( $.art ) return this.exit_() } } actionsBlock($,$next){ this.rule_(125,$next) for(;;)switch(this.s){ case 125:if(this.mk(126,'actions')){ $.art.actions = this.createDict(); }continue case 126:this.m(127,'{');continue case 127:switch(this.l()){ case'Id':case'@':this.boundActionFunctionDef({outer:$.art},128);continue default:this.s=129;continue } case 128:switch(this.l()){ case';':this.c(127);continue case'}':this.s=129;continue case'Id':case'@':if(this.ec('afterBrace')&&this.g(127)){ this.noAssignmentInSameLine(); }continue default:this.e();continue } case 129:if(this.m(0,'}')){this.afterBrace(); this.finalizeDictOrArray( $.art.actions ); }continue default:return this.exit_() } } boundActionFunctionDef($,$next){ let art=new XsnArtifact() this.rule_(131,$next) { this.docComment( art ); } for(;;)switch(this.s){ case 131:switch(this.l()){ case'@':this.annoAssignStd({art},131);continue default:this.s=132;continue } case 132:switch(this.lk()){ case'action':this.ck(133);continue case'function':this.ck(137);continue default:this.e();continue } case 133:if(this.mi(134,'BoundAction')){ this.addDef( art, $.outer, 'actions', 'action', this.identAst() ); this.docComment( art ); }continue case 134:switch(this.l()){ case'@':this.annoAssignMid({art},134);continue default:this.s=135;continue } case 135:this.paramsList({art},136);continue case 136:switch(this.lk()){ case'returns':this.returnsSpec({outer:art},0);continue default:this.gr([';']);continue } case 137:if(this.mi(138,'BoundAction')){ this.addDef( art, $.outer, 'actions', 'function', this.identAst() ); this.docComment( art ); }continue case 138:switch(this.l()){ case'@':this.annoAssignMid({art},138);continue default:this.s=139;continue } case 139:this.paramsList({art},140);continue case 140:this.returnsSpec({outer:art},0);continue default: this.attachLocation( art ) return this.exit_() } } paramsList($,$next){ this.rule_(142,$next) for(;;)switch(this.s){ case 142:if(this.m(143,'(')){ $.art.params = this.createDict(); }continue case 143:switch(this.l()){ case'Id':case'@':this.paramDef({outer:$.art},144);continue default:this.s=145;continue } case 144:switch(this.l()){ case',':this.c(143);continue case')':this.s=145;continue default:this.e();continue } case 145:if(this.m(0,')')){ this.finalizeDictOrArray( $.art.params ); }continue default:return this.exit_() } } paramDef($,$next){ let art=new XsnArtifact() this.rule_(147,$next) { this.docComment( art ); } for(;;)switch(this.s){ case 147:switch(this.l()){ case'@':this.annoAssignStd({art},147);continue default:this.s=148;continue } case 148:if(this.miA(149,'Param')){ this.addDef( art, $.outer, 'params', 'param', this.identAst() ); this.docComment( art ); }continue case 149:switch(this.l()){ case'@':this.annoAssignMid({art},149);continue default:this.s=150;continue } case 150:switch(this.l()){ case'{':this.elementsBlock({art},151);continue case':':this.c(152);continue default:this.e();continue } case 151:switch(this.lk()){ case'not':case'null':this.nullability({art},0);continue default:this.gr([',']);continue } case 152:this.typeExpression({art},0);continue default: this.attachLocation( art ) return this.exit_() } } returnsSpec($,$next){ let art=new XsnArtifact() let ret this.rule_(154,$next) for(;;)switch(this.s){ case 154:if(this.mk(155,'returns')){ret=this.lb();this.elementRestriction(0,'default'); art.kind = 'param'; $.outer.returns = art; this.docComment( art ); }continue case 155:switch(this.l()){ case'@':this.annoAssignStd({art},155);continue default:this.s=156;continue } case 156:this.typeExpression({art},0);continue default: this.attachLocation( art ); if (ret) art.location.tokenIndex = ret.location.tokenIndex return this.exit_() } } elementsBlock($,$next){ this.rule_(158,$next) for(;;)switch(this.s){ case 158:if(this.m(159,'{')){ $.art.elements = this.createDict(); }continue case 159:switch(this.l()){ case'Id':case'@':this.elementDef({outer:$.art,art:undefined},160);continue default:this.s=161;continue } case 160:switch(this.l()){ case';':this.c(159);continue case'}':this.s=161;continue case'Id':case'@':if(this.ec('afterBrace')&&this.g(159)){ this.noAssignmentInSameLine(); }continue default:this.e();continue } case 161:if(this.m(0,'}')){this.afterBrace(); this.finalizeDictOrArray( $.art.elements ); }continue default:return this.exit_() } } elementDef($,$next){ let expr;let _ this.rule_(163,$next) { $.art ??= new XsnArtifact(); this.docComment( $.art ); } for(;;)switch(this.s){ case 163:switch(this.l()){ case'@':this.annoAssignStd({art:$.art},163);continue default:this.s=164;continue } case 164:switch(this.lk()){ case'virtual':if(this.ckP(165,['Id','key'])){ $.art.virtual = this.valueWithLocation( true ); }continue default:this.s=165;continue } case 165:switch(this.lk()){ case'key':if(this.ck(166)){ $.art.key = this.valueWithLocation( true ); }continue default:this.s=166;continue } case 166:switch(this.lk()){ case'masked':if(this.ckP(167,['Id'])){ $.art.masked = this.valueWithLocation( true ); this.message( 'syntax-unsupported-masked', this.lb(), { keyword: 'masked' } ); }continue default:this.s=167;continue } case 167:switch(this.lk()){ case'element':if(this.ckP(168,['Id'])){ $.art.$syntax = 'element'; }continue default:this.s=168;continue } case 168:if(this.mi(169,'Element')){this.elementRestriction(0,'elem'); this.addDef( $.art, $.outer, 'elements', 'element', this.identAst() ); this.docComment( $.art ); }continue case 169:switch(this.l()){ case'@':this.annoAssignMid({art:$.art},169);continue default:this.s=170;continue } case 170:switch(this.l()){ case'{':this.elementsBlock({art:$.art},171);continue case':':this.c(172);continue default:this.s=173;continue } case 171:switch(this.lk()){ case'not':case'null':this.nullability({art:$.art},173);continue default:this.s=173;continue } case 172:this.typeExpression({art:$.art},173);continue case 173:switch(this.l()){ case'=':this.gc(0,'elementRestriction','calc')&&this.c(174);continue default:this.gr([';']);continue } case 174:if(this.expression(_={},175)){expr=_.expr; $.art.value = expr; }continue case 175:switch(this.lk()){ case'stored':if(this.ck(176)){ $.art.value.stored = this.valueWithLocation( true ); }continue default:this.s=176;continue } case 176:this.s=177;{ if (!this.elementRestriction( true, 'anno' )) this.docComment( $.art ); }continue case 177:switch(this.l()){ case'@':this.gc(0,'elementRestriction','anno')&&this.annoAssignStd({art:$.art},177);continue default:this.gr([';']);continue } default: this.attachLocation( $.art ) return this.exit_() } } enumSymbolsBlock($,$next){ this.rule_(179,$next) for(;;)switch(this.s){ case 179:if(this.mk(180,'enum')){ $.art.enum = this.createDict(); }continue case 180:this.m(181,'{');continue case 181:switch(this.l()){ case'Id':case'@':this.enumSymbolDef({outer:$.art},182);continue default:this.s=183;continue } case 182:switch(this.l()){ case';':this.c(181);continue case'}':this.s=183;continue default:this.e();continue } case 183:if(this.m(0,'}')){this.afterBrace(); this.finalizeDictOrArray( $.art.enum ); }continue default:return this.exit