如何修改Antlr4语法以支持左侧操作员的关联?
我想支持以下输入,因为它是提供的语法。
不起作用
with [{id: 1},{id: 2}] as a
return a[0].id, a[1].id
如果我们将其更改为:
with [{id: 1},{id: 2}] as a
return (a[0]).id, (a[1]).id
语法的相关部分在这里
oC_PropertyOrLabelsExpression
: oC_Atom ( SP? oC_PropertyLookup )* ( SP? oC_NodeLabels )? ;
:这是完整的语法: https://s3.amazonaws.com/artifacts.opencypher.org/ m18/cypher.g4
通过修改语法可以做什么?
I want to support the following input as it is with a provided grammar.
This does not work
with [{id: 1},{id: 2}] as a
return a[0].id, a[1].id
It works if we change it to be:
with [{id: 1},{id: 2}] as a
return (a[0]).id, (a[1]).id
The relevant part of the grammar is here:
oC_PropertyOrLabelsExpression
: oC_Atom ( SP? oC_PropertyLookup )* ( SP? oC_NodeLabels )? ;
This is the full grammar:
https://s3.amazonaws.com/artifacts.opencypher.org/M18/Cypher.g4
Is there anything we can do by modifying the grammar?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
变成
:
Change:
into: