Skip to content
Snippets Groups Projects
Commit a8ac7306 authored by eva's avatar eva
Browse files

test version

parent ffa56bef
No related branches found
No related tags found
2 merge requests!5Dev Merge into Master,!2Schema+RefExp Translation Rule 1
...@@ -15,6 +15,12 @@ SQLPParser_new: SQLPParser_new.c SQLPGrammar_new.y SQLPScanner_new.l util_new.o ...@@ -15,6 +15,12 @@ SQLPParser_new: SQLPParser_new.c SQLPGrammar_new.y SQLPScanner_new.l util_new.o
gcc -w SQLPParser_new.c util_new.o -o SQLPParser_new gcc -w SQLPParser_new.c util_new.o -o SQLPParser_new
rm -f lex.yy.c SQLPGrammar.tab.c SQLPGrammar.tab.h rm -f lex.yy.c SQLPGrammar.tab.c SQLPGrammar.tab.h
SQLPSchema: SQLPSchema.c SQLPSchema.y SQLPScanner_new.l util_new.o
bison --verbose -d SQLPSchema.y
flex SQLPScanner_new.l
gcc -w SQLPSchema.c util_new.o -o SQLPSchema
rm -f lex.yy.c SQLPGrammar.tab.c SQLPGrammar.tab.h
util.o: util.c util.h util.o: util.c util.h
gcc -c util.c gcc -c util.c
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
%token SCHEMA CLASS ISA PROPERTIES CONSTRAINTS PROPERTY %token SCHEMA CLASS ISA PROPERTIES CONSTRAINTS PROPERTY
%token ON DETERMINED COVER QUERY GIVEN FROM SELECT WHERE ORDER %token ON DETERMINED COVER QUERY GIVEN FROM SELECT WHERE ORDER
%token PRECOMPUTED ONE EXIST FOR ALL TRANSACTION INTCLASS STRCLASS %token PRECOMPUTED ONE EXIST FOR ALL TRANSACTION INTCLASS STRCLASS OID
%token INTEGER REAL DOUBLEREAL STRING MAXLEN RANGE TO %token INTEGER REAL DOUBLEREAL STRING MAXLEN RANGE TO SELF
%token INSERT END CHANGE DELETE DECLARE RETURN UNION %token INSERT END CHANGE DELETE DECLARE RETURN UNION
%start SQLPProgram %start SQLPProgram
......
Terminals unused in grammar Terminals unused in grammar
IMPLIES IMPLIES
HAS HAS
MAX MAX
MIN MIN
ASC ASC
DESC DESC
MOD MOD
ASSIGN ASSIGN
STAR STAR
COMMA COMMA
DOT DOT
SIZE SIZE
SELECTIVITY SELECTIVITY
OVERLAP OVERLAP
FREQUENCY FREQUENCY
UNIT UNIT
TIME TIME
SPACE SPACE
CONSTANT CONSTANT
STRING_LITERAL STRING_LITERAL
SIZEOF SIZEOF
STORE STORE
STORING STORING
DYNAMIC DYNAMIC
STATIC STATIC
OF OF
TYPE TYPE
ORDERED ORDERED
BY BY
INDEX INDEX
LIST LIST
ARRAY ARRAY
BINARY BINARY
TREE TREE
DISTRIBUTED DISTRIBUTED
POINTER POINTER
SCHEMA SCHEMA
CLASS CLASS
ISA ISA
PROPERTIES PROPERTIES
CONSTRAINTS CONSTRAINTS
PROPERTY PROPERTY
ON DISJOINT
DETERMINED FOREIGN
COVER KEY
QUERY REFERENCES
GIVEN WITH
ORDER ON
PRECOMPUTED DETERMINED
ONE COVER
FOR QUERY
ALL GIVEN
TRANSACTION ORDER
INTCLASS PRECOMPUTED
STRCLASS ONE
DOUBLEREAL FOR
MAXLEN ALL
RANGE TRANSACTION
TO INTCLASS
INSERT STRCLASS
END OID
CHANGE DOUBLEREAL
DELETE MAXLEN
DECLARE RANGE
RETURN TO
SELF
INSERT
END
CHANGE
DELETE
DECLARE
RETURN
Grammar Grammar
...@@ -141,143 +148,169 @@ Grammar ...@@ -141,143 +148,169 @@ Grammar
Terminals, with rules where they appear Terminals, with rules where they appear
$end (0) 0 $end (0) 0
'(' (40) 16 17 18 40 42 '(' (40) 16 17 18 40 42
')' (41) 16 17 18 40 42 ')' (41) 16 17 18 40 42
',' (44) 15 21 22 ',' (44) 15 21 22
'.' (46) 23 25 '.' (46) 23 25
error (256) error (256)
IMPLIES (258) IMPLIES (258)
OR (259) 36 OR (259) 36
AND (260) 38 AND (260) 38
NOT (261) 41 NOT (261) 41
LE (262) 31 LE (262) 31
GE (263) 32 GE (263) 32
LT (264) 33 LT (264) 33
GT (265) 34 GT (265) 34
NE (266) 30 NE (266) 30
HAS (267) HAS (267)
MAX (268) MAX (268)
MIN (269) MIN (269)
AS (270) 20 22 AS (270) 20 22
ASC (271) ASC (271)
DESC (272) DESC (272)
MOD (273) MOD (273)
ASSIGN (274) ASSIGN (274)
EQ (275) 29 EQ (275) 29
STAR (276) STAR (276)
COMMA (277) COMMA (277)
DOT (278) DOT (278)
SIZE (279) SIZE (279)
SELECTIVITY (280) SELECTIVITY (280)
OVERLAP (281) OVERLAP (281)
FREQUENCY (282) FREQUENCY (282)
UNIT (283) UNIT (283)
TIME (284) TIME (284)
SPACE (285) SPACE (285)
IDENTIFIER (286) 26 27 28 IDENTIFIER (286) 26 27 28
CONSTANT (287) CONSTANT (287)
STRING_LITERAL (288) STRING_LITERAL (288)
SIZEOF (289) SIZEOF (289)
STORE (290) STORE (290)
STORING (291) STORING (291)
DYNAMIC (292) DYNAMIC (292)
STATIC (293) STATIC (293)
OF (294) OF (294)
TYPE (295) TYPE (295)
ORDERED (296) ORDERED (296)
BY (297) BY (297)
INDEX (298) INDEX (298)
LIST (299) LIST (299)
ARRAY (300) ARRAY (300)
BINARY (301) BINARY (301)
TREE (302) TREE (302)
DISTRIBUTED (303) DISTRIBUTED (303)
POINTER (304) POINTER (304)
SCHEMA (305) SCHEMA (305)
CLASS (306) CLASS (306)
ISA (307) ISA (307)
PROPERTIES (308) PROPERTIES (308)
CONSTRAINTS (309) CONSTRAINTS (309)
PROPERTY (310) PROPERTY (310)
ON (311) DISJOINT (311)
DETERMINED (312) FOREIGN (312)
COVER (313) KEY (313)
QUERY (314) REFERENCES (314)
GIVEN (315) WITH (315)
FROM (316) 11 12 13 ON (316)
SELECT (317) 5 6 7 8 9 10 DETERMINED (317)
WHERE (318) 12 13 COVER (318)
ORDER (319) QUERY (319)
PRECOMPUTED (320) GIVEN (320)
ONE (321) FROM (321) 11 12 13
EXIST (322) 40 SELECT (322) 5 6 7 8 9 10
FOR (323) WHERE (323) 12 13
ALL (324) ORDER (324)
TRANSACTION (325) PRECOMPUTED (325)
INTCLASS (326) ONE (326)
STRCLASS (327) EXIST (327) 40
INTEGER (328) 45 46 FOR (328)
REAL (329) 47 ALL (329)
DOUBLEREAL (330) TRANSACTION (330)
STRING (331) 48 INTCLASS (331)
MAXLEN (332) STRCLASS (332)
RANGE (333) OID (333)
TO (334) INTEGER (334) 45 46
INSERT (335) REAL (335) 47
END (336) DOUBLEREAL (336)
CHANGE (337) STRING (337) 48
DELETE (338) MAXLEN (338)
DECLARE (339) RANGE (339)
RETURN (340) TO (340)
UNION (341) 16 SELF (341)
UNIONALL (342) 17 INSERT (342)
LIMIT (343) 4 END (343)
DISTINCT (344) 9 10 CHANGE (344)
DELETE (345)
DECLARE (346)
RETURN (347)
UNION (348) 16
UNIONALL (349) 17
LIMIT (350) 4
DISTINCT (351) 9 10
Nonterminals, with rules where they appear Nonterminals, with rules where they appear
$accept (94) $accept (101)
on left: 0 on left: 0
SQLPProgram (95) SQLPProgram (102)
on left: 1, on right: 0 on left: 1
Query (96) on right: 0
on left: 2 3 4, on right: 1 Query (103)
SelectQuery (97) on left: 2 3 4
on left: 5 6 7 8 9 10, on right: 3 4 16 17 18 on right: 1
Body (98) SelectQuery (104)
on left: 11 12 13, on right: 7 8 9 10 40 on left: 5 6 7 8 9 10
TableList (99) on right: 3 4 16 17 18
on left: 14 15, on right: 11 13 15 Body (105)
UnionQuery (100) on left: 11 12 13
on left: 16 17 18, on right: 2 16 17 on right: 7 8 9 10 40
SelectList (101) TableList (106)
on left: 19 20 21 22, on right: 6 8 10 21 22 on left: 14 15
Col (102) on right: 11 13 15
on left: 23, on right: 19 20 21 22 44 UnionQuery (107)
AttrPath (103) on left: 16 17 18
on left: 24 25, on right: 23 25 on right: 2 16 17
VarIdentifier (104) SelectList (108)
on left: 26, on right: 14 15 23 on left: 19 20 21 22
TableIdentifier (105) on right: 6 8 10 21 22
on left: 27, on right: 14 15 Col (109)
AttrIdentifier (106) on left: 23
on left: 28, on right: 20 22 24 25 on right: 19 20 21 22 44
CompOperator (107) AttrPath (110)
on left: 29 30 31 32 33 34, on right: 39 on left: 24 25
Pred (108) on right: 23 25
on left: 35 36, on right: 12 13 36 42 VarIdentifier (111)
Conj (109) on left: 26
on left: 37 38, on right: 35 36 38 on right: 14 15 23
BasicPred (110) TableIdentifier (112)
on left: 39 40 41 42, on right: 37 38 41 on left: 27
Term (111) on right: 14 15
on left: 43 44, on right: 39 AttrIdentifier (113)
Integer (112) on left: 28
on left: 45, on right: 4 on right: 20 22 24 25
Constant (113) CompOperator (114)
on left: 46 47 48, on right: 43 on left: 29 30 31 32 33 34
on right: 39
Pred (115)
on left: 35 36
on right: 12 13 36 42
Conj (116)
on left: 37 38
on right: 35 36 38
BasicPred (117)
on left: 39 40 41 42
on right: 37 38 41
Term (118)
on left: 43 44
on right: 39
Integer (119)
on left: 45
on right: 4
Constant (120)
on left: 46 47 48
on right: 43
State 0 State 0
......
This diff is collapsed.
/* A Bison parser, made by GNU Bison 3.0.4. */ /* A Bison parser, made by GNU Bison 3.4.1. */
/* Bison interface for Yacc-like parsers in C /* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -30,6 +31,9 @@ ...@@ -30,6 +31,9 @@
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
/* Undocumented macros, especially those whose name start with YY_,
are private implementation details. Do not rely on them. */
#ifndef YY_YY_SQLPGRAMMAR_NEW_TAB_H_INCLUDED #ifndef YY_YY_SQLPGRAMMAR_NEW_TAB_H_INCLUDED
# define YY_YY_SQLPGRAMMAR_NEW_TAB_H_INCLUDED # define YY_YY_SQLPGRAMMAR_NEW_TAB_H_INCLUDED
/* Debug traces. */ /* Debug traces. */
...@@ -98,40 +102,47 @@ extern int yydebug; ...@@ -98,40 +102,47 @@ extern int yydebug;
PROPERTIES = 308, PROPERTIES = 308,
CONSTRAINTS = 309, CONSTRAINTS = 309,
PROPERTY = 310, PROPERTY = 310,
ON = 311, DISJOINT = 311,
DETERMINED = 312, FOREIGN = 312,
COVER = 313, KEY = 313,
QUERY = 314, REFERENCES = 314,
GIVEN = 315, WITH = 315,
FROM = 316, ON = 316,
SELECT = 317, DETERMINED = 317,
WHERE = 318, COVER = 318,
ORDER = 319, QUERY = 319,
PRECOMPUTED = 320, GIVEN = 320,
ONE = 321, FROM = 321,
EXIST = 322, SELECT = 322,
FOR = 323, WHERE = 323,
ALL = 324, ORDER = 324,
TRANSACTION = 325, PRECOMPUTED = 325,
INTCLASS = 326, ONE = 326,
STRCLASS = 327, EXIST = 327,
INTEGER = 328, FOR = 328,
REAL = 329, ALL = 329,
DOUBLEREAL = 330, TRANSACTION = 330,
STRING = 331, INTCLASS = 331,
MAXLEN = 332, STRCLASS = 332,
RANGE = 333, OID = 333,
TO = 334, INTEGER = 334,
INSERT = 335, REAL = 335,
END = 336, DOUBLEREAL = 336,
CHANGE = 337, STRING = 337,
DELETE = 338, MAXLEN = 338,
DECLARE = 339, RANGE = 339,
RETURN = 340, TO = 340,
UNION = 341, SELF = 341,
UNIONALL = 342, INSERT = 342,
LIMIT = 343, END = 343,
DISTINCT = 344 CHANGE = 344,
DELETE = 345,
DECLARE = 346,
RETURN = 347,
UNION = 348,
UNIONALL = 349,
LIMIT = 350,
DISTINCT = 351
}; };
#endif #endif
......
...@@ -13,10 +13,11 @@ ...@@ -13,10 +13,11 @@
%token STORE STORING DYNAMIC STATIC OF TYPE ORDERED BY %token STORE STORING DYNAMIC STATIC OF TYPE ORDERED BY
%token INDEX LIST ARRAY BINARY TREE DISTRIBUTED POINTER %token INDEX LIST ARRAY BINARY TREE DISTRIBUTED POINTER
%token SCHEMA CLASS ISA PROPERTIES CONSTRAINTS PROPERTY %token SCHEMA CLASS ISA PROPERTIES CONSTRAINTS PROPERTY DISJOINT
%token FOREIGN KEY REFERENCES WITH
%token ON DETERMINED COVER QUERY GIVEN FROM SELECT WHERE ORDER %token ON DETERMINED COVER QUERY GIVEN FROM SELECT WHERE ORDER
%token PRECOMPUTED ONE EXIST FOR ALL TRANSACTION INTCLASS STRCLASS %token PRECOMPUTED ONE EXIST FOR ALL TRANSACTION INTCLASS STRCLASS OID
%token INTEGER REAL DOUBLEREAL STRING MAXLEN RANGE TO %token INTEGER REAL DOUBLEREAL STRING MAXLEN RANGE TO SELF
%token INSERT END CHANGE DELETE DECLARE RETURN UNION UNIONALL %token INSERT END CHANGE DELETE DECLARE RETURN UNION UNIONALL
%token LIMIT DISTINCT %token LIMIT DISTINCT
......
No preview for this file type
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* along with RDM. If not, see <http://www.gnu.org/licenses/>. * along with RDM. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "SQLPGrammar.tab.h" #include "SQLPGrammar_new.tab.h"
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* along with RDM. If not, see <http://www.gnu.org/licenses/>. * along with RDM. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "SQLPGrammar_new.tab.h" #include "SQLPSchema.tab.h"
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
...@@ -51,6 +51,7 @@ E [Ee][+-]?{D}+ ...@@ -51,6 +51,7 @@ E [Ee][+-]?{D}+
"delete" { strcat(LineBuffer, yytext); return(DELETE); } "delete" { strcat(LineBuffer, yytext); return(DELETE); }
"desc" { strcat(LineBuffer, yytext); return(DESC); } "desc" { strcat(LineBuffer, yytext); return(DESC); }
"distinct" { strcat(LineBuffer, yytext); return(DISTINCT); } "distinct" { strcat(LineBuffer, yytext); return(DISTINCT); }
"disjoint" { strcat(LineBuffer, yytext); return(DISJOINT); }
"union" { strcat(LineBuffer, yytext); return(UNION); } "union" { strcat(LineBuffer, yytext); return(UNION); }
"unionall" { strcat(LineBuffer, yytext); return(UNIONALL); } "unionall" { strcat(LineBuffer, yytext); return(UNIONALL); }
"determined" { strcat(LineBuffer, yytext); return(DETERMINED); } "determined" { strcat(LineBuffer, yytext); return(DETERMINED); }
...@@ -58,6 +59,8 @@ E [Ee][+-]?{D}+ ...@@ -58,6 +59,8 @@ E [Ee][+-]?{D}+
"dynamic" { strcat(LineBuffer, yytext); return(DYNAMIC); } "dynamic" { strcat(LineBuffer, yytext); return(DYNAMIC); }
"exist" { strcat(LineBuffer, yytext); return(EXIST); } "exist" { strcat(LineBuffer, yytext); return(EXIST); }
"for" { strcat(LineBuffer, yytext); return(FOR); } "for" { strcat(LineBuffer, yytext); return(FOR); }
"foreign" { strcat(LineBuffer, yytext); return(FOREIGN); }
"key" { strcat(LineBuffer, yytext); return(KEY); }
"frequency" { strcat(LineBuffer, yytext); return(FREQUENCY); } "frequency" { strcat(LineBuffer, yytext); return(FREQUENCY); }
"from" { strcat(LineBuffer, yytext); return(FROM); } "from" { strcat(LineBuffer, yytext); return(FROM); }
"given" { strcat(LineBuffer, yytext); return(GIVEN); } "given" { strcat(LineBuffer, yytext); return(GIVEN); }
...@@ -89,6 +92,7 @@ E [Ee][+-]?{D}+ ...@@ -89,6 +92,7 @@ E [Ee][+-]?{D}+
"query" { strcat(LineBuffer, yytext); return(QUERY); } "query" { strcat(LineBuffer, yytext); return(QUERY); }
"range" { strcat(LineBuffer, yytext); return(RANGE); } "range" { strcat(LineBuffer, yytext); return(RANGE); }
"return" { strcat(LineBuffer, yytext); return(RETURN); } "return" { strcat(LineBuffer, yytext); return(RETURN); }
"references" { strcat(LineBuffer, yytext); return(REFERENCES); }
"schema" { strcat(LineBuffer, yytext); return(SCHEMA); } "schema" { strcat(LineBuffer, yytext); return(SCHEMA); }
"select" { strcat(LineBuffer, yytext); return(SELECT); } "select" { strcat(LineBuffer, yytext); return(SELECT); }
"selectivity" { strcat(LineBuffer, yytext); return(SELECTIVITY); } "selectivity" { strcat(LineBuffer, yytext); return(SELECTIVITY); }
...@@ -106,6 +110,7 @@ E [Ee][+-]?{D}+ ...@@ -106,6 +110,7 @@ E [Ee][+-]?{D}+
"type" { strcat(LineBuffer, yytext); return(TYPE); } "type" { strcat(LineBuffer, yytext); return(TYPE); }
"unit" { strcat(LineBuffer, yytext); return(UNIT); } "unit" { strcat(LineBuffer, yytext); return(UNIT); }
"where" { strcat(LineBuffer, yytext); return(WHERE); } "where" { strcat(LineBuffer, yytext); return(WHERE); }
"with" { strcat(LineBuffer, yytext); return(WITH); }
{L}({L}|{D})* { strcat(LineBuffer, yytext); return(IDENTIFIER); } {L}({L}|{D})* { strcat(LineBuffer, yytext); return(IDENTIFIER); }
......
This diff is collapsed.
Terminals unused in grammar
IMPLIES
OR
AND
NOT
LE
GE
LT
GT
NE
HAS
MAX
MIN
AS
ASC
DESC
MOD
ASSIGN
EQ
STAR
COMMA
DOT
SIZE
SELECTIVITY
OVERLAP
FREQUENCY
UNIT
TIME
SPACE
CONSTANT
STRING_LITERAL
SIZEOF
STORE
STORING
DYNAMIC
STATIC
OF
TYPE
ORDERED
BY
INDEX
LIST
ARRAY
BINARY
TREE
DISTRIBUTED
POINTER
SCHEMA
PROPERTIES
CONSTRAINTS
PROPERTY
ON
DETERMINED
COVER
QUERY
GIVEN
FROM
SELECT
WHERE
ORDER
PRECOMPUTED
ONE
EXIST
FOR
ALL
TRANSACTION
INTEGER
REAL
DOUBLEREAL
STRING
MAXLEN
RANGE
TO
INSERT
END
CHANGE
DELETE
DECLARE
RETURN
UNION
UNIONALL
LIMIT
DISTINCT
State 18 conflicts: 1 shift/reduce
State 19 conflicts: 1 shift/reduce
State 20 conflicts: 1 shift/reduce
State 21 conflicts: 1 shift/reduce
Grammar
0 $accept: SQLPSchema $end
1 SQLPSchema: TableDefn
2 TableDefn: CLASS ClassIdentifier '(' ClassSpecs ')'
3 ClassSpecs: Self
4 | ClassSpecs ',' ClassAttributes
5 | ClassSpecs ',' ForeignKeys
6 | ClassSpecs ',' Specialization
7 | ClassSpecs ',' DisjointConstraints
8 Self: SELF OID
9 ClassAttributes: AttributeIdentifier Type
10 | ClassAttributes ',' AttributeIdentifier Type
11 ForeignKeys: FOREIGN KEY AttributeIdentifier REFERENCES ClassIdentifier
12 | ForeignKeys ',' FOREIGN KEY AttributeIdentifier REFERENCES ClassIdentifier
13 Specialization: ISA ClassIdentifier
14 | Specialization ',' ISA ClassIdentifier
15 DisjointConstraints: DISJOINT WITH ClassIdentifier
16 | DisjointConstraints ',' DISJOINT WITH ClassIdentifier
17 Type: INTCLASS
18 | STRCLASS
19 | OID
20 AttributeIdentifier: IDENTIFIER
21 ClassIdentifier: IDENTIFIER
Terminals, with rules where they appear
$end (0) 0
'(' (40) 2
')' (41) 2
',' (44) 4 5 6 7 10 12 14 16
error (256)
IMPLIES (258)
OR (259)
AND (260)
NOT (261)
LE (262)
GE (263)
LT (264)
GT (265)
NE (266)
HAS (267)
MAX (268)
MIN (269)
AS (270)
ASC (271)
DESC (272)
MOD (273)
ASSIGN (274)
EQ (275)
STAR (276)
COMMA (277)
DOT (278)
SIZE (279)
SELECTIVITY (280)
OVERLAP (281)
FREQUENCY (282)
UNIT (283)
TIME (284)
SPACE (285)
IDENTIFIER (286) 20 21
CONSTANT (287)
STRING_LITERAL (288)
SIZEOF (289)
STORE (290)
STORING (291)
DYNAMIC (292)
STATIC (293)
OF (294)
TYPE (295)
ORDERED (296)
BY (297)
INDEX (298)
LIST (299)
ARRAY (300)
BINARY (301)
TREE (302)
DISTRIBUTED (303)
POINTER (304)
SCHEMA (305)
CLASS (306) 2
ISA (307) 13 14
PROPERTIES (308)
CONSTRAINTS (309)
PROPERTY (310)
DISJOINT (311) 15 16
FOREIGN (312) 11 12
KEY (313) 11 12
REFERENCES (314) 11 12
WITH (315) 15 16
ON (316)
DETERMINED (317)
COVER (318)
QUERY (319)
GIVEN (320)
FROM (321)
SELECT (322)
WHERE (323)
ORDER (324)
PRECOMPUTED (325)
ONE (326)
EXIST (327)
FOR (328)
ALL (329)
TRANSACTION (330)
INTCLASS (331) 17
STRCLASS (332) 18
OID (333) 8 19
INTEGER (334)
REAL (335)
DOUBLEREAL (336)
STRING (337)
MAXLEN (338)
RANGE (339)
TO (340)
SELF (341) 8
INSERT (342)
END (343)
CHANGE (344)
DELETE (345)
DECLARE (346)
RETURN (347)
UNION (348)
UNIONALL (349)
LIMIT (350)
DISTINCT (351)
Nonterminals, with rules where they appear
$accept (100)
on left: 0
SQLPSchema (101)
on left: 1
on right: 0
TableDefn (102)
on left: 2
on right: 1
ClassSpecs (103)
on left: 3 4 5 6 7
on right: 2 4 5 6 7
Self (104)
on left: 8
on right: 3
ClassAttributes (105)
on left: 9 10
on right: 4 10
ForeignKeys (106)
on left: 11 12
on right: 5 12
Specialization (107)
on left: 13 14
on right: 6 14
DisjointConstraints (108)
on left: 15 16
on right: 7 16
Type (109)
on left: 17 18 19
on right: 9 10
AttributeIdentifier (110)
on left: 20
on right: 9 10 11 12
ClassIdentifier (111)
on left: 21
on right: 2 11 12 13 14 15 16
State 0
0 $accept: . SQLPSchema $end
CLASS shift, and go to state 1
SQLPSchema go to state 2
TableDefn go to state 3
State 1
2 TableDefn: CLASS . ClassIdentifier '(' ClassSpecs ')'
IDENTIFIER shift, and go to state 4
ClassIdentifier go to state 5
State 2
0 $accept: SQLPSchema . $end
$end shift, and go to state 6
State 3
1 SQLPSchema: TableDefn .
$default reduce using rule 1 (SQLPSchema)
State 4
21 ClassIdentifier: IDENTIFIER .
$default reduce using rule 21 (ClassIdentifier)
State 5
2 TableDefn: CLASS ClassIdentifier . '(' ClassSpecs ')'
'(' shift, and go to state 7
State 6
0 $accept: SQLPSchema $end .
$default accept
State 7
2 TableDefn: CLASS ClassIdentifier '(' . ClassSpecs ')'
SELF shift, and go to state 8
ClassSpecs go to state 9
Self go to state 10
State 8
8 Self: SELF . OID
OID shift, and go to state 11
State 9
2 TableDefn: CLASS ClassIdentifier '(' ClassSpecs . ')'
4 ClassSpecs: ClassSpecs . ',' ClassAttributes
5 | ClassSpecs . ',' ForeignKeys
6 | ClassSpecs . ',' Specialization
7 | ClassSpecs . ',' DisjointConstraints
')' shift, and go to state 12
',' shift, and go to state 13
State 10
3 ClassSpecs: Self .
$default reduce using rule 3 (ClassSpecs)
State 11
8 Self: SELF OID .
$default reduce using rule 8 (Self)
State 12
2 TableDefn: CLASS ClassIdentifier '(' ClassSpecs ')' .
$default reduce using rule 2 (TableDefn)
State 13
4 ClassSpecs: ClassSpecs ',' . ClassAttributes
5 | ClassSpecs ',' . ForeignKeys
6 | ClassSpecs ',' . Specialization
7 | ClassSpecs ',' . DisjointConstraints
IDENTIFIER shift, and go to state 14
ISA shift, and go to state 15
DISJOINT shift, and go to state 16
FOREIGN shift, and go to state 17
ClassAttributes go to state 18
ForeignKeys go to state 19
Specialization go to state 20
DisjointConstraints go to state 21
AttributeIdentifier go to state 22
State 14
20 AttributeIdentifier: IDENTIFIER .
$default reduce using rule 20 (AttributeIdentifier)
State 15
13 Specialization: ISA . ClassIdentifier
IDENTIFIER shift, and go to state 4
ClassIdentifier go to state 23
State 16
15 DisjointConstraints: DISJOINT . WITH ClassIdentifier
WITH shift, and go to state 24
State 17
11 ForeignKeys: FOREIGN . KEY AttributeIdentifier REFERENCES ClassIdentifier
KEY shift, and go to state 25
State 18
4 ClassSpecs: ClassSpecs ',' ClassAttributes .
10 ClassAttributes: ClassAttributes . ',' AttributeIdentifier Type
',' shift, and go to state 26
',' [reduce using rule 4 (ClassSpecs)]
$default reduce using rule 4 (ClassSpecs)
State 19
5 ClassSpecs: ClassSpecs ',' ForeignKeys .
12 ForeignKeys: ForeignKeys . ',' FOREIGN KEY AttributeIdentifier REFERENCES ClassIdentifier
',' shift, and go to state 27
',' [reduce using rule 5 (ClassSpecs)]
$default reduce using rule 5 (ClassSpecs)
State 20
6 ClassSpecs: ClassSpecs ',' Specialization .
14 Specialization: Specialization . ',' ISA ClassIdentifier
',' shift, and go to state 28
',' [reduce using rule 6 (ClassSpecs)]
$default reduce using rule 6 (ClassSpecs)
State 21
7 ClassSpecs: ClassSpecs ',' DisjointConstraints .
16 DisjointConstraints: DisjointConstraints . ',' DISJOINT WITH ClassIdentifier
',' shift, and go to state 29
',' [reduce using rule 7 (ClassSpecs)]
$default reduce using rule 7 (ClassSpecs)
State 22
9 ClassAttributes: AttributeIdentifier . Type
INTCLASS shift, and go to state 30
STRCLASS shift, and go to state 31
OID shift, and go to state 32
Type go to state 33
State 23
13 Specialization: ISA ClassIdentifier .
$default reduce using rule 13 (Specialization)
State 24
15 DisjointConstraints: DISJOINT WITH . ClassIdentifier
IDENTIFIER shift, and go to state 4
ClassIdentifier go to state 34
State 25
11 ForeignKeys: FOREIGN KEY . AttributeIdentifier REFERENCES ClassIdentifier
IDENTIFIER shift, and go to state 14
AttributeIdentifier go to state 35
State 26
10 ClassAttributes: ClassAttributes ',' . AttributeIdentifier Type
IDENTIFIER shift, and go to state 14
AttributeIdentifier go to state 36
State 27
12 ForeignKeys: ForeignKeys ',' . FOREIGN KEY AttributeIdentifier REFERENCES ClassIdentifier
FOREIGN shift, and go to state 37
State 28
14 Specialization: Specialization ',' . ISA ClassIdentifier
ISA shift, and go to state 38
State 29
16 DisjointConstraints: DisjointConstraints ',' . DISJOINT WITH ClassIdentifier
DISJOINT shift, and go to state 39
State 30
17 Type: INTCLASS .
$default reduce using rule 17 (Type)
State 31
18 Type: STRCLASS .
$default reduce using rule 18 (Type)
State 32
19 Type: OID .
$default reduce using rule 19 (Type)
State 33
9 ClassAttributes: AttributeIdentifier Type .
$default reduce using rule 9 (ClassAttributes)
State 34
15 DisjointConstraints: DISJOINT WITH ClassIdentifier .
$default reduce using rule 15 (DisjointConstraints)
State 35
11 ForeignKeys: FOREIGN KEY AttributeIdentifier . REFERENCES ClassIdentifier
REFERENCES shift, and go to state 40
State 36
10 ClassAttributes: ClassAttributes ',' AttributeIdentifier . Type
INTCLASS shift, and go to state 30
STRCLASS shift, and go to state 31
OID shift, and go to state 32
Type go to state 41
State 37
12 ForeignKeys: ForeignKeys ',' FOREIGN . KEY AttributeIdentifier REFERENCES ClassIdentifier
KEY shift, and go to state 42
State 38
14 Specialization: Specialization ',' ISA . ClassIdentifier
IDENTIFIER shift, and go to state 4
ClassIdentifier go to state 43
State 39
16 DisjointConstraints: DisjointConstraints ',' DISJOINT . WITH ClassIdentifier
WITH shift, and go to state 44
State 40
11 ForeignKeys: FOREIGN KEY AttributeIdentifier REFERENCES . ClassIdentifier
IDENTIFIER shift, and go to state 4
ClassIdentifier go to state 45
State 41
10 ClassAttributes: ClassAttributes ',' AttributeIdentifier Type .
$default reduce using rule 10 (ClassAttributes)
State 42
12 ForeignKeys: ForeignKeys ',' FOREIGN KEY . AttributeIdentifier REFERENCES ClassIdentifier
IDENTIFIER shift, and go to state 14
AttributeIdentifier go to state 46
State 43
14 Specialization: Specialization ',' ISA ClassIdentifier .
$default reduce using rule 14 (Specialization)
State 44
16 DisjointConstraints: DisjointConstraints ',' DISJOINT WITH . ClassIdentifier
IDENTIFIER shift, and go to state 4
ClassIdentifier go to state 47
State 45
11 ForeignKeys: FOREIGN KEY AttributeIdentifier REFERENCES ClassIdentifier .
$default reduce using rule 11 (ForeignKeys)
State 46
12 ForeignKeys: ForeignKeys ',' FOREIGN KEY AttributeIdentifier . REFERENCES ClassIdentifier
REFERENCES shift, and go to state 48
State 47
16 DisjointConstraints: DisjointConstraints ',' DISJOINT WITH ClassIdentifier .
$default reduce using rule 16 (DisjointConstraints)
State 48
12 ForeignKeys: ForeignKeys ',' FOREIGN KEY AttributeIdentifier REFERENCES . ClassIdentifier
IDENTIFIER shift, and go to state 4
ClassIdentifier go to state 49
State 49
12 ForeignKeys: ForeignKeys ',' FOREIGN KEY AttributeIdentifier REFERENCES ClassIdentifier .
$default reduce using rule 12 (ForeignKeys)
This diff is collapsed.
/* A Bison parser, made by GNU Bison 3.4.1. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Undocumented macros, especially those whose name start with YY_,
are private implementation details. Do not rely on them. */
#ifndef YY_YY_SQLPSCHEMA_TAB_H_INCLUDED
# define YY_YY_SQLPSCHEMA_TAB_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
IMPLIES = 258,
OR = 259,
AND = 260,
NOT = 261,
LE = 262,
GE = 263,
LT = 264,
GT = 265,
NE = 266,
HAS = 267,
MAX = 268,
MIN = 269,
AS = 270,
ASC = 271,
DESC = 272,
MOD = 273,
ASSIGN = 274,
EQ = 275,
STAR = 276,
COMMA = 277,
DOT = 278,
SIZE = 279,
SELECTIVITY = 280,
OVERLAP = 281,
FREQUENCY = 282,
UNIT = 283,
TIME = 284,
SPACE = 285,
IDENTIFIER = 286,
CONSTANT = 287,
STRING_LITERAL = 288,
SIZEOF = 289,
STORE = 290,
STORING = 291,
DYNAMIC = 292,
STATIC = 293,
OF = 294,
TYPE = 295,
ORDERED = 296,
BY = 297,
INDEX = 298,
LIST = 299,
ARRAY = 300,
BINARY = 301,
TREE = 302,
DISTRIBUTED = 303,
POINTER = 304,
SCHEMA = 305,
CLASS = 306,
ISA = 307,
PROPERTIES = 308,
CONSTRAINTS = 309,
PROPERTY = 310,
DISJOINT = 311,
FOREIGN = 312,
KEY = 313,
REFERENCES = 314,
WITH = 315,
ON = 316,
DETERMINED = 317,
COVER = 318,
QUERY = 319,
GIVEN = 320,
FROM = 321,
SELECT = 322,
WHERE = 323,
ORDER = 324,
PRECOMPUTED = 325,
ONE = 326,
EXIST = 327,
FOR = 328,
ALL = 329,
TRANSACTION = 330,
INTCLASS = 331,
STRCLASS = 332,
OID = 333,
INTEGER = 334,
REAL = 335,
DOUBLEREAL = 336,
STRING = 337,
MAXLEN = 338,
RANGE = 339,
TO = 340,
SELF = 341,
INSERT = 342,
END = 343,
CHANGE = 344,
DELETE = 345,
DECLARE = 346,
RETURN = 347,
UNION = 348,
UNIONALL = 349,
LIMIT = 350,
DISTINCT = 351
};
#endif
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef cons_cell * YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
extern YYSTYPE yylval;
int yyparse (void);
#endif /* !YY_YY_SQLPSCHEMA_TAB_H_INCLUDED */
...@@ -13,16 +13,16 @@ ...@@ -13,16 +13,16 @@
%token STORE STORING DYNAMIC STATIC OF TYPE ORDERED BY %token STORE STORING DYNAMIC STATIC OF TYPE ORDERED BY
%token INDEX LIST ARRAY BINARY TREE DISTRIBUTED POINTER %token INDEX LIST ARRAY BINARY TREE DISTRIBUTED POINTER
%token SCHEMA CLASS ISA PROPERTIES CONSTRAINTS PROPERTY %token SCHEMA CLASS ISA PROPERTIES CONSTRAINTS PROPERTY DISJOINT
%token FOREIGN KEY REFERENCES WITH
%token ON DETERMINED COVER QUERY GIVEN FROM SELECT WHERE ORDER %token ON DETERMINED COVER QUERY GIVEN FROM SELECT WHERE ORDER
%token PRECOMPUTED ONE EXIST FOR ALL TRANSACTION INTCLASS STRCLASS %token PRECOMPUTED ONE EXIST FOR ALL TRANSACTION INTCLASS STRCLASS OID
%token INTEGER REAL DOUBLEREAL STRING MAXLEN RANGE TO %token INTEGER REAL DOUBLEREAL STRING MAXLEN RANGE TO SELF
%token INSERT END CHANGE DELETE DECLARE RETURN UNION UNIONALL %token INSERT END CHANGE DELETE DECLARE RETURN UNION UNIONALL
%token LIMIT DISTINCT %token LIMIT DISTINCT
%start SQLPSchema %start SQLPSchema
%% %%
SQLPSchema SQLPSchema
: TableDefn : TableDefn
{ {
...@@ -34,10 +34,10 @@ SQLPSchema ...@@ -34,10 +34,10 @@ SQLPSchema
; ;
TableDefn TableDefn
: CLASS ClassIdentifier'('ClassSpecs')' : CLASS ClassIdentifier '('ClassSpecs')'
{ {
printf("TableDefn\n"); printf("TableDefn\n");
$$ = create_table_defn_operator($2, $3);
} }
; ;
...@@ -45,35 +45,35 @@ ClassSpecs ...@@ -45,35 +45,35 @@ ClassSpecs
: Self : Self
{ {
printf("ClassSpecs\n"); printf("ClassSpecs\n");
$$ = $1;
} }
| | ClassSpecs',' ClassAttributes
: ClassSpecs',' ClassAttributes
{ {
printf("ClassSpecs\n"); printf("ClassSpecs\n");
$$ = create_table_classpec_operator($1, $3);
} }
| | ClassSpecs',' ForeignKeys
: ClassSpecs',' ForeignKeys
{ {
printf("ClassSpecs\n"); printf("ClassSpecs\n");
$$ = create_table_classpec_operator($1, $3);
} }
| | ClassSpecs',' Specialization
: ClassSpecs',' Specialization
{ {
printf("ClassSpecs\n"); printf("ClassSpecs\n");
$$ = create_table_classpec_operator($1, $3);
} }
| | ClassSpecs',' DisjointConstraints
: ClassSpecs',' DisjointConstraints
{ {
printf("ClassSpecs\n"); printf("ClassSpecs\n");
$$ = create_table_classpec_operator($1, $3);
} }
; ;
Self Self
: SELF OID : SELF OID
{ {
printf("Self\n"); printf("Self\n");
$$ = create_self($1);
} }
; ;
...@@ -81,13 +81,12 @@ ClassAttributes ...@@ -81,13 +81,12 @@ ClassAttributes
: AttributeIdentifier Type : AttributeIdentifier Type
{ {
printf("ClassAttributes\n"); printf("ClassAttributes\n");
$$ = create_classattr_operator($1, $2, NULL);
} }
| | ClassAttributes',' AttributeIdentifier Type
: ClassAttributes',' ClassAttributes
{ {
printf("ClassAttributes\n"); printf("ClassAttributes\n");
$$ = create_classattr_operator($1, $3, $4);
} }
; ;
...@@ -95,13 +94,12 @@ ForeignKeys ...@@ -95,13 +94,12 @@ ForeignKeys
: FOREIGN KEY AttributeIdentifier REFERENCES ClassIdentifier : FOREIGN KEY AttributeIdentifier REFERENCES ClassIdentifier
{ {
printf("ForeignKeys\n"); printf("ForeignKeys\n");
$$ = create_forkeys_operator($3, $5, NULL);
} }
| | ForeignKeys',' FOREIGN KEY AttributeIdentifier REFERENCES ClassIdentifier
: ForeignKeys',' ForeignKeys
{ {
printf("ForeignKeys\n"); printf("ForeignKeys\n");
$$ = create_forkeys_operator($1, $4, $6);
} }
; ;
...@@ -109,13 +107,12 @@ Specialization ...@@ -109,13 +107,12 @@ Specialization
: ISA ClassIdentifier : ISA ClassIdentifier
{ {
printf("Specialization\n"); printf("Specialization\n");
$$ = create_specialization_operator($2, NULL);
} }
| | Specialization',' ISA ClassIdentifier
: Specialization',' Specialization
{ {
printf("Specialization\n"); printf("Specialization\n");
$$ = create_specialization_operator($1, $3);
} }
; ;
...@@ -123,38 +120,37 @@ DisjointConstraints ...@@ -123,38 +120,37 @@ DisjointConstraints
: DISJOINT WITH ClassIdentifier : DISJOINT WITH ClassIdentifier
{ {
printf("DisjointConstraints\n"); printf("DisjointConstraints\n");
$$ = create_disjoint_operator($3, NULL);
} }
| | DisjointConstraints',' DISJOINT WITH ClassIdentifier
: DisjointConstraints',' DisjointConstraints
{ {
printf("DisjointConstraints\n"); printf("DisjointConstraints\n");
$$ = create_disjoint_operator($1, $5);
} }
; ;
Type Type
: INTCLASS : INTCLASS
{ {
printf("Type\n"); printf("INTCLASS is |%s|", yytext);
$$ = create_type(yytext);
} }
| | STRCLASS
: STRCLASS
{ {
printf("Type\n"); printf("STRCLASS is |%s|", yytext);
$$ = create_type(yytext);
} }
| | OID
: OID
{ {
printf("Type\n"); printf("OID is |%s|", yytext);
$$ = create_type(yytext);
} }
AttributeIdentifier AttributeIdentifier
: IDENTIFIER : IDENTIFIER
{ {
printf("ClassIdentifier is |%s| ", yytext); printf("AttributeIdentifier is |%s| ", yytext);
$$ = create_var(yytext); $$ = create_var(yytext);
} }
; ;
...@@ -163,7 +159,6 @@ ClassIdentifier ...@@ -163,7 +159,6 @@ ClassIdentifier
{ {
printf("ClassIdentifier is |%s| ", yytext); printf("ClassIdentifier is |%s| ", yytext);
$$ = create_var(yytext); $$ = create_var(yytext);
} }
; ;
...@@ -209,6 +209,73 @@ cons_cell* create_as_operator(cons_cell* ra1, cons_cell* ra2) { ...@@ -209,6 +209,73 @@ cons_cell* create_as_operator(cons_cell* ra1, cons_cell* ra2) {
return create_cons_cell_w_atom(operator, ra1_cons); return create_cons_cell_w_atom(operator, ra1_cons);
} }
//*********************************************************************************
/* cons_cell* create_type(char* type) {
cons_cell* type_cons = create_cons_cell_w_atom(type, NULL);
char operator[5] = "TYPE\0";
return create_cons_cell_w_atom(operator, type_cons);
}
cons_cell* create_self(char* self) {
cons_cell* self_cons = create_cons_cell_w_atom(self, NULL);
char operator[5] = "SELF\0";
return create_cons_cell_w_atom(operator, self_cons);
}
cons_cell* create_disjoint_operator(cons_cell* ra1, cons_cell* ra2) {
cons_cell* ra2_cons = create_cons_cell(ra2, NULL);
cons_cell* ra1_cons = create_cons_cell(ra1, ra2_cons);
char operator[9] = "DISJOINT\0";
cons_cell* operator_cons = create_cons_cell_w_atom(operator, ra1_cons);
return operator_cons;
}
cons_cell* create_tabledefn_operator(cons_cell* ra1, cons_cell* ra2) {
cons_cell* ra2_cons = create_cons_cell(ra2, NULL);
cons_cell* ra1_cons = create_cons_cell(ra1, ra2_cons);
char operator[10] = "TABLEDEFN\0";
cons_cell* operator_cons = create_cons_cell_w_atom(operator, ra1_cons);
return operator_cons;
}
cons_cell* create_classpec_operator(cons_cell* ra1, cons_cell* ra2) {
cons_cell* ra2_cons = create_cons_cell(ra2, NULL);
cons_cell* ra1_cons = create_cons_cell(ra1, ra2_cons);
char operator[9] = "CLASSPEC\0";
cons_cell* operator_cons = create_cons_cell_w_atom(operator, ra1_cons);
return operator_cons;
}
cons_cell* create_classattr_operator(cons_cell* ra1, cons_cell* ra2, cons_cell* ra3) {
cons_cell* ra2_cons = create_cons_cell(ra2, NULL);
cons_cell* ra3_cons = create_cons_cell(ra3, NULL);
cons_cell* ra2_ra3_cons = create_cons_cell(ra2_cons, ra3_cons);
cons_cell* ra1_cons = create_cons_cell(ra1, ra2_ra3_cons);
char operator[10] = "CLASSATTR\0";
cons_cell* operator_cons = create_cons_cell_w_atom(operator, ra1_cons);
return operator_cons;
}
cons_cell* create_forkey_operator(cons_cell* ra1, cons_cell* ra2, cons_cell* ra3) {
cons_cell* ra2_cons = create_cons_cell(ra2, NULL);
cons_cell* ra3_cons = create_cons_cell(ra3, NULL);
cons_cell* ra2_ra3_cons = create_cons_cell(ra2_cons, ra3_cons);
cons_cell* ra1_cons = create_cons_cell(ra1, ra2_ra3_cons);
char operator[7] = "FORKEY\0";
cons_cell* operator_cons = create_cons_cell_w_atom(operator, ra1_cons);
return operator_cons;
}
cons_cell* create_specialization_operator(cons_cell* ra1, cons_cell* ra2) {
cons_cell* ra2_cons = create_cons_cell(ra2, NULL);
cons_cell* ra1_cons = create_cons_cell(ra1, ra2_cons);
char operator[15] = "SPECIALIZATION\0";
cons_cell* operator_cons = create_cons_cell_w_atom(operator, ra1_cons);
return operator_cons;
}
*/
void print_cons_tree(cons_cell *root) { void print_cons_tree(cons_cell *root) {
print_cons_tree_helper(root, 0); print_cons_tree_helper(root, 0);
} }
...@@ -231,5 +298,5 @@ void print_cons_tree_helper(cons_cell *root, int indent) { ...@@ -231,5 +298,5 @@ void print_cons_tree_helper(cons_cell *root, int indent) {
print_cons_tree_helper((cons_cell*)root->car, indent); print_cons_tree_helper((cons_cell*)root->car, indent);
print_cons_tree_helper(root->cdr, indent); print_cons_tree_helper(root->cdr, indent);
} }
} }
...@@ -85,6 +85,16 @@ cons_cell* create_and_operator(cons_cell* ra1, cons_cell* ra2); ...@@ -85,6 +85,16 @@ cons_cell* create_and_operator(cons_cell* ra1, cons_cell* ra2);
cons_cell* create_or_operator(cons_cell* ra1, cons_cell* ra2); cons_cell* create_or_operator(cons_cell* ra1, cons_cell* ra2);
cons_cell* create_as_operator(cons_cell* ra1, cons_cell* ra2); cons_cell* create_as_operator(cons_cell* ra1, cons_cell* ra2);
//*****************************************************************
/*cons_cell* create_type(char *var);
cons_cell* create_self(char *self);
cons_cell* create_disjoint_operator(cons_cell* ra1, cons_cell* ra2);
cons_cell* create_tabledefn_operator(cons_cell* ra1, cons_cell* ra2);
cons_cell* create_classpec_operator(cons_cell* ra1, cons_cell* ra2);
cons_cell* create_classattr_operator(cons_cell* ra1, cons_cell* ra2, cons_cell* ra3);
cons_cell* create_forkey_operator(cons_cell* ra1, cons_cell* ra2, cons_cell* ra3);
cons_cell* create_specialization_operator(cons_cell* ra1, cons_cell* ra2); */
// Prints an in order traversal of the tree // Prints an in order traversal of the tree
void print_cons_tree(cons_cell *root); void print_cons_tree(cons_cell *root);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment