19 December 2015

FilterLanguage.g4

FilterLanguage.g4

filter GroovyCode simpleSearchLiteral boolexpr
boolexpr brackedBoolExpr expr '<' '>' '=' '<=' '>=' '<>' 'like' 'is' 'startswith' 'wie' 'endswith' 'regex' 'regexfind' '~' expr expr negatedBoolExpr boolexpr 'and' boolexpr boolexpr 'or' boolexpr SimpleRegExSearchAllStatement identWithSimpleRegExSearchStatement
simpleSearchLiteral literal
identWithSimpleRegExSearchStatement qualifier SimpleRegExSearchAllStatement
negatedBoolExpr 'not' brackedBoolExpr
expr brackedExpr funcCall substIdentifier number DateLiteral StringLiteral NOTHING qualifier expr '*' '/' expr expr '+' '-' expr andLiteral orLiteral RegexLiteral
number INT DOUBLE sizePrefix
sizePrefix KB MB GB
brackedExpr '(' expr ')'
literal ID StringLiteral
andLiteral literal '&' literal
orLiteral literal '|' literal
qualifier ID '.' ID
substIdentifier '$' literal argList
funcCall ID argList ID '#' simpleArg
simpleArg number literal
argList '(' ')' '(' expr ',' expr ')'
brackedBoolExpr '(' boolexpr ')'
group GroovyCode groupInstruction '--' groupInstruction
groupInstruction 'groupby' 'group' 'by' 'by' groupExprList havingClause
groupExprList groupExprPart ',' ';' groupExprPart
havingClause 'having' boolexpr
groupExprPart qualifier '(' groupExpr ')'
groupExpr ifStmt groupTerm
groupTerm expr
ifStmt 'if' boolexpr thenStmt elseIfStmt elseStmt
thenStmt '{' expr '}'
elseIfStmt 'elseif' boolexpr thenStmt
elseStmt 'else' thenStmt
DateLiteral '"' DIGIT DIGIT DIGIT DIGIT '/' DIGIT DIGIT '/' DIGIT DIGIT '"' ε ''' DIGIT DIGIT DIGIT DIGIT '/' DIGIT DIGIT '/' DIGIT DIGIT ''' ε
StringLiteral '"' DoubleStringCharacter '"' ε ''' SingleStringCharacter ''' ε
DoubleStringCharacter not '"' '\' '\' SingleEscapeCharacter
SingleStringCharacter not ''' '\' '\' SingleEscapeCharacter
SingleEscapeCharacter ''' '"' '\' 'b' 'f' 'n' 'r' 't' 'v' '.' 'w' 's' 'd'
DIGIT [0-9]
GroovyCode 'groovy' any char
INT [0-9]
DOUBLE DIGIT '.' DIGIT '.' DIGIT
WS [ \t\r\n]
BlockComment '/*' any char '*/'
LineComment '//' not [\r\n]
RegexFragment [a-zA-Z_0-9'.*\?[]()+-{}$|:^/&%ยง]
REGEX2 '~'
RegexLiteral '~' RegexFragment '~' StringLiteral
SimpleRegExSearchAllStatement '?' RegexFragment '?' StringLiteral
MUL '*'
DIV '/'
ADD '+'
SUB '-'
LOWER '<'
HIGHER '>'
EQUAL '='
LOWEREQUALTHEN '<='
HIGHEREQUALTHEN '>='
UNEQUAL '<>'
LIKE 'like'
IS 'is'
STARTSWITH 'startswith'
WIE 'wie'
ENDSWITH 'endswith'
REGEX 'regex'
REGEXFIND 'regexfind'
AND 'and'
OR 'or'
NOT 'not'
NOTHING 'nothing' 'null'
KB 'kb' 'KB'
MB 'mb' 'MB'
GB 'gb' 'GB'
ID [a-zA-Z_] [a-zA-Z_0-9']