Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Step Functions: ASL Grammars Enhancements (#10372)
- Loading branch information
Showing
14 changed files
with
1,510 additions
and
1,608 deletions.
There are no files selected for viewing
113 changes: 44 additions & 69 deletions
113
localstack/services/stepfunctions/asl/antlr/ASLIntrinsicLexer.g4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,59 @@ | ||
lexer grammar ASLIntrinsicLexer; | ||
// $antlr-format alignTrailingComments true, columnLimit 150, maxEmptyLinesToKeep 1, reflowComments false, useTab false | ||
// $antlr-format allowShortRulesOnASingleLine true, allowShortBlocksOnASingleLine true, minEmptyLines 0, alignSemicolons ownLine | ||
// $antlr-format alignColons trailing, singleLineOverrulesHangingColon true, alignLexerCommands true, alignLabels true, alignTrailers true | ||
|
||
lexer grammar ASLIntrinsicLexer; | ||
|
||
CONTEXT_PATH_STRING | ||
: DOLLAR DOLLAR JSON_PATH_BODY | ||
; | ||
CONTEXT_PATH_STRING: DOLLAR DOLLAR JSON_PATH_BODY; | ||
|
||
JSON_PATH_STRING | ||
: DOLLAR JSON_PATH_BODY | ||
; | ||
JSON_PATH_STRING: DOLLAR JSON_PATH_BODY; | ||
|
||
fragment JSON_PATH_BODY | ||
: JSON_PATH_BRACK? (DOT IDENTIFIER? JSON_PATH_BRACK?)* | ||
; | ||
fragment JSON_PATH_BODY: JSON_PATH_BRACK? (DOT IDENTIFIER? JSON_PATH_BRACK?)*; | ||
|
||
fragment JSON_PATH_BRACK | ||
: '[' (JSON_PATH_BRACK | ~[\]])* ']' | ||
; | ||
fragment JSON_PATH_BRACK: '[' (JSON_PATH_BRACK | ~[\]])* ']'; | ||
|
||
DOLLAR: '$'; | ||
LPAREN: '('; | ||
RPAREN: ')'; | ||
COMMA: ','; | ||
DOT: '.'; | ||
DOLLAR : '$'; | ||
LPAREN : '('; | ||
RPAREN : ')'; | ||
COMMA : ','; | ||
DOT : '.'; | ||
|
||
TRUE: 'true'; | ||
FALSE: 'false'; | ||
TRUE : 'true'; | ||
FALSE : 'false'; | ||
|
||
States: 'States'; | ||
Format: 'Format'; | ||
StringToJson: 'StringToJson'; | ||
JsonToString: 'JsonToString'; | ||
Array: 'Array'; | ||
ArrayPartition: 'ArrayPartition'; | ||
ArrayContains: 'ArrayContains'; | ||
ArrayRange: 'ArrayRange'; | ||
ArrayGetItem: 'ArrayGetItem'; | ||
ArrayLength: 'ArrayLength'; | ||
ArrayUnique: 'ArrayUnique'; | ||
Base64Encode: 'Base64Encode'; | ||
Base64Decode: 'Base64Decode'; | ||
Hash: 'Hash'; | ||
JsonMerge: 'JsonMerge'; | ||
MathRandom: 'MathRandom'; | ||
MathAdd: 'MathAdd'; | ||
StringSplit: 'StringSplit'; | ||
UUID: 'UUID'; | ||
States : 'States'; | ||
Format : 'Format'; | ||
StringToJson : 'StringToJson'; | ||
JsonToString : 'JsonToString'; | ||
Array : 'Array'; | ||
ArrayPartition : 'ArrayPartition'; | ||
ArrayContains : 'ArrayContains'; | ||
ArrayRange : 'ArrayRange'; | ||
ArrayGetItem : 'ArrayGetItem'; | ||
ArrayLength : 'ArrayLength'; | ||
ArrayUnique : 'ArrayUnique'; | ||
Base64Encode : 'Base64Encode'; | ||
Base64Decode : 'Base64Decode'; | ||
Hash : 'Hash'; | ||
JsonMerge : 'JsonMerge'; | ||
MathRandom : 'MathRandom'; | ||
MathAdd : 'MathAdd'; | ||
StringSplit : 'StringSplit'; | ||
UUID : 'UUID'; | ||
|
||
STRING | ||
: '\'' (ESC | SAFECODEPOINT)*? '\'' | ||
; | ||
STRING: '\'' (ESC | SAFECODEPOINT)*? '\''; | ||
|
||
fragment ESC | ||
: '\\' (UNICODE | .) | ||
; | ||
fragment UNICODE | ||
: 'u' HEX HEX HEX HEX | ||
; | ||
fragment HEX | ||
: [0-9a-fA-F] | ||
; | ||
fragment SAFECODEPOINT | ||
: ~ ['\\\u0000-\u001F] | ||
; | ||
fragment ESC : '\\' (UNICODE | .); | ||
fragment UNICODE : 'u' HEX HEX HEX HEX; | ||
fragment HEX : [0-9a-fA-F]; | ||
fragment SAFECODEPOINT : ~ ['\\\u0000-\u001F]; | ||
INT | ||
: '-'? ('0' | [1-9] [0-9]*) | ||
; | ||
INT: '-'? ('0' | [1-9] [0-9]*); | ||
NUMBER | ||
: '-'? INT ('.' [0-9] +)? EXP? | ||
; | ||
NUMBER: '-'? INT ('.' [0-9]+)? EXP?; | ||
fragment EXP | ||
: [Ee] [+\-]? INT | ||
; | ||
fragment EXP: [Ee] [+\-]? INT; | ||
IDENTIFIER | ||
: ([0-9a-zA-Z_] | UNICODE)+ | ||
; | ||
IDENTIFIER: ([0-9a-zA-Z_] | UNICODE)+; | ||
WS | ||
: [ \t\n] + -> skip | ||
; | ||
WS: [ \t\n]+ -> skip; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.