Lexer

The rule validation lexer file, "RuleValidationLexer.g4" defines the rule syntax parsing hierarchy.

Delimitor and Separators

CONCAT : PIPE;
LPAREN : '(' ;
RPAREN : ')' ;
SQUOTE : '\'' ;
QUOTE : '"' ;
DOT : '.' ;



Logical Operators

OR  : '.OR.';
AND : '.AND.';
NOT : '.NOT.';



Equality Operators

EQ  : '=';
NE  : '!=';
LT  : '<';
LTE : '<=';
GT  : '>';
GTE : '>=';



Set Operators

CONTAINS : '.CONTAINS.';
IN : '.IN.';
COMMA: ',';



Arithmatic

PLUS: '+';
MINUS: '-';
TIMES: '*';
DIV: '/';
MOD: '.MOD.';



Miscellaneous

PIPE: '|';
OPEN_BRACKET: '[';
CLOSE_BRACKET: ']';
HASH: '#';
LAST: 'LAST';



Collections

ARRAY: 'ARRAY';
LIST: 'LIST';
SET: 'SET';
DIFFERENCE: 'DIFFERENCE';
INTERSECTION: 'INTERSECTION';
UNION: 'UNION';



Date/Time

RETSDATE: DIGIT DIGIT DIV DIGIT DIGIT DIV DIGIT DIGIT DIGIT DIGIT ;
RETSTIME: DIGIT DIGIT COLON DIGIT DIGIT COLON DIGIT DIGIT ;

RETS_DATETIME
  : DIGIT DIGIT DIGIT DIGIT '-' DIGIT DIGIT '-' DIGIT DIGIT 'T' DIGIT DIGIT ':' DIGIT DIGIT ':' DIGIT DIGIT ('.' (DIGIT)*)? ((PLUS | MINUS) DIGIT DIGIT ':' DIGIT DIGIT | 'Z')?
  ;
WKDAY: 'Mon' | 'Tue' | 'Wed' | 'Thu' | 'Fri' | 'Sat' | 'Sun' ;
YEAR_MONTH: 'Jan' | 'Feb' | 'Mar' | 'Apr' | 'May' | 'Jun' | 'Jul' | 'Aug' | 'Sep' | 'Oct' | 'Nov' | 'Dec' ;
COLON: ':' ;
CARET: '^' ;
TIMEZONE: 'GMT' | 'PST' ;

RESO defined Function Names

FUNCTION_NAME
	: 'LOWER'
	| 'STRLEN'
	| 'SUBSTR'
	| 'UPPER'
	| 'BOOL'
	| 'CHAR'
	| 'CHARF'
	| 'DATE'
    | 'FLOAT'
	| 'INT'
	| 'TIME'
	| 'IIF'
	| 'DAY'
	| 'MONTH'
	| 'YEAR'
	| 'WEEKDAY'
	| 'TYPEOF'
    ;

Local Names or Extension Functions

LOCAL_NAME
	: 'MATCH'
	| 'RESOURCE'
	| 'TRIM'
	| 'DAYS'
	| 'DATEONLY'
	| 'SECOND'
	| 'MINUTE'
	| 'HOUR'
	| 'COUNT'
	| 'ROSTER'
	| 'DUPLICATE'
	| 'ALPHANUMERIC'
	;

Dictionary Names

DICTNAME : ALPHA (ALPHA|DIGIT)*;

Special Operations

SPECOP
    :   'EMPTY'
    |   'TRUE'
    |   'FALSE'
    |   'TODAY'
    |   'NOW'
    |   'ENTRY'
    |   'OLDVALUE'
    |   'USERID'
    |   'USERCLASS'
    |   'USERLEVEL'
    |   'AGENTCODE'
    |   'BROKERCODE'
    |   'BROKERBRANCH'
    |   'UPDATEACTION'
    |   'any'
    ;

Names and Qouted Terms

ALPHA: ('a'..'z' | 'A'..'Z');
DIGIT: ('0'..'9');
ALPHANUM: ALPHA (ALPHA|DIGIT)*;
QUOTED_TERM
    :   QUOTE (~[\\"])*? QUOTE
    |   SQUOTE (~[\'])*? SQUOTE
    ;

Comments

SLASH_STAR_COMMENT  : '/*' .*? '*/';
SLASH_SLASH_COMMENT : '//' .*? ('\n'|EOF) -> skip;

Whitespace

WS : [ \t\n\r]+ -> skip ;