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