cublas
This commit is contained in:
parent
a05aa8a83e
commit
3804bc8c5d
2 changed files with 49 additions and 0 deletions
1
grammars/cublas.gebnf
Normal file
1
grammars/cublas.gebnf
Normal file
File diff suppressed because one or more lines are too long
48
grammars/mysql.gebnf
Normal file
48
grammars/mysql.gebnf
Normal file
|
@ -0,0 +1,48 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
# Define a table definition
|
||||
|
||||
|
||||
tablename ::= [a-zA-Z_][a-zA-Z0-9_]*
|
||||
|
||||
# Define column definitions
|
||||
columndefinitions ::= columndefinition+
|
||||
|
||||
# Define a column definition
|
||||
columndefinition ::= columnname " " datatype
|
||||
|
||||
# Define a column name
|
||||
columnname ::= [a-zA-Z_][a-zA-Z0-9_]*
|
||||
|
||||
# Define a data type
|
||||
datatype ::= "INT" | "VARCHAR" | "DATE"
|
||||
|
||||
# Define relationship definitions
|
||||
relationshipdefinitions ::= relationshipdefinition+
|
||||
|
||||
# Define a relationship definition
|
||||
relationshipdefinition ::= "FOREIGN KEY (" columnname ") REFERENCES " tablename " (" columnname ")"
|
||||
|
||||
# Define ID tokens for each table
|
||||
tableidtokens ::= tableidtoken+
|
||||
|
||||
# Define an ID token for a table
|
||||
tableidtoken ::= tablename "_id"
|
||||
|
||||
# Define predicates for each table ID
|
||||
tableidpredicates ::= tableidpredicate+
|
||||
|
||||
# Define predicates for a table ID
|
||||
tableidpredicate ::= tableidtoken "." columnname
|
||||
|
||||
# Define optional whitespace between components
|
||||
ws ::= [ \t\n]+
|
||||
|
||||
tabledefinition ::= "CREATE TABLE " tablename " (" columndefinitions ")" "\n"
|
||||
|
||||
tabledefinitions ::= tabledefinition+
|
||||
|
||||
root ::= tabledefinitions relationshipdefinitions
|
Loading…
Add table
Add a link
Reference in a new issue