1. DOT := '.';
    2. COLON : ':' ;
    3. COMMA := ',' ;
    4. SEMICOLON := ';' ;
    5. LPAREN := '(' ;
    6. RPAREN := ')' ;
    7. LBRACKET := '[';
    8. RBRACKET := ']';
    9. EQUAL := '=' | '==';
    10. NOTEQUAL := '<>' | '!=';
    11. LESSTHANOREQUALTO := '<=';
    12. LESSTHAN := '<';
    13. GREATERTHANOREQUALTO := '>=';
    14. GREATERTHAN := '>';
    15. DIVIDE := '/';
    16. PLUS := '+';
    17. STAR := '*';
    18. HexDigit := 'a'..'f' | 'A'..'F';
    19. Digit := '0'..'9';
    20. Boolean := TRUE | FALSE | 0 | 1 (case insensitive)
    1. StringLiteral := ( '\'' ( ~('\'') )* '\'' | '\"' ( ~('\"') )* '\"');
    2. eg. abc
    3. eg. abc
    1. Integer := ('-' | '+')? Digit+;
    2. eg. 123
    3. eg. -222
    1. Identifier := (Letter | '_') (Letter | Digit | '_' | MINUS)*;
    2. eg. a123
    3. eg. _abc123
    1. PointValue : Integer | Float | StringLiteral | Boolean
    1. TimeValue : Integer | DateTime | ISO8601 | NOW()
    2. Note: Integer means timestamp type.
    3. DateTime :
    4. eg. 2016-11-16T16:22:33+08:00
    5. eg. 2016-11-16T16:22:33.000+08:00
    6. eg. 2016-11-16 16:22:33.000+08:00
    7. Note: DateTime Type can support several types, see Chapter 3 Datetime section for details.
    1. Timeseries : ROOT [DOT <LayerName>]* DOT <SensorName>
    2. LayerName : Identifier
    3. SensorName : Identifier
    4. eg. root.ln.wf01.wt01.status
    5. eg. root.sgcc.wf03.wt01.temperature
    6. Note: Timeseries must be start with `root`(case insensitive) and end with sensor name.
    1. PrefixPath : ROOT (DOT <LayerName>)*
    2. LayerName : Identifier | STAR
    3. eg. root.sgcc
    4. eg. root.*
    1. Path: (ROOT | <LayerName>) (DOT <LayerName>)*
    2. LayerName: Identifier | STAR
    3. eg. root.ln.wf01.wt01.status
    4. eg. root.*.wf01.wt01.status
    5. eg. root.ln.wf01.wt01.*
    6. eg. *