Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LDI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Grant Weddell
LDI
Commits
ffa56bef
Commit
ffa56bef
authored
5 years ago
by
eva
Browse files
Options
Downloads
Patches
Plain Diff
outline for SQLP schema grammar
parent
deea1dda
No related branches found
No related tags found
2 merge requests
!5
Dev Merge into Master
,
!2
Schema+RefExp Translation Rule 1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SQLPScanner_new.l
+2
-0
2 additions, 0 deletions
SQLPScanner_new.l
SQLPSchema.y
+169
-0
169 additions, 0 deletions
SQLPSchema.y
with
171 additions
and
0 deletions
SQLPScanner_new.l
+
2
−
0
View file @
ffa56bef
...
...
@@ -75,6 +75,7 @@ E [Ee][+-]?{D}+
"mod" { strcat(LineBuffer, yytext); return(MOD); }
"not" { strcat(LineBuffer, yytext); return(NOT); }
"of" { strcat(LineBuffer, yytext); return(OF); }
"Oid" { strcat(LineBuffer, yytext); return(OID); }
"on" { strcat(LineBuffer, yytext); return(ON); }
"one" { strcat(LineBuffer, yytext); return(ONE); }
"or" { strcat(LineBuffer, yytext); return(OR); }
...
...
@@ -91,6 +92,7 @@ E [Ee][+-]?{D}+
"schema" { strcat(LineBuffer, yytext); return(SCHEMA); }
"select" { strcat(LineBuffer, yytext); return(SELECT); }
"selectivity" { strcat(LineBuffer, yytext); return(SELECTIVITY); }
"self" { strcat(LineBuffer, yytext); return(SELF); }
"size" { strcat(LineBuffer, yytext); return(SIZE); }
"space" { strcat(LineBuffer, yytext); return(SPACE); }
"static" { strcat(LineBuffer, yytext); return(STATIC); }
...
...
This diff is collapsed.
Click to expand it.
SQLPSchema.y
0 → 100644
+
169
−
0
View file @
ffa56bef
%{
#include "util_new.h"
%}
%define api.value.type {cons_cell *}
%token IMPLIES OR AND NOT LE GE LT GT NE HAS MAX MIN AS ASC DESC MOD ASSIGN EQ STAR COMMA DOT
%token SIZE SELECTIVITY OVERLAP
%token FREQUENCY UNIT TIME SPACE
%token IDENTIFIER CONSTANT STRING_LITERAL SIZEOF
%token STORE STORING DYNAMIC STATIC OF TYPE ORDERED BY
%token INDEX LIST ARRAY BINARY TREE DISTRIBUTED POINTER
%token SCHEMA CLASS ISA PROPERTIES CONSTRAINTS PROPERTY
%token ON DETERMINED COVER QUERY GIVEN FROM SELECT WHERE ORDER
%token PRECOMPUTED ONE EXIST FOR ALL TRANSACTION INTCLASS STRCLASS
%token INTEGER REAL DOUBLEREAL STRING MAXLEN RANGE TO
%token INSERT END CHANGE DELETE DECLARE RETURN UNION UNIONALL
%token LIMIT DISTINCT
%start SQLPSchema
%%
SQLPSchema
: TableDefn
{
printf("Input Schema\n");
cons_cell *n = $1;
printf("Printing Tree\n");
print_cons_tree(n);
}
;
TableDefn
: CLASS ClassIdentifier'('ClassSpecs')'
{
printf("TableDefn\n");
}
;
ClassSpecs
: Self
{
printf("ClassSpecs\n");
}
|
: ClassSpecs',' ClassAttributes
{
printf("ClassSpecs\n");
}
|
: ClassSpecs',' ForeignKeys
{
printf("ClassSpecs\n");
}
|
: ClassSpecs',' Specialization
{
printf("ClassSpecs\n");
}
|
: ClassSpecs',' DisjointConstraints
{
printf("ClassSpecs\n");
}
;
Self
: SELF OID
{
printf("Self\n");
}
;
ClassAttributes
: AttributeIdentifier Type
{
printf("ClassAttributes\n");
}
|
: ClassAttributes',' ClassAttributes
{
printf("ClassAttributes\n");
}
;
ForeignKeys
: FOREIGN KEY AttributeIdentifier REFERENCES ClassIdentifier
{
printf("ForeignKeys\n");
}
|
: ForeignKeys',' ForeignKeys
{
printf("ForeignKeys\n");
}
;
Specialization
: ISA ClassIdentifier
{
printf("Specialization\n");
}
|
: Specialization',' Specialization
{
printf("Specialization\n");
}
;
DisjointConstraints
: DISJOINT WITH ClassIdentifier
{
printf("DisjointConstraints\n");
}
|
: DisjointConstraints',' DisjointConstraints
{
printf("DisjointConstraints\n");
}
;
Type
: INTCLASS
{
printf("Type\n");
}
|
: STRCLASS
{
printf("Type\n");
}
|
: OID
{
printf("Type\n");
}
AttributeIdentifier
: IDENTIFIER
{
printf("ClassIdentifier is |%s| ", yytext);
$$ = create_var(yytext);
}
;
ClassIdentifier
: IDENTIFIER
{
printf("ClassIdentifier is |%s| ", yytext);
$$ = create_var(yytext);
}
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment