From c8e8abf0b36acf751f8e46af352a7c26efc1b3f5 Mon Sep 17 00:00:00 2001 From: Pedro Date: Sat, 27 Feb 2016 16:58:51 +0100 Subject: [PATCH] cleaned up documentation --- README.md | 23 +++++++++------- docs/{documentation.md => dev-docs.md} | 29 ++++++++++---------- docs/doxy.conf | 20 -------------- docs/integration.md | 8 ------ docs/issues.md | 10 ------- {benchmark => hyrise/benchmark}/benchmark.py | 0 6 files changed, 28 insertions(+), 62 deletions(-) rename docs/{documentation.md => dev-docs.md} (51%) delete mode 100644 docs/doxy.conf delete mode 100644 docs/integration.md delete mode 100644 docs/issues.md rename {benchmark => hyrise/benchmark}/benchmark.py (100%) diff --git a/README.md b/README.md index 2a372cd..f990d85 100644 --- a/README.md +++ b/README.md @@ -9,20 +9,25 @@ In March 2015 we've also written a short paper outlining discussing some develop ### Usage -To use the SQL parser in your own projects you simply have to follow these few steps. The only requirement for is GCC 4.8+. Older versions of GCC probably also work, but are untested. +**Requirements:** + * gcc 4.8+ + +To use the SQL parser in your own projects you simply have to follow these few steps. The only requirement for is gcc 4.8+. Older versions of gcc might also work, but are untested. 1. Download the [latest release here](https://github.com/hyrise/sql-parser/releases) 2. Compile the library `make` to create `libsqlparser.so` + 3. *(Optional)* Run `make install` to copy the library to `/usr/local/lib/` 3. Run the tests `make test` to make sure everything worked - 4. Take a look at the [example project here](https://github.com/hyrise/sql-parser/tree/dynamic-library/example) + 4. Take a look at the [example project here](https://github.com/hyrise/sql-parser/tree/master/example) 5. Include the `SQLParser.h` from `src/` and link the library in your project ### Development -**Prerequisites:** -* [bison](https://www.gnu.org/software/bison/) (tested with v3.0.2) -* [flex](http://flex.sourceforge.net/) (tested with v2.5.5) +**Requirements for development:** + * gcc 4.8 (or newer) + * [bison](https://www.gnu.org/software/bison/) (tested with v3.0.2) + * [flex](http://flex.sourceforge.net/) (tested with v2.5.5) First step to extending this parser is cloning the repository `git clone git@github.com:hyrise/sql-parser.git` and making sure everything works by running the following steps: @@ -45,12 +50,10 @@ make test # build parser, library and runs the tests We strongly encourage you to contribute to this project! If you want to contribute to this project there are several options. If you've noticed a bug or would like an improvement let us know by creating a [new issue](https://github.com/hyrise/sql-parser/issues). If you want to develop a new feature yourself or just improve the quality of the system, feel free to fork the reposistory and implement your changes. Open a pull request as soon as your done and we will look over it. If we think it's good then your pull request will be merged into this repository. -### Documenation +### Resources -* [Working Syntax Examples](docs/syntax.md) -* [Known Issues](docs/issues.md) -* [Developer Documentation](docs/documentation.md) -* [Integration in Hyrise](docs/integration.md) + * [Working Syntax Examples](docs/syntax.md) + * [Developer Documentation](docs/dev-docs.md) ### License diff --git a/docs/documentation.md b/docs/dev-docs.md similarity index 51% rename from docs/documentation.md rename to docs/dev-docs.md index 7cb9edb..1214879 100644 --- a/docs/documentation.md +++ b/docs/dev-docs.md @@ -1,29 +1,31 @@ Developer Documentation ======================= -This page contains information about how to extend this parser with new functionalities. +## Developing New Functionality + +This section contains information about how to extend this parser with new functionalities. +### Implementing a new Statement -## Implementing Statement Class - -Create a new file and class in src/lib/statements/ or extend any of the existing Statements. Every statement needs to have the base class SQLStatement and needs to call its super constructor with its type. If your defining a new statement type, you need to define a new StatementType in SQLStatement.h. +Create a new file and class in `src/sql/` or extend any of the existing Statements. Every statement needs to have the base class SQLStatement and needs to call its super constructor with its type. If your defining a new statement type, you need to define a new StatementType in `SQLStatement.h`. It is important that you create an appropriate constructor for your statement that zero-initializes all its pointer variables and that your create an appropriate destructor. -Lastly you need to include your new file in src/lib/sqllib.h +Finally you will need to include your new file in `src/sql/statements.h`. - -## Extending the Grammar +### Extending the Grammar Related files: - * src/parser/bison_parser.y - * src/parser/flex_lexer.l - * src/parser/keywordlist_generator.py - * src/parser/sql_keywords.txt +```` +src/parser/bison_parser.y +src/parser/flex_lexer.l +src/parser/keywordlist_generator.py +src/parser/sql_keywords.txt +``` -To extend the grammar the file you will mostly have to deal with is the bison grammar definition in src/parser/bison_parser.y. +To extend the grammar the file you will mostly have to deal with is the bison grammar definition in `src/parser/bison_parser.y`. If your extending an existing statement, skip to the non-terminal definition for that statement. I.e. for an InsertStatement the non-terminal insert_statement. @@ -33,7 +35,6 @@ If your defining a new statement, you will need to define your type in the \%uni ## Implementing Tests -Related files: - * src/sql_tests.cpp +All test related files are in `test/`. Take a look to see how tests are implemented. diff --git a/docs/doxy.conf b/docs/doxy.conf deleted file mode 100644 index 4ea6b16..0000000 --- a/docs/doxy.conf +++ /dev/null @@ -1,20 +0,0 @@ -@PROJECT_NAME = "SQL Parser for Hyrise (C++)" - -@OUTPUT_DIRECTORY = docs/__doxygen__/ -@GENERATE_LATEX = NO -@GENERATE_HTML = YES - -@INCLUDE_FILE_PATTERNS = *.y *.l -@FILE_PATTERNS = *.y *.l *.h *.cpp *.md - - -@INPUT = README.md \ - docs/ \ - src/parser/SQLParser.h \ - src/parser/SQLParser.cpp \ - src/parser/bison_parser.y \ - src/parser/flex_lexer.l \ - src/lib/ \ - - -@RECURSIVE = YES \ No newline at end of file diff --git a/docs/integration.md b/docs/integration.md deleted file mode 100644 index b2173b1..0000000 --- a/docs/integration.md +++ /dev/null @@ -1,8 +0,0 @@ -Integration in Hyrise -===================== - -On this page we describe how to integrate changes to the parser into Hyrise. - -## Update the Parser code in Hyrise - -Run `./deploy_to_hyrise.sh path/to/hyrise` to update the SQL parser code within Hyrise. \ No newline at end of file diff --git a/docs/issues.md b/docs/issues.md deleted file mode 100644 index 90a3c3d..0000000 --- a/docs/issues.md +++ /dev/null @@ -1,10 +0,0 @@ -Known Issues -============ - -Here we will keep track of issues with the parser and the integration in Hyrise. - -## Missing Functionality - - * Union clauses - * Create anything other than tables - * Alter/Rename statements diff --git a/benchmark/benchmark.py b/hyrise/benchmark/benchmark.py similarity index 100% rename from benchmark/benchmark.py rename to hyrise/benchmark/benchmark.py