* fix: #213 use uid to replace SLASH_TEXT in dtFilePath rule * test: #213 flinksql syntax expression --------- Co-authored-by: liuyi <liuyi@dtstack.com>
This commit is contained in:
@ -583,9 +583,7 @@ REAL_LITERAL: (DEC_DIGIT+)? '.' DEC_DIGIT+
|
||||
| DEC_DIGIT+ EXPONENT_NUM_PART;
|
||||
BIT_STRING: BIT_STRING_L;
|
||||
ID_LITERAL: ID_LITERAL_FRAG;
|
||||
SLASH_TEXT: SLASH_TEXT_FRAG;
|
||||
|
||||
fragment SLASH_TEXT_FRAG: [/\\] (~([/\\ ] | '(' | ')' | ';'))*;
|
||||
fragment JAR_FILE_PARTTARN: '`' ( '\\'. | '``' | ~('`'|'\\'))* '`';
|
||||
fragment EXPONENT_NUM_PART: 'E' [-+]? DEC_DIGIT+;
|
||||
fragment ID_LITERAL_FRAG: [A-Z_0-9a-z]*?[A-Z_a-z]+?[A-Z_0-9a-z]*;
|
||||
|
@ -101,7 +101,7 @@ dtAddStatement
|
||||
;
|
||||
|
||||
dtFilePath
|
||||
: SLASH_TEXT+
|
||||
: (SLASH_SIGN? uid)+
|
||||
;
|
||||
|
||||
// Create statements
|
||||
@ -698,7 +698,6 @@ valueExpression
|
||||
| left=valueExpression operator=BIT_XOR_OP right=valueExpression #arithmeticBinary
|
||||
| left=valueExpression operator=BIT_OR_OP right=valueExpression #arithmeticBinary
|
||||
| left=valueExpression comparisonOperator right=valueExpression #comparison
|
||||
| left=valueExpression right=SLASH_TEXT #arithmeticBinaryAlternate
|
||||
;
|
||||
|
||||
primaryExpression
|
||||
|
File diff suppressed because one or more lines are too long
@ -539,7 +539,6 @@ DIG_LITERAL=538
|
||||
REAL_LITERAL=539
|
||||
BIT_STRING=540
|
||||
ID_LITERAL=541
|
||||
SLASH_TEXT=542
|
||||
'ABS'=4
|
||||
'ALL'=5
|
||||
'ALLOCATE'=6
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -539,7 +539,6 @@ DIG_LITERAL=538
|
||||
REAL_LITERAL=539
|
||||
BIT_STRING=540
|
||||
ID_LITERAL=541
|
||||
SLASH_TEXT=542
|
||||
'ABS'=4
|
||||
'ALL'=5
|
||||
'ALLOCATE'=6
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
// Generated from /Users/hayden/Desktop/dt-works/dt-sql-parser/src/grammar/flinksql/FlinkSqlParser.g4 by ANTLR 4.9.0-SNAPSHOT
|
||||
// Generated from /Users/liuyi/Desktop/Projects/dtstack/dt-sql-parser/src/grammar/flinksql/FlinkSqlParser.g4 by ANTLR 4.9.0-SNAPSHOT
|
||||
|
||||
|
||||
import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener";
|
||||
@ -10,7 +10,6 @@ import { ValueExpressionDefaultContext } from "./FlinkSqlParser";
|
||||
import { ArithmeticUnaryContext } from "./FlinkSqlParser";
|
||||
import { ArithmeticBinaryContext } from "./FlinkSqlParser";
|
||||
import { ComparisonContext } from "./FlinkSqlParser";
|
||||
import { ArithmeticBinaryAlternateContext } from "./FlinkSqlParser";
|
||||
import { SearchedCaseContext } from "./FlinkSqlParser";
|
||||
import { SimpleCaseContext } from "./FlinkSqlParser";
|
||||
import { CastContext } from "./FlinkSqlParser";
|
||||
@ -321,19 +320,6 @@ export interface FlinkSqlParserListener extends ParseTreeListener {
|
||||
*/
|
||||
exitComparison?: (ctx: ComparisonContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by the `arithmeticBinaryAlternate`
|
||||
* labeled alternative in `FlinkSqlParser.valueExpression`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
enterArithmeticBinaryAlternate?: (ctx: ArithmeticBinaryAlternateContext) => void;
|
||||
/**
|
||||
* Exit a parse tree produced by the `arithmeticBinaryAlternate`
|
||||
* labeled alternative in `FlinkSqlParser.valueExpression`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
exitArithmeticBinaryAlternate?: (ctx: ArithmeticBinaryAlternateContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by the `searchedCase`
|
||||
* labeled alternative in `FlinkSqlParser.primaryExpression`.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Generated from /Users/hayden/Desktop/dt-works/dt-sql-parser/src/grammar/flinksql/FlinkSqlParser.g4 by ANTLR 4.9.0-SNAPSHOT
|
||||
// Generated from /Users/liuyi/Desktop/Projects/dtstack/dt-sql-parser/src/grammar/flinksql/FlinkSqlParser.g4 by ANTLR 4.9.0-SNAPSHOT
|
||||
|
||||
|
||||
import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor";
|
||||
@ -10,7 +10,6 @@ import { ValueExpressionDefaultContext } from "./FlinkSqlParser";
|
||||
import { ArithmeticUnaryContext } from "./FlinkSqlParser";
|
||||
import { ArithmeticBinaryContext } from "./FlinkSqlParser";
|
||||
import { ComparisonContext } from "./FlinkSqlParser";
|
||||
import { ArithmeticBinaryAlternateContext } from "./FlinkSqlParser";
|
||||
import { SearchedCaseContext } from "./FlinkSqlParser";
|
||||
import { SimpleCaseContext } from "./FlinkSqlParser";
|
||||
import { CastContext } from "./FlinkSqlParser";
|
||||
@ -289,14 +288,6 @@ export interface FlinkSqlParserVisitor<Result> extends ParseTreeVisitor<Result>
|
||||
*/
|
||||
visitComparison?: (ctx: ComparisonContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by the `arithmeticBinaryAlternate`
|
||||
* labeled alternative in `FlinkSqlParser.valueExpression`.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
visitArithmeticBinaryAlternate?: (ctx: ArithmeticBinaryAlternateContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by the `searchedCase`
|
||||
* labeled alternative in `FlinkSqlParser.primaryExpression`.
|
||||
|
Reference in New Issue
Block a user