【发布时间】:2020-10-05 12:16:10
【问题描述】:
Sybase 具有用于表示外连接的非 ANSI SQL 条件运算符:*=。
它已被弃用 (http://dcx.sybase.com/1200/en/dbusage/apxa-transactsqlouter-joins-aspen.html)。
当我们从 Sybase ASE 迁移到 MySQL 时,我开始使用 ANTLR4 来解析 Sybase SQL 代码以尝试将其转换为 MySQL 代码等价物。
我已尝试将其添加到此处提供的 TSqlParser.g4 语法:https://github.com/antlr/grammars-v4/tree/master/sql/tsql。请参阅下面行尾的 '*' '=' 但它不起作用
// https://msdn.microsoft.com/en-us/library/ms188074.aspx
// Spaces are allowed for comparison operators.
comparison_operator
: '=' | '>' | '<' | '<' '=' | '>' '=' | '<' '>' | '!' '=' | '!' '>' | '!' '<' | '*' '='
;
我尝试了一些方法来使其工作,例如转义 \* 和删除 *= assignment_operator,但没有任何效果。这可能是一个愚蠢的问题,因为我是 ANTLR 的新手。 :-(
请帮忙。
【问题讨论】:
标签: tsql antlr sybase antlr4 sap-ase