Implemented parser.

This commit is contained in:
2018-06-09 16:39:20 +01:00
parent cb262733ed
commit 9e60b793c6
9 changed files with 935 additions and 149 deletions

View File

@@ -8,7 +8,7 @@ Drop Table X
StatementList = StatementList, Statement | Statement ;
Statement = SelectStmt | InsertStmt | UpdateStmt | DeleteStmt | CreateStmt | DropStmt ';' ;
SelectStmt = 'Select', FieldList, 'From', Identifier, AssignmentList ;
SelectStmt = 'Select', FieldList, 'From', Identifier, ['Where', ComparisonGroup] ;
InsertStmt = 'Insert Into', Identifier, 'Set', AssignmentList ;
UpdateStmt = 'Update', Identifier, 'Set', AssignmentList, 'Where', AssignmentList ;
DeleteStmt = 'Delete From', Identifier, 'Where', AssignmentList ;
@@ -17,7 +17,7 @@ DropStmt = 'Drop Table', Identifier ;
ColumnSpecList = ColumnSpec | ColumnSpecList, ',', ColumnSpec ;
ColumnSpec = Identifier, ColumnType | Identifier, ColumnType, ColumnOption ;
ColumnType = 'String(', number, ')' | 'Int' ;
ColumnType = 'String', '(', number, ')' | 'Int' | 'Integer' ;
ColumnOption = 'Index' ;
FieldList = Identifier | FieldList, ',', Identifier ;