-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OPER-1484] Add ANTLR syntax for op selection on frontend (#26099)
## Summary & Motivation Similar to the new asset selection syntax, we want to add one for ops on the frontend. This PR just adds grammar, which is just a subset of the asset selection grammar, and the generated files from ANTLR. ## How I Tested These Changes N/A
- Loading branch information
Showing
12 changed files
with
1,934 additions
and
0 deletions.
There are no files selected for viewing
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
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
63 changes: 63 additions & 0 deletions
63
js_modules/dagster-ui/packages/ui-core/src/op-selection/OpSelection.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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
grammar OpSelection; | ||
|
||
start: expr EOF; | ||
|
||
// Root rule for parsing expressions | ||
expr | ||
: traversalAllowedExpr # TraversalAllowedExpression | ||
| traversal traversalAllowedExpr traversal # UpAndDownTraversalExpression | ||
| traversal traversalAllowedExpr # UpTraversalExpression | ||
| traversalAllowedExpr traversal # DownTraversalExpression | ||
| NOT expr # NotExpression | ||
| expr AND expr # AndExpression | ||
| expr OR expr # OrExpression | ||
| STAR # AllExpression | ||
; | ||
|
||
// Allowed expressions for traversals | ||
traversalAllowedExpr | ||
: attributeExpr # AttributeExpression | ||
| LPAREN expr RPAREN # ParenthesizedExpression | ||
; | ||
|
||
// Traversal operators | ||
traversal | ||
: STAR | ||
| PLUS+ | ||
; | ||
|
||
// Attribute expressions for specific attributes | ||
attributeExpr | ||
: NAME COLON value # NameExpr | ||
| NAME_SUBSTRING COLON value # NameSubstringExpr | ||
; | ||
|
||
// Value can be a quoted or unquoted string | ||
value | ||
: QUOTED_STRING | ||
| UNQUOTED_STRING | ||
; | ||
|
||
// Tokens for operators and keywords | ||
AND : 'and'; | ||
OR : 'or'; | ||
NOT : 'not'; | ||
|
||
STAR : '*'; | ||
PLUS : '+'; | ||
|
||
COLON : ':'; | ||
|
||
LPAREN : '('; | ||
RPAREN : ')'; | ||
|
||
// Tokens for attributes | ||
NAME : 'name'; | ||
NAME_SUBSTRING : 'name_substring'; | ||
|
||
// Tokens for strings | ||
QUOTED_STRING : '"' (~["\\\r\n])* '"' ; | ||
UNQUOTED_STRING : [a-zA-Z_][a-zA-Z0-9_]*; | ||
// Whitespace | ||
WS : [ \t\r\n]+ -> skip ; |
43 changes: 43 additions & 0 deletions
43
js_modules/dagster-ui/packages/ui-core/src/op-selection/generated/OpSelection.interp
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
js_modules/dagster-ui/packages/ui-core/src/op-selection/generated/OpSelection.tokens
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
js_modules/dagster-ui/packages/ui-core/src/op-selection/generated/OpSelectionLexer.interp
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
js_modules/dagster-ui/packages/ui-core/src/op-selection/generated/OpSelectionLexer.tokens
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
170 changes: 170 additions & 0 deletions
170
js_modules/dagster-ui/packages/ui-core/src/op-selection/generated/OpSelectionLexer.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
5d4edc8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for dagit-core-storybook ready!
✅ Preview
https://dagit-core-storybook-h7bvm9rg8-elementl.vercel.app
Built with commit 5d4edc8.
This pull request is being automatically deployed with vercel-action