UNPKG

@sap/cds-compiler

Version:

CDS (Core Data Services) compiler and backends

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