UNPKG

@sap/cds-compiler

Version:

CDS (Core Data Services) compiler and backends

2,124 lines 140 kB
// Parser generated by redepage v0.4.0 'use strict;' const { XsnSource, XsnArtifact, XsnName } = require( '../compiler/xsn-model' ) const { isValidEnumValue } = require( '../compiler/base' ) 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,784],'':11}, { type:12,view:'type',event:'type',action:'type',aspect:'type',entity:'type',context:'type',service:'type',abstract:'type',function:'type',annotation:'type', 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,250,[]], context:[0,257,[],'hide_'], type:[0,264,[],'hide_'], aspect:[0,276,[],'hide_'],entity:'aspect', projection:[0,287,[],'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}, ['my',36], 'simplePath', ['mi',40], {'.':['c',41],'':0}, ['my',40], 'serviceDef', ['mk',44,'service',,,'vocabularyRestriction'], [45,35], {'@':[45,790],'':46}, {'{':[0,5],'':0}, 'contextDef', ['mk',49,'context',,,'vocabularyRestriction'], [50,35], {'@':[50,790],'':51}, {'{':[0,5],'':0}, 'annotationDef', ['mk',54,'annotation'], [55,35], {'@':[55,790],'':56}, [0,359], 'typeDef', ['mk',59,'type'], [60,35], {'@':[60,790],'':61}, [0,359], 'aspectDef', { aspect:['ck',65], abstract:['ck',64,,'hide_'], }, ['mk',65,'entity'], [66,35], {'@':[66,790],'':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,790],'':76}, {'(':[77,142],'':77}, { '{':81, ':':['c',78], as:['ck',82], }, {Id:79}, {Id:[80,39],'':81}, { ',':['c',79], '{':81, }, [87,158], { '(':[87,463],select:'(', projection:['g',83,,,'sloppy','afterBrace'], }, [84,457], {group:[85,621],where:'group',having:'group','':85}, {limit:[86,633],order:'limit','':86}, ['g',87,,,'normal','afterBrace'], {actions:[0,125],'':0}, 'viewDef', ['mk',90,'view'], [91,35], {'@':[91,790],'':92}, { '(':[98,142], with:['ck',93,,'hide_'], '':98 }, ['mk',94,'parameters'], [95,147], {',':['c',96],'':97}, [95,147], ['g',98], ['mk',99,'as'], [0,463], 'eventDef', ['mk',102,'event'], [103,35], {'@':[103,790],'':104}, { '{':[0,158], ':':['c',105], }, { '{':[0,158], Id:[106,39], projection:[0,457,[]], }, {',':107,'{':',','':111}, {',':['c',108],'':110}, {Id:[109,39],'':110}, { ',':['c',108], '{':110, }, [0,158], {'@':[111,784],'':0}, 'actionMainDef', ['mk',114,'action'], [115,35], {'@':[115,790],'':116}, [117,142], {returns:[0,154],'':0}, 'functionMainDef', ['mk',120,'function'], [121,35], {'@':[121,790],'':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,784],'':132}, { action:['ck',133], function:['ck',137], }, ['mi',134], {'@':[134,790],'':135}, [136,142], {returns:[0,154],'':0}, ['mi',138], {'@':[138,790],'':139}, [140,142], [0,154], 'paramsList', ['m',143,'('], {Id:[144,147],'@':'Id','':145}, { ',':['c',143], ')':145, }, ['m',0,')'], 'paramDef', {'@':[147,784],'':148}, ['my',149], {'@':[149,790],'':150}, { '{':[151,158], ':':['c',152], }, {not:[0,450],null:'not','':0}, [0,369], 'returnsSpec', ['mk',155,'returns',,'default','elementRestriction'], {'@':[155,784],'':156}, [0,369], 'elementsBlock', ['m',159,'{'], {Id:[160,163],'@':'Id','':161}, { ';':['c',159], '}':161, Id:['g',159,,'afterBrace'],'@':'Id',key:'Id', }, ['m',0,'}',,,'afterBrace'], 'elementDef', {'@':[163,784],'':164}, {virtual:['ck',165,['Id','key']],'':165}, {key:['ck',166],'':166}, {masked:['ck',167,['Id'],'hide_'],'':167}, {element:['ck',168,['Id'],'hide_'],'':168}, ['mi',169,,,'elem','elementRestriction'], {'@':[169,790],'':170}, { '{':[171,158], ':':['c',172], '':173 }, {not:[173,450],null:'not','':173}, [173,369], {'=':['c',174,,'elementRestriction','calc'],'':0}, [175,655], {stored:['ck',176],'':176}, ['g',177], {'@':[177,784,,'elementRestriction','anno'],'':0}, 'enumSymbolsBlock', ['mk',180,'enum'], ['m',181,'{'], {Id:[182,185],'@':'Id','':183}, { ';':['c',181], '}':183, }, ['m',0,'}',,,'afterBrace'], 'enumSymbolDef', {'@':[185,784],'':186}, ['mi',187], {'@':[187,784],'':188}, {'=':['c',189],'':0}, { String:['c',191], Number:['c',191], '+':['c',190],'-':'+', Id:[191,781,,'hide_'],'#':'Id',QuotedLiteral:'Id', }, ['m',191,'Number'], ['g',192], {'@':[192,784],'':0}, 'foreignKeysBlock', ['m',195,'{'], {Id:[196,199],'@':'Id','':197}, { ',':['c',195], '}':197, }, ['m',0,'}'], 'foreignKeyDef', {'@':[199,784],'':200}, [201,39], {as:['ck',202],'':0}, ['mi',0], 'mixinElementDef', ['mi',205], ['m',206,':'], { association:['ck',207], composition:['ck',209], }, {'[':[208,438],'':208}, ['mk',211,'to'], {'[':[210,438],'':210}, ['mk',211,'of'], {one:['ck',212,['Id'],'noRepeatedCardinality'],many:'one','':212}, [213,39], ['mk',214,'on'], [0,653], 'annotateArtifact', [217,35], { ':':['c',218], with:['ck',223], '':223 }, [219,35], {with:['ck',220],'':220}, ['g',221], {'@':[221,784],'':222}, {'{':[0,320],'':0}, ['g',224], {'@':[224,784],'':225}, {'(':[226,307],'':226}, { returns:[0,316], '{':[227,320], '':227 }, {actions:[0,295],'':0}, 'extendArtifact', [230,35], { ':':['c',231], with:['ck',240], '':237 }, [232,35], {with:['ck',233],'':233}, ['g',234], {'@':[234,784],'':235}, { '{':236, elements:['ck',236], enum:[0,346], '(':[0,429], '':0 }, [0,330], {'@':[237,784],'':238}, {'{':[239,330],'':0}, {actions:[0,125],'':0}, {'@':[240,784],'':241}, { Id:[242,39], '{':246, elements:['ck',246,['{']], actions:[0,125,[]], enum:[0,346,[]], '(':[0,429], group:[0,616,[]],limit:'group',order:'group',where:'group',having:'group',columns:'group', definitions:['ck',248,['{']], '':0 }, {',':['c',243],'':244}, [242,39], {'{':[245,330],'':245}, {actions:[0,125],'':0}, [247,330], {actions:[0,125],'':0}, [0,5], 'extendService', ['mk',251,'service'], [252,35], {with:['ck',253],'':253}, ['g',254], {'@':[254,784],'':255}, {'{':[0,5],'':0}, 'extendContext', ['mk',258,'context'], [259,35], {with:['ck',260],'':260}, ['g',261], {'@':[261,784],'':262}, {'{':[0,5],'':0}, 'extendType', ['mk',265,'type'], [266,35], {with:['ck',269],'':267}, {'@':[267,784],'':268}, {'{':[0,330],'':0}, {'@':[269,784],'':270}, { Id:[271,39], '{':274, elements:['ck',274,['{']], enum:[0,179,[]], '(':[0,429], '':0 }, {',':['c',272],'':273}, [271,39], {'{':[0,330],'':0}, [0,330], 'extendEntityOrAspect', {aspect:['ck',277],entity:'aspect'}, [278,35], {with:['ck',280],'':279}, {'@':[279,784],'':284}, {'@':[280,784],'':281}, {Id:[282,39],'':['g',284,[]],actions:''}, {',':['c',283],'':284}, [282,39], {'{':[285,330],'':285}, {actions:[0,125],'':0}, 'extendProjection', ['mk',288,'projection'], [289,35], {with:['ck',290],'':290}, ['g',291], {'@':[291,784],'':292}, {'{':[293,566],'':293}, {actions:[0,125],'':0}, 'annotateActionsBlock', ['mk',296,'actions'], ['m',297,'{'], {Id:[298,301],'@':'Id','':299}, { ';':['c',297], '}':299, Id:['g',297,,'afterBrace'],'@':'Id', }, ['m',0,'}',,,'afterBrace'], 'annotateBoundAction', {'@':[301,784],'':302}, ['mi',303], {'@':[303,784],'':304}, {'(':[305,307],'':305}, {returns:[0,316],'':0}, 'annotateParamsBlock', ['m',308,'('], {Id:[309,312],'@':'Id','':310}, { ',':['c',308], ')':310, }, ['m',0,')'], 'annotateParam', {'@':[312,784],'':313}, ['mi',314], {'@':[314,784],'':0}, 'annotateReturns', ['mk',317,'returns'], {'@':[317,784],'':318}, {'{':[0,320],'':0}, 'annotateElementsBlock', ['m',321,'{'], {Id:[322,325],'@':'Id','':323}, { ';':['c',321], '}':323, Id:['g',321,,'afterBrace'],'@':'Id', }, ['m',0,'}',,,'afterBrace'], 'annotateElement', {'@':[325,784],'':326}, ['mi',327], {'@':[327,784],'':328}, {'{':[0,320],'':0}, 'extendElementsBlock', ['m',331,'{'], {Id:[332,335],'@':'Id','':333}, { ';':['c',331], '}':333, Id:['g',331,,'afterBrace'],'@':'Id',key:'Id', }, ['m',0,'}',,,'afterBrace'], 'elementDefOrExtend', {'@':[335,784],'':336}, { Id:[0,163],'@':'Id',key:'Id', extend:['ck',337,['Id']], }, {element:['ck',338,['Id']],'':338}, ['mi',339], {with:['ck',342],'':340}, {'@':[340,784],'':341}, {'{':[0,330],'':0}, {'@':[342,784],'':343}, { '{':344, elements:['ck',344], enum:[0,346], '(':[0,429], '':0 }, [0,330], 'extendEnumSymbolsBlock', ['mk',347,'enum'], ['m',348,'{'], {Id:[349,352],'@':'Id','':350}, { ';':['c',348], '}':350, }, ['m',0,'}',,,'afterBrace'], 'enumSymbolDefOrExtend', {'@':[352,784],'':353}, { Id:[0,185],'@':'Id', extend:['ck',354,['Id']], }, ['mi',355], {with:['ck',356],'':356}, ['g',357], {'@':[357,784],'':0}, 'typeOrIncludesSpec', { '{':[360,158], ':':['c',361], }, {not:[0,450],null:'not','':0}, { projection:[0,457,[]], '{':[0,369,[]],many:'{',type:'{',array:'{',localized:'{',association:'{',composition:'{', Id:[362,39], }, { ',':363,'{':',', '(':[367,416],':':'(', '@':[0,370],not:'@',enum:'@',null:'@',default:'@', '':0 }, {',':['c',364],'':365}, { Id:[363,39], '{':365, }, [366,158], {not:[0,450],null:'not','':0}, {'@':[0,370],not:'@',enum:'@',null:'@',default:'@','':0}, 'typeExpression', { Id:[370,415], type:[370,407,[]], localized:['ck',379,['Id']], association:['ck',381,['[','to'],,'calc','elementRestriction'], composition:['ck',385,['[','of'],,'calc','elementRestriction'], array:['ck',389,['of'],,'calc','elementRestriction'], many:['ck',390,['Id','{'],,'calc','elementRestriction'], '{':[395,158,,,'calc','elementRestriction'], }, ['g',371], {'@':[371,784],'':372}, {not:[373,450,,'elementRestriction','notNull'],null:'not','':374}, {'@':[373,784],'':374}, { enum:[375,179,,,'anno','elementRestriction'], '@':[0,404],not:'@',null:'@',default:'@', '':0 }, {not:[376,450,,'elementRestriction','notNull'],null:'not','':376}, {default:['ck',377,,'elementRestriction','default'],'':378}, [378,655], {not:[0,450,,'elementRestriction','notNull'],null:'not','':0}, [380,415], {'@':[0,404],not:'@',null:'@',default:'@','':0}, {'[':[382,438],'':382}, ['mk',383,'to'], {one:['ck',384,['Id'],'noRepeatedCardinality'],many:'one','':384}, [0,397], {'[':[386,438],'':386}, ['mk',387,'of'], {one:['ck',388,['Id','{'],'noRepeatedCardinality'],many:'one','':388}, { Id:[0,397], '{':[0,158], }, ['mk',390,'of'], { Id:[391,415], type:[391,407,[]], '{':[394,158], }, {not:[392,450,,'elementRestriction','notNull'],null:'not','':392}, {enum:[394,179],'':393}, {'@':[393,784],'':0}, {not:[0,450,,'elementRestriction','notNull'],null:'not','':0}, {not:[0,450],null:'not','':0}, 'typeAssocProperties', [398,39], {'@':[398,784],'':399}, { on:['ck',400], '{':[402,194], '@':[0,404],not:'@',null:'@',default:'@', '':0 }, [401,653], {'@':[401,784],'':0}, {'@':[0,404],not:'@',null:'@',default:'@','':0}, 'typeProperties', { '@':[404,784], not:[404,450,,'elementRestriction','notNull'],null:'not', default:['ck',405,,'elementRestriction','default'], '':0 }, [404,655], 'typeTypeOf', ['mk',408,'type'], ['mk',409,'of'], [410,39], {':':['c',411],'':0}, ['my',412], {'.':['c',413],'':0}, ['my',412], 'typeRefOptArgs', [416,39], { ':':['c',417], '(':['c',421], '':0 }, ['my',418], {'.':['c',419],'':420}, ['my',418], ['g',0], { Number:['c',422], Id:425, }, {',':['c',423],'':424}, { Number:['c',422], floating:['ck',422],variable:'floating', ')':424, }, ['g',427], {Id:[426,434],'':427}, { ',':['c',425], ')':427, }, ['m',0,')'], 'typeNamedArgsList', ['m',430,'('], {Id:[431,434],'':432}, { ',':['c',430], ')':432, }, ['m',0,')'], 'typeNamedArg', ['mi',435], ['m',436,':'], { Number:['c',0], floating:['ck',0],variable:'floating', }, 'cardinality', ['m',439,'['], { '*':['c',440], Number:['c',442], ']':444, }, {',':['c',441],'':444}, [444,446], { ',':['c',443], '..':[444,447], '':444 }, [444,446], ['m',0,']'], 'targetCardinality', { '*':['c',0], Number:['c',447], }, {'..':['c',448],'':0}, { '*':['c',0], Number:['c',0], }, 'nullability', { null:['ck',0], not:['ck',451], }, ['mk',0,'null'], 'queryEOF', [454,463], {';':['c',455],'':455}, ['m',0,'EOF'], 'projectionSpec', ['mk',458,'projection'], ['mk',459,'on'], [460,522], {'{':[461,566],'':461}, {excluding:[0,559],'':0}, 'queryExpression', { '(':['c',464], Id:[466,472,,,,'orderByLimitRestriction'], }, [465,463], ['m',466,')'], { intersect:['ck',467,,'precLeft_',4], minus:['ck',467,,'precLeft_',2],except:'minus', union:['ck',468,,'precLeft_',2], '':470 }, {distinct:['ck',469],'':469}, {all:['ck',469],distinct:'all','':469}, [466,463,,,,'orderByLimitRestriction'], {limit:[0,633,,'orderByLimitRestriction'],order:'limit','':0}, 'selectQuery', ['mk',473,'select'], { from:['ck',474], Id:484,'#':'Id','(':'Id','*':'Id','+':'Id','-':'Id',':':'Id','?':'Id','@':'Id','{':'Id',key:'Id',not:'Id',case:'Id',cast:'Id',null:'Id',true:'Id',false:'Id',Number:'Id',String:'Id',exists:'Id',QuotedLiteral:'Id', all:['ck',484],distinct:'all', }, [475,492], {mixin:['ck',476],'':481}, ['m',477,'{'], {Id:[478,204],'':479}, { ';':['c',477], '}':479, }, ['m',480,'}'], ['mk',481,'into'], {all:['ck',482],distinct:'all','':482}, {'{':[483,566],'':483}, {excluding:[490,559],'':490}, ['g',485,,,'sqlStyle','inSelectItem'], { '*':['c',486], Id:[486,576],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id','@':'Id','{':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', }, {',':['c',487],'':488}, { '*':['c',486], Id:[486,576],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id','@':'Id','{':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', }, ['mk',489,'from'], [490,492], {group:[0,621],where:'group',having:'group','':0}, 'querySource', [493,497], {',':494,'':0}, {',':['c',495],'':0}, [494,497], 'tableExpression', { '(':[498,509], Id:[498,522], }, { cross:['ck',499], inner:['ck',502], full:['ck',501],left:'full',right:'full', join:['ck',504], '':0 }, ['mk',500,'join'], { '(':[498,509], Id:[498,522], }, {outer:['ck',502],'':502}, {one:[503,516],many:'one',exact:'one','':503}, ['mk',504,'join'], ['g',505], [506,497], ['mk',507,'on'], [498,653], 'tableOrQueryParens', ['m',510,'(',,,'queryOnLeft'], { '(':[511,509], Id:[512,497,,,'table','queryOnLeft'], select:[512,463], }, { full:[512,498,,,'table','queryOnLeft'],join:'full',left:'full',cross:'full',inner:'full',right:'full', limit:[512,466,,'queryOnLeft'],minus:'limit',order:'limit',union:'limit',except:'limit',intersect:'limit', '':512 }, ['m',513,')'], { as:['ck',514,,'queryOnLeft','table'], Id:['ci',0,,'queryOnLeftSloppyAlias'], '':0,on:'',all:'',where:'',distinct:'' }, ['mi',0], 'joinCardinality', { one:517, exact:['ck',517], many:['ck',518], }, ['mk',518,'one'], ['mk',519,'to'], { one:520, exact:['ck',520], many:['ck',0], }, ['mk',0,'one'], 'fromRefWithOptAlias', [523,529], {':':['c',524],'':525}, [525,529], { as:['ck',526], Id:['ci',0,,'isNoKeywordInRuleFollow'], '':527,on:'',all:'',where:'',distinct:'' }, ['mi',0], ['g',0], 'fromPath', ['mi',530], {'(':[531,535],'[':'(','':531}, {'.':['c',532,,'notAfterEntityArgOrFilter'],'':0}, ['my',533], {'(':[531,535],'[':'(','':531}, 'fromArgumentsAndFilter', {'(':['c',536],'':540}, {Id:537}, {Id:[538,542],'':539}, { ',':['c',537], ')':539, }, ['m',540,')'], {'[':[0,546],'':0}, 'fromNamedArgument', ['mi',543], ['m',544,':'], [0,655], 'cardinalityAndFilter', ['m',547,'['], {Number:['c',548,,'beforeColon'],'':549}, ['m',549,':'], { group:['g',551,[]],limit:'group',order:'group',having:'group', where:['ck',550], ']':['c',0], '':550 }, [551,653], {group:['g',552,,'hide_'],'':553}, [553,627], {having:['ck',554,,'hide_'],'':555}, [555,653], {Id:['g',556,,'hide_'],'':557}, [557,633], ['m',0,']'], 'excludingClause', ['mk',560,'excluding'], ['m',561,'{'], {Id:562}, {Id:['cy',563],'':564}, { ',':['c',562], '}':564, }, ['m',0,'}',,,'afterBrace'], 'selectItemsList', ['m',567,'{',,'top','inSelectItem'], { '*':['c',568], Id:[568,576],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id','@':'Id','{':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', '':569 }, { ',':['c',567], '}':569, }, ['m',0,'}',,,'afterBrace'], 'nestedSelectItemsList', ['m',572,'{',,,'inSelectItem'], { '*':['c',573], Id:[573,576],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id','@':'Id','{':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', '':574 }, { ',':['c',572], '}':574, }, ['m',0,'}',,,'afterBrace'], 'selectItemDef', {'@':[576,787],'':577}, {virtual:['ck',578,['Id','#','(','+','-',':','?','{','key','not','case','cast','null','true','false','Number','String','exists','QuotedLiteral'],'modifierRestriction'],'':578}, ['g',579,,,'key','columnExpr'], {key:['ck',580,,'modifierRestriction'],'':580}, { '#':[581,655,[]],'(':'#','+':'#','-':'#',':':'#','?':'#',new:'#',not:'#',case:'#',cast:'#',null:'#',true:'#',false:'#',Number:'#',String:'#',exists:'#',QuotedLiteral:'#', Id:[583,683], '{':[594,571], }, { as:['ck',582], Id:['ci',591,,'hide_'], '':591,from:'' }, ['mi',591], { over:['ck',584], '*':[586,666],'+':'*','-':'*','/':'*','<':'*','=':'*','>':'*','?':'*','!=':'*','<=':'*','<>':'*','==':'*','>=':'*',in:'*',is:'*',or:'*','||':'*',and:'*',not:'*',like:'*',between:'*', as:['ck',588], Id:['ci',591,,'hide_',,'nestedExpand'], '.':['c',589], '':['g',591,,,,'nestedExpand'],from:'' }, [585,745], {'*':[586,666],'+':'*','-':'*','/':'*','<':'*','=':'*','>':'*','?':'*','!=':'*','<=':'*','<>':'*','==':'*','>=':'*',in:'*',is:'*',or:'*','||':'*',and:'*',not:'*',like:'*',between:'*','':586}, { as:['ck',587], Id:['ci',591,,'hide_'], '':591,from:'' }, ['mi',591], ['mi',591,,,,'nestedExpand'], { '{':[590,571], '*':['c',0], }, {excluding:[0,559],'':0}, {'{':['g',592,,'nestedExpand'],'':597}, [593,571], {excluding:[597,559],'':597}, {excluding:[595,559],'':595}, ['mk',596,'as'], ['mi',597], ['g',598,,,,'columnExpr'], {'@':[598,790],'':599}, {':':['c',600],'':0}, { Id:[613,369],'{':'Id', redirected:['ck',601,['to']], association:['ck',605,['[','to'],'columnExpr'], composition:['ck',607,['[','of'],'columnExpr'], }, ['mk',602,'to'], [603,39], { on:['ck',604], '{':[613,194], '':613 }, [613,653], {'[':[606,438],'':606}, ['mk',609,'to'], {'[':[608,438],'':608}, ['mk',609,'of'], {one:['ck',610,['Id'],'noRepeatedCardinality'],many:'one','':610}, [611,39], ['mk',612,'on'], [613,653], ['g',614], {'@':[614,784],'':0}, 'queryClauses', {columns:['ck',617],'':618}, [618,566], {group:[619,621],where:'group',having:'group','':619}, {limit:[0,633],order:'limit','':0}, 'whereGroupByHaving', {where:['ck',622],'':623}, [623,653], {group:[624,627],'':624}, {having:['ck',625],'':0}, [0,653], 'groupByClause', ['mk',628,'group'], ['mk',629,'by'], [630,655], {',':['c',631],'':0}, [630,655], 'orderByLimitOffset', {order:[634,639],'':634}, {limit:['ck',635],'':0}, [636,655], {offset:['ck',637],'':0}, [0,655], 'orderByClause', ['mk',640,'order'], ['mk',641,'by'], [642,645], {',':['c',643],'':0}, [642,645], 'orderByExpression', [646,655], {asc:['ck',647],desc:'asc','':647}, {nulls:['ck',648],'':0}, {last:['ck',0],first:'last'}, 'conditionEOF', [651,655], ['m',0,'EOF'], 'condition', [0,655], 'expression', { '(':[666,689], '#':[666,781],null:'#',true:'#',false:'#',Number:'#',String:'#',QuotedLiteral:'#', ':':['c',656], '?':['c',666,,'hide_'], Id:[658,683], new:['ck',661,['Id']], exists:['ck',662], case:[666,701], cast:[666,712], '+':['c',665,,'precRight_',30],'-':'+', not:['ck',665,,'precRight_',8], }, { Id:['cy',657], Number:['c',666,,'hide_'], }, {'.':[666,685],'':666}, {over:['ck',659],'':660}, [660,745], ['g',666], [666,683], { '(':['c',663], Id:[666,683], '?':['c',666,,'hide_'], }, [664,463], ['m',666,')'], [666,655], { '*':['c',670,,'precLeft_',24],'/':'*', '+':['c',670,,'precLeft_',22],'-':'+', '||':['c',670,,'precLeft_',20], and:['ck',670,,'precLeft_',4], or:['ck',670,,'precLeft_',2], '?':['c',667,,'precRight_',0], '<':['c',669,,'precNone_',10],'=':'<','>':'<','!=':'<','<=':'<','<>':'<','>=':'<', '==':['c',670,,'precNone_',10], is:['ck',671,,'precNone_',10], not:['ck',673,,'isNegatedRelation',10], in:['g',673,,'precNone_',10],like:'in',between:'in', '':0 }, [668,655], ['m',670,':'], {all:['ck',670],any:'all',some:'all','':670}, [681,655], {not:['ck',672],'':672}, ['mk',681,'null'], { between:['ck',674], in:['ck',677], like:['ck',678], }, [675,655], ['mk',676,'and'], [681,655], [681,655], [679,655], {escape:['ck',680],'':681}, [681,655], ['g',666], 'valuePath', ['mi',684], {'(':[685,719],'[':'(','':685}, {'.':['c',686,,'isDotForPath'],'':0}, ['my',687], {'(':[685,719],'[':'(','':685}, 'expressionOrQueryParens', ['m',690,'(',,,'queryOnLeft'], { '(':[691,689], Id:[693,655,,,'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:[694,463], }, { '*':[692,666,,,'expr','queryOnLeft'],'+':'*','-':'*','/':'*','<':'*','=':'*','>':'*','?':'*','!=':'*','<=':'*','<>':'*','==':'*','>=':'*',in:'*',is:'*',or:'*','||':'*',and:'*',not:'*',like:'*',between:'*', ',':[694,696,,,'expr','queryOnLeft'], limit:[694,466,,'queryOnLeft'],minus:'limit',order:'limit',union:'limit',except:'limit',intersect:'limit', '':694 }, {',':[694,696],'':694}, {',':[694,696],'':694}, ['m',0,')'], 'continueExpressionslist', ['m',697,','], {Id:698,'#':'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'}, {Id:[699,655],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id','':0}, {',':['c',698],'':0}, 'caseExpression', ['mk',702,'case'], {Id:[703,655],'#':'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','':703,when:''}, {when:704}, {when:['ck',705],'':708}, [706,655], ['mk',707,'then'], [704,655], {else:['ck',709],'':710}, [710,655], ['mk',0,'end'], 'castFunction', ['mk',713,'cast'], ['m',714,'('], [715,655], ['mk',716,'as'], [717,415], ['m',0,')'], 'argumentsAndFilter', {'(':['c',720,,,,'prepareSpecialFunction'],'':738}, { ')':737, Id:['cy',721,,'isNamedArg'], '':730 }, { ':':['c',722], '=>':['c',726], }, [723,655], { ',':['c',724], ')':737, }, { Id:['cy',725], ')':737, }, ['m',722,':'], [727,655], { ',':['c',728], ')':737, }, { Id:['cy',729], ')':737, }, ['m',726,'=>'], [731,740], {',':['c',732,,,,'nextFunctionArgument'],'':734}, {')':['c',733],'':730}, {'[':[0,546],'':0}, {order:['ck',735],'':737}, ['mk',736,'by'], [737,760], ['m',738,')'], {'[':[0,546],'':0}, 'funcExpression', { ' lookahead':'lGenericIntroOrExpr', Id:[742,655],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', GenericExpr:['cx',742], GenericIntro:['cx',741], }, [742,655], { ' lookahead':'lGenericSeparator', GenericSeparator:['cx',743], '':0 }, { ' lookahead':'lGenericExpr', Id:[742,655],'#':'Id','(':'Id','+':'Id','-':'Id',':':'Id','?':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', GenericExpr:['cx',742], }, 'overClause', ['m',746,'('], {partition:['ck',747],'':749}, ['mk',748,'by'], [749,756], {order:['ck',750],'':752}, ['mk',751,'by'], [752,760], {rows:['ck',753],'':754}, [754,769], ['m',0,')'], 'expressionsAsXpr', [757,655], {',':['c',758],'':0}, [757,655], 'orderByClauseAsXpr', [761,764], {',':['c',762],'':0}, [761,764], 'orderBySpecAsXpr', [765,655], {asc:['ck',766],desc:'asc','':766}, {nulls:['ck',767],'':0}, {last:['ck',0],first:'last'}, 'windowFrameClause', { unbounded:['ck',770], Number:['c',770], current:['ck',771], between:['ck',772], }, ['mk',0,'preceding'], ['mk',0,'row'], [773,776], ['mk',774,'and'], [0,776], 'windowFrameBoundSpec', { unbounded:['ck',777], Number:['c',777], current:['ck',779], }, { following:['ck',778], preceding:['ck',778], }, ['g',0], ['mk',0,'row'], 'literalValue', { '#':['c',782], null:['ck',0], true:['ck',0],false:'true', Number:['c',0], String:['c',0], QuotedLiteral:['c',0], }, ['my',0], 'annoAssignStd', ['m',785,'@',,,'annoInSameLine'], { '(':[0,793], Id:[0,798], }, 'annoAssignCol', ['m',788,'@'], { '(':[0,793], Id:[0,798], }, 'annoAssignMid', ['m',791,'@',,,'annoInSameLine'], { '(':[0,793], Id:[0,802], }, 'annoAssignParen', ['m',794,'(',,,'annoInSameLine'], {Id:[795,798],'':796}, { ',':['c',794], ')':796, }, ['m',0,')'], 'annoAssignBase', [799,802], {':':['c',800,,'annoInSameLine'],'':0}, [0,824], 'annoNamePath', ['my',803], {'.':['c',804],'':806}, { Id:['cy',803], '@':['c',805], }, ['my',803], {'#':[0,815,,'annoInSameLine'],'':0}, 'annoPath', { Id:['cy',810], '@':['c',809], }, ['my',810], {'.':['c',811],'':813}, { Id:['cy',810], '@':['c',812], }, ['my',810], {'#':[0,815],'':0}, 'annoPathVariant', ['m',816,'#'], ['my',817], {'.':['c',818],'':0}, ['my',817], 'annoStructValue', [821,808], {':':['c',822],'':0}, [0,824], 'annoValue', { '#':[0,781],null:'#',true:'#',false:'#',Number:'#',String:'#',QuotedLiteral:'#', '+':['c',825],'-':'+', Id:[0,808],'@':'Id', '{':['c',826], '[':['c',829,,,,'arrayAnno'], '(':['c',835], }, ['m',0,'Number'], {Id:[827,820],'@':'Id','':828}, { ',':['c',826], '}':828, Id:['g',826,,'fail'],'@':'Id', }, {'}':['c',0,,'arrayAnno','orNotEmpty']}, { Id:[833,824],'#':'Id','(':'Id','+':'Id','-':'Id','@':'Id','[':'Id','{':'Id',Number:'Id',String:'Id',QuotedLiteral:'Id', '...':['c',830,,'arrayAnno','ellipsis'], '':834 }, { up:['ck',831], ',':833,']':',', }, ['mk',832,'to'], [833,824], { ',':['c',829], ']':834, }, {']':['c',0,,'arrayAnno','bracket']}, {')':['c',0,,'fail'],'':836}, [837,653], ['m',0,')'], ] class CdlParser extends AstBuildingParser{ hardGuards={afterBrace:true,fail:true} 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.l()){ case'namespace':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'@':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':this.s=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.lt()){ 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'@':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':this.s=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.lt()){ case'@':this.annoAssignStd({art},10);continue default:this.s=11;continue } case 11:switch(this.l()){ 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.ck(13)){ art.kind = 'extend'; }continue case'annotate':this.ck(14);continue default:this.e();continue } case 12:switch(this.l()){ case'service':this.serviceDef({art,outer:$.outer},0);continue case'context':this.contextDef({art,outer:$.outer},0);continue case'annotation':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.l()){ case'Id':this.extendArtifact({art,outer:$.outer},0);continue case'service':this.extendService({art,outer:$.outer},0);continue case'context':this.extendContext({art,outer:$.outer},0);continue case'type':this.extendType({art,outer:$.outer},0);continue case'aspect':case'entity':this.extendEntityOrAspect({art,outer:$.outer},0);continue case'projection':this.extendProjection({art,outer:$.outer},0);continue default:this.e();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.l()){ 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.e();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.lt()){ case'Id':this.usingProxy({outer:decl,proxy:{ kind: 'using' }},26);continue default:this.s=27;continue } case 26:switch(this.lt()){ 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.lt()){ case'.':this.c(37);continue default:this.gr(['@']);continue } case 37:if(this.my(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.lt()){ case'.':this.c(41);continue default:this.gr();continue } case 41:if(this.my(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.lt()){ case'@':this.annoAssignMid({art:$.art},45);continue default:this.s=46;continue } case 46:switch(this.lt()){ 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.lt()){ case'@':this.annoAssignMid({art:$.art},50);continue default:this.s=51;continue } case 51:switch(this.lt()){ 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.lt()){ 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.lt()){ 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.lt()){ case'@':this.annoAssignMid({art:$.art},66);continue default:this.s=67;continue } case 67:switch(this.lt()){ case'{':this.elementsBlock({art:$.art},71);continue case':':this.c(68);continue default:this.gr([';']);continue } case 68:switch(this.lt()){ 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.lt()){ 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.lt()){ case'@':this.annoAssignMid({art:$.art},75);continue default:this.s=76;continue } case 76:switch(this.lt()){ 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.l()){ case'Id':this.s=79;continue default:this.e();continue } case 79:switch(this.lt()){ case'Id':if(this.simplePath(_={category:'artref'},80)){incl=_.ref; $.art.includes.push( incl ); }continue default:this.s=81;continue } case 80:switch(this.lt()){ 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.lt()){ 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.lt()){ 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.lt()){ case'@':this.annoAssignMid({art:$.art},103);continue default:this.s=104;continue } case 104:switch(this.lt()){ case'{':this.elementsBlock({art:$.art},0);continue case':':this.c(105);continue default:this.e();continue } case 105:switch(this.l()){ 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.projectionSpec(_={},0)){query=_.query; $.art.query = query; $.art.$syntax = 'projection'; }continue default:this.e();continue } case 106:switch(this.lt()){ 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.lt()){ case',':this.c(108);continue default:this.s=110;continue } case 108:switch(this.lt()){ case'Id':if(this.simplePath(_={category:'artref'},109)){incl=_.ref; $.art.includes.push( incl ); }continue default:this.s=110;continue } case 109:switch(this.lt()){ 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.lt()){ 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.lt()){ 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.lt()){ 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.lt()){ 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'@':case'action':case'function':this.s=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.lt()){ 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.lt()){ 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.lt()){ 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.lt()){ case'Id':case'@':this.paramDef({outer:$.art},144);continue default:this.s=145;continue } case 144:switch(this.lt()){ 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.lt()){ case'@':this.annoAssignStd({art},147);continue default:this.s=148;continue } case 148:if(this.my(149,'Param')){ this.addDef( art, $.outer, 'params', 'param', this.identAst() ); this.docComment( art ); }continue case 149:switch(this.lt()){ case'@':this.annoAssignMid({art},149);continue default:this.s=150;continue } case 150:switch(this.lt()){ 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.lt()){ 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.lt()){ 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'@':case'key':this.s=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.lt()){ case'@':this.annoAssignStd({art:$.art},163);continue default:this.s=164;continue } case 164:switch(this.l()){ case'virtual':if(this.ck(165)){ $.art.virtual = this.valueWithLocation( true ); }continue default:this.s=165;continue } case 165:switch(this.l()){ case'key':if(this.ck(166)){ $.art.key = this.valueWithLocation( true ); }continue default:this.s=166;continue } case 166:switch(this.l()){ case'masked':if(this.ck(167)){ $.art.masked = this.valueWithLocation( true ); this.message( 'syntax-unsupported-masked', this.lb(), { keyword: 'masked' } ); }continue default:this.s=167;continue } case 167:switch(this.l()){ case'element':if(this.ck(168)){ $.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.lt()){ case'@':this.annoAssignMid({art:$.art},169);continue default:this.s=170;continue } case 170:switch(this.lt()){ 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.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;co