Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test code for grammar specification #2

Closed
wants to merge 10 commits into from
Closed
152 changes: 108 additions & 44 deletions antlr/Schema.g4
Original file line number Diff line number Diff line change
@@ -1,46 +1,110 @@
grammar Schema;

// Entry point of the grammar
start: typeDefinitions EOF;
typeDefinitions
: typeDefinition (WHITESPACE* typeDefinitions)?
;
typeDefinition
: 'type' IDENTIFIER '{' fieldList '}'
;
fieldList
: field (WHITESPACE* fieldList)?
;
field
: IDENTIFIER WHITESPACE* ':' WHITESPACE* fieldType
;
fieldType
: typeExpression arraySuffix*
;
typeExpression
: unionType
| simpleType
;
simpleType
: primitiveType
| IDENTIFIER
;
arraySuffix
: '[]'
;
unionType
: '(' WHITESPACE* unionTypeInner WHITESPACE* ')'
| unionTypeInner
;
unionTypeInner
: simpleType (WHITESPACE* '|' WHITESPACE* simpleType)*
;
primitiveType
: ('string' | 'number' | 'boolean')
;
IDENTIFIER
: [a-zA-Z_] [a-zA-Z0-9_]*
;
WHITESPACE
: [ \t\n\r]+ -> skip
;
// Lexer rules
IDENTIFIER: [a-zA-Z_] [a-zA-Z0-9_]*;
NEWLINE: '\r'? '\n' -> skip;
COMMENT: ('//' | '#') ~[\r\n]* -> skip;
DIGIT: [0-9];
WHITESPACE: [ \t\n\r]+ -> skip;

// Keywords
YORKIE_OBJECT: 'yorkie.Object';
YORKIE_ARRAY: 'yorkie.Array';
YORKIE_COUNTER: 'yorkie.Counter';
YORKIE_TEXT: 'yorkie.Text';
YORKIE_TREE: 'yorkie.Tree';

// Operations and Symbols
MINUS: '-';
SEMICOLON: ';';
LPAREN: '(';
RPAREN: ')';
LCURLY: '{';
RCURLY: '}';
GT: '>';
LT: '<';
PIPE: '|';
QUESTION: '?';
EQ: '=';
COMMA: ',';
LSQUARE: '[';
RSQUARE: ']';

// Utils
DOUBLE_QUOTED_STRING: '"' (ESC | ~["\n])* '"';
SINGLE_QUOTED_STRING: '\'' (ESC | ~['\n])* '\'';
fragment ESC: '\\' [btnr\\'"];

// Top-level rule
document: definitionList EOF;

definitionList: definition (WHITESPACE* definition)*;

definition: objectTypeDefinition;

typeName: IDENTIFIER;

objectTypeDefinition
: 'type' WHITESPACE* typeName WHITESPACE* LCURLY WHITESPACE*
fieldDefList? WHITESPACE* RCURLY SEMICOLON?
;

fieldDefList
: fieldDef ((COMMA | SEMICOLON | NEWLINE) fieldDef)*
;

identifier: IDENTIFIER;

fieldDef: identifier QUESTION? ':' type;
Comment on lines +52 to +58
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider standardizing field separators

The 'fieldDefList' rule currently allows for multiple separators (comma, semicolon, newline) between field definitions. While this provides flexibility, it may lead to inconsistencies in schema definitions.

Consider standardizing on a single separator for clarity and consistency. For example:

fieldDefList
    : fieldDef (COMMA fieldDef)*
    ;

This change would enforce a consistent style across schema definitions.


type: nonUnionType (PIPE type)*;

nonUnionType: nonUnionTypeL2 (LSQUARE RSQUARE)*;

nonUnionTypeL2:
LPAREN type RPAREN
| objectLiteralType
| primitiveType
| literalType
| yorkieType
| typeReference;

typeReference: typeName;
objectLiteralType: LCURLY fieldDefList? RCURLY;

primitiveType:
'string'
| 'number'
| 'boolean'
| 'null'
| 'bigint'
| 'Uint8Array'
| 'Date'
;

literalType:
booleanLiteralType
| numberLiteralType
| stringLiteralType;

booleanLiteralType: 'true' | 'false';

numberLiteralType: MINUS? DIGIT+ ('.' DIGIT+)?;
sigmaith marked this conversation as resolved.
Show resolved Hide resolved

stringLiteralType: DOUBLE_QUOTED_STRING | SINGLE_QUOTED_STRING;
sigmaith marked this conversation as resolved.
Show resolved Hide resolved

yorkieType:
yorkieObjectType
| yorkieArrayType
| yorkieCounterType
| yorkieTextType
| yorkieTreeType;

yorkieObjectType:
YORKIE_OBJECT LT (typeReference | objectLiteralType) GT;
yorkieArrayType:
YORKIE_ARRAY LT (typeReference | objectLiteralType) GT;
yorkieCounterType: YORKIE_COUNTER;
yorkieTextType:
YORKIE_TEXT LT (typeReference | objectLiteralType) GT;
yorkieTreeType: YORKIE_TREE LT GT;
98 changes: 80 additions & 18 deletions antlr/Schema.interp
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
token literal names:
null
'type'
'{'
'}'
':'
'[]'
'('
')'
'|'
'string'
'number'
'boolean'
'null'
'bigint'
'Uint8Array'
'Date'
'true'
'false'
'.'
null
null
null
null
null
'yorkie.Object'
'yorkie.Array'
'yorkie.Counter'
'yorkie.Text'
'yorkie.Tree'
'-'
';'
'('
')'
'{'
'}'
'>'
'<'
'|'
'?'
'='
','
'['
']'
null
null

Expand All @@ -27,23 +52,60 @@ null
null
null
null
null
IDENTIFIER
NEWLINE
COMMENT
DIGIT
WHITESPACE
YORKIE_OBJECT
YORKIE_ARRAY
YORKIE_COUNTER
YORKIE_TEXT
YORKIE_TREE
MINUS
SEMICOLON
LPAREN
RPAREN
LCURLY
RCURLY
GT
LT
PIPE
QUESTION
EQ
COMMA
LSQUARE
RSQUARE
DOUBLE_QUOTED_STRING
SINGLE_QUOTED_STRING

rule names:
start
typeDefinitions
typeDefinition
fieldList
field
fieldType
typeExpression
simpleType
arraySuffix
unionType
unionTypeInner
document
definitionList
definition
typeName
objectTypeDefinition
fieldDefList
identifier
fieldDef
type
nonUnionType
nonUnionTypeL2
typeReference
objectLiteralType
primitiveType
literalType
booleanLiteralType
numberLiteralType
stringLiteralType
yorkieType
yorkieObjectType
yorkieArrayType
yorkieCounterType
yorkieTextType
yorkieTreeType


atn:
[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 15, 130, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 7, 3, 32, 10, 3, 12, 3, 14, 3, 35, 11, 3, 3, 3, 5, 3, 38, 10, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 7, 5, 48, 10, 5, 12, 5, 14, 5, 51, 11, 5, 3, 5, 5, 5, 54, 10, 5, 3, 6, 3, 6, 7, 6, 58, 10, 6, 12, 6, 14, 6, 61, 11, 6, 3, 6, 3, 6, 7, 6, 65, 10, 6, 12, 6, 14, 6, 68, 11, 6, 3, 6, 3, 6, 3, 7, 3, 7, 7, 7, 74, 10, 7, 12, 7, 14, 7, 77, 11, 7, 3, 8, 3, 8, 5, 8, 81, 10, 8, 3, 9, 3, 9, 5, 9, 85, 10, 9, 3, 10, 3, 10, 3, 11, 3, 11, 7, 11, 91, 10, 11, 12, 11, 14, 11, 94, 11, 11, 3, 11, 3, 11, 7, 11, 98, 10, 11, 12, 11, 14, 11, 101, 11, 11, 3, 11, 3, 11, 3, 11, 5, 11, 106, 10, 11, 3, 12, 3, 12, 7, 12, 110, 10, 12, 12, 12, 14, 12, 113, 11, 12, 3, 12, 3, 12, 7, 12, 117, 10, 12, 12, 12, 14, 12, 120, 11, 12, 3, 12, 7, 12, 123, 10, 12, 12, 12, 14, 12, 126, 11, 12, 3, 13, 3, 13, 3, 13, 2, 2, 2, 14, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 2, 3, 3, 2, 11, 13, 2, 132, 2, 26, 3, 2, 2, 2, 4, 29, 3, 2, 2, 2, 6, 39, 3, 2, 2, 2, 8, 45, 3, 2, 2, 2, 10, 55, 3, 2, 2, 2, 12, 71, 3, 2, 2, 2, 14, 80, 3, 2, 2, 2, 16, 84, 3, 2, 2, 2, 18, 86, 3, 2, 2, 2, 20, 105, 3, 2, 2, 2, 22, 107, 3, 2, 2, 2, 24, 127, 3, 2, 2, 2, 26, 27, 5, 4, 3, 2, 27, 28, 7, 2, 2, 3, 28, 3, 3, 2, 2, 2, 29, 37, 5, 6, 4, 2, 30, 32, 7, 15, 2, 2, 31, 30, 3, 2, 2, 2, 32, 35, 3, 2, 2, 2, 33, 31, 3, 2, 2, 2, 33, 34, 3, 2, 2, 2, 34, 36, 3, 2, 2, 2, 35, 33, 3, 2, 2, 2, 36, 38, 5, 4, 3, 2, 37, 33, 3, 2, 2, 2, 37, 38, 3, 2, 2, 2, 38, 5, 3, 2, 2, 2, 39, 40, 7, 3, 2, 2, 40, 41, 7, 14, 2, 2, 41, 42, 7, 4, 2, 2, 42, 43, 5, 8, 5, 2, 43, 44, 7, 5, 2, 2, 44, 7, 3, 2, 2, 2, 45, 53, 5, 10, 6, 2, 46, 48, 7, 15, 2, 2, 47, 46, 3, 2, 2, 2, 48, 51, 3, 2, 2, 2, 49, 47, 3, 2, 2, 2, 49, 50, 3, 2, 2, 2, 50, 52, 3, 2, 2, 2, 51, 49, 3, 2, 2, 2, 52, 54, 5, 8, 5, 2, 53, 49, 3, 2, 2, 2, 53, 54, 3, 2, 2, 2, 54, 9, 3, 2, 2, 2, 55, 59, 7, 14, 2, 2, 56, 58, 7, 15, 2, 2, 57, 56, 3, 2, 2, 2, 58, 61, 3, 2, 2, 2, 59, 57, 3, 2, 2, 2, 59, 60, 3, 2, 2, 2, 60, 62, 3, 2, 2, 2, 61, 59, 3, 2, 2, 2, 62, 66, 7, 6, 2, 2, 63, 65, 7, 15, 2, 2, 64, 63, 3, 2, 2, 2, 65, 68, 3, 2, 2, 2, 66, 64, 3, 2, 2, 2, 66, 67, 3, 2, 2, 2, 67, 69, 3, 2, 2, 2, 68, 66, 3, 2, 2, 2, 69, 70, 5, 12, 7, 2, 70, 11, 3, 2, 2, 2, 71, 75, 5, 14, 8, 2, 72, 74, 5, 18, 10, 2, 73, 72, 3, 2, 2, 2, 74, 77, 3, 2, 2, 2, 75, 73, 3, 2, 2, 2, 75, 76, 3, 2, 2, 2, 76, 13, 3, 2, 2, 2, 77, 75, 3, 2, 2, 2, 78, 81, 5, 20, 11, 2, 79, 81, 5, 16, 9, 2, 80, 78, 3, 2, 2, 2, 80, 79, 3, 2, 2, 2, 81, 15, 3, 2, 2, 2, 82, 85, 5, 24, 13, 2, 83, 85, 7, 14, 2, 2, 84, 82, 3, 2, 2, 2, 84, 83, 3, 2, 2, 2, 85, 17, 3, 2, 2, 2, 86, 87, 7, 7, 2, 2, 87, 19, 3, 2, 2, 2, 88, 92, 7, 8, 2, 2, 89, 91, 7, 15, 2, 2, 90, 89, 3, 2, 2, 2, 91, 94, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 92, 93, 3, 2, 2, 2, 93, 95, 3, 2, 2, 2, 94, 92, 3, 2, 2, 2, 95, 99, 5, 22, 12, 2, 96, 98, 7, 15, 2, 2, 97, 96, 3, 2, 2, 2, 98, 101, 3, 2, 2, 2, 99, 97, 3, 2, 2, 2, 99, 100, 3, 2, 2, 2, 100, 102, 3, 2, 2, 2, 101, 99, 3, 2, 2, 2, 102, 103, 7, 9, 2, 2, 103, 106, 3, 2, 2, 2, 104, 106, 5, 22, 12, 2, 105, 88, 3, 2, 2, 2, 105, 104, 3, 2, 2, 2, 106, 21, 3, 2, 2, 2, 107, 124, 5, 16, 9, 2, 108, 110, 7, 15, 2, 2, 109, 108, 3, 2, 2, 2, 110, 113, 3, 2, 2, 2, 111, 109, 3, 2, 2, 2, 111, 112, 3, 2, 2, 2, 112, 114, 3, 2, 2, 2, 113, 111, 3, 2, 2, 2, 114, 118, 7, 10, 2, 2, 115, 117, 7, 15, 2, 2, 116, 115, 3, 2, 2, 2, 117, 120, 3, 2, 2, 2, 118, 116, 3, 2, 2, 2, 118, 119, 3, 2, 2, 2, 119, 121, 3, 2, 2, 2, 120, 118, 3, 2, 2, 2, 121, 123, 5, 16, 9, 2, 122, 111, 3, 2, 2, 2, 123, 126, 3, 2, 2, 2, 124, 122, 3, 2, 2, 2, 124, 125, 3, 2, 2, 2, 125, 23, 3, 2, 2, 2, 126, 124, 3, 2, 2, 2, 127, 128, 9, 2, 2, 2, 128, 25, 3, 2, 2, 2, 17, 33, 37, 49, 53, 59, 66, 75, 80, 84, 92, 99, 105, 111, 118, 124]
[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 40, 221, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 7, 3, 56, 10, 3, 12, 3, 14, 3, 59, 11, 3, 3, 3, 7, 3, 62, 10, 3, 12, 3, 14, 3, 65, 11, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 7, 6, 73, 10, 6, 12, 6, 14, 6, 76, 11, 6, 3, 6, 3, 6, 7, 6, 80, 10, 6, 12, 6, 14, 6, 83, 11, 6, 3, 6, 3, 6, 7, 6, 87, 10, 6, 12, 6, 14, 6, 90, 11, 6, 3, 6, 5, 6, 93, 10, 6, 3, 6, 7, 6, 96, 10, 6, 12, 6, 14, 6, 99, 11, 6, 3, 6, 3, 6, 5, 6, 103, 10, 6, 3, 7, 3, 7, 3, 7, 7, 7, 108, 10, 7, 12, 7, 14, 7, 111, 11, 7, 3, 8, 3, 8, 3, 9, 3, 9, 5, 9, 117, 10, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 7, 10, 125, 10, 10, 12, 10, 14, 10, 128, 11, 10, 3, 11, 3, 11, 3, 11, 7, 11, 133, 10, 11, 12, 11, 14, 11, 136, 11, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 5, 12, 147, 10, 12, 3, 13, 3, 13, 3, 14, 3, 14, 5, 14, 153, 10, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 5, 16, 162, 10, 16, 3, 17, 3, 17, 3, 18, 5, 18, 167, 10, 18, 3, 18, 6, 18, 170, 10, 18, 13, 18, 14, 18, 171, 3, 18, 3, 18, 6, 18, 176, 10, 18, 13, 18, 14, 18, 177, 5, 18, 180, 10, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 5, 20, 189, 10, 20, 3, 21, 3, 21, 3, 21, 3, 21, 5, 21, 195, 10, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 203, 10, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 5, 24, 213, 10, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 2, 2, 2, 26, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 2, 6, 5, 2, 16, 16, 26, 26, 36, 36, 3, 2, 5, 11, 3, 2, 12, 13, 3, 2, 39, 40, 2, 227, 2, 50, 3, 2, 2, 2, 4, 53, 3, 2, 2, 2, 6, 66, 3, 2, 2, 2, 8, 68, 3, 2, 2, 2, 10, 70, 3, 2, 2, 2, 12, 104, 3, 2, 2, 2, 14, 112, 3, 2, 2, 2, 16, 114, 3, 2, 2, 2, 18, 121, 3, 2, 2, 2, 20, 129, 3, 2, 2, 2, 22, 146, 3, 2, 2, 2, 24, 148, 3, 2, 2, 2, 26, 150, 3, 2, 2, 2, 28, 156, 3, 2, 2, 2, 30, 161, 3, 2, 2, 2, 32, 163, 3, 2, 2, 2, 34, 166, 3, 2, 2, 2, 36, 181, 3, 2, 2, 2, 38, 188, 3, 2, 2, 2, 40, 190, 3, 2, 2, 2, 42, 198, 3, 2, 2, 2, 44, 206, 3, 2, 2, 2, 46, 208, 3, 2, 2, 2, 48, 216, 3, 2, 2, 2, 50, 51, 5, 4, 3, 2, 51, 52, 7, 2, 2, 3, 52, 3, 3, 2, 2, 2, 53, 63, 5, 6, 4, 2, 54, 56, 7, 19, 2, 2, 55, 54, 3, 2, 2, 2, 56, 59, 3, 2, 2, 2, 57, 55, 3, 2, 2, 2, 57, 58, 3, 2, 2, 2, 58, 60, 3, 2, 2, 2, 59, 57, 3, 2, 2, 2, 60, 62, 5, 6, 4, 2, 61, 57, 3, 2, 2, 2, 62, 65, 3, 2, 2, 2, 63, 61, 3, 2, 2, 2, 63, 64, 3, 2, 2, 2, 64, 5, 3, 2, 2, 2, 65, 63, 3, 2, 2, 2, 66, 67, 5, 10, 6, 2, 67, 7, 3, 2, 2, 2, 68, 69, 7, 15, 2, 2, 69, 9, 3, 2, 2, 2, 70, 74, 7, 3, 2, 2, 71, 73, 7, 19, 2, 2, 72, 71, 3, 2, 2, 2, 73, 76, 3, 2, 2, 2, 74, 72, 3, 2, 2, 2, 74, 75, 3, 2, 2, 2, 75, 77, 3, 2, 2, 2, 76, 74, 3, 2, 2, 2, 77, 81, 5, 8, 5, 2, 78, 80, 7, 19, 2, 2, 79, 78, 3, 2, 2, 2, 80, 83, 3, 2, 2, 2, 81, 79, 3, 2, 2, 2, 81, 82, 3, 2, 2, 2, 82, 84, 3, 2, 2, 2, 83, 81, 3, 2, 2, 2, 84, 88, 7, 29, 2, 2, 85, 87, 7, 19, 2, 2, 86, 85, 3, 2, 2, 2, 87, 90, 3, 2, 2, 2, 88, 86, 3, 2, 2, 2, 88, 89, 3, 2, 2, 2, 89, 92, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 91, 93, 5, 12, 7, 2, 92, 91, 3, 2, 2, 2, 92, 93, 3, 2, 2, 2, 93, 97, 3, 2, 2, 2, 94, 96, 7, 19, 2, 2, 95, 94, 3, 2, 2, 2, 96, 99, 3, 2, 2, 2, 97, 95, 3, 2, 2, 2, 97, 98, 3, 2, 2, 2, 98, 100, 3, 2, 2, 2, 99, 97, 3, 2, 2, 2, 100, 102, 7, 30, 2, 2, 101, 103, 7, 26, 2, 2, 102, 101, 3, 2, 2, 2, 102, 103, 3, 2, 2, 2, 103, 11, 3, 2, 2, 2, 104, 109, 5, 16, 9, 2, 105, 106, 9, 2, 2, 2, 106, 108, 5, 16, 9, 2, 107, 105, 3, 2, 2, 2, 108, 111, 3, 2, 2, 2, 109, 107, 3, 2, 2, 2, 109, 110, 3, 2, 2, 2, 110, 13, 3, 2, 2, 2, 111, 109, 3, 2, 2, 2, 112, 113, 7, 15, 2, 2, 113, 15, 3, 2, 2, 2, 114, 116, 5, 14, 8, 2, 115, 117, 7, 34, 2, 2, 116, 115, 3, 2, 2, 2, 116, 117, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 119, 7, 4, 2, 2, 119, 120, 5, 18, 10, 2, 120, 17, 3, 2, 2, 2, 121, 126, 5, 20, 11, 2, 122, 123, 7, 33, 2, 2, 123, 125, 5, 18, 10, 2, 124, 122, 3, 2, 2, 2, 125, 128, 3, 2, 2, 2, 126, 124, 3, 2, 2, 2, 126, 127, 3, 2, 2, 2, 127, 19, 3, 2, 2, 2, 128, 126, 3, 2, 2, 2, 129, 134, 5, 22, 12, 2, 130, 131, 7, 37, 2, 2, 131, 133, 7, 38, 2, 2, 132, 130, 3, 2, 2, 2, 133, 136, 3, 2, 2, 2, 134, 132, 3, 2, 2, 2, 134, 135, 3, 2, 2, 2, 135, 21, 3, 2, 2, 2, 136, 134, 3, 2, 2, 2, 137, 138, 7, 27, 2, 2, 138, 139, 5, 18, 10, 2, 139, 140, 7, 28, 2, 2, 140, 147, 3, 2, 2, 2, 141, 147, 5, 26, 14, 2, 142, 147, 5, 28, 15, 2, 143, 147, 5, 30, 16, 2, 144, 147, 5, 38, 20, 2, 145, 147, 5, 24, 13, 2, 146, 137, 3, 2, 2, 2, 146, 141, 3, 2, 2, 2, 146, 142, 3, 2, 2, 2, 146, 143, 3, 2, 2, 2, 146, 144, 3, 2, 2, 2, 146, 145, 3, 2, 2, 2, 147, 23, 3, 2, 2, 2, 148, 149, 5, 8, 5, 2, 149, 25, 3, 2, 2, 2, 150, 152, 7, 29, 2, 2, 151, 153, 5, 12, 7, 2, 152, 151, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 154, 3, 2, 2, 2, 154, 155, 7, 30, 2, 2, 155, 27, 3, 2, 2, 2, 156, 157, 9, 3, 2, 2, 157, 29, 3, 2, 2, 2, 158, 162, 5, 32, 17, 2, 159, 162, 5, 34, 18, 2, 160, 162, 5, 36, 19, 2, 161, 158, 3, 2, 2, 2, 161, 159, 3, 2, 2, 2, 161, 160, 3, 2, 2, 2, 162, 31, 3, 2, 2, 2, 163, 164, 9, 4, 2, 2, 164, 33, 3, 2, 2, 2, 165, 167, 7, 25, 2, 2, 166, 165, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 169, 3, 2, 2, 2, 168, 170, 7, 18, 2, 2, 169, 168, 3, 2, 2, 2, 170, 171, 3, 2, 2, 2, 171, 169, 3, 2, 2, 2, 171, 172, 3, 2, 2, 2, 172, 179, 3, 2, 2, 2, 173, 175, 7, 14, 2, 2, 174, 176, 7, 18, 2, 2, 175, 174, 3, 2, 2, 2, 176, 177, 3, 2, 2, 2, 177, 175, 3, 2, 2, 2, 177, 178, 3, 2, 2, 2, 178, 180, 3, 2, 2, 2, 179, 173, 3, 2, 2, 2, 179, 180, 3, 2, 2, 2, 180, 35, 3, 2, 2, 2, 181, 182, 9, 5, 2, 2, 182, 37, 3, 2, 2, 2, 183, 189, 5, 40, 21, 2, 184, 189, 5, 42, 22, 2, 185, 189, 5, 44, 23, 2, 186, 189, 5, 46, 24, 2, 187, 189, 5, 48, 25, 2, 188, 183, 3, 2, 2, 2, 188, 184, 3, 2, 2, 2, 188, 185, 3, 2, 2, 2, 188, 186, 3, 2, 2, 2, 188, 187, 3, 2, 2, 2, 189, 39, 3, 2, 2, 2, 190, 191, 7, 20, 2, 2, 191, 194, 7, 32, 2, 2, 192, 195, 5, 24, 13, 2, 193, 195, 5, 26, 14, 2, 194, 192, 3, 2, 2, 2, 194, 193, 3, 2, 2, 2, 195, 196, 3, 2, 2, 2, 196, 197, 7, 31, 2, 2, 197, 41, 3, 2, 2, 2, 198, 199, 7, 21, 2, 2, 199, 202, 7, 32, 2, 2, 200, 203, 5, 24, 13, 2, 201, 203, 5, 26, 14, 2, 202, 200, 3, 2, 2, 2, 202, 201, 3, 2, 2, 2, 203, 204, 3, 2, 2, 2, 204, 205, 7, 31, 2, 2, 205, 43, 3, 2, 2, 2, 206, 207, 7, 22, 2, 2, 207, 45, 3, 2, 2, 2, 208, 209, 7, 23, 2, 2, 209, 212, 7, 32, 2, 2, 210, 213, 5, 24, 13, 2, 211, 213, 5, 26, 14, 2, 212, 210, 3, 2, 2, 2, 212, 211, 3, 2, 2, 2, 213, 214, 3, 2, 2, 2, 214, 215, 7, 31, 2, 2, 215, 47, 3, 2, 2, 2, 216, 217, 7, 24, 2, 2, 217, 218, 7, 32, 2, 2, 218, 219, 7, 31, 2, 2, 219, 49, 3, 2, 2, 2, 25, 57, 63, 74, 81, 88, 92, 97, 102, 109, 116, 126, 134, 146, 152, 161, 166, 171, 177, 179, 188, 194, 202, 212]
69 changes: 57 additions & 12 deletions antlr/Schema.tokens
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,61 @@ T__7=8
T__8=9
T__9=10
T__10=11
IDENTIFIER=12
WHITESPACE=13
T__11=12
IDENTIFIER=13
NEWLINE=14
COMMENT=15
DIGIT=16
WHITESPACE=17
YORKIE_OBJECT=18
YORKIE_ARRAY=19
YORKIE_COUNTER=20
YORKIE_TEXT=21
YORKIE_TREE=22
MINUS=23
SEMICOLON=24
LPAREN=25
RPAREN=26
LCURLY=27
RCURLY=28
GT=29
LT=30
PIPE=31
QUESTION=32
EQ=33
COMMA=34
LSQUARE=35
RSQUARE=36
DOUBLE_QUOTED_STRING=37
SINGLE_QUOTED_STRING=38
'type'=1
'{'=2
'}'=3
':'=4
'[]'=5
'('=6
')'=7
'|'=8
'string'=9
'number'=10
'boolean'=11
':'=2
'string'=3
'number'=4
'boolean'=5
'null'=6
'bigint'=7
'Uint8Array'=8
'Date'=9
'true'=10
'false'=11
'.'=12
'yorkie.Object'=18
'yorkie.Array'=19
'yorkie.Counter'=20
'yorkie.Text'=21
'yorkie.Tree'=22
'-'=23
';'=24
'('=25
')'=26
'{'=27
'}'=28
'>'=29
'<'=30
'|'=31
'?'=32
'='=33
','=34
'['=35
']'=36
Loading