2021-05-20 19:35:03 +00:00
|
|
|
// Package policy provides facilities for creating policy from SQL-like language.
|
2021-05-21 15:12:32 +00:00
|
|
|
// ANTLRv4 grammar is provided in `parser/Query.g4` and `parser/QueryLexer.g4`.
|
2021-05-20 19:35:03 +00:00
|
|
|
//
|
|
|
|
// Current limitations:
|
2021-05-21 15:12:27 +00:00
|
|
|
// 1. Filters must be defined before they are used.
|
2021-05-21 16:04:15 +00:00
|
|
|
// This requirement may be relaxed in future.
|
|
|
|
// 2. Keywords are key-sensitive. This can be changed if necessary
|
|
|
|
// https://github.com/antlr/antlr4/blob/master/doc/case-insensitive-lexing.md .
|
2021-05-20 19:35:03 +00:00
|
|
|
//
|
|
|
|
// Example query:
|
2021-05-21 16:04:15 +00:00
|
|
|
// REP 1 IN SPB
|
|
|
|
// REP 2 IN Americas
|
2021-05-20 19:35:03 +00:00
|
|
|
// CBF 4
|
2021-05-21 16:04:15 +00:00
|
|
|
// SELECT 1 IN City FROM SPBSSD AS SPB
|
|
|
|
// SELECT 2 IN SAME City FROM Americas AS Americas
|
2021-05-20 19:35:03 +00:00
|
|
|
// FILTER SSD EQ true AS IsSSD
|
2021-05-21 16:04:15 +00:00
|
|
|
// FILTER @IsSSD AND Country EQ "RU" AND City EQ "St.Petersburg" AS SPBSSD
|
|
|
|
// FILTER 'Continent' EQ 'North America' OR Continent EQ 'South America' AS Americas
|
2021-05-20 19:35:03 +00:00
|
|
|
package policy
|