2023-08-20 12:13:40 +08:00
|
|
|
parser grammar CKEnumsParser;
|
2023-08-17 15:48:30 +08:00
|
|
|
options { tokenVocab = CKGeneralLexer; }
|
|
|
|
|
2023-08-19 00:03:00 +08:00
|
|
|
prog: enumBody* ;
|
2023-08-17 15:48:30 +08:00
|
|
|
|
|
|
|
enumBody: CKGENERAL_TYPEDEF? CKGENERAL_ENUM CKGENERAL_ID CKGENERAL_LBRACKET
|
2023-08-18 15:55:31 +08:00
|
|
|
entryPair+
|
2023-08-17 15:48:30 +08:00
|
|
|
CKGENERAL_RBRACKET CKGENERAL_ID? CKGENERAL_SEMICOLON ;
|
|
|
|
|
2023-08-18 15:55:31 +08:00
|
|
|
entryPair: CKGENERAL_ID (CKGENERAL_EQUAL entryValue)? CKGENERAL_COMMA? ;
|
2023-08-17 15:48:30 +08:00
|
|
|
|
2023-08-18 15:55:31 +08:00
|
|
|
entryValue: CKGENERAL_NUM (CKGENERAL_LSHIFT CKGENERAL_NUM)? # entryDirectValue
|
2023-08-17 15:48:30 +08:00
|
|
|
| CKGENERAL_ID (CKGENERAL_OR CKGENERAL_ID)* # entryRelativeValue
|
|
|
|
;
|