UNPKG

@sap/cds-compiler

Version:

CDS (Core Data Services) compiler and backends

2,125 lines 138 kB
// Parser generated by redepage v0.3.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, '@':['g',1,,'afterBrace'],type:'@',view:'@',event:'@',using:'@',action:'@',aspect:'@',define:'@',entity:'@',extend:'@',context:'@',service:'@',abstract:'@',annotate:'@',function:'@',namespace:'@',annotation:'@', }, ['m',0,'EOF'], 'artifactsBlock', ['m',6,'{',,'init','afterBrace'], {Id:[7,10],'@':'Id','':8}, { ';':['c',6], '}':8, '@':['g',6,,'afterBrace'],type:'@',view:'@',event:'@',action:'@',aspect:'@',define:'@',entity:'@',extend:'@',context:'@',service:'@',abstract:'@',annotate:'@',function:'@',annotation:'@', }, ['m',0,'}',,,'afterBrace'], 'artifactDefOrExtend', {'@':[10,769],'':11}, { type:12,view:12,event:12,action:12,aspect:12,entity:12,context:12,service:12,abstract:12,function:12,annotation:12, define:['ck',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,775],'':46}, {'{':[0,5],'':0}, 'contextDef', ['mk',49,'context',,,'vocabularyRestriction'], [50,35], {'@':[50,775],'':51}, {'{':[0,5],'':0}, 'annotationDef', ['mk',54,'annotation'], [55,35], {'@':[55,775],'':56}, [0,347], 'typeDef', ['mk',59,'type'], [60,35], {'@':[60,775],'':61}, [0,347], 'aspectDef', { aspect:['ck',65], abstract:['ck',64,,'hide_'], }, ['mk',65,'entity'], [66,35], {'@':[66,775],'':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,775],'':76}, {'(':[77,142],'':77}, { '{':81, ':':['c',78], as:['ck',82], }, {Id:79}, {Id:[80,39],'':81}, { ',':['c',79], '{':81, }, [87,158], { '(':[87,451],select:'(', projection:['g',83,,,'sloppy','afterBrace'], }, [84,445], {group:[85,605],where:'group',having:'group','':85}, {limit:[86,617],order:'limit','':86}, ['g',87,,,'normal','afterBrace'], {actions:[0,125],'':0}, 'viewDef', ['mk',90,'view'], [91,35], {'@':[91,775],'':92}, { '(':[98,142], with:['ck',93,,'hide_'], '':98 }, ['mk',94,'parameters'], [95,147], {',':['c',96],'':97}, [95,147], ['g',98], ['mk',99,'as'], [0,451], 'eventDef', ['mk',102,'event'], [103,35], {'@':[103,775],'':104}, { '{':[0,158], ':':['c',105], }, { '{':[0,158], Id:[106,39], projection:[0,445,1], }, {',':107,'{':107,'':111}, {',':['c',108],'':110}, {Id:[109,39],'':110}, { ',':['c',108], '{':110, }, [0,158], {'@':[111,769],'':0}, 'actionMainDef', ['mk',114,'action'], [115,35], {'@':[115,775],'':116}, [117,142], {returns:[0,154],'':0}, 'functionMainDef', ['mk',120,'function'], [121,35], {'@':[121,775],'':122}, [123,142], [0,154], 'actionsBlock', ['mk',126,'actions'], ['m',127,'{'], {Id:[128,131],'@':'Id','':129}, { ';':['c',127], '}':129, '@':['g',127,,'afterBrace'],action:'@',function:'@', }, ['m',0,'}',,,'afterBrace'], 'boundActionFunctionDef', {'@':[131,769],'':132}, { action:['ck',133], function:['ck',137], }, ['mi',134], {'@':[134,775],'':135}, [136,142], {returns:[0,154],'':0}, ['mi',138], {'@':[138,775],'':139}, [140,142], [0,154], 'paramsList', ['m',143,'('], {Id:[144,147],'@':'Id','':145}, { ',':['c',143], ')':145, }, ['m',0,')'], 'paramDef', {'@':[147,769],'':148}, ['miA',149], {'@':[149,775],'':150}, { '{':[151,158], ':':['c',152], }, {not:[0,438],null:'not','':0}, [0,357], 'returnsSpec', ['mk',155,'returns',,'default','elementRestriction'], {'@':[155,769],'':156}, [0,357], 'elementsBlock', ['m',159,'{'], {Id:[160,163],'@':'Id','':161}, { ';':['c',159], '}':161, Id:['g',159,,'afterBrace'],'@':'Id',key:'Id', }, ['m',0,'}',,,'afterBrace'], 'elementDef', {'@':[163,769],'':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,775],'':170}, { '{':[171,158], ':':['c',172], '':173 }, {not:[173,438],null:'not','':173}, [173,357], {'=':['c',174,,'elementRestriction','calc'],'':0}, [175,639], {stored:['ck',176],'':176}, ['g',177], {'@':[177,769,,'elementRestriction','anno'],'':0}, 'enumSymbolsBlock', ['mk',180,'enum'], ['m',181,'{'], {Id:[182,185],'@':'Id','':183}, { ';':['c',181], '}':183, }, ['m',0,'}',,,'afterBrace'], 'enumSymbolDef', {'@':[185,769],'':186}, ['mi',187], {'@':[187,769],'':188}, {'=':['c',189],'':0}, { String:['c',191], Number:['c',191], '+':['c',190],'-':'+', Id:[191,766,,'hide_'],'#':'Id',QuotedLiteral:'Id', }, ['m',191,'Number'], ['g',192], {'@':[192,769],'':0}, 'foreignKeysBlock', ['m',195,'{'], {Id:[196,199],'@':'Id','':197}, { ',':['c',195], '}':197, }, ['m',0,'}'], 'foreignKeyDef', {'@':[199,769],'':200}, [201,39], {as:['ck',202],'':0}, ['mi',0], 'mixinElementDef', ['mi',205], ['m',206,':'], { association:['ck',207], composition:['ck',209], }, {'[':[208,426],'':208}, ['mk',211,'to'], {'[':[210,426],'':210}, ['mk',211,'of'], {one:['ck',212,1,'noRepeatedCardinality'],many:'one','':212}, [213,39], ['mk',214,'on'], [0,637], 'annotateArtifact', [217,35], { ':':['c',218], with:['ck',223], '':223 }, [219,35], {with:['ck',220],'':220}, ['g',221], {'@':[221,769],'':222}, {'{':[0,321],'':0}, ['g',224], {'@':[224,769],'':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,769],'':235}, { '{':236, elements:['ck',236], enum:[0,179], '(':[0,417], '':0 }, [0,331], {'@':[237,769],'':238}, {'{':[239,331],'':0}, {actions:[0,125],'':0}, {'@':[240,769],'':241}, { Id:[242,39], '{':246, elements:['ck',246,1], actions:[0,125,1], enum:[0,179,1], '(':[0,417], 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,555], [0,5], 'extendService', ['mk',252,'service'], [253,35], {with:['ck',254],'':254}, ['g',255], {'@':[255,769],'':256}, {'{':[0,5],'':0}, 'extendContext', ['mk',259,'context'], [260,35], {with:['ck',261],'':261}, ['g',262], {'@':[262,769],'':263}, {'{':[0,5],'':0}, 'extendType', ['mk',266,'type'], [267,35], {with:['ck',270],'':268}, {'@':[268,769],'':269}, {'{':[0,331],'':0}, {'@':[270,769],'':271}, { Id:[272,39], '{':275, elements:['ck',275,1], enum:[0,179,1], '(':[0,417], '':0 }, {',':['c',273],'':274}, [272,39], {'{':[0,331],'':0}, [0,331], 'extendEntityOrAspect', {aspect:['ck',278],entity:'aspect'}, [279,35], {with:['ck',281],'':280}, {'@':[280,769],'':285}, {'@':[281,769],'':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,769],'':293}, {'{':[294,555],'':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,769],'':303}, ['mi',304], {'@':[304,769],'':305}, {'(':[306,308],'':306}, {returns:[0,317,1],'':0}, 'annotateParamsBlock', ['m',309,'('], {Id:[310,313],'@':'Id','':311}, { ',':['c',309], ')':311, }, ['m',0,')'], 'annotateParam', {'@':[313,769],'':314}, ['mi',315], {'@':[315,769],'':0}, 'annotateReturns', ['mk',318,'returns'], {'@':[318,769],'':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,769],'':327}, ['mi',328], {'@':[328,769],'':329}, {'{':[0,321],'':0}, 'extendElementsBlock', ['m',332,'{'], {Id:[333,336],'@':'Id','':334}, { ';':['c',332], '}':334, Id:['g',332,,'afterBrace'],'@':'Id',key:'Id', }, ['m',0,'}',,,'afterBrace'], 'elementDefOrExtend', {'@':[336,769],'':337}, { Id:[0,163],'@':'Id',key:'Id', extend:['ck',338,1], }, {element:['ck',339,1],'':339}, ['mi',340], {with:['ck',343],'':341}, {'@':[341,769],'':342}, {'{':[0,331],'':0}, {'@':[343,769],'':344}, { '{':345, elements:['ck',345], enum:[0,179], '(':[0,417], '':0 }, [0,331], 'typeOrIncludesSpec', { '{':[348,158], ':':['c',349], }, {not:[0,438],null:'not','':0}, { projection:[0,445,1], '{':[0,357,1],many:'{',type:'{',array:'{',localized:'{',association:'{',composition:'{', Id:[350,39], }, { ',':351,'{':351, '(':[355,404],':':'(', '@':[0,358],not:'@',enum:'@',null:'@',default:'@', '':0 }, {',':['c',352],'':353}, { Id:[351,39], '{':353, }, [354,158], {not:[0,438],null:'not','':0}, {'@':[0,358],not:'@',enum:'@',null:'@',default:'@','':0}, 'typeExpression', { Id:[358,403], type:[358,395,1], localized:['ck',367,1], association:['ck',369,1,,'calc','elementRestriction'], composition:['ck',373,1,,'calc','elementRestriction'], array:['ck',377,1,,'calc','elementRestriction'], many:['ck',378,1,,'calc','elementRestriction'], '{':[383,158,,,'calc','elementRestriction'], }, ['g',359], {'@':[359,769],'':360}, {not:[361,438,,'elementRestriction','notNull'],null:'not','':362}, {'@':[361,769],'':362}, { enum:[363,179,,,'anno','elementRestriction'], '@':[0,392],not:'@',null:'@',default:'@', '':0 }, {not:[364,438,,'elementRestriction','notNull'],null:'not','':364}, {default:['ck',365,,'elementRestriction','default'],'':366}, [366,639], {not:[0,438,,'elementRestriction','notNull'],null:'not','':0}, [368,403], {'@':[0,392],not:'@',null:'@',default:'@','':0}, {'[':[370,426],'':370}, ['mk',371,'to'], {one:['ck',372,1,'noRepeatedCardinality'],many:'one','':372}, [0,385], {'[':[374,426],'':374}, ['mk',375,'of'], {one:['ck',376,1,'noRepeatedCardinality'],many:'one','':376}, { Id:[0,385], '{':[0,158], }, ['mk',378,'of'], { Id:[379,403], type:[379,395,1], '{':[382,158], }, {not:[380,438,,'elementRestriction','notNull'],null:'not','':380}, {enum:[382,179],'':381}, {'@':[381,769],'':0}, {not:[0,438,,'elementRestriction','notNull'],null:'not','':0}, {not:[0,438],null:'not','':0}, 'typeAssocProperties', [386,39], {'@':[386,769],'':387}, { on:['ck',388], '{':[390,194], '@':[0,392],not:'@',null:'@',default:'@', '':0 }, [389,637], {'@':[389,769],'':0}, {'@':[0,392],not:'@',null:'@',default:'@','':0}, 'typeProperties', { '@':[392,769], not:[392,438,,'elementRestriction','notNull'],null:'not', default:['ck',393,,'elementRestriction','default'], '':0 }, [392,639], 'typeTypeOf', ['mk',396,'type'], ['mk',397,'of'], [398,39], {':':['c',399],'':0}, ['miA',400], {'.':['c',401],'':0}, ['miA',400], 'typeRefOptArgs', [404,39], { ':':['c',405], '(':['c',409], '':0 }, ['miA',406], {'.':['c',407],'':408}, ['miA',406], ['g',0], { Number:['c',410], Id:413, }, {',':['c',411],'':412}, { Number:['c',410], floating:['ck',410],variable:'floating', ')':412, }, ['g',415], {Id:[414,422],'':415}, { ',':['c',413], ')':415, }, ['m',0,')'], 'typeNamedArgsList', ['m',418,'('], {Id:[419,422],'':420}, { ',':['c',418], ')':420, }, ['m',0,')'], 'typeNamedArg', ['mi',423], ['m',424,':'], { Number:['c',0], floating:['ck',0],variable:'floating', }, 'cardinality', ['m',427,'['], { '*':['c',428], Number:['c',430], ']':432, }, {',':['c',429],'':432}, [432,434], { ',':['c',431], '..':[432,435], '':432 }, [432,434], ['m',0,']'], 'targetCardinality', { '*':['c',0], Number:['c',435], }, {'..':['c',436],'':0}, { '*':['c',0], Number:['c',0], }, 'nullability', { null:['ck',0], not:['ck',439], }, ['mk',0,'null'], 'queryEOF', [442,451], {';':['c',443],'':443}, ['m',0,'EOF'], 'projectionSpec', ['mk',446,'projection'], ['mk',447,'on'], [448,511], {'{':[449,555],'':449}, {excluding:[0,548],'':0}, 'queryExpression', { '(':['c',452], Id:[454,460,,,,'orderByLimitRestriction'], }, [453,451], ['m',454,')'], { intersect:['ck',455,,'precLeft_',4], minus:['ck',455,,'precLeft_',2],except:'minus', union:['ck',456,,'precLeft_',2], '':458 }, {distinct:['ck',457],'':457}, {all:['ck',457],distinct:'all','':457}, [454,451,,,,'orderByLimitRestriction'], {limit:[0,617,,'orderByLimitRestriction'],order:'limit','':0}, 'selectQuery', ['mk',461,'select'], { from:['ck',462], Id:472,'#':472,'(':472,'*':472,'+':472,'-':472,':':472,'?':472,'@':472,'{':472,key:472,not:472,case:472,cast:472,null:472,true:472,false:472,Number:472,String:472,exists:472,QuotedLiteral:472, all:['ck',472],distinct:'all', }, [463,480], {mixin:['ck',464],'':469}, ['m',465,'{'], {Id:[466,204],'':467}, { ';':['c',465], '}':467, }, ['m',468,'}'], ['mk',469,'into'], {all:['ck',470],distinct:'all','':470}, {'{':[471,555],'':471}, {excluding:[478,548],'':478}, ['g',473,,,'sqlStyle','inSelectItem'], { '*':['c',474], Id:[474,565],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id','@':'Id','{':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', }, {',':['c',475],'':476}, { '*':['c',474], Id:[474,565],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id','@':'Id','{':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', }, ['mk',477,'from'], [478,480], {group:[0,605],where:'group',having:'group','':0}, 'querySource', [481,485], {',':482,'':0}, {',':['c',483],'':0}, [482,485], 'tableExpression', { '(':[486,498], Id:[487,511], }, ['g',487], { cross:['ck',488], inner:['ck',491], full:['ck',490],left:'full',right:'full', join:['ck',493], '':0 }, ['mk',489,'join'], { '(':[487,498], Id:[487,511], }, {outer:['ck',491],'':491}, {one:[492,505],many:'one',exact:'one','':492}, ['mk',493,'join'], ['g',494], [495,485], ['mk',496,'on'], [487,637], 'tableOrQueryParens', ['m',499,'(',,,'queryOnLeft'], { '(':[500,498], Id:[501,485,,,'table','queryOnLeft'], select:[501,451], }, { full:[501,486,,,'table','queryOnLeft'],join:'full',left:'full',cross:'full',inner:'full',right:'full', limit:[501,454,,'queryOnLeft'],minus:'limit',order:'limit',union:'limit',except:'limit',intersect:'limit', '':501 }, ['m',502,')'], { as:['ck',503,,'queryOnLeft','table'], Id:['ci',0,,'queryOnLeftSloppyAlias'], '':0 }, ['mi',0], 'joinCardinality', { one:506, exact:['ck',506], many:['ck',507], }, ['mk',507,'one'], ['mk',508,'to'], { one:509, exact:['ck',509], many:['ck',0], }, ['mk',0,'one'], 'fromRefWithOptAlias', [512,518], {':':['c',513],'':514}, [514,518], { as:['ck',515], Id:['ci',0,,'isNoKeywordInRuleFollow'], '':516 }, ['mi',0], ['g',0], 'fromPath', ['mi',519], {'(':[520,524],'[':'(','':520}, {'.':['c',521,,'notAfterEntityArgOrFilter'],'':0}, ['miA',522], {'(':[520,524],'[':'(','':520}, 'fromArgumentsAndFilter', {'(':['c',525],'':529}, {Id:526}, {Id:[527,531],'':528}, { ',':['c',526], ')':528, }, ['m',529,')'], {'[':[0,535],'':0}, 'fromNamedArgument', ['mi',532], ['m',533,':'], [0,639], 'cardinalityAndFilter', ['m',536,'['], {Number:['c',537,,'beforeColon'],'':538}, ['m',538,':'], { group:['g',540,1],limit:'group',order:'group',having:'group', where:['ck',539], ']':['c',0], '':539 }, [540,637], {group:['g',541,,'hide_'],'':542}, [542,611], {having:['ck',543,,'hide_'],'':544}, [544,637], {Id:['g',545,,'hide_'],'':546}, [546,617], ['m',0,']'], 'excludingClause', ['mk',549,'excluding'], ['m',550,'{'], {Id:551}, {Id:['ciA',552],'':553}, { ',':['c',551], '}':553, }, ['m',0,'}',,,'afterBrace'], 'selectItemsList', ['m',556,'{',,'top','inSelectItem'], { '*':['c',557], Id:[557,565],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id','@':'Id','{':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', '':558 }, { ',':['c',556], '}':558, }, ['m',0,'}',,,'afterBrace'], 'nestedSelectItemsList', ['m',561,'{',,,'inSelectItem'], { '*':['c',562], Id:[562,565],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id','@':'Id','{':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', '':563 }, { ',':['c',561], '}':563, }, ['m',0,'}',,,'afterBrace'], 'selectItemDef', {'@':[565,772],'':566}, {virtual:['ck',567,1,'modifierRestriction'],'':567}, ['g',568,,,'key','columnExpr'], {key:['ck',569,,'modifierRestriction'],'':569}, { '#':[570,639,1],'(':'#','+':'#','-':'#',':':'#','?':'#',new:'#',not:'#',case:'#',cast:'#',null:'#',true:'#',false:'#',Number:'#',String:'#',exists:'#',QuotedLiteral:'#', Id:[572,668], '{':[583,560], }, { as:['ck',571], Id:['ci',580,,'hide_'], '':580 }, ['mi',580], { over:['ck',573], '*':[575,640],'+':'*','-':'*','/':'*','<':'*','=':'*','>':'*','?':'*','!=':'*','<=':'*','<>':'*','==':'*','>=':'*',in:'*',is:'*',or:'*','||':'*',and:'*',not:'*',like:'*',between:'*', as:['ck',577], Id:['ci',580,,'hide_',,'nestedExpand'], '.':['c',578], '':580 }, [574,730], {'*':[575,640],'+':'*','-':'*','/':'*','<':'*','=':'*','>':'*','?':'*','!=':'*','<=':'*','<>':'*','==':'*','>=':'*',in:'*',is:'*',or:'*','||':'*',and:'*',not:'*',like:'*',between:'*','':575}, { as:['ck',576], Id:['ci',580,,'hide_'], '':580 }, ['mi',580], ['mi',580,,,,'nestedExpand'], { '{':[579,560], '*':['c',0], }, {excluding:[0,548],'':0}, {'{':['g',581,,'nestedExpand'],'':586}, [582,560], {excluding:[586,548],'':586}, {excluding:[584,548],'':584}, ['mk',585,'as'], ['mi',586], ['g',587,,,,'columnExpr'], {'@':[587,775],'':588}, {':':['c',589],'':0}, { Id:[602,357],'{':'Id', redirected:['ck',590,1], association:['ck',594,1,'columnExpr'], composition:['ck',596,1,'columnExpr'], }, ['mk',591,'to'], [592,39], { on:['ck',593], '{':[602,194], '':602 }, [602,637], {'[':[595,426],'':595}, ['mk',598,'to'], {'[':[597,426],'':597}, ['mk',598,'of'], {one:['ck',599,1,'noRepeatedCardinality'],many:'one','':599}, [600,39], ['mk',601,'on'], [602,637], ['g',603], {'@':[603,769],'':0}, 'whereGroupByHaving', {where:['ck',606],'':607}, [607,637], {group:[608,611],'':608}, {having:['ck',609],'':0}, [0,637], 'groupByClause', ['mk',612,'group'], ['mk',613,'by'], [614,639], {',':['c',615],'':0}, [614,639], 'orderByLimitOffset', {order:[618,623],'':618}, {limit:['ck',619],'':0}, [620,639], {offset:['ck',621],'':0}, [0,639], 'orderByClause', ['mk',624,'order'], ['mk',625,'by'], [626,629], {',':['c',627],'':0}, [626,629], 'orderByExpression', [630,639], {asc:['ck',631],desc:'asc','':631}, {nulls:['ck',632],'':0}, {last:['ck',0],first:'last'}, 'conditionEOF', [635,639], ['m',0,'EOF'], 'condition', [0,639], 'expression', { '(':[640,674], '#':[651,766],null:'#',true:'#',false:'#',Number:'#',String:'#',QuotedLiteral:'#', ':':['c',641], '?':['c',651,,'hide_'], Id:[643,668], new:['ck',646,1], exists:['ck',647], case:[651,686], cast:[651,697], '+':['c',650,,'precRight_',30],'-':'+', not:['ck',650,,'precRight_',8], }, ['g',651], { Id:['ciA',642], Number:['c',651,,'hide_'], }, {'.':[651,670],'':651}, {over:['ck',644],'':645}, [645,730], ['g',651], [651,668], { '(':['c',648], Id:[651,668], '?':['c',651,,'hide_'], }, [649,451], ['m',651,')'], [651,639], { '*':['c',655,,'precLeft_',24],'/':'*', '+':['c',655,,'precLeft_',22],'-':'+', '||':['c',655,,'precLeft_',20], and:['ck',655,,'precLeft_',4], or:['ck',655,,'precLeft_',2], '?':['c',652,,'precRight_',0], '<':['c',654,,'precNone_',10],'=':'<','>':'<','!=':'<','<=':'<','<>':'<','>=':'<', '==':['c',655,,'precNone_',10], is:['ck',656,,'precNone_',10], not:['ck',658,,'isNegatedRelation',10], in:['g',658,,'precNone_',10],like:'in',between:'in', '':0 }, [653,639], ['m',655,':'], {all:['ck',655],any:'all',some:'all','':655}, [666,639], {not:['ck',657],'':657}, ['mk',666,'null'], { between:['ck',659], in:['ck',662], like:['ck',663], }, [660,639], ['mk',661,'and'], [666,639], [666,639], [664,639], {escape:['ck',665],'':666}, [666,639], ['g',651], 'valuePath', ['mi',669], {'(':[670,704],'[':'(','':670}, {'.':['c',671,,'isDotForPath'],'':0}, ['miA',672], {'(':[670,704],'[':'(','':670}, 'expressionOrQueryParens', ['m',675,'(',,,'queryOnLeft'], { '(':[676,674], Id:[678,639,,,'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:[679,451], }, { '*':[677,640,,,'expr','queryOnLeft'],'+':'*','-':'*','/':'*','<':'*','=':'*','>':'*','?':'*','!=':'*','<=':'*','<>':'*','==':'*','>=':'*',in:'*',is:'*',or:'*','||':'*',and:'*',not:'*',like:'*',between:'*', ',':[679,681,,,'expr','queryOnLeft'], limit:[679,454,,'queryOnLeft'],minus:'limit',order:'limit',union:'limit',except:'limit',intersect:'limit', '':679 }, {',':[679,681],'':679}, {',':[679,681],'':679}, ['m',0,')'], 'continueExpressionslist', ['m',682,','], {Id:683,'#':683,'(':683,'+':683,'-':683,':':683,'?':683,not:683,case:683,cast:683,null:683,true:683,false:683,Number:683,String:683,exists:683,QuotedLiteral:683}, {Id:[684,639],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id','':0}, {',':['c',683],'':0}, 'caseExpression', ['mk',687,'case'], {Id:[688,639],'#':'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','':688}, {when:689}, {when:['ck',690],'':693}, [691,639], ['mk',692,'then'], [689,639], {else:['ck',694],'':695}, [695,639], ['mk',0,'end'], 'castFunction', ['mk',698,'cast'], ['m',699,'('], [700,639], ['mk',701,'as'], [702,403], ['m',0,')'], 'argumentsAndFilter', {'(':['c',705,,,,'prepareSpecialFunction'],'':723}, { ')':722, Id:['ciA',706,,'isNamedArg'], '':715 }, { ':':['c',707], '=>':['c',711], }, [708,639], { ',':['c',709], ')':722, }, { Id:['ciA',710], ')':722, }, ['m',707,':'], [712,639], { ',':['c',713], ')':722, }, { Id:['ciA',714], ')':722, }, ['m',711,'=>'], [716,725], {',':['c',717,,,,'nextFunctionArgument'],'':719}, {')':['c',718],'':715}, {'[':[0,535],'':0}, {order:['ck',720],'':722}, ['mk',721,'by'], [722,745], ['m',723,')'], {'[':[0,535],'':0}, 'funcExpression', { ' lookahead':'lGenericIntroOrExpr', Id:[727,639],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', GenericExpr:['ckA',727], GenericIntro:['ckA',726], }, [727,639], { ' lookahead':'lGenericSeparator', GenericSeparator:['ckA',728], '':0 }, { ' lookahead':'lGenericExpr', Id:[727,639],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', GenericExpr:['ckA',727], }, 'overClause', ['m',731,'('], {partition:['ck',732],'':734}, ['mk',733,'by'], [734,741], {order:['ck',735],'':737}, ['mk',736,'by'], [737,745], {rows:['ck',738],'':739}, [739,754], ['m',0,')'], 'expressionsAsXpr', [742,639], {',':['c',743],'':0}, [742,639], 'orderByClauseAsXpr', [746,749], {',':['c',747],'':0}, [746,749], 'orderBySpecAsXpr', [750,639], {asc:['ck',751],desc:'asc','':751}, {nulls:['ck',752],'':0}, {last:['ck',0],first:'last'}, 'windowFrameClause', { unbounded:['ck',755], Number:['c',755], current:['ck',756], between:['ck',757], }, ['mk',0,'preceding'], ['mk',0,'row'], [758,761], ['mk',759,'and'], [0,761], 'windowFrameBoundSpec', { unbounded:['ck',762], Number:['c',762], current:['ck',764], }, { following:['ck',763], preceding:['ck',763], }, ['g',0], ['mk',0,'row'], 'literalValue', { '#':['c',767], null:['ck',0], true:['ck',0],false:'true', Number:['c',0], String:['c',0], QuotedLiteral:['c',0], }, ['miA',0], 'annoAssignStd', ['m',770,'@',,,'annoInSameLine'], { '(':[0,778], Id:[0,783], }, 'annoAssignCol', ['m',773,'@'], { '(':[0,778], Id:[0,783], }, 'annoAssignMid', ['m',776,'@',,,'annoInSameLine'], { '(':[0,778], Id:[0,787], }, 'annoAssignParen', ['m',779,'(',,,'annoInSameLine'], {Id:[780,783],'':781}, { ',':['c',779], ')':781, }, ['m',0,')'], 'annoAssignBase', [784,787], {':':['c',785,,'annoInSameLine'],'':0}, [0,809], 'annoNamePath', ['miA',788], {'.':['c',789],'':791}, { Id:['ciA',788], '@':['c',790], }, ['miA',788], {'#':[0,800,,'annoInSameLine'],'':0}, 'annoPath', { Id:['ciA',795], '@':['c',794], }, ['miA',795], {'.':['c',796],'':798}, { Id:['ciA',795], '@':['c',797], }, ['miA',795], {'#':[0,800],'':0}, 'annoPathVariant', ['m',801,'#'], ['miA',802], {'.':['c',803],'':0}, ['miA',802], 'annoStructValue', [806,793], {':':['c',807],'':0}, [0,809], 'annoValue', { '#':[0,766],null:'#',true:'#',false:'#',Number:'#',String:'#',QuotedLiteral:'#', '+':['c',810],'-':'+', Id:[0,793],'@':'Id', '{':['c',811], '[':['c',814,,,,'arrayAnno'], '(':['c',820], }, ['m',0,'Number'], {Id:[812,805],'@':'Id','':813}, { ',':['c',811], '}':813, Id:['g',811,,'fail'],'@':'Id', }, ['m',0,'}','arrayAnno','orNotEmpty'], { Id:[818,809],'#':'Id','(':'Id','+':'Id','-':'Id','@':'Id','[':'Id','{':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', '...':['c',815,,'arrayAnno','ellipsis'], '':819 }, { up:['ck',816], ',':818,']':818, }, ['mk',817,'to'], [818,809], { ',':['c',814], ']':819, }, ['m',0,']','arrayAnno','bracket'], {')':['c',0,,'fail'],'':821}, [822,637], ['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( '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.lk()){ case';':this.c(1);continue case'EOF':this.s=3;continue case'@':case'type':case'view':case'event':case'using':case'action':case'aspect':case'define':case'entity':case'extend':case'context':case'service':case'abstract':case'annotate':case'function':case'namespace':case'annotation':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('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.lk()){ case';':this.c(6);continue case'}':this.s=8;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.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'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'define':this.ck(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'{':this.s=81;continue case':':if(this.c(78)){ $.art.includes ??= []; }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('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('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.lk()){ case';':this.c(127);continue case'}':this.s=129;continue case'@':case'action':case'function':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('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.lk()){ case';':this.c(159);continue case'}':this.s=161;continue case'Id':case'@':case'key':if(this.ec('afterBrace')&&this.g(159)){ this.noAssignmentInSameLine(); }continue default:this.ei();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('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 ) if (!$.art.name) this.addDef( $.art, $.outer, 'elements', 'element' ) 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