Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Slowroll:Base:1
sql-parser
sql-parser-1.5+git20181206.obscpio
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File sql-parser-1.5+git20181206.obscpio of Package sql-parser
07070100000000000081A4000003E800000064000000015C0989F3000004D6000000000000000000000000000000000000002700000000sql-parser-1.5+git20181206/.travis.yml language: cpp install: - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - sudo apt-get -qq update - sudo apt-get install -y g++-6 libstdc++-6-dev - sudo apt-get install -y valgrind - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 90 # Install bison 3.0.4. - wget http://ftp.gnu.org/gnu/bison/bison-3.0.4.tar.gz - tar -xvzf bison-3.0.4.tar.gz - cd bison-3.0.4 - ./configure && make && sudo make install - cd .. # Install flex 2.6.4 - wget https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz - tar -xvzf flex-2.6.4.tar.gz - cd flex-2.6.4 - ./configure && make && sudo make install - cd .. # Show installed versions. - which g++ - g++ -v - bison --version - flex --version - valgrind --version - if [ "$CXX" = "clang++" ]; then export CXXFLAGS="-stdlib=libc++"; fi compiler: - gcc - clang script: # bi build with flex/bison files checked into repo - make -j4 - make test - make test_example # build flex/bison files in CI - make cleanall - make -j4 - make test - make test_example # Test if benchmark can be built. # - make benchmark 07070100000001000081A4000003E800000064000000015C0989F30000043D000000000000000000000000000000000000002300000000sql-parser-1.5+git20181206/LICENSEMIT License Copyright (c) 2012-2017 Hasso-Plattner-Institut Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 07070100000002000081A4000003E800000064000000015C0989F3000011F2000000000000000000000000000000000000002400000000sql-parser-1.5+git20181206/Makefileall: library ####################################### ############# Directories ############# ####################################### BIN = bin SRC = src INCLUDE = include/sqlparser SRCPARSER = src/parser INSTALL = /usr/local ###################################### ############ Compile Mode ############ ###################################### # Set compile mode to -g or -O3. # Debug mode: make mode=debug mode ?= release MODE_LOG = "" OPT_FLAG = ifeq ($(mode), debug) OPT_FLAG = -g MODE_LOG = "Building in \033[1;31mdebug\033[0m mode" else OPT_FLAG = -O3 MODE_LOG = "Building in \033[0;32mrelease\033[0m mode ('make mode=debug' for debug mode)" endif GMAKE = make mode=$(mode) ####################################### ############### Library ############### ####################################### NAME := sqlparser PARSER_CPP = $(SRCPARSER)/bison_parser.cpp $(SRCPARSER)/flex_lexer.cpp PARSER_H = $(SRCPARSER)/bison_parser.h $(SRCPARSER)/flex_lexer.h LIB_CFLAGS = -std=c++11 -Wall -Werror $(OPT_FLAG) static ?= no ifeq ($(static), yes) LIB_BUILD = lib$(NAME).a LIBLINKER = $(AR) LIB_LFLAGS = rs else LIB_BUILD = lib$(NAME).so LIBLINKER = $(CXX) LIB_CFLAGS += -fPIC LIB_LFLAGS = -shared -o endif LIB_CPP = $(shell find $(SRC) -name '*.cpp' -not -path "$(SRCPARSER)/*") $(PARSER_CPP) LIB_H = $(shell find $(INCLUDE) -name '*.h' -not -path "$(SRCPARSER)/*") $(PARSER_H) LIB_ALL = $(shell find $(SRC) -name '*.cpp' -not -path "$(SRCPARSER)/*") $(shell find $(INCLUDE) -name '*.h' -not -path "$(SRCPARSER)/*") LIB_OBJ = $(LIB_CPP:%.cpp=%.o) library: $(LIB_BUILD) $(LIB_BUILD): $(LIB_OBJ) $(LIBLINKER) $(LIB_LFLAGS) $(LIB_BUILD) $(LIB_OBJ) $(SRCPARSER)/flex_lexer.o: $(SRCPARSER)/flex_lexer.cpp $(SRCPARSER)/bison_parser.cpp $(CXX) $(LIB_CFLAGS) -c -o $@ $< -Wno-sign-compare -Wno-unneeded-internal-declaration -Wno-register %.o: %.cpp $(PARSER_CPP) $(LIB_H) $(CXX) $(LIB_CFLAGS) -c -o $@ $< $(SRCPARSER)/bison_parser.cpp: $(SRCPARSER)/bison_parser.y $(GMAKE) -C $(SRCPARSER)/ bison_parser.cpp $(SRCPARSER)/flex_lexer.cpp: $(SRCPARSER)/flex_lexer.l $(GMAKE) -C $(SRCPARSER)/ flex_lexer.cpp $(SRCPARSER)/bison_parser.h: $(SRCPARSER)/bison_parser.cpp $(SRCPARSER)/flex_lexer.h: $(SRCPARSER)/flex_lexer.cpp clean: rm -f lib$(NAME).a lib$(NAME).so rm -rf $(BIN) find $(SRC) -type f -name '*.o' -delete cleanparser: $(GMAKE) -C $(SRCPARSER)/ clean cleanall: clean cleanparser install: cp $(LIB_BUILD) $(INSTALL)/lib/$(LIB_BUILD) rm -rf $(INSTALL)/include/hsql cp -r src $(INSTALL)/include/hsql find $(INSTALL)/include/hsql -not -name '*.h' -type f | xargs rm ####################################### ############## Benchmark ############## ####################################### BM_BUILD = $(BIN)/benchmark BM_CFLAGS = -std=c++17 -Wall -Isrc/ -Iinclude/sqlparser/ -L./ $(OPT_FLAG) BM_PATH = benchmark BM_CPP = $(shell find $(BM_PATH)/ -name '*.cpp') BM_ALL = $(shell find $(BM_PATH)/ -name '*.cpp' -or -name '*.h') benchmark: $(BM_BUILD) run_benchmarks: benchmark ./$(BM_BUILD) --benchmark_counters_tabular=true # --benchmark_filter="abc save_benchmarks: benchmark ./$(BM_BUILD) --benchmark_format=csv > benchmarks.csv $(BM_BUILD): $(BM_ALL) $(LIB_BUILD) @mkdir -p $(BIN)/ $(CXX) $(BM_CFLAGS) $(BM_CPP) -o $(BM_BUILD) -lbenchmark -lpthread -lsqlparser -lstdc++ -lstdc++fs ######################################## ############ Test & Example ############ ######################################## TEST_BUILD = $(BIN)/tests TEST_CFLAGS = -std=c++11 -Wall -Isrc/ -Iinclude/sqlparser/ -Itest/ -L./ $(OPT_FLAG) TEST_CPP = $(shell find test/ -name '*.cpp') TEST_ALL = $(shell find test/ -name '*.cpp') $(shell find test/ -name '*.h') EXAMPLE_SRC = $(shell find example/ -name '*.cpp') $(shell find example/ -name '*.h') test: $(TEST_BUILD) bash test/test.sh $(TEST_BUILD): $(TEST_ALL) $(LIB_BUILD) @mkdir -p $(BIN)/ $(CXX) $(TEST_CFLAGS) $(TEST_CPP) -o $(TEST_BUILD) -lsqlparser -lstdc++ test_example: $(GMAKE) -C example/ LD_LIBRARY_PATH=./ \ ./example/example "SELECT * FROM students WHERE name = 'Max Mustermann';" test_format: @! astyle --options=astyle.options $(LIB_ALL) | grep -q "Formatted" @! astyle --options=astyle.options $(TEST_ALL) | grep -q "Formatted" ######################################## ################# Misc ################# ######################################## format: astyle --options=astyle.options $(LIB_ALL) astyle --options=astyle.options $(TEST_ALL) astyle --options=astyle.options $(EXAMPLE_SRC) log_mode: @echo $(MODE_LOG) 07070100000003000081A4000003E800000064000000015C0989F3000001C7000000000000000000000000000000000000002500000000sql-parser-1.5+git20181206/README.mdC++ SQL Parser Library ====================== This code has been forked from [Hyrise SQL Parser](https://github.com/hyrise/sql-parser). Files have been moved around and modified to make it easy for inclusion in envoy mysql_proxy. MySQL specific extensions have been added to the SQL parser. The SQL parser library will be eventually merged into envoy core and used as a generic SQL parser for different database implementations (MySQL, Postgres, etc.). 07070100000004000081A4000003E800000064000000015C0989F30000007D000000000000000000000000000000000000002A00000000sql-parser-1.5+git20181206/astyle.options --style=google # indentation --indent=spaces=2 --indent-namespaces --align-reference=type --align-pointer=type --pad-oper 07070100000005000041ED000003E800000064000000025C0989F300000000000000000000000000000000000000000000002500000000sql-parser-1.5+git20181206/benchmark07070100000006000081A4000003E800000064000000015C0989F300000113000000000000000000000000000000000000002F00000000sql-parser-1.5+git20181206/benchmark/README.md# Benchmark This directory contains the scripts to execute benchmarks of the parser. We use [Google Benchmark](https://github.com/google/benchmark) to define and run benchmarks. ## Install Google Benchmark ```bash cmake -DCMAKE_BUILD_TYPE=Release make make install ``` 07070100000007000081A4000003E800000064000000015C0989F30000043D000000000000000000000000000000000000003300000000sql-parser-1.5+git20181206/benchmark/benchmark.cpp#include "benchmark/benchmark.h" #include "benchmark_utils.h" #include "queries.h" int main(int argc, char** argv) { // Create parse and tokenize benchmarks for TPC-H queries. const auto tpch_queries = getTPCHQueries(); for (const auto& query : tpch_queries) { std::string p_name = query.first + "-parse"; benchmark::RegisterBenchmark(p_name.c_str(), &BM_ParseBenchmark, query.second); std::string t_name = query.first + "-tokenize"; benchmark::RegisterBenchmark(t_name.c_str(), &BM_TokenizeBenchmark, query.second); } // Create parse and tokenize benchmarks for all queries in sql_queries array. for (unsigned i = 0; i < sql_queries.size(); ++i) { const auto& query = sql_queries[i]; std::string p_name = getQueryName(i) + "-parse"; benchmark::RegisterBenchmark(p_name.c_str(), &BM_ParseBenchmark, query.second); std::string t_name = getQueryName(i) + "-tokenize"; benchmark::RegisterBenchmark(t_name.c_str(), &BM_TokenizeBenchmark, query.second); } benchmark::Initialize(&argc, argv); benchmark::RunSpecifiedBenchmarks(); } 07070100000008000081A4000003E800000064000000015C0989F3000004BD000000000000000000000000000000000000003900000000sql-parser-1.5+git20181206/benchmark/benchmark_utils.cpp#include "benchmark_utils.h" #include <fstream> #include <iostream> #include "SQLParser.h" size_t getNumTokens(const std::string& query) { std::vector<int16_t> tokens; hsql::SQLParser::tokenize(query, &tokens); return tokens.size(); } void BM_TokenizeBenchmark(benchmark::State& st, const std::string& query) { st.counters["num_tokens"] = getNumTokens(query); st.counters["num_chars"] = query.size(); while (st.KeepRunning()) { std::vector<int16_t> tokens(512); hsql::SQLParser::tokenize(query, &tokens); } } void BM_ParseBenchmark(benchmark::State& st, const std::string& query) { st.counters["num_tokens"] = getNumTokens(query); st.counters["num_chars"] = query.size(); while (st.KeepRunning()) { hsql::SQLParserResult result; hsql::SQLParser::parse(query, &result); if (!result.isValid()) { std::cout << query << std::endl; std::cout << result.errorMsg() << std::endl; st.SkipWithError("Parsing failed!"); } } } std::string readFileContents(const std::string& file_path) { std::ifstream t(file_path.c_str()); std::string text((std::istreambuf_iterator<char>(t)), std::istreambuf_iterator<char>()); return text; } 07070100000009000081A4000003E800000064000000015C0989F3000003D6000000000000000000000000000000000000003700000000sql-parser-1.5+git20181206/benchmark/benchmark_utils.h#ifndef __BENCHMARK_UTILS_H__ #define __BENCHMARK_UTILS_H__ #include "benchmark/benchmark.h" size_t getNumTokens(const std::string& query); void BM_TokenizeBenchmark(benchmark::State& st, const std::string& query); void BM_ParseBenchmark(benchmark::State& st, const std::string& query); std::string readFileContents(const std::string& file_path); #define TIME_DIFF(end, start)\ std::chrono::duration_cast<std::chrono::duration<double>>(end - start); #define NOW()\ std::chrono::high_resolution_clock::now(); #define PARSE_QUERY_BENCHMARK(name, query)\ static void name(benchmark::State& st) {\ BM_ParseBenchmark(st, query);\ }\ BENCHMARK(name); #define TOKENIZE_QUERY_BENCHMARK(name, query)\ static void name(benchmark::State& st) {\ BM_TokenizeBenchmark(st, query);\ }\ BENCHMARK(name); #define BENCHMARK_QUERY(test_name, query)\ TOKENIZE_QUERY_BENCHMARK(test_name##Tokenize, query)\ PARSE_QUERY_BENCHMARK(test_name##Parse, query) #endif0707010000000A000081A4000003E800000064000000015C0989F300000969000000000000000000000000000000000000003A00000000sql-parser-1.5+git20181206/benchmark/parser_benchmark.cpp #include <chrono> #include <sstream> #include "benchmark/benchmark.h" #include "SQLParser.h" #include "parser/bison_parser.h" #include "parser/flex_lexer.h" #include "benchmark_utils.h" // Benchmark the influence of increasing size of the query, while // the number of tokens remains unchanged. static void BM_CharacterCount(benchmark::State& st) { const size_t querySize = st.range(0); // Base query has size of 18 characters. std::string query = "SELECT %name% FROM test;"; const uint pad = querySize - 18; const std::string filler = std::string(pad, 'a'); query.replace(7, 6, filler); st.counters["num_tokens"] = getNumTokens(query); st.counters["num_chars"] = query.size(); while (st.KeepRunning()) { hsql::SQLParserResult result; hsql::SQLParser::parse(query, &result); } } BENCHMARK(BM_CharacterCount) ->RangeMultiplier(1 << 2) ->Ranges({{1 << 5, 1 << 15}, {5, 5}}); // Benchmark the influence of increasing number of tokens, while // the number of characters remains unchanged. static void BM_ConditionalTokens(benchmark::State& st) { const size_t targetSize = st.range(0); const size_t numTokens = st.range(1); // Base query contains 6 tokens. std::string query = "SELECT * FROM test"; // Create conditional. std::stringstream condStream; size_t missingTokens = numTokens - 4; if (missingTokens > 0) { condStream << " WHERE a"; missingTokens -= 2; while (missingTokens > 0) { condStream << " AND a"; missingTokens -= 2; } } query += condStream.str(); if (targetSize >= query.size()) { const size_t pad = targetSize - query.size(); const std::string filler = std::string(pad, 'a'); query.replace(7, 1, filler); } else { // Query can't be the same length as in the other benchmarks. // Running this will result in unusable data. fprintf(stderr, "Too many tokens. Query too long for benchmark char limit (%lu > %lu).\n", query.size(), targetSize); return; } st.counters["num_tokens"] = getNumTokens(query); st.counters["num_chars"] = query.size(); while (st.KeepRunning()) { hsql::SQLParserResult result; hsql::SQLParser::parse(query, &result); if (!result.isValid()) st.SkipWithError("Parsing failed!"); } } BENCHMARK(BM_ConditionalTokens) ->RangeMultiplier(1 << 2) ->Ranges({{1 << 14, 1 << 14}, {1 << 2, 1 << 11}}); 0707010000000B000081A4000003E800000064000000015C0989F3000004C8000000000000000000000000000000000000003100000000sql-parser-1.5+git20181206/benchmark/queries.cpp#include "queries.h" #include <experimental/filesystem> #include <algorithm> #include <iostream> #include <regex> #include "benchmark_utils.h" namespace filesystem = std::experimental::filesystem; std::string getQueryName(unsigned i) { if (sql_queries[i].first.empty()) { std::string name = "#" + std::to_string(i + 1); return name; } return std::string("") + sql_queries[i].first; } std::vector<SQLQuery> getQueriesFromDirectory(const std::string& dir_path) { std::regex query_file_regex("\\.sql$"); std::vector<std::string> files; for (auto& entry : filesystem::directory_iterator(dir_path)) { if (filesystem::is_regular_file(entry)) { std::string path_str = filesystem::path(entry); if (std::regex_search(path_str, query_file_regex)) { files.push_back(path_str); } } } std::sort(files.begin(), files.end()); std::vector<SQLQuery> queries; for (const std::string& file_path : files) { const filesystem::path p(file_path); const std::string query = readFileContents(file_path); queries.emplace_back(p.filename(), query); } return queries; } std::vector<SQLQuery> getTPCHQueries() { return getQueriesFromDirectory("test/queries/"); } 0707010000000C000081A4000003E800000064000000015C0989F3000009AA000000000000000000000000000000000000002F00000000sql-parser-1.5+git20181206/benchmark/queries.h#ifndef __QUERIES_H__ #define __QUERIES_H__ #include <string> #include <vector> typedef std::pair<std::string, std::string> SQLQuery; // name, query static std::vector<SQLQuery> sql_queries = { {"Q1", "SELECT * FROM test;"}, {"Q2", "SELECT a, b AS address FROM (SELECT * FROM test WHERE c < 100 AND b > 3) t1 WHERE a < 10 AND b < 100;"}, {"Q3", "SELECT \"left\".a, \"left\".b, \"right\".a, \"right\".b FROM table_a AS \"left\" JOIN table_b AS \"right\" ON \"left\".a = \"right\".a;"}, {"Q4", "" "SELECT" " l_orderkey," " SUM(l_extendedprice * (1 - l_discount)) AS revenue," " o_orderdate," " o_shippriority" " FROM" " customer," " orders," " lineitem" " WHERE" " c_mktsegment = '%s'" " and c_custkey = o_custkey" " and l_orderkey = o_orderkey" " and o_orderdate < '%s'" " and l_shipdate > '%s'" " GROUP BY" " l_orderkey," " o_orderdate," " o_shippriority" " ORDER BY" " revenue DESC," " o_orderdate;" }, {"LongSelectList26", "SELECT a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z FROM test;"}, {"LongSelectElement26", "SELECT abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy FROM test;"}, {"LongSelectList52", "SELECT a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z FROM test;"}, {"LongSelectElement52", "SELECT abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy FROM test;"}, {"TwoSelects", "SELECT * FROM test; SELECT age, street AS address FROM data1;"}, {"LargeInsert", "INSERT INTO test VALUES (\'abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz\')" }, {"ExecuteNoParams", "EXECUTE procedure;"}, {"Execute2Params", "EXECUTE procedure(11, 'test');"}, {"Execute10Params", "EXECUTE procedure(11, 'test', 5.6, 4.2, 'abc', 6, 7, 8, 9, 10000);"}, // {"name", "query"}, }; std::string getQueryName(unsigned i); std::vector<SQLQuery> getQueriesFromDirectory(const std::string& dir_path); std::vector<SQLQuery> getTPCHQueries(); #endif 0707010000000D000041ED000003E800000064000000025C0989F300000000000000000000000000000000000000000000002000000000sql-parser-1.5+git20181206/docs0707010000000E000081A4000003E800000064000000015C0989F30000019E000000000000000000000000000000000000002A00000000sql-parser-1.5+git20181206/docs/README.mdDocumentation ============= Internal Links: * [Developer Documentation](dev-docs.md) * [Supported SQL Queries](syntax-support.md) * [Known Limitations & Missing Features](known-limitations.md) External Resources: * [Original Dev-Paper (2015)](http://torpedro.com/paper/HyriseSQL-03-2015.pdf) * [Blog Post about Basic Usage](http://torpedro.github.io/tech/c++/sql/parser/2016/02/27/c++-sql-parser.html) 0707010000000F000081A4000003E800000064000000015C0989F30000099D000000000000000000000000000000000000002C00000000sql-parser-1.5+git20181206/docs/dev-docs.mdDeveloper Documentation ======================= ## Basic Requirements **Requirements for development:** * gcc 4.8+ (or clang 3.4+) * [bison](https://www.gnu.org/software/bison/) (v3.0.2+) * [flex](http://flex.sourceforge.net/) (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: ```bash make parser # builds the bison parser and flex lexer make library # builds the libsqlparser.so make test # runs the tests with the library ``` Rerun these steps whenever you change part of the parse. To execute the entire pipeline automatically you can run: ```bash make cleanall # cleans the parser build and library build make test # build parser, library and runs the tests ``` ## Developing New Functionality This section contains information about how to extend this parser with new functionalities. ### Implementing a new Statement 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. Finally you will need to include your new file in `src/sql/statements.h`. ### 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 ``` 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. If your defining a new statement, you will need to define your type in the \%union directive `hsql::ExampleStatement example_stmt`. Next you need to associate this type with a non-terminal `\%type <example_stmt> example_statement`. Then you have to define the non-terminal `example_statement`. Look the other non-terminals for statements to figure out how. ## Implementing Tests All test related files are in `test/`. Take a look to see how tests are implemented. 07070100000010000081A4000003E800000064000000015C0989F300000394000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/docs/known-limitations.mdKnown Limitations & Missing Features ==================================== This page contains an overview of known missing limitations and missing features in our SQL parser project. In general, we would like to see all of these features being supported at some point. If you are particularly interested in a specific feature, feel free to contribute to this project through a pull request. ### Completely Missing Statement Types * EXPLAIN * EXPORT * RENAME * ALTER Additionally, there are a lot of statement types that are specific to certain database systems. Supporting all of these is not on our roadmap, but if someone implements support for such a statement, we can also integrate it. ### Other SQL Limitations * Tables names ignore the schema name (see grammar rule `table_name`). This affects, for example, `INSERT, IMPORT, DROP, DELETE`. * Column data types only support `INT, DOUBLE, TEXT`. 07070100000011000081A4000003E800000064000000015C0989F30000061C000000000000000000000000000000000000003200000000sql-parser-1.5+git20181206/docs/syntax-support.mdSupported SQL Queries ===================== This page contains a short list of queries that can be correctly parsed with our parser. If you are interested in finding out if a certain feature is supported, it is probably the easiest to checkout the repository and try the example project or check our [list of known limitations](known-limitations.md). Also the file [queries-good.sql](../test/queries/queries-good.sql) shows a list of queries which are parsable with the current version. ## Select Statements We implement a broad support for the most common elements for `SELECT` statements. Following are a few examples of basic constructs that are supported. ```sql SELECT name, city, * FROM students AS t1 JOIN students AS t2 ON t1.city = t2.city WHERE t1.grade < 2.0 AND t2.grade > 2.0 AND t1.city = 'Frohnau' ORDER BY t1.grade DESC; SELECT city, AVG(grade) AS average, MIN(grade) AS best, MAX(grade) AS worst FROM students GROUP BY city; ``` ## Data Definition & Modification **Create Tables** ```sql CREATE TABLE students ( name TEXT, student_number INTEGER, city TEXT, grade DOUBLE ); ``` **Update and Delete** ```sql UPDATE students SET name='Max Mustermann' WHERE name = 'Ralf Mustermann'; DELETE FROM students WHERE name = 'Max Mustermann'; ``` ## Prepared Statements The definition and execution of prepared statements is supported using the following syntax. ```sql PREPARE select_test FROM 'SELECT * FROM customer WHERE c_name = ?;'; EXECUTE select_test('Max Mustermann'); ``` 07070100000012000041ED000003E800000064000000025C0989F300000000000000000000000000000000000000000000002300000000sql-parser-1.5+git20181206/example07070100000013000081A4000003E800000064000000015C0989F300000090000000000000000000000000000000000000002C00000000sql-parser-1.5+git20181206/example/Makefile CFLAGS = -std=c++1z -lstdc++ -Wall -Werror -I../include/sqlparser/ -I../src/ -L../ all: $(CXX) $(CFLAGS) example.cpp -o example -lsqlparser 07070100000014000081A4000003E800000064000000015C0989F3000003D8000000000000000000000000000000000000002F00000000sql-parser-1.5+git20181206/example/example.cpp #include <stdlib.h> #include <string> // include the sql parser #include "SQLParser.h" // contains printing utilities #include "util/sqlhelper.h" int main(int argc, char* argv[]) { if (argc <= 1) { fprintf(stderr, "Usage: ./example \"SELECT * FROM test;\"\n"); return -1; } std::string query = argv[1]; // parse a given query hsql::SQLParserResult result; hsql::SQLParser::parse(query, &result); // check whether the parsing was successful if (result.isValid()) { printf("Parsed successfully!\n"); printf("Number of statements: %lu\n", result.size()); for (auto i = 0u; i < result.size(); ++i) { // Print a statement summary. hsql::printStatementInfo(result.getStatement(i)); } return 0; } else { fprintf(stderr, "Given string is not a valid SQL query.\n"); fprintf(stderr, "%s (L%d:%d)\n", result.errorMsg(), result.errorLine(), result.errorColumn()); return -1; } } 07070100000015000041ED000003E800000064000000045C0989F300000000000000000000000000000000000000000000002200000000sql-parser-1.5+git20181206/hyrise07070100000016000041ED000003E800000064000000025C0989F300000000000000000000000000000000000000000000002C00000000sql-parser-1.5+git20181206/hyrise/benchmark07070100000017000081A4000003E800000064000000015C0989F300001530000000000000000000000000000000000000003900000000sql-parser-1.5+git20181206/hyrise/benchmark/benchmark.py#!/bin/python import urllib, urllib2 import json class HyriseConnection(object): def __init__(self, host, port): super(HyriseConnection, self).__init__() self.host = host self.port = port def __hyriseurl(self): return 'http://%s:%d/query' % (self.host, self.port) def __parseResponse(self, response): result = json.loads(response) if 'error' in result: print 'An error occurred: %s' % result['error'][0] return None if 'performanceData' in result: pf_data = result['performanceData'] total_time = 0 parse_time = 0 querytask_time = 0 for operator in pf_data: time_ms = operator['endTime'] - operator['startTime'] total_time += time_ms if operator['name'] == 'RequestParseTask': parse_time += time_ms if operator['name'] == 'SQLQueryTask': querytask_time += time_ms return { 'total_ms': total_time, 'parse_ms': parse_time, 'querytask_ms': querytask_time, 'preparation_ms': parse_time + querytask_time } def __sendRequest(self, params): url = self.__hyriseurl() params['performance'] = 'true' data = urllib.urlencode(params) req = urllib2.Request(url, data) try: rsp = urllib2.urlopen(req) response = rsp.read(); return self.__parseResponse(response) except TypeError, e: print "An error occurred" return None except Exception, e: return self.__parseResponse(e.read()) def __aggregatePerfArray(self, perfArray): perf = perfArray[0] for data in perfArray[1:]: for key in data: perf[key] += data[key] for key in perf: perf[key] /= len(perfArray) return perf def executeSingleSQL(self, sql): params = {'sql': sql} return self.__sendRequest(params) def executeSingleJSON(self, jsonString): params = {'query': jsonString} return self.__sendRequest(params) def executeSQL(self, sql, times=1): perf = [self.executeSingleSQL(sql) for _ in range(times)] return self.__aggregatePerfArray(perf) def executeJSON(self, json, times=1): perf = [self.executeSingleJSON(json) for _ in range(times)] return self.__aggregatePerfArray(perf) queries = { 'select-1': { 'sql': "SELECT name, city FROM students WHERE grade <= 2.0", 'json': """{"operators":{"0":{"type":"GetTable","name":"students"},"1":{"type":"SimpleTableScan","predicates":[{"type":"LTE_V","in":0,"f":"grade","value":2,"vtype":1}]},"2":{"type":"ProjectionScan","fields":["name","city"]}},"edges":[["0","1"],["1","2"]]}""", 'prepare': "PREPARE sel_test: SELECT name, city FROM students WHERE grade <= ?", 'execute': "EXECUTE sel_test(2.0);" }, 'insert-1': { 'sql': "INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3);", 'json': """{"operators":{"0":{"type":"GetTable","name":"students"},"1":{"type":"InsertScan","data":[["Max",42,"Musterhausen",2.3]]},"commit":{"type":"Commit"}},"edges":[["0","1"],["1","commit"]]}""" }, 'insert-2': { 'sql': """ INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3); INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3); INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3); INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3); INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3); INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3); INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3); INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3); """, 'json': """{ "operators": { "0": { "type": "GetTable", "name": "students" }, "1": { "type": "InsertScan", "data": [ ["Max", 42, "Musterhausen", 2.3], ["Max", 42, "Musterhausen", 2.3], ["Max", 42, "Musterhausen", 2.3], ["Max", 42, "Musterhausen", 2.3], ["Max", 42, "Musterhausen", 2.3], ["Max", 42, "Musterhausen", 2.3], ["Max", 42, "Musterhausen", 2.3], ["Max", 42, "Musterhausen", 2.3] ] }, "commit" : { "type" : "Commit" } }, "edges": [["0","1"],["1","commit"]] }""", 'prepare': """PREPARE batch_insert { INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3); INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3); INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3); INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3); INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3); INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3); INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3); INSERT INTO students VALUES ('Max', 42, 'Musterhausen', 2.3); }""", 'execute': "EXECUTE batch_insert;" } } if __name__ == '__main__': hyrise = HyriseConnection('localhost', 5000) # Load Table hyrise.executeSQL("CREATE TABLE IF NOT EXISTS students FROM TBL FILE 'test/students.tbl';") query = queries['insert-2'] times = 50 # if 'prepare' in query: hyrise.executeSQL(query['prepare']) if 'sql' in query: print 'SQL: ', hyrise.executeSQL(query['sql'], times) if 'execute' in query: print 'Prepared: ', hyrise.executeSQL(query['execute'], times) # if 'json' in query: print 'JSON: ', hyrise.executeJSON(query['json'], times) 07070100000018000081ED000003E800000064000000015C0989F300000157000000000000000000000000000000000000003600000000sql-parser-1.5+git20181206/hyrise/deploy_to_hyrise.sh#!/bin/sh # Usage: deploy_to_hyrise.sh path/to/hyrise.git BUILD_PATH=$(readlink -f $(dirname $0))/build HYRISE_PATH=$1 SQL_PATH=${HYRISE_PATH}/src/lib/access/sql if [ ! -d $SQL_PATH ]; then echo "Could not verify Hyrise path! ${HYRISE_PATH}" exit fi make -C src/ build rm ${SQL_PATH}/parser/* cp ${BUILD_PATH}/* ${SQL_PATH}/parser/ 07070100000019000041ED000003E800000064000000025C0989F300000000000000000000000000000000000000000000003000000000sql-parser-1.5+git20181206/hyrise/web-interface0707010000001A000081A4000003E800000064000000015C0989F30001BD5B000000000000000000000000000000000000004200000000sql-parser-1.5+git20181206/hyrise/web-interface/bootstrap.min.css/*! * Bootstrap v3.3.0 (http://getbootstrap.com) * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) *//*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:before,:after{color:#000!important;text-shadow:none!important;background:transparent!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before,.glyphicon-eur:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:before,:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:400;line-height:1;color:#777}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}mark,.mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#428bca}a.text-primary:hover{color:#3071a9}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#428bca}a.bg-primary:hover{background-color:#3071a9}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=radio],input[type=checkbox]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=radio]:focus,input[type=checkbox]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee;opacity:1}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{line-height:34px;line-height:1.42857143 \0}input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px;line-height:1.5 \0}input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px;line-height:1.33 \0}_:-ms-fullscreen,:root input[type=date],_:-ms-fullscreen,:root input[type=time],_:-ms-fullscreen,:root input[type=datetime-local],_:-ms-fullscreen,:root input[type=month]{line-height:1.42857143}_:-ms-fullscreen.input-sm,:root input[type=date].input-sm,_:-ms-fullscreen.input-sm,:root input[type=time].input-sm,_:-ms-fullscreen.input-sm,:root input[type=datetime-local].input-sm,_:-ms-fullscreen.input-sm,:root input[type=month].input-sm{line-height:1.5}_:-ms-fullscreen.input-lg,:root input[type=date].input-lg,_:-ms-fullscreen.input-lg,:root input[type=time].input-lg,_:-ms-fullscreen.input-lg,:root input[type=datetime-local].input-lg,_:-ms-fullscreen.input-lg,:root input[type=month].input-lg{line-height:1.33}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.radio input[type=radio],.radio-inline input[type=radio],.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox]{position:absolute;margin-top:4px \9;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type=radio][disabled],input[type=checkbox][disabled],input[type=radio].disabled,input[type=checkbox].disabled,fieldset[disabled] input[type=radio],fieldset[disabled] input[type=checkbox]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm,.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm,select.form-group-sm .form-control{height:30px;line-height:30px}textarea.input-sm,textarea.form-group-sm .form-control,select[multiple].input-sm,select[multiple].form-group-sm .form-control{height:auto}.input-lg,.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg,select.form-group-lg .form-control{height:46px;line-height:46px}textarea.input-lg,textarea.form-group-lg .form-control,select[multiple].input-lg,select[multiple].form-group-lg .form-control{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success.radio label,.has-success.checkbox label,.has-success.radio-inline label,.has-success.checkbox-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning.radio label,.has-warning.checkbox label,.has-warning.radio-inline label,.has-warning.checkbox-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error.radio label,.has-error.checkbox label,.has-error.radio-inline label,.has-error.checkbox-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type=radio],.form-inline .checkbox input[type=checkbox]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.3px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn:focus,.btn:active:focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn.active.focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus,.btn.focus{color:#333;text-decoration:none}.btn:active,.btn.active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default.focus,.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary.focus,.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#3071a9;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-primary .badge{color:#428bca;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success.focus,.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info.focus,.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning.focus,.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger.focus,.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#428bca;border-radius:0}.btn-link,.btn-link:active,.btn-link.active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#777;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none;visibility:hidden}.collapse.in{display:block;visibility:visible}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#428bca;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#777}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px solid}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=radio],[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=radio],.input-group-addon input[type=checkbox]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none;visibility:hidden}.tab-content>.active{display:block;visibility:visible}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important;visibility:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type=radio],.navbar-form .checkbox input[type=checkbox]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#333}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#fff}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#428bca;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{color:#2a6496;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;cursor:default;background-color:#428bca;border-color:#428bca}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:hover,.label-default[href]:focus{background-color:#5e5e5e}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px 15px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding:48px 0}.container .jumbotron{padding-right:60px;padding-left:60px}.jumbotron h1,.jumbotron .h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-right:auto;margin-left:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#428bca}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-left,.media-right,.media-body{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{color:#555;text-decoration:none;background-color:#f5f5f5}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,a.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,a.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:hover,a.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,a.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,a.list-group-item-danger:focus{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table caption,.panel>.table-responsive>.table caption,.panel>.panel-collapse>.table caption{padding-right:15px;padding-left:15px}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body,.panel-group .panel-heading+.panel-collapse>.list-group{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#428bca}.panel-primary>.panel-heading .badge{color:#428bca;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{min-height:16.43px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-size:12px;line-height:1.4;visibility:visible;filter:alpha(opacity=0);opacity:0}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{right:5px;bottom:0;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-size:14px;font-weight:400;line-height:1.42857143;text-align:left;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000;perspective:1000}.carousel-inner>.item.next,.carousel-inner>.item.active.right{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.prev,.carousel-inner>.item.active.left{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right,.carousel-inner>.item.active{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-footer:before,.modal-footer:after{display:table;content:" "}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-footer:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important;visibility:hidden!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none!important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}}0707010000001B000081A4000003E800000064000000015C0989F300000B3B000000000000000000000000000000000000004400000000sql-parser-1.5+git20181206/hyrise/web-interface/hyrise-connector.js var HyriseConnector = function(endpointUrl) { this._endpointUrl = endpointUrl; } HyriseConnector.prototype.executeSQL = function(query, callback, errorCallback) { var url = encodeURI(this._endpointUrl); var self = this; jQuery.ajax({ type: "POST", url: url, dataType: 'json', data: { performance: true, sql: query }, success: function(result) { if (typeof result.real_size === "undefined") { result.real_size = 0; result.rows = []; result.header = []; if (!result.performanceData) result.performanceData = []; } self._formatPerformanceData(result); callback(result); }, error: errorCallback }); return this; }; HyriseConnector.prototype._formatPerformanceData = function(object) { var performanceData = object.performanceData; var totalTime = 0; var queryTaskTime = 0; var parseTime = 0; $.each(performanceData, function(i, data) { data.time_ms = data.endTime - data.startTime; totalTime += data.time_ms; if (data.name === 'SQLQueryTask') queryTaskTime += data.time_ms; if (data.name === 'RequestParseTask') parseTime += data.time_ms; }); object.performanceData = { totalTime: totalTime, queryTaskTime: queryTaskTime, parseTime: parseTime, operators: performanceData, } }; HyriseConnector.prototype.benchmarkSQL = function(query, numRuns, callback) { var self = this; function __aggregateData(allData) { var result = { totalTime: 0, queryTaskTime: 0, parseTime: 0, numRuns: allData.length, operators: [] }; var operatorMap = {}; $.each(allData, function(i, run) { var perfData = run.performanceData; result.totalTime += perfData.totalTime; result.queryTaskTime += perfData.queryTaskTime; result.parseTime += perfData.parseTime; $.each(perfData.operators, function(i, data) { if (!(data.id in operatorMap)) { operatorMap[data.id] = data; } else { operatorMap[data.id].duration += data.duration; operatorMap[data.id].startTime += data.startTime; operatorMap[data.id].endTime += data.endTime; operatorMap[data.id].time_ms += data.time_ms; } }); }); // Calc average and Transform into array result.totalTime /= result.numRuns; result.queryTaskTime /= result.numRuns; result.parseTime /= result.numRuns; $.each(operatorMap, function(id, data) { data.duration /= result.numRuns; data.startTime /= result.numRuns; data.time_ms /= result.numRuns; result.operators.push(data); }); callback({ performanceData: result }); } var allData = []; var num_completed = 0; function __run() { self.executeSQL(query, function(result) { allData.push(result); // Run again or return aggregated Data num_completed++; if (num_completed == numRuns) __aggregateData(allData); }); } for (var i = 0; i < numRuns; ++i) { __run(); } __run(); };0707010000001C000081A4000003E800000064000000015C0989F300000D2F000000000000000000000000000000000000003B00000000sql-parser-1.5+git20181206/hyrise/web-interface/index.html<html> <head> <script type="text/javascript" src="jquery-1.11.1.min.js"></script> <link href="bootstrap.min.css" rel="stylesheet"> <script type="text/javascript" src="hyrise-connector.js"></script> <script type="text/javascript" src="ui.js"></script> <link href="style.css" rel="stylesheet" /> <title>Hyrise SQL Frontend</title> </head> <body> <div class="content"> <div class="row"> <div class="col-lg-5"> <!-- Config --> <div class="row"> <div class="form-group col-sm-12"> <input type="text" class="form-control" id="endpointInput" placeholder="Hyrise Host" value="http://localhost:5000/query" /> </div> </div> <!-- Sample Queries --> <div class="row" style="margin-bottom: 10px;"> <div class="col-sm-12" id="sampleQueries"></div> <!-- <div class="col-sm-4" id="buggyQueries"></div> --> </div> <!-- Input --> <div class="row"> <div class="col-sm-12"> <textarea id="queryInput" class="form-control" placeholder="Enter your SQL query here..."></textarea> </div> </div> <!-- Submit --> <div class="row" style="margin: 10px 0px;"> <div class="col-sm-6"> <button type="button" class="btn btn-primary" id="submitBtn">Submit Query (Shift + Enter)</button> </div> <div class="col-sm-6"> <div class="input-group"> <span class="input-group-addon" id="basic-addon1"># times</span> <input type="text" class="form-control" id="benchmarkInput" placeholder="Number of times to run" value="10" /> <span class="input-group-btn"> <button class="btn btn-primary" type="button" id="benchmarkBtn">Benchmark</button> </span> </div><!-- /input-group --> </div> </div> </div> <div class="col-lg-7"> <div class="row"> <div class="col-sm-12"> <!-- View: Performance Data --> <h3>Performance Data</h3> <h4 id="timeInfo"></h4> <table id="performanceDataTable" class="table table-bordered table-striped table-hover"> <thead> <tr> <th data-key="id">ID</th> <th data-key="name">Name</th> <th data-key="duration">Duration</th> <th data-key="time_ms">Time (ms)</th> <th data-key="startTime">Start Time</th> <th data-key="endTime">End Time</th> </tr> </thead> <tbody></tbody> </table> </div> </div> <div class="row"> <div class="col-sm-12"> <!-- View: Result Table --> <h3>Results (first 100 rows)</h3> <div id="msgContainer" class="alert alert-success" role="alert"> <div id="resultInfo">Frontend Ready</div> </div> <table id="resultTable" class="table table-bordered table-striped table-hover"></table> </div> </div> </div> </div> </div> </body> </html>0707010000001D000081A4000003E800000064000000015C0989F30001762A000000000000000000000000000000000000004500000000sql-parser-1.5+git20181206/hyrise/web-interface/jquery-1.11.1.min.js/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px") },cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m}); 0707010000001E000081ED000003E800000064000000015C0989F30000006D000000000000000000000000000000000000003E00000000sql-parser-1.5+git20181206/hyrise/web-interface/run_server.sh#!/bin/sh # Default Port PORT="10101" if [ $# -gt 0 ]; then PORT=$1 fi python -m SimpleHTTPServer ${PORT}0707010000001F000081A4000003E800000064000000015C0989F300000795000000000000000000000000000000000000004300000000sql-parser-1.5+git20181206/hyrise/web-interface/sample-queries.sql# Load Tables CREATE TABLE IF NOT EXISTS students FROM TBL FILE 'test/students.tbl'; CREATE TABLE IF NOT EXISTS test_big FROM TBL FILE 'test/lin_xxs.tbl'; CREATE TABLE IF NOT EXISTS companies FROM TBL FILE 'test/tables/companies.tbl'; CREATE TABLE IF NOT EXISTS employees FROM TBL FILE 'test/tables/employees.tbl'; CREATE TABLE IF NOT EXISTS test (v1 INTEGER, v2 INTEGER, v3 INTEGER); # SELECT SELECT * FROM students WHERE grade <= 2.0; # SUB-SELECT SELECT name, city, grade FROM (SELECT * FROM students WHERE city = 'Potsdam') t1 WHERE grade <= 1.5 OR grade >= 3.5; # GROUP SELECT city, AVG(grade) AS average, MIN(grade) AS best, MAX(grade) AS worst FROM students GROUP BY city; # UNION SELECT * FROM students WHERE grade = 1.3 UNION SELECT * FROM students WHERE grade = 3.7; # JOIN SELECT * FROM companies JOIN employees ON company_id = employee_company_id; # INSERT INSERT INTO students VALUES ('Max Mustermann', 10101, 'Musterhausen', 1.7); # CREATE CREATE TABLE IF NOT EXISTS test (v1 INTEGER, v2 INTEGER, v3 INTEGER); # INSERT/SELECT INSERT INTO test VALUES (1, 23, 45); INSERT INTO test VALUES (1, 23, 45); INSERT INTO test VALUES (1, 23, 45); SELECT * FROM test; # CREATE/INSERT/SELECT CREATE TABLE IF NOT EXISTS test (v1 INTEGER, v2 INTEGER, v3 INTEGER); INSERT INTO test VALUES (1, 12, 43); SELECT * FROM test; # PREPARE 1 PREPARE select_test: SELECT * FROM students WHERE grade = ?; # EXECUTE 1 EXECUTE select_test(2.0); # PREPARE 2 PREPARE insert_test { INSERT INTO test VALUES (?, 0, 0); INSERT INTO test VALUES (?, 0, 0); INSERT INTO test VALUES (?, 0, 0); INSERT INTO test VALUES (?, 0, 0); INSERT INTO test VALUES (?, 0, 0); }; EXECUTE insert_test(1, 2, 3, 4 ,5); SELECT * FROM test; # EXECUTE 2 EXECUTE insert_test(1, 2, 3, 4, 5); #! GROUP SELECT AVG(grade) FROM (SELECT city, AVG(grade) FROM students GROUP BY city) t1 #! UNION (kills hyrise) SELECT name FROM students WHERE grade > 2.0 UNION SELECT name FROM students07070100000020000081A4000003E800000064000000015C0989F30000015F000000000000000000000000000000000000003A00000000sql-parser-1.5+git20181206/hyrise/web-interface/style.css body { text-align: center; } div { margin: auto; } button { margin-left: 1px; margin-right: 1px; } table { font-size: 14px; } .content { width: 90%; margin: auto; margin-top: 10px; } textarea#queryInput { font-family: 'Monospace'; height: 500px; resize: none; } h1, h2, h3, h4, h5, h6 { margin-top: 0px; } h4 { font-size: 14px; }07070100000021000081A4000003E800000064000000015C0989F300001859000000000000000000000000000000000000003600000000sql-parser-1.5+git20181206/hyrise/web-interface/ui.js function SetUiStateRunning() { $('#resultTable').html(''); $('#resultInfo').html('waiting for result...'); $('#msgContainer').attr('class', 'alert alert-warning'); $('#performanceDataTable tbody').html(''); } function SetUiStateError(msg) { $('#resultInfo').html(msg); $('#msgContainer').attr('class', 'alert alert-danger'); $('#performanceDataTable tbody').html(''); } function SetUiStateSuccess(msg) { $('#msgContainer').attr('class', 'alert alert-success'); $('#resultInfo').html(msg); } function GetHyriseUrl() { var endpointUrl = $('#endpointInput').val(); return endpointUrl; } function GetQuery() { var query = $('#queryInput').val(); // Check whether a part of the query has been selected var selectedText = GetSelectedText(); if (query.indexOf(selectedText) >= 0) { query = selectedText; } return query; } /** * Bootstrap */ $(function() { LoadSampleQueries('sample-queries.sql'); // Simple query submit $('#submitBtn').click(function() { SetUiStateRunning(); var query = GetQuery(); var hyrise = new HyriseConnector(GetHyriseUrl()); hyrise.executeSQL(query, function(result) { console.log("Query result: ", result); // On Success SetUiStateSuccess('Result contains ' + result.real_size + ' rows'); UpdateResultTable(result); UpdatePerformanceData(result.performanceData); }, function(xhr, status, error) { // console.log(arguments); // On Error var msg = 'Error when fetching result. Possibly no connection to Hyrise.'; if (xhr.responseJSON) msg = xhr.responseJSON.error[0]; SetUiStateError(msg); }); }); $('#queryInput').keypress(function(evt) { if (evt.keyCode == 13 && evt.shiftKey) { $('#submitBtn').click(); return false; } return true; }); // Benchmark submit $('#benchmarkBtn').click(function() { SetUiStateRunning(); var query = GetQuery(); var hyrise = new HyriseConnector(GetHyriseUrl()); // TODO: hardcoded 5 var numRuns = parseInt($('#benchmarkInput').val()); hyrise.benchmarkSQL(query, numRuns, function(result) { console.log("Benchmark result: ", result); UpdatePerformanceData(result.performanceData); SetUiStateSuccess('Success! See PerformanceData for results.'); }); }); // Setup Table triggers var table = document.querySelector('#performanceDataTable'); $('#performanceDataTable thead th').click(function() { var key = $(this).attr('data-key'); if (table._sortKey && table._sortKey == key) table._asc = !table._asc; else table._asc = true; var sign = (table._asc) ? 1 : -1; if (table._data) { table._sortKey = key; SortTableData(table); InsertPerformanceData(table._data); } }); }); function GetSelectedText() { var text = ""; if (window.getSelection) { text = window.getSelection().toString(); } else if (document.selection && document.selection.type != "Control") { text = document.selection.createRange().text; } return (text === "") ? null : text; } function LoadSampleQueries(url) { $.get(url, function(data) { var lines = data.split('\n'); var name, query = "", isBuggy = false; $.each(lines, function(i, line) { if (line[0] == '#') { // Append last query if (name && !isBuggy) AddSampleQuery(name, query); if (name && isBuggy) AddBuggyQuery(name, query); // New query isBuggy = (line[1] == '!'); name = line.substring((isBuggy) ? 3 : 2); query = ""; } else { query += line + '\n'; } }); if (name && !isBuggy) AddSampleQuery(name, query); if (name && isBuggy) AddBuggyQuery(name, query); }); } function AddSampleQuery(name, query) { var btn = $('<button type="button" class="btn btn-sm btn-success">' + name + '</button>'); btn.click(function(evt) { $('#queryInput').val(query); if (!evt.shiftKey) { $('#submitBtn').click(); } }); $('#sampleQueries').append(btn); } function AddBuggyQuery(name, query) { var btn = $('<button type="button" class="btn btn-sm btn-danger">' + name + '</button>'); btn.click(function(evt) { $('#queryInput').val(query); if (!evt.shiftKey) { $('#submitBtn').click(); } }); $('#buggyQueries').append(btn); } function CreateElement(tag, value) { return $('<' + tag + '>' + value + '</' + tag + '>'); }; function UpdateResultTable(result) { // Present result json in result-view var table = $('#resultTable'); table.html(''); var th = $('<tr>'); $.each(result.header, function(i, val) { th.append($('<th>' + val + '</th>')); }); table.append(th); // Limit the rows to be displayed to 100 for (var i = 0; i < 100 && i < result.real_size; ++i) { var row = result.rows[i]; var tr = $('<tr>'); $.each(row, function(j, val) { tr.append($('<td>' + val + '</td>')); }); table.append(tr); } }; function UpdatePerformanceData(performanceData) { var table = document.querySelector('#performanceDataTable'); var timeStrings = [ (performanceData.queryTaskTime + performanceData.parseTime).toFixed(3), performanceData.queryTaskTime.toFixed(3), performanceData.parseTime.toFixed(3), performanceData.totalTime.toFixed(3), ] var timeInfo = + ',' $('#timeInfo').html(timeStrings.join(',')); // Sort and insert into table var tableData = performanceData.operators; table._data = tableData; SortTableData(table); InsertPerformanceData(tableData); }; function InsertPerformanceData(performanceData) { var tbody = $('#performanceDataTable tbody'); tbody.html(''); $.each(performanceData, function(i, data) { if (!data.time_ms) data.time_ms = data.endTime - data.startTime; var tr = $('<tr>'); tr.append(CreateElement('td', data.id)); tr.append(CreateElement('td', data.name)); tr.append(CreateElement('td', data.duration)); tr.append(CreateElement('td', data.time_ms.toFixed(6))); tr.append(CreateElement('td', data.startTime)); tr.append(CreateElement('td', data.endTime)); tbody.append(tr); }); } function SortTableData(table) { if (!table._sortKey) table._sortKey = 'startTime'; if (!('_asc') in table) table._asc = true; var key = table._sortKey; var sign = (table._asc) ? -1 : 1; table._data.sort(function(a, b) { if (a[key].localeCompare) return sign * a[key].localeCompare(b[key]); return sign * (a[key] - b[key]); }); }07070100000022000041ED000003E800000064000000035C0989F300000000000000000000000000000000000000000000002300000000sql-parser-1.5+git20181206/include07070100000023000041ED000003E800000064000000025C0989F300000000000000000000000000000000000000000000002D00000000sql-parser-1.5+git20181206/include/sqlparser07070100000024000081A4000003E800000064000000015C0989F300000325000000000000000000000000000000000000003E00000000sql-parser-1.5+git20181206/include/sqlparser/AlterStatement.h#pragma once #include "SQLStatement.h" #include "SelectStatement.h" namespace hsql { enum AlterType { kAlterTable, kAlterSchema, kAlterDatabase }; // Represents SQL Alter statements. // Example: "ALTER TABLE students ADD column Id varchar (20)" struct AlterStatement : SQLStatement { AlterStatement(AlterType type); virtual ~AlterStatement(); void tablesAccessed(TableAccessMap& accessMap) const override { if (tableName != nullptr) { TableAccess::addOperation(accessMap, tableName, schema, TableAccess::OpAlter); } }; AlterType type; bool dflt; // default: false bool equal; // default: false char* schema; char* tableName; Expr* charsetName; ColumnDefinition* columns; }; } // namsepace hsql 07070100000025000081A4000003E800000064000000015C0989F30000082B000000000000000000000000000000000000003F00000000sql-parser-1.5+git20181206/include/sqlparser/CreateStatement.h#pragma once #include "SQLStatement.h" #include "TableAccess.h" #include "Database.h" #include <ostream> // Note: Implementations of constructors and destructors can be found in statements.cpp. namespace hsql { struct SelectStatement; enum class DataType { UNKNOWN, INT, LONG, FLOAT, DOUBLE, CHAR, VARCHAR, TEXT }; // Represents the type of a column, e.g., FLOAT or VARCHAR(10) struct ColumnType { ColumnType() = default; ColumnType(DataType data_type, int64_t length = 0); DataType data_type; int64_t length; // Used for, e.g., VARCHAR(10) }; bool operator==(const ColumnType& lhs, const ColumnType& rhs); bool operator!=(const ColumnType& lhs, const ColumnType& rhs); std::ostream& operator<<(std::ostream&, const ColumnType&); // Represents definition of a table column struct ColumnDefinition { ColumnDefinition(char* name, ColumnType type, bool nullable); virtual ~ColumnDefinition(); char* name; ColumnType type; bool nullable; }; enum CreateType { kCreateTable, kCreateTableFromTbl, // Hyrise file format kCreateView, kCreateDatabase }; // Represents SQL Create statements. // Example: "CREATE TABLE students (name TEXT, student_number INTEGER, city TEXT, grade DOUBLE)" struct CreateStatement : SQLStatement { CreateStatement(CreateType type); virtual ~CreateStatement(); void tablesAccessed(TableAccessMap& accessMap) const override { if (select != nullptr) { select->tablesAccessed(accessMap); } if (tableName != nullptr) { TableAccess::addOperation(accessMap, tableName, schema, TableAccess::OpCreate); } }; CreateType type; bool temporary; // default: false bool ifNotExists; // default: false char* filePath; // default: nullptr char* schema; // default: nullptr char* tableName; // default: nullptr std::vector<ColumnDefinition*>* columns; // default: nullptr std::vector<char*>* viewColumns; SelectStatement* select; }; } // namespace hsql 07070100000026000081A4000003E800000064000000015C0989F30000009A000000000000000000000000000000000000003800000000sql-parser-1.5+git20181206/include/sqlparser/Database.h#pragma once #include "Expr.h" #include <stdio.h> #include <vector> namespace hsql { struct DatabaseName { char* name; }; } // namespace hsql 07070100000027000081A4000003E800000064000000015C0989F30000037D000000000000000000000000000000000000003F00000000sql-parser-1.5+git20181206/include/sqlparser/DeleteStatement.h#pragma once #include "SQLStatement.h" // Note: Implementations of constructors and destructors can be found in statements.cpp. namespace hsql { // Represents SQL Delete statements. // Example: "DELETE FROM students WHERE grade > 3.0" // Note: if (expr == nullptr) => delete all rows (truncate) struct DeleteStatement : SQLStatement { DeleteStatement(); virtual ~DeleteStatement(); void tablesAccessed(TableAccessMap& accessMap) const override { if (expr != nullptr) { expr->tablesAccessed(accessMap); } if (tableName != nullptr) { TableAccess::addOperation(accessMap, tableName, schema, TableAccess::OpDelete); } } bool low_priority; // default: false bool quick; // default: false bool ignore; // default: false char* schema; char* tableName; Expr* expr; }; } // namespace hsql 07070100000028000081A4000003E800000064000000015C0989F3000002FD000000000000000000000000000000000000003D00000000sql-parser-1.5+git20181206/include/sqlparser/DropStatement.h#pragma once #include "SQLStatement.h" // Note: Implementations of constructors and destructors can be found in statements.cpp. namespace hsql { enum DropType { kDropTable, kDropSchema, kDropIndex, kDropView, kDropDatabase, kDropPreparedStatement }; // Represents SQL Delete statements. // Example "DROP TABLE students;" struct DropStatement : SQLStatement { DropStatement(DropType type); virtual ~DropStatement(); void tablesAccessed(TableAccessMap& accessMap) const override { if (name != nullptr) { TableAccess::addOperation(accessMap, name, schema, TableAccess::OpDrop); } }; DropType type; bool ifExists; char* schema; char* name; }; } // namespace hsql 07070100000029000081A4000003E800000064000000015C0989F300000252000000000000000000000000000000000000004000000000sql-parser-1.5+git20181206/include/sqlparser/ExecuteStatement.h#pragma once #include "SQLStatement.h" namespace hsql { // Represents SQL Execute statements. // Example: "EXECUTE ins_prep(100, "test", 2.3);" struct ExecuteStatement : SQLStatement { ExecuteStatement(); virtual ~ExecuteStatement(); void tablesAccessed(TableAccessMap& accessMap) const override { if (parameters != nullptr) { for (auto it = parameters->begin(); it != parameters->end(); ++it) { (*it)->tablesAccessed(accessMap); } } }; char* name; std::vector<Expr*>* parameters; }; } // namsepace hsql 0707010000002A000081A4000003E800000064000000015C0989F300001110000000000000000000000000000000000000003400000000sql-parser-1.5+git20181206/include/sqlparser/Expr.h#pragma once #include <stdlib.h> #include <memory> #include <vector> #include "TableAccess.h" namespace hsql { struct SelectStatement; // Helper function used by the lexer. // TODO: move to more appropriate place. char* substr(const char* source, int from, int to); enum ExprType { kExprLiteralFloat, kExprLiteralString, kExprLiteralInt, kExprLiteralNull, kExprStar, kExprParameter, kExprColumnRef, kExprFunctionRef, kExprOperator, kExprSelect, kExprHint, kExprArray, kExprArrayIndex, kExprDatetimeField }; // Operator types. These are important for expressions of type kExprOperator. enum OperatorType { kOpNone, // Ternary operator kOpBetween, // n-nary special case kOpCase, kOpCaseListElement, // `WHEN expr THEN expr` // Binary operators. kOpPlus, kOpMinus, kOpAsterisk, kOpSlash, kOpPercentage, kOpCaret, kOpEquals, kOpNotEquals, kOpLess, kOpLessEq, kOpGreater, kOpGreaterEq, kOpLike, kOpNotLike, kOpILike, kOpAnd, kOpOr, kOpIn, kOpConcat, // Unary operators. kOpNot, kOpUnaryMinus, kOpIsNull, kOpExists }; enum DatetimeField { kDatetimeNone, kDatetimeSecond, kDatetimeMinute, kDatetimeHour, kDatetimeDay, kDatetimeMonth, kDatetimeYear, }; typedef struct Expr Expr; // Represents SQL expressions (i.e. literals, operators, column_refs). // TODO: When destructing a placeholder expression, we might need to alter the // placeholder_list. struct Expr : public TableAccess { Expr(ExprType type); virtual ~Expr(); ExprType type; // TODO: Replace expressions by list. Expr* expr; Expr* expr2; std::vector<Expr*>* exprList; SelectStatement* select; char* name; char* table; char* alias; double fval; int64_t ival; int64_t ival2; DatetimeField datetimeField; bool isBoolLiteral; OperatorType opType; bool distinct; // TableAccess void tablesAccessed(TableAccessMap& accessMap) const override; // Convenience accessor methods. bool isType(ExprType exprType) const; bool isLiteral() const; bool hasAlias() const; bool hasTable() const; const char* getName() const; // Static constructors. static Expr* make(ExprType type); static Expr* makeOpUnary(OperatorType op, Expr* expr); static Expr* makeOpBinary(Expr* expr1, OperatorType op, Expr* expr2); static Expr* makeBetween(Expr* expr, Expr* left, Expr* right); static Expr* makeCaseList(Expr* caseListElement); static Expr* makeCaseListElement(Expr* when, Expr* then); static Expr* caseListAppend(Expr* caseList, Expr* caseListElement); static Expr* makeCase(Expr* expr, Expr* when, Expr* elseExpr); static Expr* makeLiteral(int64_t val); static Expr* makeLiteral(double val); static Expr* makeLiteral(char* val); static Expr* makeLiteral(bool val); static Expr* makeNullLiteral(); static Expr* makeColumnRef(char* name); static Expr* makeColumnRef(char* table, char* name); static Expr* makeStar(void); static Expr* makeStar(char* table); static Expr* makeFunctionRef(char* func_name, std::vector<Expr*>* exprList, bool distinct); static Expr* makeArray(std::vector<Expr*>* exprList); static Expr* makeArrayIndex(Expr* expr, int64_t index); static Expr* makeParameter(int id); static Expr* makeSelect(SelectStatement* select); static Expr* makeExists(SelectStatement* select); static Expr* makeInOperator(Expr* expr, std::vector<Expr*>* exprList); static Expr* makeInOperator(Expr* expr, SelectStatement* select); static Expr* makeExtract(DatetimeField datetimeField1, Expr* expr); }; // Zero initializes an Expr object and assigns it to a space in the heap // For Hyrise we still had to put in the explicit NULL constructor // http://www.ex-parrot.com/~chris/random/initialise.html // Unused #define ALLOC_EXPR(var, type) \ Expr* var; \ do { \ Expr zero = {type}; \ var = (Expr*)malloc(sizeof *var); \ *var = zero; \ } while (0); #undef ALLOC_EXPR } // namespace hsql 0707010000002B000081A4000003E800000064000000015C0989F300000266000000000000000000000000000000000000003F00000000sql-parser-1.5+git20181206/include/sqlparser/ImportStatement.h#pragma once #include "SQLStatement.h" namespace hsql { enum ImportType { kImportCSV, kImportTbl, // Hyrise file format }; // Represents SQL Import statements. struct ImportStatement : SQLStatement { ImportStatement(ImportType type); virtual ~ImportStatement(); void tablesAccessed(TableAccessMap& accessMap) const override { if (tableName != nullptr) { TableAccess::addOperation(accessMap, tableName, schema, TableAccess::OpImport); } }; ImportType type; char* filePath; char* schema; char* tableName; }; } // namespace hsql 0707010000002C000081A4000003E800000064000000015C0989F300000466000000000000000000000000000000000000003F00000000sql-parser-1.5+git20181206/include/sqlparser/InsertStatement.h#pragma once #include "SQLStatement.h" #include "SelectStatement.h" namespace hsql { enum InsertType { kInsertValues, kInsertSelect }; // Represents SQL Insert statements. // Example: "INSERT INTO students VALUES ('Max', 1112233, 'Musterhausen', 2.3)" struct InsertStatement : SQLStatement { InsertStatement(InsertType type); virtual ~InsertStatement(); void tablesAccessed(TableAccessMap& accessMap) const override { if (tableName != nullptr) { TableAccess::addOperation(accessMap, tableName, schema, TableAccess::OpInsert); } if (values != nullptr) { for (auto it = values->begin(); it != values->end(); ++it) { (*it)->tablesAccessed(accessMap); } } if (select != nullptr) { select->tablesAccessed(accessMap); } }; InsertType type; bool priority; // default: false bool ignore; // default: false char* schema; char* tableName; std::vector<char*>* columns; std::vector<Expr*>* values; SelectStatement* select; }; } // namsepace hsql 0707010000002D000081A4000003E800000064000000015C0989F30000025E000000000000000000000000000000000000004000000000sql-parser-1.5+git20181206/include/sqlparser/PrepareStatement.h#pragma once #include "SQLStatement.h" namespace hsql { // Represents SQL Prepare statements. // Example: PREPARE test FROM 'SELECT * FROM test WHERE a = ?;' struct PrepareStatement : SQLStatement { PrepareStatement(): SQLStatement(kStmtPrepare), name(nullptr), query(nullptr) {} virtual ~PrepareStatement() { free(name); free(query); } void tablesAccessed(TableAccessMap&) const override {}; char* name; // The query that is supposed to be prepared. char* query; }; } // namsepace hsql 0707010000002E000081A4000003E800000064000000015C0989F30000041F000000000000000000000000000000000000003900000000sql-parser-1.5+git20181206/include/sqlparser/SQLParser.h#pragma once #include "SQLParserResult.h" #include "statements.h" namespace hsql { // Static methods used to parse SQL strings. class SQLParser { public: // Parses a given constant character SQL string into the result object. // Returns true if the lexer and parser could run without internal errors. // This does NOT mean that the SQL string was valid SQL. To check that // you need to check result->isValid(); static bool parse(const std::string& sql, SQLParserResult* result); // Run tokenization on the given string and store the tokens in the output vector. static bool tokenize(const std::string& sql, std::vector<int16_t>* tokens); // Deprecated. // Old method to parse SQL strings. Replaced by parse(). static bool parseSQLString(const char* sql, SQLParserResult* result); // Deprecated. // Old method to parse SQL strings. Replaced by parse(). static bool parseSQLString(const std::string& sql, SQLParserResult* result); private: SQLParser(); }; } // namespace hsql 0707010000002F000081A4000003E800000064000000015C0989F300000A2E000000000000000000000000000000000000003F00000000sql-parser-1.5+git20181206/include/sqlparser/SQLParserResult.h#pragma once #include "SQLStatement.h" namespace hsql { // Represents the result of the SQLParser. // If parsing was successful it contains a list of SQLStatement. class SQLParserResult { public: // Initialize with empty statement list. SQLParserResult(); // Initialize with a single statement. // Takes ownership of the statement. SQLParserResult(SQLStatement* stmt); // Move constructor. SQLParserResult(SQLParserResult&& moved); // Deletes all statements in the result. virtual ~SQLParserResult(); // Set whether parsing was successful. void setIsValid(bool isValid); // Returns true if parsing was successful. bool isValid() const; // Returns the number of statements in the result. size_t size() const; // Set the details of the error, if available. // Takes ownership of errorMsg. void setErrorDetails(char* errorMsg, int errorLine, int errorColumn); // Returns the error message, if an error occurred. const char* errorMsg() const; // Returns the line number of the occurrance of the error in the query. int errorLine() const; // Returns the column number of the occurrance of the error in the query. int errorColumn() const; // Adds a statement to the result list of statements. // SQLParserResult takes ownership of the statement. void addStatement(SQLStatement* stmt); // Gets the SQL statement with the given index. const SQLStatement* getStatement(size_t index) const; // Gets the non const SQL statement with the given index. SQLStatement* getMutableStatement(size_t index); // Get the list of all statements. const std::vector<SQLStatement*>& getStatements() const; // Returns a copy of the list of all statements in this result. // Removes them from this result. std::vector<SQLStatement*> releaseStatements(); // Deletes all statements and other data within the result. void reset(); // Does NOT take ownership. void addParameter(Expr* parameter); const std::vector<Expr*>& parameters(); private: // List of statements within the result. std::vector<SQLStatement*> statements_; // Flag indicating the parsing was successful. bool isValid_; // Error message, if an error occurred. char* errorMsg_; // Line number of the occurrance of the error in the query. int errorLine_; // Column number of the occurrance of the error in the query. int errorColumn_; // Does NOT have ownership. std::vector<Expr*> parameters_; }; } // namespace hsql 07070100000030000081A4000003E800000064000000015C0989F30000048A000000000000000000000000000000000000003C00000000sql-parser-1.5+git20181206/include/sqlparser/SQLStatement.h#pragma once #include <vector> #include "TableAccess.h" #include "Expr.h" namespace hsql { enum StatementType { kStmtError, // unused kStmtSelect, kStmtImport, kStmtInsert, kStmtUpdate, kStmtDelete, kStmtCreate, kStmtDrop, kStmtPrepare, kStmtExecute, kStmtExport, kStmtRename, kStmtAlter, kStmtShow }; // Base struct for every SQL statement struct SQLStatement : public TableAccess { SQLStatement(StatementType type) : hints(nullptr), type_(type) {}; virtual ~SQLStatement() { if (hints != nullptr) { for (Expr* hint : *hints) { delete hint; } } delete hints; } StatementType type() const { return type_; } bool isType(StatementType type) const { return (type_ == type); } // Shorthand for isType(type). bool is(StatementType type) const { return isType(type); } // Length of the string in the SQL query string size_t stringLength; std::vector<Expr*>* hints; private: StatementType type_; }; } // namespace hsql 07070100000031000081A4000003E800000064000000015C0989F300000763000000000000000000000000000000000000003F00000000sql-parser-1.5+git20181206/include/sqlparser/SelectStatement.h#pragma once #include "SQLStatement.h" #include "Expr.h" #include "Table.h" namespace hsql { enum OrderType { kOrderAsc, kOrderDesc }; // Description of the order by clause within a select statement. struct OrderDescription { OrderDescription(OrderType type, Expr* expr); virtual ~OrderDescription(); OrderType type; Expr* expr; }; const int64_t kNoLimit = -1; const int64_t kNoOffset = -1; // Description of the limit clause within a select statement. struct LimitDescription { LimitDescription(int64_t limit, int64_t offset); int64_t limit; int64_t offset; }; // Description of the group-by clause within a select statement. struct GroupByDescription { GroupByDescription(); virtual ~GroupByDescription(); std::vector<Expr*>* columns; Expr* having; }; // Representation of a full SQL select statement. // TODO: add union_order and union_limit. struct SelectStatement : SQLStatement { SelectStatement(); virtual ~SelectStatement(); void tablesAccessed(TableAccessMap& accessMap) const override { if (fromTable != nullptr) { fromTable->tablesAccessed(accessMap, TableAccess::OpSelect); } if (selectList != nullptr) { for (auto it = selectList->begin(); it != selectList->end(); ++it) { (*it)->tablesAccessed(accessMap); } } if (whereClause != nullptr) { whereClause->tablesAccessed(accessMap); } if (unionSelect != nullptr) { unionSelect->tablesAccessed(accessMap); } }; TableRef* fromTable; bool selectDistinct; std::vector<Expr*>* selectList; Expr* whereClause; GroupByDescription* groupBy; SelectStatement* unionSelect; std::vector<OrderDescription*>* order; LimitDescription* limit; }; } // namespace hsql 07070100000032000081A4000003E800000064000000015C0989F30000027E000000000000000000000000000000000000003D00000000sql-parser-1.5+git20181206/include/sqlparser/ShowStatement.h#pragma once #include "SQLStatement.h" // Note: Implementations of constructors and destructors can be found in statements.cpp. namespace hsql { enum ShowType { kShowColumns, kShowTables, kShowDatabases }; // Represents SQL SHOW statements. // Example "SHOW TABLES;" struct ShowStatement : SQLStatement { ShowStatement(ShowType type); virtual ~ShowStatement(); void tablesAccessed(TableAccessMap& accessMap) const override { TableAccess::addOperation(accessMap, name, schema, TableAccess::OpShow); }; ShowType type; char* schema; char* name; }; } // namespace hsql 07070100000033000081A4000003E800000064000000015C0989F300000606000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/include/sqlparser/Table.h#pragma once #include "Expr.h" #include <stdio.h> #include <vector> namespace hsql { struct SelectStatement; struct JoinDefinition; struct TableRef; // Possible table reference types. enum TableRefType { kTableName, kTableSelect, kTableJoin, kTableCrossProduct }; struct TableName { char* schema; char* name; }; struct Alias { Alias(char* name, std::vector<char*>* columns = nullptr); ~Alias(); char* name; std::vector<char*>* columns; }; // Holds reference to tables. Can be either table names or a select statement. struct TableRef { TableRef(TableRefType type); virtual ~TableRef(); void tablesAccessed(TableAccessMap& accessMap, const std::string& op) const; TableRefType type; char* schema; char* name; Alias* alias; SelectStatement* select; std::vector<TableRef*>* list; JoinDefinition* join; // Returns true if a schema is set. bool hasSchema() const; // Returns the alias, if it is set. Otherwise the name. const char* getName() const; }; // Possible types of joins. enum JoinType { kJoinInner, kJoinFull, kJoinLeft, kJoinRight, kJoinCross, kJoinNatural }; // Definition of a join construct. struct JoinDefinition { JoinDefinition(); virtual ~JoinDefinition(); void tablesAccessed(TableAccessMap& accessMap, const std::string& op) const; TableRef* left; TableRef* right; Expr* condition; JoinType type; }; } // namespace hsql 07070100000034000081A4000003E800000064000000015C0989F3000004E7000000000000000000000000000000000000003B00000000sql-parser-1.5+git20181206/include/sqlparser/TableAccess.h#pragma once #include <string> #include <set> #include <map> #include <iterator> #include <unordered_map> namespace hsql { typedef std::unordered_map<std::string, std::set<std::string>> TableAccessMap; class TableAccess { public: const std::string OpUnknown{"unknown"}; const std::string OpInsert{"insert"}; const std::string OpSelect{"select"}; const std::string OpShow{"show"}; const std::string OpUpdate{"update"}; const std::string OpDelete{"delete"}; const std::string OpCreate{"create"}; const std::string OpDrop{"drop"}; const std::string OpAlter{"alter"}; const std::string OpImport{"import"}; virtual void tablesAccessed(TableAccessMap &t) const = 0; static void addOperation(TableAccessMap &t, const char *table, const char *db, const std::string& op) { t[buildKey(table, db)].insert(op); } virtual ~TableAccess() {} private: static std::string buildKey(const char *table, const char *db) { std::string key; key.append(table); if (db != nullptr) { key.append(".").append(db); } return key; } }; } // namespace hsql 07070100000035000081A4000003E800000064000000015C0989F3000003EA000000000000000000000000000000000000003F00000000sql-parser-1.5+git20181206/include/sqlparser/UpdateStatement.h#pragma once #include "SQLStatement.h" namespace hsql { // Represents "column = value" expressions. struct UpdateClause { char* column; Expr* value; }; // Represents SQL Update statements. struct UpdateStatement : SQLStatement { UpdateStatement(); virtual ~UpdateStatement(); void tablesAccessed(TableAccessMap& accessMap) const override { if (updates != nullptr) { for (auto it = updates->begin(); it != updates->end(); ++it) { (*it)->value->tablesAccessed(accessMap); } } if (where != nullptr) { where->tablesAccessed(accessMap); } if (table != nullptr) { table->tablesAccessed(accessMap, TableAccess::OpUpdate); } }; // TODO: switch to char* instead of TableRef bool low_priority; // default: false bool ignore; // default: false TableRef* table; std::vector<UpdateClause*>* updates; Expr* where; }; } // namsepace hsql 07070100000036000081A4000003E800000064000000015C0989F30000014B000000000000000000000000000000000000003A00000000sql-parser-1.5+git20181206/include/sqlparser/statements.h#pragma once #include "SelectStatement.h" #include "ImportStatement.h" #include "CreateStatement.h" #include "InsertStatement.h" #include "UpdateStatement.h" #include "DeleteStatement.h" #include "DropStatement.h" #include "AlterStatement.h" #include "PrepareStatement.h" #include "ExecuteStatement.h" #include "ShowStatement.h" 07070100000037000041ED000003E800000064000000055C0989F300000000000000000000000000000000000000000000001F00000000sql-parser-1.5+git20181206/src07070100000038000081A4000003E800000064000000015C0989F30000084D000000000000000000000000000000000000002D00000000sql-parser-1.5+git20181206/src/SQLParser.cpp #include "../include/sqlparser/SQLParser.h" #include "parser/bison_parser.h" #include "parser/flex_lexer.h" #include <stdio.h> #include <string> namespace hsql { SQLParser::SQLParser() { fprintf(stderr, "SQLParser only has static methods atm! Do not initialize!\n"); } // static bool SQLParser::parse(const std::string& sql, SQLParserResult* result) { yyscan_t scanner; YY_BUFFER_STATE state; if (hsql_lex_init(&scanner)) { // Couldn't initialize the lexer. fprintf(stderr, "SQLParser: Error when initializing lexer!\n"); return false; } const char* text = sql.c_str(); state = hsql__scan_string(text, scanner); // Parse the tokens. // If parsing fails, the result will contain an error object. int ret = hsql_parse(result, scanner); bool success = (ret == 0); result->setIsValid(success); hsql__delete_buffer(state, scanner); hsql_lex_destroy(scanner); return true; } // static bool SQLParser::parseSQLString(const char* sql, SQLParserResult* result) { return parse(sql, result); } bool SQLParser::parseSQLString(const std::string& sql, SQLParserResult* result) { return parse(sql, result); } // static bool SQLParser::tokenize(const std::string& sql, std::vector<int16_t>* tokens) { // Initialize the scanner. yyscan_t scanner; if (hsql_lex_init(&scanner)) { fprintf(stderr, "SQLParser: Error when initializing lexer!\n"); return false; } YY_BUFFER_STATE state; state = hsql__scan_string(sql.c_str(), scanner); YYSTYPE yylval; YYLTYPE yylloc; // Step through the string until EOF is read. // Note: hsql_lex returns int, but we know that its range is within 16 bit. int16_t token = hsql_lex(&yylval, &yylloc, scanner); while (token != 0) { tokens->push_back(token); token = hsql_lex(&yylval, &yylloc, scanner); if (token == SQL_IDENTIFIER || token == SQL_STRING) { free(yylval.sval); } } hsql__delete_buffer(state, scanner); hsql_lex_destroy(scanner); return true; } } // namespace hsql 07070100000039000081A4000003E800000064000000015C0989F3000009A6000000000000000000000000000000000000003300000000sql-parser-1.5+git20181206/src/SQLParserResult.cpp #include "../include/sqlparser/SQLParserResult.h" #include <algorithm> namespace hsql { SQLParserResult::SQLParserResult() : isValid_(false), errorMsg_(nullptr) {}; SQLParserResult::SQLParserResult(SQLStatement* stmt) : isValid_(false), errorMsg_(nullptr) { addStatement(stmt); }; // Move constructor. SQLParserResult::SQLParserResult(SQLParserResult&& moved) { isValid_ = moved.isValid_; errorMsg_ = moved.errorMsg_; statements_ = std::move(moved.statements_); moved.errorMsg_ = nullptr; moved.reset(); } SQLParserResult::~SQLParserResult() { reset(); } void SQLParserResult::addStatement(SQLStatement* stmt) { statements_.push_back(stmt); } const SQLStatement* SQLParserResult::getStatement(size_t index) const { return statements_[index]; } SQLStatement* SQLParserResult::getMutableStatement(size_t index) { return statements_[index]; } size_t SQLParserResult::size() const { return statements_.size(); } bool SQLParserResult::isValid() const { return isValid_; } const char* SQLParserResult::errorMsg() const { return errorMsg_; } int SQLParserResult::errorLine() const { return errorLine_; } int SQLParserResult::errorColumn() const { return errorColumn_; } void SQLParserResult::setIsValid(bool isValid) { isValid_ = isValid; } void SQLParserResult::setErrorDetails(char* errorMsg, int errorLine, int errorColumn) { errorMsg_ = errorMsg; errorLine_ = errorLine; errorColumn_ = errorColumn; } const std::vector<SQLStatement*>& SQLParserResult::getStatements() const { return statements_; } std::vector<SQLStatement*> SQLParserResult::releaseStatements() { std::vector<SQLStatement*> copy = statements_; statements_.clear(); return copy; } void SQLParserResult::reset() { for (SQLStatement* statement : statements_) { delete statement; } statements_.clear(); isValid_ = false; free(errorMsg_); errorMsg_ = nullptr; errorLine_ = -1; errorColumn_ = -1; } // Does NOT take ownership. void SQLParserResult::addParameter(Expr* parameter) { parameters_.push_back(parameter); std::sort(parameters_.begin(), parameters_.end(), [](const Expr * a, const Expr * b) { return a->ival < b->ival; }); } const std::vector<Expr*>& SQLParserResult::parameters() { return parameters_; } } // namespace hsql 0707010000003A000041ED000003E800000064000000025C0989F300000000000000000000000000000000000000000000002600000000sql-parser-1.5+git20181206/src/parser0707010000003B000081A4000003E800000064000000015C0989F300000511000000000000000000000000000000000000002F00000000sql-parser-1.5+git20181206/src/parser/Makefile# bison's version is too old on OSX, allow user to pass in custom path BISON?=bison FLEX?=flex BISON_VERSION=$(shell $(BISON) --version | head -n 1 | grep -o '[0-9]\.[0-9]\+') BISON_VERSION_SUPPORTED=$(shell echo $(BISON_VERSION) \>= 3.0 | bc) ifneq ($(BISON_VERSION_SUPPORTED), 1) $(error Bison version $(BISON_VERSION) not supported. If you are using OS X, `bison` uses the system default instead of the brew version. Run BISON=/usr/local/opt/bison/bin/bison make) endif FLEX_VERSION=$(shell $(FLEX) --version | head -n 1 | grep -o '[0-9]\.[0-9]\+') FLEX_VERSION_SUPPORTED=$(shell echo $(FLEX_VERSION) \>= 2.6 | bc) ifneq ($(FLEX_VERSION_SUPPORTED), 1) $(error Flex version $(FLEX_VERSION) not supported. If you are using OS X, `flex` uses the system default instead of the brew version. Run FLEX=/usr/local/opt/flex/bin/flex make) endif all: bison_parser.cpp flex_lexer.cpp bison_parser.cpp: bison_parser.y $(BISON) bison_parser.y --output=bison_parser.cpp --defines=bison_parser.h --verbose flex_lexer.cpp: flex_lexer.l $(FLEX) flex_lexer.l clean: rm -f bison_parser.cpp flex_lexer.cpp bison_parser.h flex_lexer.h *.output # Tests if the parser builds correctly and doesn't contain conflicts. test: ! $(BISON) bison_parser.y -v --output=conflict_test.cpp 2>&1 | grep "conflict" >&2 0707010000003C000081A4000003E800000064000000015C0989F300026D3A000000000000000000000000000000000000003700000000sql-parser-1.5+git20181206/src/parser/bison_parser.cpp/* A Bison parser, made by GNU Bison 3.2. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018 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. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Undocumented macros, especially those whose name start with YY_, are private implementation details. Do not rely on them. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "3.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 2 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Substitute the type names. */ #define YYSTYPE HSQL_STYPE #define YYLTYPE HSQL_LTYPE /* Substitute the variable and function names. */ #define yyparse hsql_parse #define yylex hsql_lex #define yyerror hsql_error #define yydebug hsql_debug #define yynerrs hsql_nerrs /* First part of user prologue. */ #line 1 "bison_parser.y" /* yacc.c:338 */ /** * bison_parser.y * defines bison_parser.h * outputs bison_parser.c * * Grammar File Spec: http://dinosaur.compilertools.net/bison/bison_6.html * */ /********************************* ** Section 1: C Declarations *********************************/ #include "bison_parser.h" #include "flex_lexer.h" #include <stdio.h> #include <string.h> using namespace hsql; int yyerror(YYLTYPE* llocp, SQLParserResult* result, yyscan_t scanner, const char *msg) { result->setIsValid(false); result->setErrorDetails(strdup(msg), llocp->first_line, llocp->first_column); return 0; } #line 106 "bison_parser.cpp" /* yacc.c:338 */ # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # else # define YY_NULLPTR ((void*)0) # endif # endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 1 #endif /* In a future release of Bison, this section will be replaced by #include "bison_parser.h". */ #ifndef YY_HSQL_BISON_PARSER_H_INCLUDED # define YY_HSQL_BISON_PARSER_H_INCLUDED /* Debug traces. */ #ifndef HSQL_DEBUG # if defined YYDEBUG #if YYDEBUG # define HSQL_DEBUG 1 # else # define HSQL_DEBUG 0 # endif # else /* ! defined YYDEBUG */ # define HSQL_DEBUG 0 # endif /* ! defined YYDEBUG */ #endif /* ! defined HSQL_DEBUG */ #if HSQL_DEBUG extern int hsql_debug; #endif /* "%code requires" blocks. */ #line 35 "bison_parser.y" /* yacc.c:353 */ // %code requires block #include "../../include/sqlparser/statements.h" #include "../../include/sqlparser/SQLParserResult.h" #include "parser_typedef.h" // Auto update column and line number #define YY_USER_ACTION \ yylloc->first_line = yylloc->last_line; \ yylloc->first_column = yylloc->last_column; \ for(int i = 0; yytext[i] != '\0'; i++) { \ yylloc->total_column++; \ yylloc->string_length++; \ if(yytext[i] == '\n') { \ yylloc->last_line++; \ yylloc->last_column = 0; \ } \ else { \ yylloc->last_column++; \ } \ } #line 171 "bison_parser.cpp" /* yacc.c:353 */ /* Token type. */ #ifndef HSQL_TOKENTYPE # define HSQL_TOKENTYPE enum hsql_tokentype { SQL_IDENTIFIER = 258, SQL_STRING = 259, SQL_FLOATVAL = 260, SQL_INTVAL = 261, SQL_DEALLOCATE = 262, SQL_PARAMETERS = 263, SQL_INTERSECT = 264, SQL_TEMPORARY = 265, SQL_TIMESTAMP = 266, SQL_DISTINCT = 267, SQL_NVARCHAR = 268, SQL_RESTRICT = 269, SQL_TRUNCATE = 270, SQL_ANALYZE = 271, SQL_BETWEEN = 272, SQL_CASCADE = 273, SQL_COLUMNS = 274, SQL_CONTROL = 275, SQL_DEFAULT = 276, SQL_EXECUTE = 277, SQL_EXPLAIN = 278, SQL_HISTORY = 279, SQL_INTEGER = 280, SQL_NATURAL = 281, SQL_PREPARE = 282, SQL_PRIMARY = 283, SQL_SCHEMAS = 284, SQL_SPATIAL = 285, SQL_VARCHAR = 286, SQL_VIRTUAL = 287, SQL_BEFORE = 288, SQL_COLUMN = 289, SQL_CREATE = 290, SQL_DELETE = 291, SQL_DIRECT = 292, SQL_DOUBLE = 293, SQL_ESCAPE = 294, SQL_EXCEPT = 295, SQL_EXISTS = 296, SQL_EXTRACT = 297, SQL_GLOBAL = 298, SQL_HAVING = 299, SQL_IMPORT = 300, SQL_INSERT = 301, SQL_ISNULL = 302, SQL_OFFSET = 303, SQL_RENAME = 304, SQL_SCHEMA = 305, SQL_SELECT = 306, SQL_SORTED = 307, SQL_TABLES = 308, SQL_UNIQUE = 309, SQL_UNLOAD = 310, SQL_UPDATE = 311, SQL_VALUES = 312, SQL_AFTER = 313, SQL_ALTER = 314, SQL_CROSS = 315, SQL_DELTA = 316, SQL_FLOAT = 317, SQL_GROUP = 318, SQL_INDEX = 319, SQL_INNER = 320, SQL_LIMIT = 321, SQL_LOCAL = 322, SQL_MERGE = 323, SQL_MINUS = 324, SQL_ORDER = 325, SQL_OUTER = 326, SQL_RIGHT = 327, SQL_TABLE = 328, SQL_UNION = 329, SQL_USING = 330, SQL_WHERE = 331, SQL_CALL = 332, SQL_CASE = 333, SQL_CHAR = 334, SQL_DATE = 335, SQL_DESC = 336, SQL_DROP = 337, SQL_ELSE = 338, SQL_FILE = 339, SQL_FROM = 340, SQL_FULL = 341, SQL_HASH = 342, SQL_HINT = 343, SQL_INTO = 344, SQL_JOIN = 345, SQL_LEFT = 346, SQL_LIKE = 347, SQL_LOAD = 348, SQL_LONG = 349, SQL_NULL = 350, SQL_PLAN = 351, SQL_SHOW = 352, SQL_TEXT = 353, SQL_THEN = 354, SQL_TIME = 355, SQL_VIEW = 356, SQL_WHEN = 357, SQL_WITH = 358, SQL_LOW_PRIORITY = 359, SQL_DELAYED = 360, SQL_HIGH_PRIORITY = 361, SQL_QUICK = 362, SQL_IGNORE = 363, SQL_DATABASES = 364, SQL_DATABASE = 365, SQL_CHARACTER = 366, SQL_ADD = 367, SQL_ALL = 368, SQL_AND = 369, SQL_ASC = 370, SQL_CSV = 371, SQL_END = 372, SQL_FOR = 373, SQL_INT = 374, SQL_KEY = 375, SQL_NOT = 376, SQL_OFF = 377, SQL_SET = 378, SQL_TBL = 379, SQL_TOP = 380, SQL_AS = 381, SQL_BY = 382, SQL_IF = 383, SQL_IN = 384, SQL_IS = 385, SQL_OF = 386, SQL_ON = 387, SQL_OR = 388, SQL_TO = 389, SQL_ARRAY = 390, SQL_CONCAT = 391, SQL_ILIKE = 392, SQL_SECOND = 393, SQL_MINUTE = 394, SQL_HOUR = 395, SQL_DAY = 396, SQL_MONTH = 397, SQL_YEAR = 398, SQL_TRUE = 399, SQL_FALSE = 400, SQL_ESCAPED = 401, SQL_DATA = 402, SQL_INFILE = 403, SQL_CONCURRENT = 404, SQL_REPLACE = 405, SQL_PARTITION = 406, SQL_FIELDS = 407, SQL_TERMINATED = 408, SQL_OPTIONALLY = 409, SQL_ENCLOSED = 410, SQL_LINES = 411, SQL_ROWS = 412, SQL_STARTING = 413, SQL_EQUALS = 414, SQL_NOTEQUALS = 415, SQL_LESS = 416, SQL_GREATER = 417, SQL_LESSEQ = 418, SQL_GREATEREQ = 419, SQL_NOTNULL = 420, SQL_UMINUS = 421 }; #endif /* Value type. */ #if ! defined HSQL_STYPE && ! defined HSQL_STYPE_IS_DECLARED union HSQL_STYPE { #line 95 "bison_parser.y" /* yacc.c:353 */ double fval; int64_t ival; char* sval; uintmax_t uval; bool bval; hsql::SQLStatement* statement; hsql::SelectStatement* select_stmt; hsql::ImportStatement* import_stmt; hsql::CreateStatement* create_stmt; hsql::InsertStatement* insert_stmt; hsql::DeleteStatement* delete_stmt; hsql::UpdateStatement* update_stmt; hsql::DropStatement* drop_stmt; hsql::PrepareStatement* prep_stmt; hsql::AlterStatement* alter_stmt; hsql::ExecuteStatement* exec_stmt; hsql::ShowStatement* show_stmt; hsql::TableName table_name; hsql::DatabaseName db_name; hsql::TableRef* table; hsql::Expr* expr; hsql::OrderDescription* order; hsql::OrderType order_type; hsql::DatetimeField datetime_field; hsql::LimitDescription* limit; hsql::ColumnDefinition* column_t; hsql::ColumnType column_type_t; hsql::GroupByDescription* group_t; hsql::UpdateClause* update_t; hsql::Alias* alias_t; std::vector<hsql::SQLStatement*>* stmt_vec; std::vector<char*>* str_vec; std::vector<hsql::TableRef*>* table_vec; std::vector<hsql::ColumnDefinition*>* column_vec; std::vector<hsql::UpdateClause*>* update_vec; std::vector<hsql::Expr*>* expr_vec; std::vector<hsql::OrderDescription*>* order_vec; #line 394 "bison_parser.cpp" /* yacc.c:353 */ }; typedef union HSQL_STYPE HSQL_STYPE; # define HSQL_STYPE_IS_TRIVIAL 1 # define HSQL_STYPE_IS_DECLARED 1 #endif /* Location type. */ #if ! defined HSQL_LTYPE && ! defined HSQL_LTYPE_IS_DECLARED typedef struct HSQL_LTYPE HSQL_LTYPE; struct HSQL_LTYPE { int first_line; int first_column; int last_line; int last_column; }; # define HSQL_LTYPE_IS_DECLARED 1 # define HSQL_LTYPE_IS_TRIVIAL 1 #endif int hsql_parse (hsql::SQLParserResult* result, yyscan_t scanner); #endif /* !YY_HSQL_BISON_PARSER_H_INCLUDED */ #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE # if (defined __GNUC__ \ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C # define YY_ATTRIBUTE(Spec) __attribute__(Spec) # else # define YY_ATTRIBUTE(Spec) /* empty */ # endif #endif #ifndef YY_ATTRIBUTE_PURE # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) #endif #ifndef YY_ATTRIBUTE_UNUSED # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) #else # define YYUSE(E) /* empty */ #endif #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined HSQL_LTYPE_IS_TRIVIAL && HSQL_LTYPE_IS_TRIVIAL \ && defined HSQL_STYPE_IS_TRIVIAL && HSQL_STYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; YYLTYPE yyls_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 68 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 658 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 184 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 112 /* YYNRULES -- Number of rules. */ #define YYNRULES 283 /* YYNSTATES -- Number of states. */ #define YYNSTATES 519 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 421 #define YYTRANSLATE(YYX) \ ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 173, 2, 2, 178, 179, 171, 169, 182, 170, 180, 172, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 181, 162, 159, 163, 183, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 176, 2, 177, 174, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 160, 161, 164, 165, 166, 167, 168, 175 }; #if HSQL_DEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 263, 263, 284, 290, 299, 303, 307, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 333, 334, 339, 340, 344, 348, 360, 367, 370, 374, 386, 395, 399, 408, 417, 418, 419, 423, 424, 425, 429, 430, 434, 435, 436, 440, 441, 442, 446, 447, 448, 458, 461, 464, 479, 487, 495, 503, 508, 516, 517, 521, 522, 526, 527, 531, 537, 538, 539, 540, 541, 542, 543, 544, 548, 549, 550, 561, 567, 573, 578, 586, 587, 596, 608, 609, 613, 614, 618, 619, 623, 636, 645, 658, 659, 660, 661, 665, 666, 676, 687, 688, 692, 707, 714, 721, 729, 730, 734, 735, 745, 746, 747, 764, 765, 769, 770, 774, 784, 801, 805, 806, 807, 811, 812, 816, 828, 829, 833, 837, 838, 841, 846, 847, 851, 856, 860, 861, 864, 865, 869, 870, 874, 878, 879, 880, 886, 887, 891, 892, 893, 894, 895, 896, 897, 898, 905, 906, 910, 911, 915, 916, 920, 930, 931, 932, 933, 934, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 951, 952, 956, 957, 958, 959, 960, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 978, 979, 983, 984, 985, 986, 992, 993, 994, 995, 999, 1000, 1004, 1005, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1019, 1020, 1024, 1028, 1029, 1030, 1031, 1032, 1033, 1036, 1040, 1044, 1048, 1049, 1050, 1051, 1055, 1056, 1057, 1058, 1059, 1063, 1067, 1068, 1072, 1073, 1077, 1081, 1085, 1097, 1098, 1108, 1109, 1113, 1114, 1123, 1124, 1129, 1140, 1149, 1150, 1155, 1160, 1161, 1166, 1167, 1171, 1172, 1177, 1178, 1186, 1194, 1204, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1237, 1246, 1247, 1252, 1253 }; #endif #if HSQL_DEBUG || YYERROR_VERBOSE || 1 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "IDENTIFIER", "STRING", "FLOATVAL", "INTVAL", "DEALLOCATE", "PARAMETERS", "INTERSECT", "TEMPORARY", "TIMESTAMP", "DISTINCT", "NVARCHAR", "RESTRICT", "TRUNCATE", "ANALYZE", "BETWEEN", "CASCADE", "COLUMNS", "CONTROL", "DEFAULT", "EXECUTE", "EXPLAIN", "HISTORY", "INTEGER", "NATURAL", "PREPARE", "PRIMARY", "SCHEMAS", "SPATIAL", "VARCHAR", "VIRTUAL", "BEFORE", "COLUMN", "CREATE", "DELETE", "DIRECT", "DOUBLE", "ESCAPE", "EXCEPT", "EXISTS", "EXTRACT", "GLOBAL", "HAVING", "IMPORT", "INSERT", "ISNULL", "OFFSET", "RENAME", "SCHEMA", "SELECT", "SORTED", "TABLES", "UNIQUE", "UNLOAD", "UPDATE", "VALUES", "AFTER", "ALTER", "CROSS", "DELTA", "FLOAT", "GROUP", "INDEX", "INNER", "LIMIT", "LOCAL", "MERGE", "MINUS", "ORDER", "OUTER", "RIGHT", "TABLE", "UNION", "USING", "WHERE", "CALL", "CASE", "CHAR", "DATE", "DESC", "DROP", "ELSE", "FILE", "FROM", "FULL", "HASH", "HINT", "INTO", "JOIN", "LEFT", "LIKE", "LOAD", "LONG", "NULL", "PLAN", "SHOW", "TEXT", "THEN", "TIME", "VIEW", "WHEN", "WITH", "LOW_PRIORITY", "DELAYED", "HIGH_PRIORITY", "QUICK", "IGNORE", "DATABASES", "DATABASE", "CHARACTER", "ADD", "ALL", "AND", "ASC", "CSV", "END", "FOR", "INT", "KEY", "NOT", "OFF", "SET", "TBL", "TOP", "AS", "BY", "IF", "IN", "IS", "OF", "ON", "OR", "TO", "ARRAY", "CONCAT", "ILIKE", "SECOND", "MINUTE", "HOUR", "DAY", "MONTH", "YEAR", "TRUE", "FALSE", "ESCAPED", "DATA", "INFILE", "CONCURRENT", "REPLACE", "PARTITION", "FIELDS", "TERMINATED", "OPTIONALLY", "ENCLOSED", "LINES", "ROWS", "STARTING", "'='", "EQUALS", "NOTEQUALS", "'<'", "'>'", "LESS", "GREATER", "LESSEQ", "GREATEREQ", "NOTNULL", "'+'", "'-'", "'*'", "'/'", "'%'", "'^'", "UMINUS", "'['", "']'", "'('", "')'", "'.'", "';'", "','", "'?'", "$accept", "input", "statement_list", "statement", "preparable_statement", "opt_hints", "hint_list", "hint", "prepare_statement", "prepare_target_query", "execute_statement", "import_statement", "import_file_type", "file_path", "load_statement", "opt_low_priority_or_concurrent", "opt_replace_or_ignore", "opt_local", "opt_fields_or_columns", "opt_lines", "opt_ignore_lines_rows", "show_statement", "create_statement", "opt_temporary", "opt_not_exists", "column_def_commalist", "column_def", "column_type", "opt_column_nullable", "drop_statement", "opt_exists", "delete_statement", "opt_low_priority", "opt_quick", "opt_ignore", "truncate_statement", "insert_statement", "opt_priority", "opt_column_list", "update_statement", "update_clause_commalist", "update_clause", "alter_statement", "opt_default", "opt_equal", "select_statement", "select_with_paren", "select_paren_or_clause", "select_no_paren", "set_operator", "set_type", "opt_all", "select_clause", "opt_distinct", "select_list", "opt_from_clause", "from_clause", "opt_where", "opt_group", "opt_having", "opt_order", "order_list", "order_desc", "opt_order_type", "opt_top", "opt_limit", "expr_list", "opt_literal_list", "literal_list", "expr_alias", "expr", "operand", "scalar_expr", "unary_expr", "binary_expr", "logic_expr", "in_expr", "case_expr", "case_list", "exists_expr", "comp_expr", "function_expr", "extract_expr", "datetime_field", "array_expr", "array_index", "between_expr", "column_name", "literal", "string_literal", "bool_literal", "num_literal", "int_literal", "null_literal", "param_expr", "table_ref", "table_ref_atomic", "nonjoin_table_ref_atomic", "table_ref_commalist", "table_ref_name", "table_ref_name_no_alias", "table_name", "db_name", "table_alias", "opt_table_alias", "alias", "opt_alias", "join_clause", "opt_join_type", "join_condition", "opt_semicolon", "ident_commalist", YY_NULLPTR }; #endif # ifdef YYPRINT /* YYTOKNUM[NUM] -- (External) token number corresponding to the (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 61, 414, 415, 60, 62, 416, 417, 418, 419, 420, 43, 45, 42, 47, 37, 94, 421, 91, 93, 40, 41, 46, 59, 44, 63 }; # endif #define YYPACT_NINF -353 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-353))) #define YYTABLE_NINF -279 #define yytable_value_is_error(Yytable_value) \ (!!((Yytable_value) == (-279))) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { 14, 15, 28, 64, 127, 152, 59, 109, -53, 94, 59, 16, 96, 123, 11, -31, 260, 105, -353, 206, 206, -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, 18, -353, 23, 308, 135, -353, 138, 243, -353, 189, 189, 189, 268, -353, 226, 238, -353, -353, -353, 261, 368, 369, 261, 381, 28, 381, 257, 257, 257, -67, 28, -353, -353, 209, 213, -353, 14, -353, 305, -353, -353, -353, -353, -353, -31, 281, 269, -31, 50, -353, 392, 20, 394, 278, 381, 28, 381, 189, -353, 261, -353, 316, -353, 312, -353, -353, -353, 185, 28, -353, 384, 299, 384, 371, 28, 28, 381, -353, -353, 346, -353, -353, -353, -353, 236, -353, 349, -353, -353, -353, 185, 349, 368, 9, -353, -353, -353, -353, -353, -353, -353, -353, 237, 239, -353, -353, -353, -353, -353, -353, -353, -353, -353, 379, -353, 244, -353, 28, 338, 422, 28, 143, 249, 250, 72, 262, 253, 232, -353, 154, 345, 255, -353, 40, 288, -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, 315, -353, -353, 320, 401, 328, -353, -353, -353, -353, -353, 293, 439, 50, 264, -353, 131, 50, -353, 395, 396, 404, -353, 20, -353, 468, 347, -66, 28, 385, -353, 244, 2, 6, 424, 327, 185, 108, 69, 306, 232, 389, 185, 171, 298, -79, 1, 409, -353, 185, -353, 185, 477, 185, -353, -353, 232, -353, 232, -8, 309, 103, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 368, 483, 365, 486, 367, 422, 314, 90, -353, -353, 185, -353, -353, -353, -353, 368, 368, 368, -353, -353, 99, -31, 370, 486, 409, 28, 44, -353, 185, -353, -353, 317, -353, -353, -353, -353, -353, -353, 408, 126, 137, 185, 185, -353, 424, 403, -74, -353, -353, -31, -353, 222, -353, 318, -353, 30, -353, 185, 443, -353, -353, -353, 393, 342, 361, 232, 321, 154, -353, 434, 341, 361, 361, 361, 361, 436, 436, 436, 436, 171, 171, 39, 39, 39, -102, 359, 380, -58, -353, 382, 539, -353, 382, -69, 20, -353, 439, -353, -353, -353, -353, -353, 535, -353, 456, 157, -353, -353, -353, 364, -353, 169, -353, 185, 185, 185, -353, 205, 162, 366, -353, 374, 453, -353, -353, -353, 473, 475, 476, 464, 1, 554, -353, -353, -353, 163, 440, -353, 232, 361, 154, 390, 170, -353, -353, 185, 483, -353, -353, 185, -353, 397, -353, -353, 398, -353, -353, -353, 113, 185, -353, -353, 479, 179, -353, -353, 422, -353, 486, 20, -353, 54, 163, 217, -353, 185, -353, 30, 1, -353, -353, -353, 1, 300, 400, 185, 389, 402, 180, -353, -353, 163, -353, 163, 565, 567, -353, 484, -353, 163, 501, -353, -353, -353, 191, -353, -353, 163, -353, -353, -3, 468, -27, -353, -353, 405, 406, -353, 28, -353, 410, 185, 196, 185, -353, -353, -353, -6, 7, 163, -353, -353, 163, 427, 429, 430, 407, 411, 462, 465, 65, 485, -353, 579, 587, 467, 469, 589, 244, -353, -353, 593, 596, 95, -353, -353, -353, -353, -353 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_uint16 yydefact[] = { 0, 0, 0, 0, 0, 59, 84, 0, 95, 146, 84, 0, 0, 0, 0, 0, 0, 281, 3, 20, 20, 18, 9, 10, 7, 11, 17, 13, 15, 12, 16, 14, 8, 109, 110, 138, 0, 255, 89, 27, 0, 58, 61, 61, 61, 0, 83, 86, 0, 92, 93, 94, 88, 0, 126, 88, 0, 0, 0, 81, 81, 81, 35, 0, 50, 51, 0, 0, 1, 280, 2, 0, 6, 5, 120, 121, 119, 0, 123, 0, 0, 154, 79, 0, 158, 0, 0, 0, 0, 0, 61, 85, 88, 30, 0, 87, 0, 242, 145, 125, 0, 0, 257, 106, 0, 106, 0, 0, 0, 0, 33, 34, 40, 52, 113, 112, 4, 0, 114, 138, 115, 122, 118, 0, 138, 0, 0, 116, 256, 237, 240, 243, 238, 239, 244, 0, 157, 159, 232, 233, 234, 241, 235, 236, 26, 25, 0, 57, 97, 56, 0, 0, 0, 0, 228, 0, 0, 0, 0, 0, 0, 230, 0, 129, 127, 155, 265, 162, 169, 170, 171, 164, 166, 172, 165, 184, 173, 174, 175, 168, 163, 177, 178, 0, 254, 105, 0, 0, 0, 80, 76, 77, 78, 39, 0, 0, 154, 137, 139, 144, 154, 149, 151, 150, 147, 28, 0, 60, 0, 0, 0, 0, 0, 31, 97, 126, 0, 0, 0, 0, 0, 0, 0, 0, 180, 0, 179, 0, 0, 0, 132, 128, 0, 263, 0, 0, 0, 264, 161, 0, 181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 21, 111, 0, 143, 142, 141, 117, 0, 0, 0, 160, 282, 0, 0, 0, 0, 132, 0, 0, 216, 0, 229, 231, 0, 219, 220, 221, 222, 223, 224, 0, 0, 0, 0, 0, 203, 0, 0, 0, 176, 167, 0, 130, 245, 247, 0, 249, 261, 248, 0, 134, 156, 195, 262, 196, 0, 191, 0, 0, 0, 182, 0, 194, 193, 209, 210, 211, 212, 213, 214, 215, 186, 185, 188, 187, 189, 190, 0, 0, 132, 99, 108, 0, 104, 108, 38, 0, 19, 0, 140, 153, 152, 148, 96, 0, 55, 0, 0, 62, 82, 29, 0, 91, 0, 207, 0, 0, 0, 201, 0, 0, 0, 225, 0, 0, 277, 269, 275, 273, 276, 271, 0, 0, 0, 260, 253, 258, 131, 0, 124, 0, 192, 0, 0, 0, 183, 226, 0, 0, 98, 107, 0, 66, 0, 69, 68, 0, 67, 72, 65, 75, 0, 37, 36, 0, 0, 22, 283, 0, 54, 0, 0, 217, 0, 205, 0, 204, 0, 208, 261, 0, 272, 274, 270, 0, 246, 262, 0, 227, 0, 0, 199, 197, 101, 100, 103, 0, 0, 73, 0, 64, 102, 0, 24, 53, 63, 0, 218, 202, 206, 250, 266, 278, 0, 136, 200, 198, 0, 0, 74, 0, 90, 0, 0, 0, 0, 133, 70, 71, 43, 0, 279, 267, 259, 135, 0, 0, 46, 228, 0, 0, 0, 0, 49, 268, 0, 0, 0, 0, 0, 97, 42, 41, 0, 0, 0, 32, 45, 44, 47, 48 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -353, -353, -353, 542, -353, 584, -353, 258, -353, -353, -353, -353, -353, -254, -353, -353, -353, -353, -353, -353, -353, -353, -353, -353, 4, -353, -267, -353, -353, -353, 240, -353, 603, -353, 36, -353, -353, -353, -211, -353, -353, 210, -353, 510, 265, -253, 167, 540, -13, 586, -353, -353, 302, 412, -353, -353, -353, -262, -353, -353, 166, -353, 352, -353, -353, -20, -217, -353, -342, 387, -117, -114, -353, -353, -353, -353, -353, -353, 414, -353, -353, -353, -353, -353, -353, -353, -353, 136, -83, -147, -353, -353, -46, -353, -353, -353, -352, 187, -353, -353, -353, -2, 112, -353, 186, 460, -353, -353, -353, -353, -353, 158 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 16, 17, 18, 19, 72, 267, 268, 20, 145, 21, 22, 94, 212, 23, 112, 422, 194, 495, 501, 508, 24, 25, 45, 87, 365, 351, 418, 458, 26, 107, 27, 47, 92, 96, 28, 29, 52, 209, 30, 347, 348, 31, 186, 409, 32, 33, 119, 34, 77, 78, 122, 35, 100, 163, 230, 231, 318, 397, 484, 81, 197, 198, 273, 54, 127, 164, 135, 136, 165, 166, 167, 168, 169, 170, 171, 172, 173, 221, 174, 175, 176, 177, 298, 178, 179, 180, 181, 182, 138, 139, 140, 141, 142, 143, 310, 311, 312, 313, 314, 183, 315, 103, 392, 393, 394, 238, 316, 389, 490, 70, 280 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 38, 137, 67, 286, 37, 213, 199, 98, 306, 289, 496, 353, 423, 493, 99, 97, 366, 483, 317, 282, 9, 1, 367, 382, 129, 130, 97, 74, 363, 2, 63, 37, 74, 233, 245, 234, 3, 110, 443, 420, 220, 4, 36, 233, 224, 228, 226, 88, 89, 5, 6, 49, 50, 51, 236, 104, 381, 383, 75, 7, 8, 113, 384, 75, 64, 9, 56, 39, 385, 386, 10, 371, 480, 11, 260, 154, 129, 130, 97, 201, 204, 421, 111, 387, 325, 407, 148, 464, 388, 57, 470, 101, 76, 79, 150, 9, 12, 76, 125, 184, 308, 369, 299, 380, 202, 190, 191, 13, 232, 224, 402, 14, 283, 155, 156, 131, 126, 320, 213, 322, 65, 326, 203, 278, 406, 323, 58, 324, 151, 481, 40, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 494, 15, 210, 227, 157, 214, 301, 199, 234, 232, 391, 154, 129, 130, 97, 463, 41, 46, 132, 133, 235, 131, 234, 59, 105, 302, 462, 236, 219, 245, 269, 290, 161, 309, 274, 287, 66, 448, 377, 378, 303, 236, 154, 129, 130, 97, 15, 158, 48, 155, 156, 60, 328, 147, 395, 149, 42, 134, 291, 9, 61, 159, 456, 284, 219, 399, 271, 259, 345, 260, 132, 133, 505, 53, 375, 192, 234, 506, 329, 374, 155, 156, 472, 358, 359, 360, 157, 465, 457, 154, 129, 130, 97, 302, 234, 236, 160, 161, 118, 234, 272, 118, 382, 131, 162, 517, 518, 43, 376, 134, 431, 432, 433, 236, 68, 435, 44, 157, 236, 154, 129, 130, 97, 355, 62, 137, 356, 370, 156, 158, 234, 234, 361, 213, 131, 362, 383, 368, 446, 196, 69, 384, 451, 159, 200, 379, 453, 385, 386, 236, 236, 514, 132, 133, 108, 109, 459, 222, 156, 239, 158, 245, 387, 71, 157, 82, -278, 388, 401, 83, 84, 86, 467, 234, 159, 215, 434, 216, 160, 161, 382, 131, 85, 132, 133, 234, 162, 91, 466, 240, 427, 134, 236, 428, 157, 90, 256, 257, 258, 259, 137, 260, 430, 450, 236, 232, 232, 223, 93, 160, 161, 131, 461, 474, 383, 206, 232, 162, 489, 384, 492, 159, 134, 95, 479, 385, 386, 206, 97, 491, 132, 133, 362, 120, 241, 99, 120, 223, 102, 106, 387, 447, 114, 240, -278, 388, 115, 117, 121, 128, 123, 159, 144, 146, 152, 153, 160, 161, -251, 185, 132, 133, 240, 242, 162, 187, 189, 193, 195, 134, 205, 243, 244, 79, 207, 206, 208, 211, 245, 246, 129, 217, 218, 225, 229, 262, 160, 161, 241, 263, 240, 232, 261, 264, 162, 265, 266, 275, 276, 134, 270, 247, 248, 249, 250, 251, 277, -279, 252, 253, 398, 254, 255, 256, 257, 258, 259, 305, 260, 292, 293, 294, 295, 296, 297, 279, 244, 281, 285, 9, 487, 307, 245, 246, 321, 241, -252, 240, 304, 317, 346, 327, 349, 350, 352, 244, 354, 373, 364, 325, 372, 245, -279, 400, 390, 247, 248, 249, 250, 251, 396, 234, 252, 253, 305, 254, 255, 256, 257, 258, 259, 260, 260, 244, -279, -279, -279, 250, 251, 245, 246, 252, 253, 403, 254, 255, 256, 257, 258, 259, 404, 260, 425, 405, 426, 408, 429, 438, 439, 436, 440, 441, 247, 248, 249, 250, 251, 437, 442, 252, 253, 444, 254, 255, 256, 257, 258, 259, 410, 260, 244, 445, 460, 449, 411, 475, 245, 476, 478, 454, 455, 412, 471, 477, 498, 473, 499, 509, 485, 486, 500, 216, 488, 503, 502, 510, 504, 507, 511, 513, 512, 515, -279, -279, 516, 413, -279, -279, 73, 254, 255, 256, 257, 258, 259, 116, 260, 55, 424, 188, 452, 419, 414, 319, 124, 80, 357, 468, 497, 469, 237, 288, 0, 482, 0, 0, 0, 415, 300, 0, 0, 416, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 417 }; static const yytype_int16 yycheck[] = { 2, 84, 15, 214, 3, 152, 123, 53, 225, 3, 3, 265, 354, 19, 12, 6, 283, 44, 76, 85, 51, 7, 284, 26, 4, 5, 6, 9, 281, 15, 19, 3, 9, 3, 136, 114, 22, 104, 390, 108, 157, 27, 27, 3, 158, 162, 160, 43, 44, 35, 36, 104, 105, 106, 133, 57, 309, 60, 40, 45, 46, 63, 65, 40, 53, 51, 50, 3, 71, 72, 56, 288, 75, 59, 176, 3, 4, 5, 6, 125, 126, 150, 149, 86, 92, 347, 88, 429, 91, 73, 442, 55, 74, 70, 90, 51, 82, 74, 48, 101, 179, 57, 219, 177, 95, 107, 108, 93, 182, 223, 327, 97, 178, 41, 42, 95, 66, 234, 265, 236, 109, 129, 113, 206, 182, 239, 110, 241, 92, 132, 3, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 152, 178, 150, 162, 78, 153, 83, 270, 114, 182, 126, 3, 4, 5, 6, 428, 10, 104, 144, 145, 126, 95, 114, 73, 58, 102, 426, 133, 102, 136, 196, 171, 171, 178, 200, 179, 15, 400, 301, 302, 117, 133, 3, 4, 5, 6, 178, 121, 85, 41, 42, 101, 95, 87, 317, 89, 50, 183, 217, 51, 110, 135, 95, 211, 102, 325, 81, 174, 260, 176, 144, 145, 153, 125, 83, 109, 114, 158, 121, 99, 41, 42, 445, 275, 276, 277, 78, 179, 121, 3, 4, 5, 6, 102, 114, 133, 170, 171, 77, 114, 115, 80, 26, 95, 178, 156, 157, 101, 117, 183, 373, 374, 375, 133, 0, 99, 110, 78, 133, 3, 4, 5, 6, 179, 147, 354, 182, 286, 42, 121, 114, 114, 179, 426, 95, 182, 60, 285, 398, 119, 181, 65, 405, 135, 124, 304, 409, 71, 72, 133, 133, 508, 144, 145, 60, 61, 419, 41, 42, 17, 121, 136, 86, 103, 78, 3, 90, 91, 327, 180, 178, 128, 435, 114, 135, 178, 117, 180, 170, 171, 26, 95, 85, 144, 145, 114, 178, 107, 117, 47, 179, 183, 133, 182, 78, 73, 171, 172, 173, 174, 429, 176, 179, 179, 133, 182, 182, 121, 116, 170, 171, 95, 179, 179, 60, 182, 182, 178, 481, 65, 483, 135, 183, 108, 179, 71, 72, 182, 6, 179, 144, 145, 182, 77, 92, 12, 80, 121, 3, 128, 86, 400, 179, 47, 90, 91, 179, 88, 113, 3, 127, 135, 4, 121, 84, 89, 170, 171, 182, 21, 144, 145, 47, 121, 178, 112, 41, 67, 178, 183, 179, 129, 130, 70, 41, 182, 178, 85, 136, 137, 4, 178, 178, 176, 85, 111, 170, 171, 92, 34, 47, 182, 123, 111, 178, 148, 3, 48, 48, 183, 182, 159, 160, 161, 162, 163, 48, 92, 166, 167, 114, 169, 170, 171, 172, 173, 174, 121, 176, 138, 139, 140, 141, 142, 143, 3, 130, 126, 89, 51, 478, 179, 136, 137, 3, 92, 182, 47, 178, 76, 3, 178, 123, 3, 123, 130, 178, 85, 124, 92, 179, 136, 137, 178, 182, 159, 160, 161, 162, 163, 63, 114, 166, 167, 121, 169, 170, 171, 172, 173, 174, 176, 176, 130, 159, 160, 161, 162, 163, 136, 137, 166, 167, 95, 169, 170, 171, 172, 173, 174, 177, 176, 3, 159, 84, 159, 178, 90, 71, 179, 71, 71, 159, 160, 161, 162, 163, 179, 90, 166, 167, 3, 169, 170, 171, 172, 173, 174, 25, 176, 130, 127, 89, 179, 31, 6, 136, 6, 73, 178, 178, 38, 178, 95, 153, 179, 153, 4, 179, 179, 156, 180, 178, 127, 179, 4, 127, 108, 127, 6, 127, 4, 162, 163, 4, 62, 166, 167, 20, 169, 170, 171, 172, 173, 174, 69, 176, 10, 356, 105, 406, 352, 79, 232, 80, 35, 270, 437, 488, 438, 166, 215, -1, 471, -1, -1, -1, 94, 220, -1, -1, 98, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 119 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { 0, 7, 15, 22, 27, 35, 36, 45, 46, 51, 56, 59, 82, 93, 97, 178, 185, 186, 187, 188, 192, 194, 195, 198, 205, 206, 213, 215, 219, 220, 223, 226, 229, 230, 232, 236, 27, 3, 285, 3, 3, 10, 50, 101, 110, 207, 104, 216, 85, 104, 105, 106, 221, 125, 248, 216, 50, 73, 110, 73, 101, 110, 147, 19, 53, 109, 230, 232, 0, 181, 294, 103, 189, 189, 9, 40, 74, 233, 234, 70, 233, 244, 3, 180, 178, 85, 128, 208, 208, 208, 73, 107, 217, 116, 196, 108, 218, 6, 276, 12, 237, 218, 3, 286, 285, 286, 128, 214, 214, 214, 104, 149, 199, 285, 179, 179, 187, 88, 230, 231, 236, 113, 235, 127, 231, 48, 66, 249, 3, 4, 5, 95, 144, 145, 183, 251, 252, 272, 273, 274, 275, 276, 277, 278, 4, 193, 121, 286, 285, 286, 208, 218, 84, 89, 3, 41, 42, 78, 121, 135, 170, 171, 178, 238, 250, 253, 254, 255, 256, 257, 258, 259, 260, 261, 263, 264, 265, 266, 268, 269, 270, 271, 272, 284, 285, 21, 227, 112, 227, 41, 285, 285, 286, 67, 201, 178, 244, 245, 246, 254, 244, 276, 95, 113, 276, 179, 182, 41, 178, 222, 285, 85, 197, 273, 285, 178, 180, 178, 178, 102, 254, 262, 41, 121, 255, 176, 255, 232, 254, 85, 239, 240, 182, 3, 114, 126, 133, 289, 290, 17, 47, 92, 121, 129, 130, 136, 137, 159, 160, 161, 162, 163, 166, 167, 169, 170, 171, 172, 173, 174, 176, 123, 111, 34, 111, 148, 3, 190, 191, 249, 182, 81, 115, 247, 249, 48, 48, 48, 272, 3, 295, 126, 85, 178, 285, 89, 222, 179, 237, 3, 171, 232, 138, 139, 140, 141, 142, 143, 267, 254, 262, 83, 102, 117, 178, 121, 250, 179, 179, 178, 279, 280, 281, 282, 283, 285, 291, 76, 241, 253, 254, 3, 254, 255, 255, 92, 129, 178, 95, 121, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 276, 3, 224, 225, 123, 3, 210, 123, 197, 178, 179, 182, 246, 276, 276, 276, 179, 182, 229, 124, 209, 210, 241, 285, 57, 232, 250, 179, 85, 99, 83, 117, 254, 254, 232, 177, 229, 26, 60, 65, 71, 72, 86, 91, 292, 182, 126, 287, 288, 289, 254, 63, 242, 114, 255, 178, 232, 250, 95, 177, 159, 182, 241, 159, 228, 25, 31, 38, 62, 79, 94, 98, 119, 211, 228, 108, 150, 200, 252, 191, 3, 84, 179, 182, 178, 179, 254, 254, 254, 117, 99, 179, 179, 90, 71, 71, 71, 90, 280, 3, 127, 255, 232, 250, 179, 179, 254, 225, 254, 178, 178, 95, 121, 212, 254, 89, 179, 197, 210, 252, 179, 117, 254, 288, 281, 280, 178, 250, 179, 179, 6, 6, 95, 73, 179, 75, 132, 295, 44, 243, 179, 179, 285, 178, 254, 293, 179, 254, 19, 152, 202, 3, 271, 153, 153, 156, 203, 179, 127, 127, 153, 158, 108, 204, 4, 4, 127, 127, 6, 222, 4, 4, 156, 157 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { 0, 184, 185, 186, 186, 187, 187, 187, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 189, 189, 190, 190, 191, 191, 192, 193, 194, 194, 195, 196, 197, 198, 199, 199, 199, 200, 200, 200, 201, 201, 202, 202, 202, 203, 203, 203, 204, 204, 204, 205, 205, 205, 206, 206, 206, 206, 206, 207, 207, 208, 208, 209, 209, 210, 211, 211, 211, 211, 211, 211, 211, 211, 212, 212, 212, 213, 213, 213, 213, 214, 214, 215, 216, 216, 217, 217, 218, 218, 219, 220, 220, 221, 221, 221, 221, 222, 222, 223, 224, 224, 225, 226, 226, 226, 227, 227, 228, 228, 229, 229, 229, 230, 230, 231, 231, 232, 232, 233, 234, 234, 234, 235, 235, 236, 237, 237, 238, 239, 239, 240, 241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 247, 247, 247, 248, 248, 249, 249, 249, 249, 249, 249, 249, 249, 250, 250, 251, 251, 252, 252, 253, 254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 256, 256, 257, 257, 257, 257, 257, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, 259, 259, 260, 260, 260, 260, 261, 261, 261, 261, 262, 262, 263, 263, 264, 264, 264, 264, 264, 264, 264, 265, 265, 266, 267, 267, 267, 267, 267, 267, 268, 269, 270, 271, 271, 271, 271, 272, 272, 272, 272, 272, 273, 274, 274, 275, 275, 276, 277, 278, 279, 279, 280, 280, 281, 281, 282, 282, 283, 284, 285, 285, 286, 287, 287, 288, 288, 289, 289, 290, 290, 291, 291, 291, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 293, 294, 294, 295, 295 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 2, 1, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 0, 1, 3, 1, 4, 4, 1, 2, 5, 7, 1, 1, 14, 1, 1, 0, 1, 1, 0, 1, 0, 4, 4, 0, 4, 4, 0, 3, 3, 0, 2, 2, 3, 9, 8, 7, 4, 4, 1, 0, 3, 0, 1, 3, 3, 1, 1, 1, 1, 1, 4, 4, 1, 1, 2, 0, 4, 4, 4, 3, 2, 0, 7, 1, 0, 1, 0, 1, 0, 2, 10, 7, 1, 1, 1, 0, 3, 0, 7, 1, 3, 3, 8, 8, 6, 1, 0, 1, 0, 1, 1, 5, 3, 3, 1, 1, 3, 5, 2, 1, 1, 1, 1, 0, 7, 1, 0, 1, 1, 0, 2, 2, 0, 4, 0, 2, 0, 3, 0, 1, 3, 2, 1, 1, 0, 2, 0, 2, 4, 2, 2, 2, 4, 4, 0, 1, 3, 1, 0, 1, 3, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 2, 2, 2, 3, 4, 1, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 5, 6, 5, 6, 4, 6, 3, 5, 4, 5, 4, 5, 3, 3, 3, 3, 3, 3, 3, 3, 5, 6, 1, 1, 1, 1, 1, 1, 4, 4, 5, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 4, 1, 3, 2, 1, 1, 3, 1, 1, 5, 1, 0, 2, 1, 1, 0, 4, 6, 8, 1, 2, 1, 2, 1, 2, 1, 1, 1, 0, 1, 1, 0, 1, 3 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (&yylloc, result, scanner, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Error token number */ #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (N) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (0) #endif #define YYRHSLOC(Rhs, K) ((Rhs)[K]) /* Enable debugging if requested. */ #if HSQL_DEBUG # ifndef YYFPRINTF # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if defined HSQL_LTYPE_IS_TRIVIAL && HSQL_LTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. Private, do not rely on its existence. */ YY_ATTRIBUTE_UNUSED static int yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += YYFPRINTF (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += YYFPRINTF (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += YYFPRINTF (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += YYFPRINTF (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += YYFPRINTF (yyo, "-%d", end_col); } return res; } # define YY_LOCATION_PRINT(File, Loc) \ yy_location_print_ (File, &(Loc)) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value, Location, result, scanner); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ static void yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, hsql::SQLParserResult* result, yyscan_t scanner) { FILE *yyoutput = yyo; YYUSE (yyoutput); YYUSE (yylocationp); YYUSE (result); YYUSE (scanner); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyo, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); } /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ static void yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, hsql::SQLParserResult* result, yyscan_t scanner) { YYFPRINTF (yyo, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); YY_LOCATION_PRINT (yyo, *yylocationp); YYFPRINTF (yyo, ": "); yy_symbol_value_print (yyo, yytype, yyvaluep, yylocationp, result, scanner); YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, hsql::SQLParserResult* result, yyscan_t scanner) { unsigned long yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], &(yyvsp[(yyi + 1) - (yynrhs)]) , &(yylsp[(yyi + 1) - (yynrhs)]) , result, scanner); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, yylsp, Rule, result, scanner); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !HSQL_DEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !HSQL_DEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T yystrlen (const char *yystr) { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * yystpcpy (char *yydest, const char *yysrc) { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); } # endif /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message about the unexpected token YYTOKEN for the state stack whose top is YYSSP. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return 2 if the required number of bytes is too large to store. */ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per "expected"). */ int yycount = 0; /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". - Don't assume there isn't a lookahead just because this state is a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated yychar. - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the scanner and before detecting a syntax error. Thus, state merging (from LALR or IELR) and default reductions corrupt the expected token list. However, the list is correct for canonical LR with one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ if (yytoken != YYEMPTY) { int yyn = yypact[*yyssp]; yyarg[yycount++] = yytname[yytoken]; if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyx; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; break; } yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } } } } switch (yycount) { # define YYCASE_(N, S) \ case N: \ yyformat = S; \ break default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); # undef YYCASE_ } { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } if (*yymsg_alloc < yysize) { *yymsg_alloc = 2 * yysize; if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; return 1; } /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ { char *yyp = *yymsg; int yyi = 0; while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyformat += 2; } else { yyp++; yyformat++; } } return 0; } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, hsql::SQLParserResult* result, yyscan_t scanner) { YYUSE (yyvaluep); YYUSE (yylocationp); YYUSE (result); YYUSE (scanner); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN switch (yytype) { case 3: /* IDENTIFIER */ #line 146 "bison_parser.y" /* yacc.c:1254 */ { free( (((*yyvaluep).sval)) ); } #line 1777 "bison_parser.cpp" /* yacc.c:1254 */ break; case 4: /* STRING */ #line 146 "bison_parser.y" /* yacc.c:1254 */ { free( (((*yyvaluep).sval)) ); } #line 1783 "bison_parser.cpp" /* yacc.c:1254 */ break; case 5: /* FLOATVAL */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 1789 "bison_parser.cpp" /* yacc.c:1254 */ break; case 6: /* INTVAL */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 1795 "bison_parser.cpp" /* yacc.c:1254 */ break; case 186: /* statement_list */ #line 147 "bison_parser.y" /* yacc.c:1254 */ { if ((((*yyvaluep).stmt_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).stmt_vec))) { delete ptr; } } delete (((*yyvaluep).stmt_vec)); } #line 1808 "bison_parser.cpp" /* yacc.c:1254 */ break; case 187: /* statement */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).statement)); } #line 1814 "bison_parser.cpp" /* yacc.c:1254 */ break; case 188: /* preparable_statement */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).statement)); } #line 1820 "bison_parser.cpp" /* yacc.c:1254 */ break; case 189: /* opt_hints */ #line 147 "bison_parser.y" /* yacc.c:1254 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { delete ptr; } } delete (((*yyvaluep).expr_vec)); } #line 1833 "bison_parser.cpp" /* yacc.c:1254 */ break; case 190: /* hint_list */ #line 147 "bison_parser.y" /* yacc.c:1254 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { delete ptr; } } delete (((*yyvaluep).expr_vec)); } #line 1846 "bison_parser.cpp" /* yacc.c:1254 */ break; case 191: /* hint */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 1852 "bison_parser.cpp" /* yacc.c:1254 */ break; case 192: /* prepare_statement */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).prep_stmt)); } #line 1858 "bison_parser.cpp" /* yacc.c:1254 */ break; case 193: /* prepare_target_query */ #line 146 "bison_parser.y" /* yacc.c:1254 */ { free( (((*yyvaluep).sval)) ); } #line 1864 "bison_parser.cpp" /* yacc.c:1254 */ break; case 194: /* execute_statement */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).exec_stmt)); } #line 1870 "bison_parser.cpp" /* yacc.c:1254 */ break; case 195: /* import_statement */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).import_stmt)); } #line 1876 "bison_parser.cpp" /* yacc.c:1254 */ break; case 196: /* import_file_type */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 1882 "bison_parser.cpp" /* yacc.c:1254 */ break; case 197: /* file_path */ #line 146 "bison_parser.y" /* yacc.c:1254 */ { free( (((*yyvaluep).sval)) ); } #line 1888 "bison_parser.cpp" /* yacc.c:1254 */ break; case 198: /* load_statement */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).import_stmt)); } #line 1894 "bison_parser.cpp" /* yacc.c:1254 */ break; case 205: /* show_statement */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).show_stmt)); } #line 1900 "bison_parser.cpp" /* yacc.c:1254 */ break; case 206: /* create_statement */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).create_stmt)); } #line 1906 "bison_parser.cpp" /* yacc.c:1254 */ break; case 207: /* opt_temporary */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 1912 "bison_parser.cpp" /* yacc.c:1254 */ break; case 208: /* opt_not_exists */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 1918 "bison_parser.cpp" /* yacc.c:1254 */ break; case 209: /* column_def_commalist */ #line 147 "bison_parser.y" /* yacc.c:1254 */ { if ((((*yyvaluep).column_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).column_vec))) { delete ptr; } } delete (((*yyvaluep).column_vec)); } #line 1931 "bison_parser.cpp" /* yacc.c:1254 */ break; case 210: /* column_def */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).column_t)); } #line 1937 "bison_parser.cpp" /* yacc.c:1254 */ break; case 211: /* column_type */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 1943 "bison_parser.cpp" /* yacc.c:1254 */ break; case 212: /* opt_column_nullable */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 1949 "bison_parser.cpp" /* yacc.c:1254 */ break; case 213: /* drop_statement */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).drop_stmt)); } #line 1955 "bison_parser.cpp" /* yacc.c:1254 */ break; case 214: /* opt_exists */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 1961 "bison_parser.cpp" /* yacc.c:1254 */ break; case 215: /* delete_statement */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).delete_stmt)); } #line 1967 "bison_parser.cpp" /* yacc.c:1254 */ break; case 216: /* opt_low_priority */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 1973 "bison_parser.cpp" /* yacc.c:1254 */ break; case 217: /* opt_quick */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 1979 "bison_parser.cpp" /* yacc.c:1254 */ break; case 218: /* opt_ignore */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 1985 "bison_parser.cpp" /* yacc.c:1254 */ break; case 219: /* truncate_statement */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).delete_stmt)); } #line 1991 "bison_parser.cpp" /* yacc.c:1254 */ break; case 220: /* insert_statement */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).insert_stmt)); } #line 1997 "bison_parser.cpp" /* yacc.c:1254 */ break; case 221: /* opt_priority */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 2003 "bison_parser.cpp" /* yacc.c:1254 */ break; case 222: /* opt_column_list */ #line 147 "bison_parser.y" /* yacc.c:1254 */ { if ((((*yyvaluep).str_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).str_vec))) { delete ptr; } } delete (((*yyvaluep).str_vec)); } #line 2016 "bison_parser.cpp" /* yacc.c:1254 */ break; case 223: /* update_statement */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).update_stmt)); } #line 2022 "bison_parser.cpp" /* yacc.c:1254 */ break; case 224: /* update_clause_commalist */ #line 147 "bison_parser.y" /* yacc.c:1254 */ { if ((((*yyvaluep).update_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).update_vec))) { delete ptr; } } delete (((*yyvaluep).update_vec)); } #line 2035 "bison_parser.cpp" /* yacc.c:1254 */ break; case 225: /* update_clause */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).update_t)); } #line 2041 "bison_parser.cpp" /* yacc.c:1254 */ break; case 226: /* alter_statement */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).alter_stmt)); } #line 2047 "bison_parser.cpp" /* yacc.c:1254 */ break; case 227: /* opt_default */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 2053 "bison_parser.cpp" /* yacc.c:1254 */ break; case 228: /* opt_equal */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 2059 "bison_parser.cpp" /* yacc.c:1254 */ break; case 229: /* select_statement */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).select_stmt)); } #line 2065 "bison_parser.cpp" /* yacc.c:1254 */ break; case 230: /* select_with_paren */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).select_stmt)); } #line 2071 "bison_parser.cpp" /* yacc.c:1254 */ break; case 231: /* select_paren_or_clause */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).select_stmt)); } #line 2077 "bison_parser.cpp" /* yacc.c:1254 */ break; case 232: /* select_no_paren */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).select_stmt)); } #line 2083 "bison_parser.cpp" /* yacc.c:1254 */ break; case 236: /* select_clause */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).select_stmt)); } #line 2089 "bison_parser.cpp" /* yacc.c:1254 */ break; case 237: /* opt_distinct */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 2095 "bison_parser.cpp" /* yacc.c:1254 */ break; case 238: /* select_list */ #line 147 "bison_parser.y" /* yacc.c:1254 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { delete ptr; } } delete (((*yyvaluep).expr_vec)); } #line 2108 "bison_parser.cpp" /* yacc.c:1254 */ break; case 239: /* opt_from_clause */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).table)); } #line 2114 "bison_parser.cpp" /* yacc.c:1254 */ break; case 240: /* from_clause */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).table)); } #line 2120 "bison_parser.cpp" /* yacc.c:1254 */ break; case 241: /* opt_where */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2126 "bison_parser.cpp" /* yacc.c:1254 */ break; case 242: /* opt_group */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).group_t)); } #line 2132 "bison_parser.cpp" /* yacc.c:1254 */ break; case 243: /* opt_having */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2138 "bison_parser.cpp" /* yacc.c:1254 */ break; case 244: /* opt_order */ #line 147 "bison_parser.y" /* yacc.c:1254 */ { if ((((*yyvaluep).order_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).order_vec))) { delete ptr; } } delete (((*yyvaluep).order_vec)); } #line 2151 "bison_parser.cpp" /* yacc.c:1254 */ break; case 245: /* order_list */ #line 147 "bison_parser.y" /* yacc.c:1254 */ { if ((((*yyvaluep).order_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).order_vec))) { delete ptr; } } delete (((*yyvaluep).order_vec)); } #line 2164 "bison_parser.cpp" /* yacc.c:1254 */ break; case 246: /* order_desc */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).order)); } #line 2170 "bison_parser.cpp" /* yacc.c:1254 */ break; case 247: /* opt_order_type */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 2176 "bison_parser.cpp" /* yacc.c:1254 */ break; case 248: /* opt_top */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).limit)); } #line 2182 "bison_parser.cpp" /* yacc.c:1254 */ break; case 249: /* opt_limit */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).limit)); } #line 2188 "bison_parser.cpp" /* yacc.c:1254 */ break; case 250: /* expr_list */ #line 147 "bison_parser.y" /* yacc.c:1254 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { delete ptr; } } delete (((*yyvaluep).expr_vec)); } #line 2201 "bison_parser.cpp" /* yacc.c:1254 */ break; case 251: /* opt_literal_list */ #line 147 "bison_parser.y" /* yacc.c:1254 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { delete ptr; } } delete (((*yyvaluep).expr_vec)); } #line 2214 "bison_parser.cpp" /* yacc.c:1254 */ break; case 252: /* literal_list */ #line 147 "bison_parser.y" /* yacc.c:1254 */ { if ((((*yyvaluep).expr_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).expr_vec))) { delete ptr; } } delete (((*yyvaluep).expr_vec)); } #line 2227 "bison_parser.cpp" /* yacc.c:1254 */ break; case 253: /* expr_alias */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2233 "bison_parser.cpp" /* yacc.c:1254 */ break; case 254: /* expr */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2239 "bison_parser.cpp" /* yacc.c:1254 */ break; case 255: /* operand */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2245 "bison_parser.cpp" /* yacc.c:1254 */ break; case 256: /* scalar_expr */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2251 "bison_parser.cpp" /* yacc.c:1254 */ break; case 257: /* unary_expr */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2257 "bison_parser.cpp" /* yacc.c:1254 */ break; case 258: /* binary_expr */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2263 "bison_parser.cpp" /* yacc.c:1254 */ break; case 259: /* logic_expr */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2269 "bison_parser.cpp" /* yacc.c:1254 */ break; case 260: /* in_expr */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2275 "bison_parser.cpp" /* yacc.c:1254 */ break; case 261: /* case_expr */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2281 "bison_parser.cpp" /* yacc.c:1254 */ break; case 262: /* case_list */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2287 "bison_parser.cpp" /* yacc.c:1254 */ break; case 263: /* exists_expr */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2293 "bison_parser.cpp" /* yacc.c:1254 */ break; case 264: /* comp_expr */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2299 "bison_parser.cpp" /* yacc.c:1254 */ break; case 265: /* function_expr */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2305 "bison_parser.cpp" /* yacc.c:1254 */ break; case 266: /* extract_expr */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2311 "bison_parser.cpp" /* yacc.c:1254 */ break; case 267: /* datetime_field */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 2317 "bison_parser.cpp" /* yacc.c:1254 */ break; case 268: /* array_expr */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2323 "bison_parser.cpp" /* yacc.c:1254 */ break; case 269: /* array_index */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2329 "bison_parser.cpp" /* yacc.c:1254 */ break; case 270: /* between_expr */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2335 "bison_parser.cpp" /* yacc.c:1254 */ break; case 271: /* column_name */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2341 "bison_parser.cpp" /* yacc.c:1254 */ break; case 272: /* literal */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2347 "bison_parser.cpp" /* yacc.c:1254 */ break; case 273: /* string_literal */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2353 "bison_parser.cpp" /* yacc.c:1254 */ break; case 274: /* bool_literal */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2359 "bison_parser.cpp" /* yacc.c:1254 */ break; case 275: /* num_literal */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2365 "bison_parser.cpp" /* yacc.c:1254 */ break; case 276: /* int_literal */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2371 "bison_parser.cpp" /* yacc.c:1254 */ break; case 277: /* null_literal */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2377 "bison_parser.cpp" /* yacc.c:1254 */ break; case 278: /* param_expr */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2383 "bison_parser.cpp" /* yacc.c:1254 */ break; case 279: /* table_ref */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).table)); } #line 2389 "bison_parser.cpp" /* yacc.c:1254 */ break; case 280: /* table_ref_atomic */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).table)); } #line 2395 "bison_parser.cpp" /* yacc.c:1254 */ break; case 281: /* nonjoin_table_ref_atomic */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).table)); } #line 2401 "bison_parser.cpp" /* yacc.c:1254 */ break; case 282: /* table_ref_commalist */ #line 147 "bison_parser.y" /* yacc.c:1254 */ { if ((((*yyvaluep).table_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).table_vec))) { delete ptr; } } delete (((*yyvaluep).table_vec)); } #line 2414 "bison_parser.cpp" /* yacc.c:1254 */ break; case 283: /* table_ref_name */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).table)); } #line 2420 "bison_parser.cpp" /* yacc.c:1254 */ break; case 284: /* table_ref_name_no_alias */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).table)); } #line 2426 "bison_parser.cpp" /* yacc.c:1254 */ break; case 285: /* table_name */ #line 144 "bison_parser.y" /* yacc.c:1254 */ { free( (((*yyvaluep).table_name).name) ); free( (((*yyvaluep).table_name).schema) ); } #line 2432 "bison_parser.cpp" /* yacc.c:1254 */ break; case 286: /* db_name */ #line 145 "bison_parser.y" /* yacc.c:1254 */ { free( (((*yyvaluep).db_name).name) ); } #line 2438 "bison_parser.cpp" /* yacc.c:1254 */ break; case 287: /* table_alias */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).alias_t)); } #line 2444 "bison_parser.cpp" /* yacc.c:1254 */ break; case 288: /* opt_table_alias */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).alias_t)); } #line 2450 "bison_parser.cpp" /* yacc.c:1254 */ break; case 289: /* alias */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).alias_t)); } #line 2456 "bison_parser.cpp" /* yacc.c:1254 */ break; case 290: /* opt_alias */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).alias_t)); } #line 2462 "bison_parser.cpp" /* yacc.c:1254 */ break; case 291: /* join_clause */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).table)); } #line 2468 "bison_parser.cpp" /* yacc.c:1254 */ break; case 292: /* opt_join_type */ #line 143 "bison_parser.y" /* yacc.c:1254 */ { } #line 2474 "bison_parser.cpp" /* yacc.c:1254 */ break; case 293: /* join_condition */ #line 155 "bison_parser.y" /* yacc.c:1254 */ { delete (((*yyvaluep).expr)); } #line 2480 "bison_parser.cpp" /* yacc.c:1254 */ break; case 295: /* ident_commalist */ #line 147 "bison_parser.y" /* yacc.c:1254 */ { if ((((*yyvaluep).str_vec)) != nullptr) { for (auto ptr : *(((*yyvaluep).str_vec))) { delete ptr; } } delete (((*yyvaluep).str_vec)); } #line 2493 "bison_parser.cpp" /* yacc.c:1254 */ break; default: break; } YY_IGNORE_MAYBE_UNINITIALIZED_END } /*----------. | yyparse. | `----------*/ int yyparse (hsql::SQLParserResult* result, yyscan_t scanner) { /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ /* Default value used for initialization, for pacifying older GCCs or non-GCC compilers. */ YY_INITIAL_VALUE (static YYSTYPE yyval_default;) YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Location data for the lookahead symbol. */ static YYLTYPE yyloc_default # if defined HSQL_LTYPE_IS_TRIVIAL && HSQL_LTYPE_IS_TRIVIAL = { 1, 1, 1, 1 } # endif ; YYLTYPE yylloc = yyloc_default; /* Number of syntax errors so far. */ int yynerrs; int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: 'yyss': related to states. 'yyvs': related to semantic values. 'yyls': related to locations. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; /* The location stack. */ YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls; YYLTYPE *yylsp; /* The locations where the error started and ended. */ YYLTYPE yyerror_range[3]; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; YYLTYPE yyloc; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yyssp = yyss = yyssa; yyvsp = yyvs = yyvsa; yylsp = yyls = yylsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* User initialization code. */ #line 73 "bison_parser.y" /* yacc.c:1429 */ { // Initialize yylloc.first_column = 0; yylloc.last_column = 0; yylloc.first_line = 0; yylloc.last_line = 0; yylloc.total_column = 0; yylloc.string_length = 0; } #line 2612 "bison_parser.cpp" /* yacc.c:1429 */ yylsp[0] = yylloc; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = (yytype_int16) yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; YYLTYPE *yyls1 = yyls; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yyls1, yysize * sizeof (*yylsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; yyls = yyls1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); YYSTACK_RELOCATE (yyls_alloc, yyls); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; yylsp = yyls + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = yylex (&yylval, &yylloc, scanner); } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END *++yylsp = yylloc; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; /* Default location. */ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); yyerror_range[1] = yyloc; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 263 "bison_parser.y" /* yacc.c:1645 */ { for (SQLStatement* stmt : *(yyvsp[-1].stmt_vec)) { // Transfers ownership of the statement. result->addStatement(stmt); } unsigned param_id = 0; for (void* param : yyloc.param_list) { if (param != nullptr) { Expr* expr = (Expr*) param; expr->ival = param_id; result->addParameter(expr); ++param_id; } } delete (yyvsp[-1].stmt_vec); } #line 2817 "bison_parser.cpp" /* yacc.c:1645 */ break; case 3: #line 284 "bison_parser.y" /* yacc.c:1645 */ { (yyvsp[0].statement)->stringLength = yylloc.string_length; yylloc.string_length = 0; (yyval.stmt_vec) = new std::vector<SQLStatement*>(); (yyval.stmt_vec)->push_back((yyvsp[0].statement)); } #line 2828 "bison_parser.cpp" /* yacc.c:1645 */ break; case 4: #line 290 "bison_parser.y" /* yacc.c:1645 */ { (yyvsp[0].statement)->stringLength = yylloc.string_length; yylloc.string_length = 0; (yyvsp[-2].stmt_vec)->push_back((yyvsp[0].statement)); (yyval.stmt_vec) = (yyvsp[-2].stmt_vec); } #line 2839 "bison_parser.cpp" /* yacc.c:1645 */ break; case 5: #line 299 "bison_parser.y" /* yacc.c:1645 */ { (yyval.statement) = (yyvsp[-1].prep_stmt); (yyval.statement)->hints = (yyvsp[0].expr_vec); } #line 2848 "bison_parser.cpp" /* yacc.c:1645 */ break; case 6: #line 303 "bison_parser.y" /* yacc.c:1645 */ { (yyval.statement) = (yyvsp[-1].statement); (yyval.statement)->hints = (yyvsp[0].expr_vec); } #line 2857 "bison_parser.cpp" /* yacc.c:1645 */ break; case 7: #line 307 "bison_parser.y" /* yacc.c:1645 */ { (yyval.statement) = (yyvsp[0].show_stmt); } #line 2865 "bison_parser.cpp" /* yacc.c:1645 */ break; case 8: #line 314 "bison_parser.y" /* yacc.c:1645 */ { (yyval.statement) = (yyvsp[0].select_stmt); } #line 2871 "bison_parser.cpp" /* yacc.c:1645 */ break; case 9: #line 315 "bison_parser.y" /* yacc.c:1645 */ { (yyval.statement) = (yyvsp[0].import_stmt); } #line 2877 "bison_parser.cpp" /* yacc.c:1645 */ break; case 10: #line 316 "bison_parser.y" /* yacc.c:1645 */ { (yyval.statement) = (yyvsp[0].import_stmt); } #line 2883 "bison_parser.cpp" /* yacc.c:1645 */ break; case 11: #line 317 "bison_parser.y" /* yacc.c:1645 */ { (yyval.statement) = (yyvsp[0].create_stmt); } #line 2889 "bison_parser.cpp" /* yacc.c:1645 */ break; case 12: #line 318 "bison_parser.y" /* yacc.c:1645 */ { (yyval.statement) = (yyvsp[0].insert_stmt); } #line 2895 "bison_parser.cpp" /* yacc.c:1645 */ break; case 13: #line 319 "bison_parser.y" /* yacc.c:1645 */ { (yyval.statement) = (yyvsp[0].delete_stmt); } #line 2901 "bison_parser.cpp" /* yacc.c:1645 */ break; case 14: #line 320 "bison_parser.y" /* yacc.c:1645 */ { (yyval.statement) = (yyvsp[0].alter_stmt); } #line 2907 "bison_parser.cpp" /* yacc.c:1645 */ break; case 15: #line 321 "bison_parser.y" /* yacc.c:1645 */ { (yyval.statement) = (yyvsp[0].delete_stmt); } #line 2913 "bison_parser.cpp" /* yacc.c:1645 */ break; case 16: #line 322 "bison_parser.y" /* yacc.c:1645 */ { (yyval.statement) = (yyvsp[0].update_stmt); } #line 2919 "bison_parser.cpp" /* yacc.c:1645 */ break; case 17: #line 323 "bison_parser.y" /* yacc.c:1645 */ { (yyval.statement) = (yyvsp[0].drop_stmt); } #line 2925 "bison_parser.cpp" /* yacc.c:1645 */ break; case 18: #line 324 "bison_parser.y" /* yacc.c:1645 */ { (yyval.statement) = (yyvsp[0].exec_stmt); } #line 2931 "bison_parser.cpp" /* yacc.c:1645 */ break; case 19: #line 333 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr_vec) = (yyvsp[-1].expr_vec); } #line 2937 "bison_parser.cpp" /* yacc.c:1645 */ break; case 20: #line 334 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr_vec) = nullptr; } #line 2943 "bison_parser.cpp" /* yacc.c:1645 */ break; case 21: #line 339 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr_vec) = new std::vector<Expr*>(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } #line 2949 "bison_parser.cpp" /* yacc.c:1645 */ break; case 22: #line 340 "bison_parser.y" /* yacc.c:1645 */ { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } #line 2955 "bison_parser.cpp" /* yacc.c:1645 */ break; case 23: #line 344 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[0].sval); } #line 2964 "bison_parser.cpp" /* yacc.c:1645 */ break; case 24: #line 348 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[-3].sval); (yyval.expr)->exprList = (yyvsp[-1].expr_vec); } #line 2974 "bison_parser.cpp" /* yacc.c:1645 */ break; case 25: #line 360 "bison_parser.y" /* yacc.c:1645 */ { (yyval.prep_stmt) = new PrepareStatement(); (yyval.prep_stmt)->name = (yyvsp[-2].sval); (yyval.prep_stmt)->query = (yyvsp[0].sval); } #line 2984 "bison_parser.cpp" /* yacc.c:1645 */ break; case 27: #line 370 "bison_parser.y" /* yacc.c:1645 */ { (yyval.exec_stmt) = new ExecuteStatement(); (yyval.exec_stmt)->name = (yyvsp[0].sval); } #line 2993 "bison_parser.cpp" /* yacc.c:1645 */ break; case 28: #line 374 "bison_parser.y" /* yacc.c:1645 */ { (yyval.exec_stmt) = new ExecuteStatement(); (yyval.exec_stmt)->name = (yyvsp[-3].sval); (yyval.exec_stmt)->parameters = (yyvsp[-1].expr_vec); } #line 3003 "bison_parser.cpp" /* yacc.c:1645 */ break; case 29: #line 386 "bison_parser.y" /* yacc.c:1645 */ { (yyval.import_stmt) = new ImportStatement((ImportType) (yyvsp[-4].uval)); (yyval.import_stmt)->filePath = (yyvsp[-2].sval); (yyval.import_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.import_stmt)->tableName = (yyvsp[0].table_name).name; } #line 3014 "bison_parser.cpp" /* yacc.c:1645 */ break; case 30: #line 395 "bison_parser.y" /* yacc.c:1645 */ { (yyval.uval) = kImportCSV; } #line 3020 "bison_parser.cpp" /* yacc.c:1645 */ break; case 31: #line 399 "bison_parser.y" /* yacc.c:1645 */ { (yyval.sval) = strdup((yyvsp[0].expr)->name); delete (yyvsp[0].expr); } #line 3026 "bison_parser.cpp" /* yacc.c:1645 */ break; case 32: #line 408 "bison_parser.y" /* yacc.c:1645 */ { (yyval.import_stmt) = new ImportStatement(kImportCSV); (yyval.import_stmt)->filePath = (yyvsp[-8].sval); (yyval.import_stmt)->schema = (yyvsp[-4].table_name).schema; (yyval.import_stmt)->tableName = (yyvsp[-4].table_name).name; } #line 3037 "bison_parser.cpp" /* yacc.c:1645 */ break; case 50: #line 458 "bison_parser.y" /* yacc.c:1645 */ { (yyval.show_stmt) = new ShowStatement(kShowTables); } #line 3045 "bison_parser.cpp" /* yacc.c:1645 */ break; case 51: #line 461 "bison_parser.y" /* yacc.c:1645 */ { (yyval.show_stmt) = new ShowStatement(kShowDatabases); } #line 3053 "bison_parser.cpp" /* yacc.c:1645 */ break; case 52: #line 464 "bison_parser.y" /* yacc.c:1645 */ { (yyval.show_stmt) = new ShowStatement(kShowColumns); (yyval.show_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.show_stmt)->name = (yyvsp[0].table_name).name; } #line 3063 "bison_parser.cpp" /* yacc.c:1645 */ break; case 53: #line 479 "bison_parser.y" /* yacc.c:1645 */ { (yyval.create_stmt) = new CreateStatement(kCreateTableFromTbl); (yyval.create_stmt)->temporary = (yyvsp[-7].bval); (yyval.create_stmt)->ifNotExists = (yyvsp[-5].bval); (yyval.create_stmt)->schema = (yyvsp[-4].table_name).schema; (yyval.create_stmt)->tableName = (yyvsp[-4].table_name).name; (yyval.create_stmt)->filePath = (yyvsp[0].sval); } #line 3076 "bison_parser.cpp" /* yacc.c:1645 */ break; case 54: #line 487 "bison_parser.y" /* yacc.c:1645 */ { (yyval.create_stmt) = new CreateStatement(kCreateTable); (yyval.create_stmt)->temporary = (yyvsp[-6].bval); (yyval.create_stmt)->ifNotExists = (yyvsp[-4].bval); (yyval.create_stmt)->schema = (yyvsp[-3].table_name).schema; (yyval.create_stmt)->tableName = (yyvsp[-3].table_name).name; (yyval.create_stmt)->columns = (yyvsp[-1].column_vec); } #line 3089 "bison_parser.cpp" /* yacc.c:1645 */ break; case 55: #line 495 "bison_parser.y" /* yacc.c:1645 */ { (yyval.create_stmt) = new CreateStatement(kCreateView); (yyval.create_stmt)->ifNotExists = (yyvsp[-4].bval); (yyval.create_stmt)->schema = (yyvsp[-3].table_name).schema; (yyval.create_stmt)->tableName = (yyvsp[-3].table_name).name; (yyval.create_stmt)->viewColumns = (yyvsp[-2].str_vec); (yyval.create_stmt)->select = (yyvsp[0].select_stmt); } #line 3102 "bison_parser.cpp" /* yacc.c:1645 */ break; case 56: #line 503 "bison_parser.y" /* yacc.c:1645 */ { (yyval.create_stmt) = new CreateStatement(kCreateDatabase); (yyval.create_stmt)->ifNotExists = (yyvsp[-1].bval); (yyval.create_stmt)->schema = (yyvsp[0].db_name).name; } #line 3112 "bison_parser.cpp" /* yacc.c:1645 */ break; case 57: #line 508 "bison_parser.y" /* yacc.c:1645 */ { (yyval.create_stmt) = new CreateStatement(kCreateDatabase); (yyval.create_stmt)->ifNotExists = (yyvsp[-1].bval); (yyval.create_stmt)->schema = (yyvsp[0].db_name).name; } #line 3122 "bison_parser.cpp" /* yacc.c:1645 */ break; case 58: #line 516 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = true; } #line 3128 "bison_parser.cpp" /* yacc.c:1645 */ break; case 59: #line 517 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = false; } #line 3134 "bison_parser.cpp" /* yacc.c:1645 */ break; case 60: #line 521 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = true; } #line 3140 "bison_parser.cpp" /* yacc.c:1645 */ break; case 61: #line 522 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = false; } #line 3146 "bison_parser.cpp" /* yacc.c:1645 */ break; case 62: #line 526 "bison_parser.y" /* yacc.c:1645 */ { (yyval.column_vec) = new std::vector<ColumnDefinition*>(); (yyval.column_vec)->push_back((yyvsp[0].column_t)); } #line 3152 "bison_parser.cpp" /* yacc.c:1645 */ break; case 63: #line 527 "bison_parser.y" /* yacc.c:1645 */ { (yyvsp[-2].column_vec)->push_back((yyvsp[0].column_t)); (yyval.column_vec) = (yyvsp[-2].column_vec); } #line 3158 "bison_parser.cpp" /* yacc.c:1645 */ break; case 64: #line 531 "bison_parser.y" /* yacc.c:1645 */ { (yyval.column_t) = new ColumnDefinition((yyvsp[-2].sval), (yyvsp[-1].column_type_t), (yyvsp[0].bval)); } #line 3166 "bison_parser.cpp" /* yacc.c:1645 */ break; case 65: #line 537 "bison_parser.y" /* yacc.c:1645 */ { (yyval.column_type_t) = ColumnType{DataType::INT}; } #line 3172 "bison_parser.cpp" /* yacc.c:1645 */ break; case 66: #line 538 "bison_parser.y" /* yacc.c:1645 */ { (yyval.column_type_t) = ColumnType{DataType::INT}; } #line 3178 "bison_parser.cpp" /* yacc.c:1645 */ break; case 67: #line 539 "bison_parser.y" /* yacc.c:1645 */ { (yyval.column_type_t) = ColumnType{DataType::LONG}; } #line 3184 "bison_parser.cpp" /* yacc.c:1645 */ break; case 68: #line 540 "bison_parser.y" /* yacc.c:1645 */ { (yyval.column_type_t) = ColumnType{DataType::FLOAT}; } #line 3190 "bison_parser.cpp" /* yacc.c:1645 */ break; case 69: #line 541 "bison_parser.y" /* yacc.c:1645 */ { (yyval.column_type_t) = ColumnType{DataType::DOUBLE}; } #line 3196 "bison_parser.cpp" /* yacc.c:1645 */ break; case 70: #line 542 "bison_parser.y" /* yacc.c:1645 */ { (yyval.column_type_t) = ColumnType{DataType::VARCHAR, (yyvsp[-1].ival)}; } #line 3202 "bison_parser.cpp" /* yacc.c:1645 */ break; case 71: #line 543 "bison_parser.y" /* yacc.c:1645 */ { (yyval.column_type_t) = ColumnType{DataType::CHAR, (yyvsp[-1].ival)}; } #line 3208 "bison_parser.cpp" /* yacc.c:1645 */ break; case 72: #line 544 "bison_parser.y" /* yacc.c:1645 */ { (yyval.column_type_t) = ColumnType{DataType::TEXT}; } #line 3214 "bison_parser.cpp" /* yacc.c:1645 */ break; case 73: #line 548 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = true; } #line 3220 "bison_parser.cpp" /* yacc.c:1645 */ break; case 74: #line 549 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = false; } #line 3226 "bison_parser.cpp" /* yacc.c:1645 */ break; case 75: #line 550 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = false; } #line 3232 "bison_parser.cpp" /* yacc.c:1645 */ break; case 76: #line 561 "bison_parser.y" /* yacc.c:1645 */ { (yyval.drop_stmt) = new DropStatement(kDropTable); (yyval.drop_stmt)->ifExists = (yyvsp[-1].bval); (yyval.drop_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.drop_stmt)->name = (yyvsp[0].table_name).name; } #line 3243 "bison_parser.cpp" /* yacc.c:1645 */ break; case 77: #line 567 "bison_parser.y" /* yacc.c:1645 */ { (yyval.drop_stmt) = new DropStatement(kDropView); (yyval.drop_stmt)->ifExists = (yyvsp[-1].bval); (yyval.drop_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.drop_stmt)->name = (yyvsp[0].table_name).name; } #line 3254 "bison_parser.cpp" /* yacc.c:1645 */ break; case 78: #line 573 "bison_parser.y" /* yacc.c:1645 */ { (yyval.drop_stmt) = new DropStatement(kDropDatabase); (yyval.drop_stmt)->ifExists = (yyvsp[-1].bval); (yyval.drop_stmt)->name = (yyvsp[0].db_name).name; } #line 3264 "bison_parser.cpp" /* yacc.c:1645 */ break; case 79: #line 578 "bison_parser.y" /* yacc.c:1645 */ { (yyval.drop_stmt) = new DropStatement(kDropPreparedStatement); (yyval.drop_stmt)->ifExists = false; (yyval.drop_stmt)->name = (yyvsp[0].sval); } #line 3274 "bison_parser.cpp" /* yacc.c:1645 */ break; case 80: #line 586 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = true; } #line 3280 "bison_parser.cpp" /* yacc.c:1645 */ break; case 81: #line 587 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = false; } #line 3286 "bison_parser.cpp" /* yacc.c:1645 */ break; case 82: #line 596 "bison_parser.y" /* yacc.c:1645 */ { (yyval.delete_stmt) = new DeleteStatement(); (yyval.delete_stmt)->low_priority = (yyvsp[-5].bval); (yyval.delete_stmt)->quick = (yyvsp[-4].bval); (yyval.delete_stmt)->ignore = (yyvsp[-3].bval); (yyval.delete_stmt)->schema = (yyvsp[-1].table_name).schema; (yyval.delete_stmt)->tableName = (yyvsp[-1].table_name).name; (yyval.delete_stmt)->expr = (yyvsp[0].expr); } #line 3300 "bison_parser.cpp" /* yacc.c:1645 */ break; case 83: #line 608 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = true; } #line 3306 "bison_parser.cpp" /* yacc.c:1645 */ break; case 84: #line 609 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = false; } #line 3312 "bison_parser.cpp" /* yacc.c:1645 */ break; case 85: #line 613 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = true; } #line 3318 "bison_parser.cpp" /* yacc.c:1645 */ break; case 86: #line 614 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = false; } #line 3324 "bison_parser.cpp" /* yacc.c:1645 */ break; case 87: #line 618 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = true; } #line 3330 "bison_parser.cpp" /* yacc.c:1645 */ break; case 88: #line 619 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = false; } #line 3336 "bison_parser.cpp" /* yacc.c:1645 */ break; case 89: #line 623 "bison_parser.y" /* yacc.c:1645 */ { (yyval.delete_stmt) = new DeleteStatement(); (yyval.delete_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.delete_stmt)->tableName = (yyvsp[0].table_name).name; } #line 3346 "bison_parser.cpp" /* yacc.c:1645 */ break; case 90: #line 636 "bison_parser.y" /* yacc.c:1645 */ { (yyval.insert_stmt) = new InsertStatement(kInsertValues); (yyval.insert_stmt)->priority = (yyvsp[-8].bval); (yyval.insert_stmt)->ignore = (yyvsp[-7].bval); (yyval.insert_stmt)->schema = (yyvsp[-5].table_name).schema; (yyval.insert_stmt)->tableName = (yyvsp[-5].table_name).name; (yyval.insert_stmt)->columns = (yyvsp[-4].str_vec); (yyval.insert_stmt)->values = (yyvsp[-1].expr_vec); } #line 3360 "bison_parser.cpp" /* yacc.c:1645 */ break; case 91: #line 645 "bison_parser.y" /* yacc.c:1645 */ { (yyval.insert_stmt) = new InsertStatement(kInsertSelect); (yyval.insert_stmt)->priority = (yyvsp[-5].bval); (yyval.insert_stmt)->ignore = (yyvsp[-4].bval); (yyval.insert_stmt)->schema = (yyvsp[-2].table_name).schema; (yyval.insert_stmt)->tableName = (yyvsp[-2].table_name).name; (yyval.insert_stmt)->columns = (yyvsp[-1].str_vec); (yyval.insert_stmt)->select = (yyvsp[0].select_stmt); } #line 3374 "bison_parser.cpp" /* yacc.c:1645 */ break; case 92: #line 658 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = true; } #line 3380 "bison_parser.cpp" /* yacc.c:1645 */ break; case 93: #line 659 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = true; } #line 3386 "bison_parser.cpp" /* yacc.c:1645 */ break; case 94: #line 660 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = true; } #line 3392 "bison_parser.cpp" /* yacc.c:1645 */ break; case 95: #line 661 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = false; } #line 3398 "bison_parser.cpp" /* yacc.c:1645 */ break; case 96: #line 665 "bison_parser.y" /* yacc.c:1645 */ { (yyval.str_vec) = (yyvsp[-1].str_vec); } #line 3404 "bison_parser.cpp" /* yacc.c:1645 */ break; case 97: #line 666 "bison_parser.y" /* yacc.c:1645 */ { (yyval.str_vec) = nullptr; } #line 3410 "bison_parser.cpp" /* yacc.c:1645 */ break; case 98: #line 676 "bison_parser.y" /* yacc.c:1645 */ { (yyval.update_stmt) = new UpdateStatement(); (yyval.update_stmt)->low_priority = (yyvsp[-5].bval); (yyval.update_stmt)->ignore = (yyvsp[-4].bval); (yyval.update_stmt)->table = (yyvsp[-3].table); (yyval.update_stmt)->updates = (yyvsp[-1].update_vec); (yyval.update_stmt)->where = (yyvsp[0].expr); } #line 3423 "bison_parser.cpp" /* yacc.c:1645 */ break; case 99: #line 687 "bison_parser.y" /* yacc.c:1645 */ { (yyval.update_vec) = new std::vector<UpdateClause*>(); (yyval.update_vec)->push_back((yyvsp[0].update_t)); } #line 3429 "bison_parser.cpp" /* yacc.c:1645 */ break; case 100: #line 688 "bison_parser.y" /* yacc.c:1645 */ { (yyvsp[-2].update_vec)->push_back((yyvsp[0].update_t)); (yyval.update_vec) = (yyvsp[-2].update_vec); } #line 3435 "bison_parser.cpp" /* yacc.c:1645 */ break; case 101: #line 692 "bison_parser.y" /* yacc.c:1645 */ { (yyval.update_t) = new UpdateClause(); (yyval.update_t)->column = (yyvsp[-2].sval); (yyval.update_t)->value = (yyvsp[0].expr); } #line 3445 "bison_parser.cpp" /* yacc.c:1645 */ break; case 102: #line 707 "bison_parser.y" /* yacc.c:1645 */ { (yyval.alter_stmt) = new AlterStatement(kAlterDatabase); (yyval.alter_stmt)->schema = (yyvsp[-5].db_name).name; (yyval.alter_stmt)->dflt = (yyvsp[-4].bval); (yyval.alter_stmt)->equal = (yyvsp[-1].bval); (yyval.alter_stmt)->charsetName = (yyvsp[0].expr); } #line 3457 "bison_parser.cpp" /* yacc.c:1645 */ break; case 103: #line 714 "bison_parser.y" /* yacc.c:1645 */ { (yyval.alter_stmt) = new AlterStatement(kAlterSchema); (yyval.alter_stmt)->schema = (yyvsp[-5].db_name).name; (yyval.alter_stmt)->dflt = (yyvsp[-4].bval); (yyval.alter_stmt)->equal = (yyvsp[-1].bval); (yyval.alter_stmt)->charsetName = (yyvsp[0].expr); } #line 3469 "bison_parser.cpp" /* yacc.c:1645 */ break; case 104: #line 721 "bison_parser.y" /* yacc.c:1645 */ { (yyval.alter_stmt) = new AlterStatement(kAlterTable); (yyval.alter_stmt)->tableName = (yyvsp[-3].table_name).name; (yyval.alter_stmt)->columns = (yyvsp[0].column_t); } #line 3479 "bison_parser.cpp" /* yacc.c:1645 */ break; case 105: #line 729 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = true; } #line 3485 "bison_parser.cpp" /* yacc.c:1645 */ break; case 106: #line 730 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = false; } #line 3491 "bison_parser.cpp" /* yacc.c:1645 */ break; case 107: #line 734 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = true; } #line 3497 "bison_parser.cpp" /* yacc.c:1645 */ break; case 108: #line 735 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = false; } #line 3503 "bison_parser.cpp" /* yacc.c:1645 */ break; case 111: #line 747 "bison_parser.y" /* yacc.c:1645 */ { // TODO: allow multiple unions (through linked list) // TODO: capture type of set_operator // TODO: might overwrite order and limit of first select here (yyval.select_stmt) = (yyvsp[-4].select_stmt); (yyval.select_stmt)->unionSelect = (yyvsp[-2].select_stmt); (yyval.select_stmt)->order = (yyvsp[-1].order_vec); // Limit could have been set by TOP. if ((yyvsp[0].limit) != nullptr) { delete (yyval.select_stmt)->limit; (yyval.select_stmt)->limit = (yyvsp[0].limit); } } #line 3522 "bison_parser.cpp" /* yacc.c:1645 */ break; case 112: #line 764 "bison_parser.y" /* yacc.c:1645 */ { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } #line 3528 "bison_parser.cpp" /* yacc.c:1645 */ break; case 113: #line 765 "bison_parser.y" /* yacc.c:1645 */ { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } #line 3534 "bison_parser.cpp" /* yacc.c:1645 */ break; case 116: #line 774 "bison_parser.y" /* yacc.c:1645 */ { (yyval.select_stmt) = (yyvsp[-2].select_stmt); (yyval.select_stmt)->order = (yyvsp[-1].order_vec); // Limit could have been set by TOP. if ((yyvsp[0].limit) != nullptr) { delete (yyval.select_stmt)->limit; (yyval.select_stmt)->limit = (yyvsp[0].limit); } } #line 3549 "bison_parser.cpp" /* yacc.c:1645 */ break; case 117: #line 784 "bison_parser.y" /* yacc.c:1645 */ { // TODO: allow multiple unions (through linked list) // TODO: capture type of set_operator // TODO: might overwrite order and limit of first select here (yyval.select_stmt) = (yyvsp[-4].select_stmt); (yyval.select_stmt)->unionSelect = (yyvsp[-2].select_stmt); (yyval.select_stmt)->order = (yyvsp[-1].order_vec); // Limit could have been set by TOP. if ((yyvsp[0].limit) != nullptr) { delete (yyval.select_stmt)->limit; (yyval.select_stmt)->limit = (yyvsp[0].limit); } } #line 3568 "bison_parser.cpp" /* yacc.c:1645 */ break; case 124: #line 816 "bison_parser.y" /* yacc.c:1645 */ { (yyval.select_stmt) = new SelectStatement(); (yyval.select_stmt)->limit = (yyvsp[-5].limit); (yyval.select_stmt)->selectDistinct = (yyvsp[-4].bval); (yyval.select_stmt)->selectList = (yyvsp[-3].expr_vec); (yyval.select_stmt)->fromTable = (yyvsp[-2].table); (yyval.select_stmt)->whereClause = (yyvsp[-1].expr); (yyval.select_stmt)->groupBy = (yyvsp[0].group_t); } #line 3582 "bison_parser.cpp" /* yacc.c:1645 */ break; case 125: #line 828 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = true; } #line 3588 "bison_parser.cpp" /* yacc.c:1645 */ break; case 126: #line 829 "bison_parser.y" /* yacc.c:1645 */ { (yyval.bval) = false; } #line 3594 "bison_parser.cpp" /* yacc.c:1645 */ break; case 128: #line 837 "bison_parser.y" /* yacc.c:1645 */ { (yyval.table) = (yyvsp[0].table); } #line 3600 "bison_parser.cpp" /* yacc.c:1645 */ break; case 129: #line 838 "bison_parser.y" /* yacc.c:1645 */ { (yyval.table) = nullptr; } #line 3606 "bison_parser.cpp" /* yacc.c:1645 */ break; case 130: #line 841 "bison_parser.y" /* yacc.c:1645 */ { (yyval.table) = (yyvsp[0].table); } #line 3612 "bison_parser.cpp" /* yacc.c:1645 */ break; case 131: #line 846 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = (yyvsp[0].expr); } #line 3618 "bison_parser.cpp" /* yacc.c:1645 */ break; case 132: #line 847 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = nullptr; } #line 3624 "bison_parser.cpp" /* yacc.c:1645 */ break; case 133: #line 851 "bison_parser.y" /* yacc.c:1645 */ { (yyval.group_t) = new GroupByDescription(); (yyval.group_t)->columns = (yyvsp[-1].expr_vec); (yyval.group_t)->having = (yyvsp[0].expr); } #line 3634 "bison_parser.cpp" /* yacc.c:1645 */ break; case 134: #line 856 "bison_parser.y" /* yacc.c:1645 */ { (yyval.group_t) = nullptr; } #line 3640 "bison_parser.cpp" /* yacc.c:1645 */ break; case 135: #line 860 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = (yyvsp[0].expr); } #line 3646 "bison_parser.cpp" /* yacc.c:1645 */ break; case 136: #line 861 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = nullptr; } #line 3652 "bison_parser.cpp" /* yacc.c:1645 */ break; case 137: #line 864 "bison_parser.y" /* yacc.c:1645 */ { (yyval.order_vec) = (yyvsp[0].order_vec); } #line 3658 "bison_parser.cpp" /* yacc.c:1645 */ break; case 138: #line 865 "bison_parser.y" /* yacc.c:1645 */ { (yyval.order_vec) = nullptr; } #line 3664 "bison_parser.cpp" /* yacc.c:1645 */ break; case 139: #line 869 "bison_parser.y" /* yacc.c:1645 */ { (yyval.order_vec) = new std::vector<OrderDescription*>(); (yyval.order_vec)->push_back((yyvsp[0].order)); } #line 3670 "bison_parser.cpp" /* yacc.c:1645 */ break; case 140: #line 870 "bison_parser.y" /* yacc.c:1645 */ { (yyvsp[-2].order_vec)->push_back((yyvsp[0].order)); (yyval.order_vec) = (yyvsp[-2].order_vec); } #line 3676 "bison_parser.cpp" /* yacc.c:1645 */ break; case 141: #line 874 "bison_parser.y" /* yacc.c:1645 */ { (yyval.order) = new OrderDescription((yyvsp[0].order_type), (yyvsp[-1].expr)); } #line 3682 "bison_parser.cpp" /* yacc.c:1645 */ break; case 142: #line 878 "bison_parser.y" /* yacc.c:1645 */ { (yyval.order_type) = kOrderAsc; } #line 3688 "bison_parser.cpp" /* yacc.c:1645 */ break; case 143: #line 879 "bison_parser.y" /* yacc.c:1645 */ { (yyval.order_type) = kOrderDesc; } #line 3694 "bison_parser.cpp" /* yacc.c:1645 */ break; case 144: #line 880 "bison_parser.y" /* yacc.c:1645 */ { (yyval.order_type) = kOrderAsc; } #line 3700 "bison_parser.cpp" /* yacc.c:1645 */ break; case 145: #line 886 "bison_parser.y" /* yacc.c:1645 */ { (yyval.limit) = new LimitDescription((yyvsp[0].expr)->ival, kNoOffset); delete (yyvsp[0].expr); } #line 3706 "bison_parser.cpp" /* yacc.c:1645 */ break; case 146: #line 887 "bison_parser.y" /* yacc.c:1645 */ { (yyval.limit) = nullptr; } #line 3712 "bison_parser.cpp" /* yacc.c:1645 */ break; case 147: #line 891 "bison_parser.y" /* yacc.c:1645 */ { (yyval.limit) = new LimitDescription((yyvsp[0].expr)->ival, kNoOffset); delete (yyvsp[0].expr); } #line 3718 "bison_parser.cpp" /* yacc.c:1645 */ break; case 148: #line 892 "bison_parser.y" /* yacc.c:1645 */ { (yyval.limit) = new LimitDescription((yyvsp[-2].expr)->ival, (yyvsp[0].expr)->ival); delete (yyvsp[-2].expr); delete (yyvsp[0].expr); } #line 3724 "bison_parser.cpp" /* yacc.c:1645 */ break; case 149: #line 893 "bison_parser.y" /* yacc.c:1645 */ { (yyval.limit) = new LimitDescription(kNoLimit, (yyvsp[0].expr)->ival); delete (yyvsp[0].expr); } #line 3730 "bison_parser.cpp" /* yacc.c:1645 */ break; case 150: #line 894 "bison_parser.y" /* yacc.c:1645 */ { (yyval.limit) = nullptr; } #line 3736 "bison_parser.cpp" /* yacc.c:1645 */ break; case 151: #line 895 "bison_parser.y" /* yacc.c:1645 */ { (yyval.limit) = nullptr; } #line 3742 "bison_parser.cpp" /* yacc.c:1645 */ break; case 152: #line 896 "bison_parser.y" /* yacc.c:1645 */ { (yyval.limit) = new LimitDescription(kNoLimit, (yyvsp[0].expr)->ival); delete (yyvsp[0].expr); } #line 3748 "bison_parser.cpp" /* yacc.c:1645 */ break; case 153: #line 897 "bison_parser.y" /* yacc.c:1645 */ { (yyval.limit) = new LimitDescription(kNoLimit, (yyvsp[0].expr)->ival); delete (yyvsp[0].expr); } #line 3754 "bison_parser.cpp" /* yacc.c:1645 */ break; case 154: #line 898 "bison_parser.y" /* yacc.c:1645 */ { (yyval.limit) = nullptr; } #line 3760 "bison_parser.cpp" /* yacc.c:1645 */ break; case 155: #line 905 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr_vec) = new std::vector<Expr*>(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } #line 3766 "bison_parser.cpp" /* yacc.c:1645 */ break; case 156: #line 906 "bison_parser.y" /* yacc.c:1645 */ { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } #line 3772 "bison_parser.cpp" /* yacc.c:1645 */ break; case 157: #line 910 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr_vec) = (yyvsp[0].expr_vec); } #line 3778 "bison_parser.cpp" /* yacc.c:1645 */ break; case 158: #line 911 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr_vec) = nullptr; } #line 3784 "bison_parser.cpp" /* yacc.c:1645 */ break; case 159: #line 915 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr_vec) = new std::vector<Expr*>(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } #line 3790 "bison_parser.cpp" /* yacc.c:1645 */ break; case 160: #line 916 "bison_parser.y" /* yacc.c:1645 */ { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } #line 3796 "bison_parser.cpp" /* yacc.c:1645 */ break; case 161: #line 920 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = (yyvsp[-1].expr); if ((yyvsp[0].alias_t)) { (yyval.expr)->alias = strdup((yyvsp[0].alias_t)->name); delete (yyvsp[0].alias_t); } } #line 3808 "bison_parser.cpp" /* yacc.c:1645 */ break; case 167: #line 938 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = (yyvsp[-1].expr); } #line 3814 "bison_parser.cpp" /* yacc.c:1645 */ break; case 176: #line 947 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeSelect((yyvsp[-1].select_stmt)); } #line 3820 "bison_parser.cpp" /* yacc.c:1645 */ break; case 179: #line 956 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } #line 3826 "bison_parser.cpp" /* yacc.c:1645 */ break; case 180: #line 957 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, (yyvsp[0].expr)); } #line 3832 "bison_parser.cpp" /* yacc.c:1645 */ break; case 181: #line 958 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-1].expr)); } #line 3838 "bison_parser.cpp" /* yacc.c:1645 */ break; case 182: #line 959 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-2].expr)); } #line 3844 "bison_parser.cpp" /* yacc.c:1645 */ break; case 183: #line 960 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeOpUnary(kOpIsNull, (yyvsp[-3].expr))); } #line 3850 "bison_parser.cpp" /* yacc.c:1645 */ break; case 185: #line 965 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpMinus, (yyvsp[0].expr)); } #line 3856 "bison_parser.cpp" /* yacc.c:1645 */ break; case 186: #line 966 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPlus, (yyvsp[0].expr)); } #line 3862 "bison_parser.cpp" /* yacc.c:1645 */ break; case 187: #line 967 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpSlash, (yyvsp[0].expr)); } #line 3868 "bison_parser.cpp" /* yacc.c:1645 */ break; case 188: #line 968 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAsterisk, (yyvsp[0].expr)); } #line 3874 "bison_parser.cpp" /* yacc.c:1645 */ break; case 189: #line 969 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPercentage, (yyvsp[0].expr)); } #line 3880 "bison_parser.cpp" /* yacc.c:1645 */ break; case 190: #line 970 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpCaret, (yyvsp[0].expr)); } #line 3886 "bison_parser.cpp" /* yacc.c:1645 */ break; case 191: #line 971 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLike, (yyvsp[0].expr)); } #line 3892 "bison_parser.cpp" /* yacc.c:1645 */ break; case 192: #line 972 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-3].expr), kOpNotLike, (yyvsp[0].expr)); } #line 3898 "bison_parser.cpp" /* yacc.c:1645 */ break; case 193: #line 973 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpILike, (yyvsp[0].expr)); } #line 3904 "bison_parser.cpp" /* yacc.c:1645 */ break; case 194: #line 974 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpConcat, (yyvsp[0].expr)); } #line 3910 "bison_parser.cpp" /* yacc.c:1645 */ break; case 195: #line 978 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAnd, (yyvsp[0].expr)); } #line 3916 "bison_parser.cpp" /* yacc.c:1645 */ break; case 196: #line 979 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpOr, (yyvsp[0].expr)); } #line 3922 "bison_parser.cpp" /* yacc.c:1645 */ break; case 197: #line 983 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].expr_vec)); } #line 3928 "bison_parser.cpp" /* yacc.c:1645 */ break; case 198: #line 984 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].expr_vec))); } #line 3934 "bison_parser.cpp" /* yacc.c:1645 */ break; case 199: #line 985 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].select_stmt)); } #line 3940 "bison_parser.cpp" /* yacc.c:1645 */ break; case 200: #line 986 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].select_stmt))); } #line 3946 "bison_parser.cpp" /* yacc.c:1645 */ break; case 201: #line 992 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeCase((yyvsp[-2].expr), (yyvsp[-1].expr), nullptr); } #line 3952 "bison_parser.cpp" /* yacc.c:1645 */ break; case 202: #line 993 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeCase((yyvsp[-4].expr), (yyvsp[-3].expr), (yyvsp[-1].expr)); } #line 3958 "bison_parser.cpp" /* yacc.c:1645 */ break; case 203: #line 994 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeCase(nullptr, (yyvsp[-1].expr), nullptr); } #line 3964 "bison_parser.cpp" /* yacc.c:1645 */ break; case 204: #line 995 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeCase(nullptr, (yyvsp[-3].expr), (yyvsp[-1].expr)); } #line 3970 "bison_parser.cpp" /* yacc.c:1645 */ break; case 205: #line 999 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeCaseList(Expr::makeCaseListElement((yyvsp[-2].expr), (yyvsp[0].expr))); } #line 3976 "bison_parser.cpp" /* yacc.c:1645 */ break; case 206: #line 1000 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::caseListAppend((yyvsp[-4].expr), Expr::makeCaseListElement((yyvsp[-2].expr), (yyvsp[0].expr))); } #line 3982 "bison_parser.cpp" /* yacc.c:1645 */ break; case 207: #line 1004 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeExists((yyvsp[-1].select_stmt)); } #line 3988 "bison_parser.cpp" /* yacc.c:1645 */ break; case 208: #line 1005 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeExists((yyvsp[-1].select_stmt))); } #line 3994 "bison_parser.cpp" /* yacc.c:1645 */ break; case 209: #line 1009 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } #line 4000 "bison_parser.cpp" /* yacc.c:1645 */ break; case 210: #line 1010 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } #line 4006 "bison_parser.cpp" /* yacc.c:1645 */ break; case 211: #line 1011 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpNotEquals, (yyvsp[0].expr)); } #line 4012 "bison_parser.cpp" /* yacc.c:1645 */ break; case 212: #line 1012 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLess, (yyvsp[0].expr)); } #line 4018 "bison_parser.cpp" /* yacc.c:1645 */ break; case 213: #line 1013 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreater, (yyvsp[0].expr)); } #line 4024 "bison_parser.cpp" /* yacc.c:1645 */ break; case 214: #line 1014 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLessEq, (yyvsp[0].expr)); } #line 4030 "bison_parser.cpp" /* yacc.c:1645 */ break; case 215: #line 1015 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreaterEq, (yyvsp[0].expr)); } #line 4036 "bison_parser.cpp" /* yacc.c:1645 */ break; case 216: #line 1019 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-2].sval), new std::vector<Expr*>(), false); } #line 4042 "bison_parser.cpp" /* yacc.c:1645 */ break; case 217: #line 1020 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-4].sval), (yyvsp[-1].expr_vec), (yyvsp[-2].bval)); } #line 4048 "bison_parser.cpp" /* yacc.c:1645 */ break; case 218: #line 1024 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeExtract((yyvsp[-3].datetime_field), (yyvsp[-1].expr)); } #line 4054 "bison_parser.cpp" /* yacc.c:1645 */ break; case 219: #line 1028 "bison_parser.y" /* yacc.c:1645 */ { (yyval.datetime_field) = kDatetimeSecond; } #line 4060 "bison_parser.cpp" /* yacc.c:1645 */ break; case 220: #line 1029 "bison_parser.y" /* yacc.c:1645 */ { (yyval.datetime_field) = kDatetimeMinute; } #line 4066 "bison_parser.cpp" /* yacc.c:1645 */ break; case 221: #line 1030 "bison_parser.y" /* yacc.c:1645 */ { (yyval.datetime_field) = kDatetimeHour; } #line 4072 "bison_parser.cpp" /* yacc.c:1645 */ break; case 222: #line 1031 "bison_parser.y" /* yacc.c:1645 */ { (yyval.datetime_field) = kDatetimeDay; } #line 4078 "bison_parser.cpp" /* yacc.c:1645 */ break; case 223: #line 1032 "bison_parser.y" /* yacc.c:1645 */ { (yyval.datetime_field) = kDatetimeMonth; } #line 4084 "bison_parser.cpp" /* yacc.c:1645 */ break; case 224: #line 1033 "bison_parser.y" /* yacc.c:1645 */ { (yyval.datetime_field) = kDatetimeYear; } #line 4090 "bison_parser.cpp" /* yacc.c:1645 */ break; case 225: #line 1036 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeArray((yyvsp[-1].expr_vec)); } #line 4096 "bison_parser.cpp" /* yacc.c:1645 */ break; case 226: #line 1040 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeArrayIndex((yyvsp[-3].expr), (yyvsp[-1].expr)->ival); } #line 4102 "bison_parser.cpp" /* yacc.c:1645 */ break; case 227: #line 1044 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeBetween((yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } #line 4108 "bison_parser.cpp" /* yacc.c:1645 */ break; case 228: #line 1048 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeColumnRef((yyvsp[0].sval)); } #line 4114 "bison_parser.cpp" /* yacc.c:1645 */ break; case 229: #line 1049 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeColumnRef((yyvsp[-2].sval), (yyvsp[0].sval)); } #line 4120 "bison_parser.cpp" /* yacc.c:1645 */ break; case 230: #line 1050 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeStar(); } #line 4126 "bison_parser.cpp" /* yacc.c:1645 */ break; case 231: #line 1051 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeStar((yyvsp[-2].sval)); } #line 4132 "bison_parser.cpp" /* yacc.c:1645 */ break; case 237: #line 1063 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeLiteral((yyvsp[0].sval)); } #line 4138 "bison_parser.cpp" /* yacc.c:1645 */ break; case 238: #line 1067 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeLiteral(true); } #line 4144 "bison_parser.cpp" /* yacc.c:1645 */ break; case 239: #line 1068 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeLiteral(false); } #line 4150 "bison_parser.cpp" /* yacc.c:1645 */ break; case 240: #line 1072 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeLiteral((yyvsp[0].fval)); } #line 4156 "bison_parser.cpp" /* yacc.c:1645 */ break; case 242: #line 1077 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeLiteral((yyvsp[0].ival)); } #line 4162 "bison_parser.cpp" /* yacc.c:1645 */ break; case 243: #line 1081 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeNullLiteral(); } #line 4168 "bison_parser.cpp" /* yacc.c:1645 */ break; case 244: #line 1085 "bison_parser.y" /* yacc.c:1645 */ { (yyval.expr) = Expr::makeParameter(yylloc.total_column); (yyval.expr)->ival2 = yyloc.param_list.size(); yyloc.param_list.push_back((yyval.expr)); } #line 4178 "bison_parser.cpp" /* yacc.c:1645 */ break; case 246: #line 1098 "bison_parser.y" /* yacc.c:1645 */ { (yyvsp[-2].table_vec)->push_back((yyvsp[0].table)); auto tbl = new TableRef(kTableCrossProduct); tbl->list = (yyvsp[-2].table_vec); (yyval.table) = tbl; } #line 4189 "bison_parser.cpp" /* yacc.c:1645 */ break; case 250: #line 1114 "bison_parser.y" /* yacc.c:1645 */ { auto tbl = new TableRef(kTableSelect); tbl->select = (yyvsp[-2].select_stmt); tbl->alias = (yyvsp[0].alias_t); (yyval.table) = tbl; } #line 4200 "bison_parser.cpp" /* yacc.c:1645 */ break; case 251: #line 1123 "bison_parser.y" /* yacc.c:1645 */ { (yyval.table_vec) = new std::vector<TableRef*>(); (yyval.table_vec)->push_back((yyvsp[0].table)); } #line 4206 "bison_parser.cpp" /* yacc.c:1645 */ break; case 252: #line 1124 "bison_parser.y" /* yacc.c:1645 */ { (yyvsp[-2].table_vec)->push_back((yyvsp[0].table)); (yyval.table_vec) = (yyvsp[-2].table_vec); } #line 4212 "bison_parser.cpp" /* yacc.c:1645 */ break; case 253: #line 1129 "bison_parser.y" /* yacc.c:1645 */ { auto tbl = new TableRef(kTableName); tbl->schema = (yyvsp[-1].table_name).schema; tbl->name = (yyvsp[-1].table_name).name; tbl->alias = (yyvsp[0].alias_t); (yyval.table) = tbl; } #line 4224 "bison_parser.cpp" /* yacc.c:1645 */ break; case 254: #line 1140 "bison_parser.y" /* yacc.c:1645 */ { (yyval.table) = new TableRef(kTableName); (yyval.table)->schema = (yyvsp[0].table_name).schema; (yyval.table)->name = (yyvsp[0].table_name).name; } #line 4234 "bison_parser.cpp" /* yacc.c:1645 */ break; case 255: #line 1149 "bison_parser.y" /* yacc.c:1645 */ { (yyval.table_name).schema = nullptr; (yyval.table_name).name = (yyvsp[0].sval);} #line 4240 "bison_parser.cpp" /* yacc.c:1645 */ break; case 256: #line 1150 "bison_parser.y" /* yacc.c:1645 */ { (yyval.table_name).schema = (yyvsp[-2].sval); (yyval.table_name).name = (yyvsp[0].sval); } #line 4246 "bison_parser.cpp" /* yacc.c:1645 */ break; case 257: #line 1155 "bison_parser.y" /* yacc.c:1645 */ {(yyval.db_name).name = (yyvsp[0].sval);} #line 4252 "bison_parser.cpp" /* yacc.c:1645 */ break; case 259: #line 1161 "bison_parser.y" /* yacc.c:1645 */ { (yyval.alias_t) = new Alias((yyvsp[-3].sval), (yyvsp[-1].str_vec)); } #line 4258 "bison_parser.cpp" /* yacc.c:1645 */ break; case 261: #line 1167 "bison_parser.y" /* yacc.c:1645 */ { (yyval.alias_t) = nullptr; } #line 4264 "bison_parser.cpp" /* yacc.c:1645 */ break; case 262: #line 1171 "bison_parser.y" /* yacc.c:1645 */ { (yyval.alias_t) = new Alias((yyvsp[0].sval)); } #line 4270 "bison_parser.cpp" /* yacc.c:1645 */ break; case 263: #line 1172 "bison_parser.y" /* yacc.c:1645 */ { (yyval.alias_t) = new Alias((yyvsp[0].sval)); } #line 4276 "bison_parser.cpp" /* yacc.c:1645 */ break; case 265: #line 1178 "bison_parser.y" /* yacc.c:1645 */ { (yyval.alias_t) = nullptr; } #line 4282 "bison_parser.cpp" /* yacc.c:1645 */ break; case 266: #line 1187 "bison_parser.y" /* yacc.c:1645 */ { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); (yyval.table)->join->type = kJoinNatural; (yyval.table)->join->left = (yyvsp[-3].table); (yyval.table)->join->right = (yyvsp[0].table); } #line 4294 "bison_parser.cpp" /* yacc.c:1645 */ break; case 267: #line 1195 "bison_parser.y" /* yacc.c:1645 */ { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); (yyval.table)->join->type = (JoinType) (yyvsp[-4].uval); (yyval.table)->join->left = (yyvsp[-5].table); (yyval.table)->join->right = (yyvsp[-2].table); (yyval.table)->join->condition = (yyvsp[0].expr); } #line 4307 "bison_parser.cpp" /* yacc.c:1645 */ break; case 268: #line 1205 "bison_parser.y" /* yacc.c:1645 */ { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); (yyval.table)->join->type = (JoinType) (yyvsp[-6].uval); (yyval.table)->join->left = (yyvsp[-7].table); (yyval.table)->join->right = (yyvsp[-4].table); auto left_col = Expr::makeColumnRef(strdup((yyvsp[-1].expr)->name)); if ((yyvsp[-1].expr)->alias != nullptr) left_col->alias = strdup((yyvsp[-1].expr)->alias); if ((yyvsp[-7].table)->getName() != nullptr) left_col->table = strdup((yyvsp[-7].table)->getName()); auto right_col = Expr::makeColumnRef(strdup((yyvsp[-1].expr)->name)); if ((yyvsp[-1].expr)->alias != nullptr) right_col->alias = strdup((yyvsp[-1].expr)->alias); if ((yyvsp[-4].table)->getName() != nullptr) right_col->table = strdup((yyvsp[-4].table)->getName()); (yyval.table)->join->condition = Expr::makeOpBinary(left_col, kOpEquals, right_col); delete (yyvsp[-1].expr); } #line 4327 "bison_parser.cpp" /* yacc.c:1645 */ break; case 269: #line 1223 "bison_parser.y" /* yacc.c:1645 */ { (yyval.uval) = kJoinInner; } #line 4333 "bison_parser.cpp" /* yacc.c:1645 */ break; case 270: #line 1224 "bison_parser.y" /* yacc.c:1645 */ { (yyval.uval) = kJoinLeft; } #line 4339 "bison_parser.cpp" /* yacc.c:1645 */ break; case 271: #line 1225 "bison_parser.y" /* yacc.c:1645 */ { (yyval.uval) = kJoinLeft; } #line 4345 "bison_parser.cpp" /* yacc.c:1645 */ break; case 272: #line 1226 "bison_parser.y" /* yacc.c:1645 */ { (yyval.uval) = kJoinRight; } #line 4351 "bison_parser.cpp" /* yacc.c:1645 */ break; case 273: #line 1227 "bison_parser.y" /* yacc.c:1645 */ { (yyval.uval) = kJoinRight; } #line 4357 "bison_parser.cpp" /* yacc.c:1645 */ break; case 274: #line 1228 "bison_parser.y" /* yacc.c:1645 */ { (yyval.uval) = kJoinFull; } #line 4363 "bison_parser.cpp" /* yacc.c:1645 */ break; case 275: #line 1229 "bison_parser.y" /* yacc.c:1645 */ { (yyval.uval) = kJoinFull; } #line 4369 "bison_parser.cpp" /* yacc.c:1645 */ break; case 276: #line 1230 "bison_parser.y" /* yacc.c:1645 */ { (yyval.uval) = kJoinFull; } #line 4375 "bison_parser.cpp" /* yacc.c:1645 */ break; case 277: #line 1231 "bison_parser.y" /* yacc.c:1645 */ { (yyval.uval) = kJoinCross; } #line 4381 "bison_parser.cpp" /* yacc.c:1645 */ break; case 278: #line 1232 "bison_parser.y" /* yacc.c:1645 */ { (yyval.uval) = kJoinInner; } #line 4387 "bison_parser.cpp" /* yacc.c:1645 */ break; case 282: #line 1252 "bison_parser.y" /* yacc.c:1645 */ { (yyval.str_vec) = new std::vector<char*>(); (yyval.str_vec)->push_back((yyvsp[0].sval)); } #line 4393 "bison_parser.cpp" /* yacc.c:1645 */ break; case 283: #line 1253 "bison_parser.y" /* yacc.c:1645 */ { (yyvsp[-2].str_vec)->push_back((yyvsp[0].sval)); (yyval.str_vec) = (yyvsp[-2].str_vec); } #line 4399 "bison_parser.cpp" /* yacc.c:1645 */ break; #line 4403 "bison_parser.cpp" /* yacc.c:1645 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; *++yylsp = yyloc; /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ { const int yylhs = yyr1[yyn] - YYNTOKENS; const int yyi = yypgoto[yylhs] + *yyssp; yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ? yytable[yyi] : yydefgoto[yylhs]); } goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (&yylloc, result, scanner, YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) { char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; yysyntax_error_status = YYSYNTAX_ERROR; if (yysyntax_error_status == 0) yymsgp = yymsg; else if (yysyntax_error_status == 1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); if (!yymsg) { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; yysyntax_error_status = 2; } else { yysyntax_error_status = YYSYNTAX_ERROR; yymsgp = yymsg; } } yyerror (&yylloc, result, scanner, yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } # undef YYSYNTAX_ERROR #endif } yyerror_range[1] = yylloc; if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval, &yylloc, result, scanner); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yyerror_range[1] = *yylsp; yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp, result, scanner); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END yyerror_range[2] = yylloc; /* Using YYLLOC is tempting, but would change the location of the lookahead. YYLOC is available though. */ YYLLOC_DEFAULT (yyloc, yyerror_range, 2); *++yylsp = yyloc; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (&yylloc, result, scanner, YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc, result, scanner); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp, yylsp, result, scanner); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif return yyresult; } #line 1256 "bison_parser.y" /* yacc.c:1903 */ /********************************* ** Section 4: Additional C code *********************************/ /* empty */ 0707010000003D000081A4000003E800000064000000015C0989F300002067000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/src/parser/bison_parser.h/* A Bison parser, made by GNU Bison 3.2. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018 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_HSQL_BISON_PARSER_H_INCLUDED # define YY_HSQL_BISON_PARSER_H_INCLUDED /* Debug traces. */ #ifndef HSQL_DEBUG # if defined YYDEBUG #if YYDEBUG # define HSQL_DEBUG 1 # else # define HSQL_DEBUG 0 # endif # else /* ! defined YYDEBUG */ # define HSQL_DEBUG 0 # endif /* ! defined YYDEBUG */ #endif /* ! defined HSQL_DEBUG */ #if HSQL_DEBUG extern int hsql_debug; #endif /* "%code requires" blocks. */ #line 35 "bison_parser.y" /* yacc.c:1906 */ // %code requires block #include "../../include/sqlparser/statements.h" #include "../../include/sqlparser/SQLParserResult.h" #include "parser_typedef.h" // Auto update column and line number #define YY_USER_ACTION \ yylloc->first_line = yylloc->last_line; \ yylloc->first_column = yylloc->last_column; \ for(int i = 0; yytext[i] != '\0'; i++) { \ yylloc->total_column++; \ yylloc->string_length++; \ if(yytext[i] == '\n') { \ yylloc->last_line++; \ yylloc->last_column = 0; \ } \ else { \ yylloc->last_column++; \ } \ } #line 79 "bison_parser.h" /* yacc.c:1906 */ /* Token type. */ #ifndef HSQL_TOKENTYPE # define HSQL_TOKENTYPE enum hsql_tokentype { SQL_IDENTIFIER = 258, SQL_STRING = 259, SQL_FLOATVAL = 260, SQL_INTVAL = 261, SQL_DEALLOCATE = 262, SQL_PARAMETERS = 263, SQL_INTERSECT = 264, SQL_TEMPORARY = 265, SQL_TIMESTAMP = 266, SQL_DISTINCT = 267, SQL_NVARCHAR = 268, SQL_RESTRICT = 269, SQL_TRUNCATE = 270, SQL_ANALYZE = 271, SQL_BETWEEN = 272, SQL_CASCADE = 273, SQL_COLUMNS = 274, SQL_CONTROL = 275, SQL_DEFAULT = 276, SQL_EXECUTE = 277, SQL_EXPLAIN = 278, SQL_HISTORY = 279, SQL_INTEGER = 280, SQL_NATURAL = 281, SQL_PREPARE = 282, SQL_PRIMARY = 283, SQL_SCHEMAS = 284, SQL_SPATIAL = 285, SQL_VARCHAR = 286, SQL_VIRTUAL = 287, SQL_BEFORE = 288, SQL_COLUMN = 289, SQL_CREATE = 290, SQL_DELETE = 291, SQL_DIRECT = 292, SQL_DOUBLE = 293, SQL_ESCAPE = 294, SQL_EXCEPT = 295, SQL_EXISTS = 296, SQL_EXTRACT = 297, SQL_GLOBAL = 298, SQL_HAVING = 299, SQL_IMPORT = 300, SQL_INSERT = 301, SQL_ISNULL = 302, SQL_OFFSET = 303, SQL_RENAME = 304, SQL_SCHEMA = 305, SQL_SELECT = 306, SQL_SORTED = 307, SQL_TABLES = 308, SQL_UNIQUE = 309, SQL_UNLOAD = 310, SQL_UPDATE = 311, SQL_VALUES = 312, SQL_AFTER = 313, SQL_ALTER = 314, SQL_CROSS = 315, SQL_DELTA = 316, SQL_FLOAT = 317, SQL_GROUP = 318, SQL_INDEX = 319, SQL_INNER = 320, SQL_LIMIT = 321, SQL_LOCAL = 322, SQL_MERGE = 323, SQL_MINUS = 324, SQL_ORDER = 325, SQL_OUTER = 326, SQL_RIGHT = 327, SQL_TABLE = 328, SQL_UNION = 329, SQL_USING = 330, SQL_WHERE = 331, SQL_CALL = 332, SQL_CASE = 333, SQL_CHAR = 334, SQL_DATE = 335, SQL_DESC = 336, SQL_DROP = 337, SQL_ELSE = 338, SQL_FILE = 339, SQL_FROM = 340, SQL_FULL = 341, SQL_HASH = 342, SQL_HINT = 343, SQL_INTO = 344, SQL_JOIN = 345, SQL_LEFT = 346, SQL_LIKE = 347, SQL_LOAD = 348, SQL_LONG = 349, SQL_NULL = 350, SQL_PLAN = 351, SQL_SHOW = 352, SQL_TEXT = 353, SQL_THEN = 354, SQL_TIME = 355, SQL_VIEW = 356, SQL_WHEN = 357, SQL_WITH = 358, SQL_LOW_PRIORITY = 359, SQL_DELAYED = 360, SQL_HIGH_PRIORITY = 361, SQL_QUICK = 362, SQL_IGNORE = 363, SQL_DATABASES = 364, SQL_DATABASE = 365, SQL_CHARACTER = 366, SQL_ADD = 367, SQL_ALL = 368, SQL_AND = 369, SQL_ASC = 370, SQL_CSV = 371, SQL_END = 372, SQL_FOR = 373, SQL_INT = 374, SQL_KEY = 375, SQL_NOT = 376, SQL_OFF = 377, SQL_SET = 378, SQL_TBL = 379, SQL_TOP = 380, SQL_AS = 381, SQL_BY = 382, SQL_IF = 383, SQL_IN = 384, SQL_IS = 385, SQL_OF = 386, SQL_ON = 387, SQL_OR = 388, SQL_TO = 389, SQL_ARRAY = 390, SQL_CONCAT = 391, SQL_ILIKE = 392, SQL_SECOND = 393, SQL_MINUTE = 394, SQL_HOUR = 395, SQL_DAY = 396, SQL_MONTH = 397, SQL_YEAR = 398, SQL_TRUE = 399, SQL_FALSE = 400, SQL_ESCAPED = 401, SQL_DATA = 402, SQL_INFILE = 403, SQL_CONCURRENT = 404, SQL_REPLACE = 405, SQL_PARTITION = 406, SQL_FIELDS = 407, SQL_TERMINATED = 408, SQL_OPTIONALLY = 409, SQL_ENCLOSED = 410, SQL_LINES = 411, SQL_ROWS = 412, SQL_STARTING = 413, SQL_EQUALS = 414, SQL_NOTEQUALS = 415, SQL_LESS = 416, SQL_GREATER = 417, SQL_LESSEQ = 418, SQL_GREATEREQ = 419, SQL_NOTNULL = 420, SQL_UMINUS = 421 }; #endif /* Value type. */ #if ! defined HSQL_STYPE && ! defined HSQL_STYPE_IS_DECLARED union HSQL_STYPE { #line 95 "bison_parser.y" /* yacc.c:1906 */ double fval; int64_t ival; char* sval; uintmax_t uval; bool bval; hsql::SQLStatement* statement; hsql::SelectStatement* select_stmt; hsql::ImportStatement* import_stmt; hsql::CreateStatement* create_stmt; hsql::InsertStatement* insert_stmt; hsql::DeleteStatement* delete_stmt; hsql::UpdateStatement* update_stmt; hsql::DropStatement* drop_stmt; hsql::PrepareStatement* prep_stmt; hsql::AlterStatement* alter_stmt; hsql::ExecuteStatement* exec_stmt; hsql::ShowStatement* show_stmt; hsql::TableName table_name; hsql::DatabaseName db_name; hsql::TableRef* table; hsql::Expr* expr; hsql::OrderDescription* order; hsql::OrderType order_type; hsql::DatetimeField datetime_field; hsql::LimitDescription* limit; hsql::ColumnDefinition* column_t; hsql::ColumnType column_type_t; hsql::GroupByDescription* group_t; hsql::UpdateClause* update_t; hsql::Alias* alias_t; std::vector<hsql::SQLStatement*>* stmt_vec; std::vector<char*>* str_vec; std::vector<hsql::TableRef*>* table_vec; std::vector<hsql::ColumnDefinition*>* column_vec; std::vector<hsql::UpdateClause*>* update_vec; std::vector<hsql::Expr*>* expr_vec; std::vector<hsql::OrderDescription*>* order_vec; #line 302 "bison_parser.h" /* yacc.c:1906 */ }; typedef union HSQL_STYPE HSQL_STYPE; # define HSQL_STYPE_IS_TRIVIAL 1 # define HSQL_STYPE_IS_DECLARED 1 #endif /* Location type. */ #if ! defined HSQL_LTYPE && ! defined HSQL_LTYPE_IS_DECLARED typedef struct HSQL_LTYPE HSQL_LTYPE; struct HSQL_LTYPE { int first_line; int first_column; int last_line; int last_column; }; # define HSQL_LTYPE_IS_DECLARED 1 # define HSQL_LTYPE_IS_TRIVIAL 1 #endif int hsql_parse (hsql::SQLParserResult* result, yyscan_t scanner); #endif /* !YY_HSQL_BISON_PARSER_H_INCLUDED */ 0707010000003E000081A4000003E800000064000000015C0989F300007CF2000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/src/parser/bison_parser.y%{ /** * bison_parser.y * defines bison_parser.h * outputs bison_parser.c * * Grammar File Spec: http://dinosaur.compilertools.net/bison/bison_6.html * */ /********************************* ** Section 1: C Declarations *********************************/ #include "bison_parser.h" #include "flex_lexer.h" #include <stdio.h> #include <string.h> using namespace hsql; int yyerror(YYLTYPE* llocp, SQLParserResult* result, yyscan_t scanner, const char *msg) { result->setIsValid(false); result->setErrorDetails(strdup(msg), llocp->first_line, llocp->first_column); return 0; } %} /********************************* ** Section 2: Bison Parser Declarations *********************************/ // Specify code that is included in the generated .h and .c files %code requires { // %code requires block #include "../../include/sqlparser/statements.h" #include "../../include/sqlparser/SQLParserResult.h" #include "parser_typedef.h" // Auto update column and line number #define YY_USER_ACTION \ yylloc->first_line = yylloc->last_line; \ yylloc->first_column = yylloc->last_column; \ for(int i = 0; yytext[i] != '\0'; i++) { \ yylloc->total_column++; \ yylloc->string_length++; \ if(yytext[i] == '\n') { \ yylloc->last_line++; \ yylloc->last_column = 0; \ } \ else { \ yylloc->last_column++; \ } \ } } // Define the names of the created files (defined in Makefile) // %output "bison_parser.cpp" // %defines "bison_parser.h" // Tell bison to create a reentrant parser %define api.pure full // Prefix the parser %define api.prefix {hsql_} %define api.token.prefix {SQL_} %define parse.error verbose %locations %initial-action { // Initialize @$.first_column = 0; @$.last_column = 0; @$.first_line = 0; @$.last_line = 0; @$.total_column = 0; @$.string_length = 0; }; // Define additional parameters for yylex (http://www.gnu.org/software/bison/manual/html_node/Pure-Calling.html) %lex-param { yyscan_t scanner } // Define additional parameters for yyparse %parse-param { hsql::SQLParserResult* result } %parse-param { yyscan_t scanner } /********************************* ** Define all data-types (http://www.gnu.org/software/bison/manual/html_node/Union-Decl.html) *********************************/ %union { double fval; int64_t ival; char* sval; uintmax_t uval; bool bval; hsql::SQLStatement* statement; hsql::SelectStatement* select_stmt; hsql::ImportStatement* import_stmt; hsql::CreateStatement* create_stmt; hsql::InsertStatement* insert_stmt; hsql::DeleteStatement* delete_stmt; hsql::UpdateStatement* update_stmt; hsql::DropStatement* drop_stmt; hsql::PrepareStatement* prep_stmt; hsql::AlterStatement* alter_stmt; hsql::ExecuteStatement* exec_stmt; hsql::ShowStatement* show_stmt; hsql::TableName table_name; hsql::DatabaseName db_name; hsql::TableRef* table; hsql::Expr* expr; hsql::OrderDescription* order; hsql::OrderType order_type; hsql::DatetimeField datetime_field; hsql::LimitDescription* limit; hsql::ColumnDefinition* column_t; hsql::ColumnType column_type_t; hsql::GroupByDescription* group_t; hsql::UpdateClause* update_t; hsql::Alias* alias_t; std::vector<hsql::SQLStatement*>* stmt_vec; std::vector<char*>* str_vec; std::vector<hsql::TableRef*>* table_vec; std::vector<hsql::ColumnDefinition*>* column_vec; std::vector<hsql::UpdateClause*>* update_vec; std::vector<hsql::Expr*>* expr_vec; std::vector<hsql::OrderDescription*>* order_vec; } /********************************* ** Destructor symbols *********************************/ %destructor { } <fval> <ival> <uval> <bval> <order_type> <datetime_field> <column_type_t> %destructor { free( ($$.name) ); free( ($$.schema) ); } <table_name> %destructor { free( ($$.name) ); } <db_name> %destructor { free( ($$) ); } <sval> %destructor { if (($$) != nullptr) { for (auto ptr : *($$)) { delete ptr; } } delete ($$); } <str_vec> <table_vec> <column_vec> <update_vec> <expr_vec> <order_vec> <stmt_vec> %destructor { delete ($$); } <*> /********************************* ** Token Definition *********************************/ %token <sval> IDENTIFIER STRING %token <fval> FLOATVAL %token <ival> INTVAL /* SQL Keywords */ %token DEALLOCATE PARAMETERS INTERSECT TEMPORARY TIMESTAMP %token DISTINCT NVARCHAR RESTRICT TRUNCATE ANALYZE BETWEEN %token CASCADE COLUMNS CONTROL DEFAULT EXECUTE EXPLAIN %token HISTORY INTEGER NATURAL PREPARE PRIMARY SCHEMAS %token SPATIAL VARCHAR VIRTUAL BEFORE COLUMN CREATE DELETE DIRECT %token DOUBLE ESCAPE EXCEPT EXISTS EXTRACT GLOBAL HAVING IMPORT %token INSERT ISNULL OFFSET RENAME SCHEMA SELECT SORTED %token TABLES UNIQUE UNLOAD UPDATE VALUES AFTER ALTER CROSS %token DELTA FLOAT GROUP INDEX INNER LIMIT LOCAL MERGE MINUS ORDER %token OUTER RIGHT TABLE UNION USING WHERE CALL CASE CHAR DATE %token DESC DROP ELSE FILE FROM FULL HASH HINT INTO JOIN %token LEFT LIKE LOAD LONG NULL PLAN SHOW TEXT THEN TIME %token VIEW WHEN WITH LOW_PRIORITY DELAYED HIGH_PRIORITY %token QUICK IGNORE DATABASES DATABASE CHARACTER ADD ALL AND ASC CSV END FOR INT KEY %token NOT OFF SET TBL TOP AS BY IF IN IS OF ON OR TO %token ARRAY CONCAT ILIKE SECOND MINUTE HOUR DAY MONTH YEAR %token TRUE FALSE %token ESCAPED DATA INFILE CONCURRENT REPLACE PARTITION FIELDS TERMINATED OPTIONALLY %token ENCLOSED LINES ROWS STARTING /********************************* ** Non-Terminal types (http://www.gnu.org/software/bison/manual/html_node/Type-Decl.html) *********************************/ %type <stmt_vec> statement_list %type <statement> statement preparable_statement %type <exec_stmt> execute_statement %type <prep_stmt> prepare_statement %type <select_stmt> select_statement select_with_paren select_no_paren select_clause select_paren_or_clause %type <import_stmt> import_statement load_statement %type <create_stmt> create_statement %type <insert_stmt> insert_statement %type <delete_stmt> delete_statement truncate_statement %type <update_stmt> update_statement %type <drop_stmt> drop_statement %type <show_stmt> show_statement %type <alter_stmt> alter_statement %type <table_name> table_name %type <db_name> db_name %type <sval> file_path prepare_target_query %type <bval> opt_not_exists opt_exists opt_distinct opt_column_nullable opt_temporary %type <bval> opt_low_priority opt_priority opt_quick opt_ignore opt_default opt_equal %type <uval> import_file_type opt_join_type %type <table> opt_from_clause from_clause table_ref table_ref_atomic table_ref_name nonjoin_table_ref_atomic %type <table> join_clause table_ref_name_no_alias %type <expr> expr operand scalar_expr unary_expr binary_expr logic_expr exists_expr extract_expr %type <expr> function_expr between_expr expr_alias param_expr %type <expr> column_name literal int_literal num_literal string_literal bool_literal %type <expr> comp_expr opt_where join_condition opt_having case_expr case_list in_expr hint %type <expr> array_expr array_index null_literal %type <limit> opt_limit opt_top %type <order> order_desc %type <order_type> opt_order_type %type <datetime_field> datetime_field %type <column_t> column_def %type <column_type_t> column_type %type <update_t> update_clause %type <group_t> opt_group %type <alias_t> opt_table_alias table_alias opt_alias alias %type <str_vec> ident_commalist opt_column_list %type <expr_vec> expr_list select_list opt_literal_list literal_list hint_list opt_hints %type <table_vec> table_ref_commalist %type <order_vec> opt_order order_list %type <update_vec> update_clause_commalist %type <column_vec> column_def_commalist /****************************** ** Token Precedence and Associativity ** Precedence: lowest to highest ******************************/ %left OR %left AND %right NOT %nonassoc '=' EQUALS NOTEQUALS LIKE ILIKE %nonassoc '<' '>' LESS GREATER LESSEQ GREATEREQ %nonassoc NOTNULL %nonassoc ISNULL %nonassoc IS /* sets precedence for IS NULL, etc */ %left '+' '-' %left '*' '/' '%' %left '^' %left CONCAT /* Unary Operators */ %right UMINUS %left '[' ']' %left '(' ')' %left '.' %left JOIN %% /********************************* ** Section 3: Grammar Definition *********************************/ // Defines our general input. input: statement_list opt_semicolon { for (SQLStatement* stmt : *$1) { // Transfers ownership of the statement. result->addStatement(stmt); } unsigned param_id = 0; for (void* param : yyloc.param_list) { if (param != nullptr) { Expr* expr = (Expr*) param; expr->ival = param_id; result->addParameter(expr); ++param_id; } } delete $1; } ; statement_list: statement { $1->stringLength = yylloc.string_length; yylloc.string_length = 0; $$ = new std::vector<SQLStatement*>(); $$->push_back($1); } | statement_list ';' statement { $3->stringLength = yylloc.string_length; yylloc.string_length = 0; $1->push_back($3); $$ = $1; } ; statement: prepare_statement opt_hints { $$ = $1; $$->hints = $2; } | preparable_statement opt_hints { $$ = $1; $$->hints = $2; } | show_statement { $$ = $1; } ; preparable_statement: select_statement { $$ = $1; } | import_statement { $$ = $1; } | load_statement { $$ = $1; } | create_statement { $$ = $1; } | insert_statement { $$ = $1; } | delete_statement { $$ = $1; } | alter_statement { $$ = $1; } | truncate_statement { $$ = $1; } | update_statement { $$ = $1; } | drop_statement { $$ = $1; } | execute_statement { $$ = $1; } ; /****************************** * Hints ******************************/ opt_hints: WITH HINT '(' hint_list ')' { $$ = $4; } | /* empty */ { $$ = nullptr; } ; hint_list: hint { $$ = new std::vector<Expr*>(); $$->push_back($1); } | hint_list ',' hint { $1->push_back($3); $$ = $1; } ; hint: IDENTIFIER { $$ = Expr::make(kExprHint); $$->name = $1; } | IDENTIFIER '(' literal_list ')' { $$ = Expr::make(kExprHint); $$->name = $1; $$->exprList = $3; } ; /****************************** * Prepared Statement ******************************/ prepare_statement: PREPARE IDENTIFIER FROM prepare_target_query { $$ = new PrepareStatement(); $$->name = $2; $$->query = $4; } ; prepare_target_query: STRING execute_statement: EXECUTE IDENTIFIER { $$ = new ExecuteStatement(); $$->name = $2; } | EXECUTE IDENTIFIER '(' opt_literal_list ')' { $$ = new ExecuteStatement(); $$->name = $2; $$->parameters = $4; } ; /****************************** * Import Statement ******************************/ import_statement: IMPORT FROM import_file_type FILE file_path INTO table_name { $$ = new ImportStatement((ImportType) $3); $$->filePath = $5; $$->schema = $7.schema; $$->tableName = $7.name; } ; import_file_type: CSV { $$ = kImportCSV; } ; file_path: string_literal { $$ = strdup($1->name); delete $1; } ; /****************************** * LOAD DATA statement * LOAD DATA INFILE 'data.txt' INTO TABLE db2.my_table; ******************************/ load_statement: LOAD DATA opt_low_priority_or_concurrent opt_local INFILE file_path opt_replace_or_ignore INTO TABLE table_name opt_fields_or_columns opt_lines opt_ignore_lines_rows opt_column_list { $$ = new ImportStatement(kImportCSV); $$->filePath = $6; $$->schema = $10.schema; $$->tableName = $10.name; } ; opt_low_priority_or_concurrent: LOW_PRIORITY | CONCURRENT | /* empty */ ; opt_replace_or_ignore: REPLACE | IGNORE | /* empty */ ; opt_local: LOCAL | /* empty */ ; opt_fields_or_columns: FIELDS TERMINATED BY STRING | COLUMNS TERMINATED BY STRING | /* empty */ ; opt_lines: LINES STARTING BY STRING | LINES TERMINATED BY STRING | /* empty */ ; opt_ignore_lines_rows: IGNORE INTVAL LINES | IGNORE INTVAL ROWS | /* empty */ ; /****************************** * Show Statement * SHOW TABLES; * SHOW DATABASES; ******************************/ show_statement: SHOW TABLES { $$ = new ShowStatement(kShowTables); } | SHOW DATABASES { $$ = new ShowStatement(kShowDatabases); } | SHOW COLUMNS table_name { $$ = new ShowStatement(kShowColumns); $$->schema = $3.schema; $$->name = $3.name; } ; /****************************** * Create Statement * CREATE TABLE students (name TEXT, student_number INTEGER, city TEXT, grade DOUBLE) * CREATE TABLE students FROM TBL FILE 'test/students.tbl' * CREATE { DATABASE | SCHEMA } [IF NOT EXISTS] name ******************************/ create_statement: CREATE opt_temporary TABLE opt_not_exists table_name FROM TBL FILE file_path { $$ = new CreateStatement(kCreateTableFromTbl); $$->temporary = $2; $$->ifNotExists = $4; $$->schema = $5.schema; $$->tableName = $5.name; $$->filePath = $9; } | CREATE opt_temporary TABLE opt_not_exists table_name '(' column_def_commalist ')' { $$ = new CreateStatement(kCreateTable); $$->temporary = $2; $$->ifNotExists = $4; $$->schema = $5.schema; $$->tableName = $5.name; $$->columns = $7; } | CREATE VIEW opt_not_exists table_name opt_column_list AS select_statement { $$ = new CreateStatement(kCreateView); $$->ifNotExists = $3; $$->schema = $4.schema; $$->tableName = $4.name; $$->viewColumns = $5; $$->select = $7; } | CREATE DATABASE opt_not_exists db_name { $$ = new CreateStatement(kCreateDatabase); $$->ifNotExists = $3; $$->schema = $4.name; } | CREATE SCHEMA opt_not_exists db_name { $$ = new CreateStatement(kCreateDatabase); $$->ifNotExists = $3; $$->schema = $4.name; } ; opt_temporary: TEMPORARY { $$ = true; } | /* empty */ { $$ = false; } ; opt_not_exists: IF NOT EXISTS { $$ = true; } | /* empty */ { $$ = false; } ; column_def_commalist: column_def { $$ = new std::vector<ColumnDefinition*>(); $$->push_back($1); } | column_def_commalist ',' column_def { $1->push_back($3); $$ = $1; } ; column_def: IDENTIFIER column_type opt_column_nullable { $$ = new ColumnDefinition($1, $2, $3); } ; column_type: INT { $$ = ColumnType{DataType::INT}; } | INTEGER { $$ = ColumnType{DataType::INT}; } | LONG { $$ = ColumnType{DataType::LONG}; } | FLOAT { $$ = ColumnType{DataType::FLOAT}; } | DOUBLE { $$ = ColumnType{DataType::DOUBLE}; } | VARCHAR '(' INTVAL ')' { $$ = ColumnType{DataType::VARCHAR, $3}; } | CHAR '(' INTVAL ')' { $$ = ColumnType{DataType::CHAR, $3}; } | TEXT { $$ = ColumnType{DataType::TEXT}; } ; opt_column_nullable: NULL { $$ = true; } | NOT NULL { $$ = false; } | /* empty */ { $$ = false; } ; /****************************** * Drop Statement * DROP TABLE students; * DROP DATABASE IF EXISTS db_name; * DEALLOCATE PREPARE stmt; ******************************/ drop_statement: DROP TABLE opt_exists table_name { $$ = new DropStatement(kDropTable); $$->ifExists = $3; $$->schema = $4.schema; $$->name = $4.name; } | DROP VIEW opt_exists table_name { $$ = new DropStatement(kDropView); $$->ifExists = $3; $$->schema = $4.schema; $$->name = $4.name; } | DROP DATABASE opt_exists db_name { $$ = new DropStatement(kDropDatabase); $$->ifExists = $3; $$->name = $4.name; } | DEALLOCATE PREPARE IDENTIFIER { $$ = new DropStatement(kDropPreparedStatement); $$->ifExists = false; $$->name = $3; } ; opt_exists: IF EXISTS { $$ = true; } | /* empty */ { $$ = false; } ; /****************************** * Delete Statement / Truncate statement * DELETE FROM students WHERE grade > 3.0 * DELETE FROM students <=> TRUNCATE students ******************************/ delete_statement: DELETE opt_low_priority opt_quick opt_ignore FROM table_name opt_where { $$ = new DeleteStatement(); $$->low_priority = $2; $$->quick = $3; $$->ignore = $4; $$->schema = $6.schema; $$->tableName = $6.name; $$->expr = $7; } ; opt_low_priority: LOW_PRIORITY { $$ = true; } | /* empty */ { $$ = false; } ; opt_quick: QUICK { $$ = true; } | /* empty */ { $$ = false; } ; opt_ignore: IGNORE { $$ = true; } | /* empty */ { $$ = false; } ; truncate_statement: TRUNCATE table_name { $$ = new DeleteStatement(); $$->schema = $2.schema; $$->tableName = $2.name; } ; /****************************** * Insert Statement * INSERT INTO students VALUES ('Max', 1112233, 'Musterhausen', 2.3) * INSERT INTO employees SELECT * FROM stundents ******************************/ insert_statement: INSERT opt_priority opt_ignore INTO table_name opt_column_list VALUES '(' literal_list ')' { $$ = new InsertStatement(kInsertValues); $$->priority = $2; $$->ignore = $3; $$->schema = $5.schema; $$->tableName = $5.name; $$->columns = $6; $$->values = $9; } | INSERT opt_priority opt_ignore INTO table_name opt_column_list select_no_paren { $$ = new InsertStatement(kInsertSelect); $$->priority = $2; $$->ignore = $3; $$->schema = $5.schema; $$->tableName = $5.name; $$->columns = $6; $$->select = $7; } ; opt_priority: LOW_PRIORITY { $$ = true; } | DELAYED { $$ = true; } | HIGH_PRIORITY { $$ = true; } | /* empty */ { $$ = false; } ; opt_column_list: '(' ident_commalist ')' { $$ = $2; } | /* empty */ { $$ = nullptr; } ; /****************************** * Update Statement * UPDATE students SET grade = 1.3, name='Felix Fürstenberg' WHERE name = 'Max Mustermann'; ******************************/ update_statement: UPDATE opt_low_priority opt_ignore table_ref_name_no_alias SET update_clause_commalist opt_where { $$ = new UpdateStatement(); $$->low_priority = $2; $$->ignore = $3; $$->table = $4; $$->updates = $6; $$->where = $7; } ; update_clause_commalist: update_clause { $$ = new std::vector<UpdateClause*>(); $$->push_back($1); } | update_clause_commalist ',' update_clause { $1->push_back($3); $$ = $1; } ; update_clause: IDENTIFIER '=' expr { $$ = new UpdateClause(); $$->column = $1; $$->value = $3; } ; /****************************** * Alter Statement * ALTER DATABASE db_name CHARACTER SET charset_name * ALTER SCHEMA db_name CHARACTER SET charset_name * ALTER TABLE table_name ADD column ******************************/ alter_statement: ALTER DATABASE db_name opt_default CHARACTER SET opt_equal expr { $$ = new AlterStatement(kAlterDatabase); $$->schema = $3.name; $$->dflt = $4; $$->equal = $7; $$->charsetName = $8; } | ALTER SCHEMA db_name opt_default CHARACTER SET opt_equal expr { $$ = new AlterStatement(kAlterSchema); $$->schema = $3.name; $$->dflt = $4; $$->equal = $7; $$->charsetName = $8; } | ALTER TABLE table_name ADD COLUMN column_def { $$ = new AlterStatement(kAlterTable); $$->tableName = $3.name; $$->columns = $6; } ; opt_default: DEFAULT { $$ = true; } | /* empty */ { $$ = false; } ; opt_equal: '=' { $$ = true; } | /* empty */ { $$ = false; } ; /****************************** * Select Statement ******************************/ select_statement: select_with_paren | select_no_paren | select_with_paren set_operator select_paren_or_clause opt_order opt_limit { // TODO: allow multiple unions (through linked list) // TODO: capture type of set_operator // TODO: might overwrite order and limit of first select here $$ = $1; $$->unionSelect = $3; $$->order = $4; // Limit could have been set by TOP. if ($5 != nullptr) { delete $$->limit; $$->limit = $5; } } ; select_with_paren: '(' select_no_paren ')' { $$ = $2; } | '(' select_with_paren ')' { $$ = $2; } ; select_paren_or_clause: select_with_paren | select_clause ; select_no_paren: select_clause opt_order opt_limit { $$ = $1; $$->order = $2; // Limit could have been set by TOP. if ($3 != nullptr) { delete $$->limit; $$->limit = $3; } } | select_clause set_operator select_paren_or_clause opt_order opt_limit { // TODO: allow multiple unions (through linked list) // TODO: capture type of set_operator // TODO: might overwrite order and limit of first select here $$ = $1; $$->unionSelect = $3; $$->order = $4; // Limit could have been set by TOP. if ($5 != nullptr) { delete $$->limit; $$->limit = $5; } } ; set_operator: set_type opt_all ; set_type: UNION | INTERSECT | EXCEPT ; opt_all: ALL | /* empty */ ; select_clause: SELECT opt_top opt_distinct select_list opt_from_clause opt_where opt_group { $$ = new SelectStatement(); $$->limit = $2; $$->selectDistinct = $3; $$->selectList = $4; $$->fromTable = $5; $$->whereClause = $6; $$->groupBy = $7; } ; opt_distinct: DISTINCT { $$ = true; } | /* empty */ { $$ = false; } ; select_list: expr_list ; opt_from_clause: from_clause { $$ = $1; } | /* empty */ { $$ = nullptr; } from_clause: FROM table_ref { $$ = $2; } ; opt_where: WHERE expr { $$ = $2; } | /* empty */ { $$ = nullptr; } ; opt_group: GROUP BY expr_list opt_having { $$ = new GroupByDescription(); $$->columns = $3; $$->having = $4; } | /* empty */ { $$ = nullptr; } ; opt_having: HAVING expr { $$ = $2; } | /* empty */ { $$ = nullptr; } opt_order: ORDER BY order_list { $$ = $3; } | /* empty */ { $$ = nullptr; } ; order_list: order_desc { $$ = new std::vector<OrderDescription*>(); $$->push_back($1); } | order_list ',' order_desc { $1->push_back($3); $$ = $1; } ; order_desc: expr opt_order_type { $$ = new OrderDescription($2, $1); } ; opt_order_type: ASC { $$ = kOrderAsc; } | DESC { $$ = kOrderDesc; } | /* empty */ { $$ = kOrderAsc; } ; // TODO: TOP and LIMIT can take more than just int literals. opt_top: TOP int_literal { $$ = new LimitDescription($2->ival, kNoOffset); delete $2; } | /* empty */ { $$ = nullptr; } ; opt_limit: LIMIT int_literal { $$ = new LimitDescription($2->ival, kNoOffset); delete $2; } | LIMIT int_literal OFFSET int_literal { $$ = new LimitDescription($2->ival, $4->ival); delete $2; delete $4; } | OFFSET int_literal { $$ = new LimitDescription(kNoLimit, $2->ival); delete $2; } | LIMIT ALL { $$ = nullptr; } | LIMIT NULL { $$ = nullptr; } | LIMIT ALL OFFSET int_literal { $$ = new LimitDescription(kNoLimit, $4->ival); delete $4; } | LIMIT NULL OFFSET int_literal { $$ = new LimitDescription(kNoLimit, $4->ival); delete $4; } | /* empty */ { $$ = nullptr; } ; /****************************** * Expressions ******************************/ expr_list: expr_alias { $$ = new std::vector<Expr*>(); $$->push_back($1); } | expr_list ',' expr_alias { $1->push_back($3); $$ = $1; } ; opt_literal_list: literal_list { $$ = $1; } | /* empty */ { $$ = nullptr; } ; literal_list: literal { $$ = new std::vector<Expr*>(); $$->push_back($1); } | literal_list ',' literal { $1->push_back($3); $$ = $1; } ; expr_alias: expr opt_alias { $$ = $1; if ($2) { $$->alias = strdup($2->name); delete $2; } } ; expr: operand | between_expr | logic_expr | exists_expr | in_expr ; operand: '(' expr ')' { $$ = $2; } | array_index | scalar_expr | unary_expr | binary_expr | case_expr | function_expr | extract_expr | array_expr | '(' select_no_paren ')' { $$ = Expr::makeSelect($2); } ; scalar_expr: column_name | literal ; unary_expr: '-' operand { $$ = Expr::makeOpUnary(kOpUnaryMinus, $2); } | NOT operand { $$ = Expr::makeOpUnary(kOpNot, $2); } | operand ISNULL { $$ = Expr::makeOpUnary(kOpIsNull, $1); } | operand IS NULL { $$ = Expr::makeOpUnary(kOpIsNull, $1); } | operand IS NOT NULL { $$ = Expr::makeOpUnary(kOpNot, Expr::makeOpUnary(kOpIsNull, $1)); } ; binary_expr: comp_expr | operand '-' operand { $$ = Expr::makeOpBinary($1, kOpMinus, $3); } | operand '+' operand { $$ = Expr::makeOpBinary($1, kOpPlus, $3); } | operand '/' operand { $$ = Expr::makeOpBinary($1, kOpSlash, $3); } | operand '*' operand { $$ = Expr::makeOpBinary($1, kOpAsterisk, $3); } | operand '%' operand { $$ = Expr::makeOpBinary($1, kOpPercentage, $3); } | operand '^' operand { $$ = Expr::makeOpBinary($1, kOpCaret, $3); } | operand LIKE operand { $$ = Expr::makeOpBinary($1, kOpLike, $3); } | operand NOT LIKE operand { $$ = Expr::makeOpBinary($1, kOpNotLike, $4); } | operand ILIKE operand { $$ = Expr::makeOpBinary($1, kOpILike, $3); } | operand CONCAT operand { $$ = Expr::makeOpBinary($1, kOpConcat, $3); } ; logic_expr: expr AND expr { $$ = Expr::makeOpBinary($1, kOpAnd, $3); } | expr OR expr { $$ = Expr::makeOpBinary($1, kOpOr, $3); } ; in_expr: operand IN '(' expr_list ')' { $$ = Expr::makeInOperator($1, $4); } | operand NOT IN '(' expr_list ')' { $$ = Expr::makeOpUnary(kOpNot, Expr::makeInOperator($1, $5)); } | operand IN '(' select_no_paren ')' { $$ = Expr::makeInOperator($1, $4); } | operand NOT IN '(' select_no_paren ')' { $$ = Expr::makeOpUnary(kOpNot, Expr::makeInOperator($1, $5)); } ; // CASE grammar based on: flex & bison by John Levine // https://www.safaribooksonline.com/library/view/flex-bison/9780596805418/ch04.html#id352665 case_expr: CASE expr case_list END { $$ = Expr::makeCase($2, $3, nullptr); } | CASE expr case_list ELSE expr END { $$ = Expr::makeCase($2, $3, $5); } | CASE case_list END { $$ = Expr::makeCase(nullptr, $2, nullptr); } | CASE case_list ELSE expr END { $$ = Expr::makeCase(nullptr, $2, $4); } ; case_list: WHEN expr THEN expr { $$ = Expr::makeCaseList(Expr::makeCaseListElement($2, $4)); } | case_list WHEN expr THEN expr { $$ = Expr::caseListAppend($1, Expr::makeCaseListElement($3, $5)); } ; exists_expr: EXISTS '(' select_no_paren ')' { $$ = Expr::makeExists($3); } | NOT EXISTS '(' select_no_paren ')' { $$ = Expr::makeOpUnary(kOpNot, Expr::makeExists($4)); } ; comp_expr: operand '=' operand { $$ = Expr::makeOpBinary($1, kOpEquals, $3); } | operand EQUALS operand { $$ = Expr::makeOpBinary($1, kOpEquals, $3); } | operand NOTEQUALS operand { $$ = Expr::makeOpBinary($1, kOpNotEquals, $3); } | operand '<' operand { $$ = Expr::makeOpBinary($1, kOpLess, $3); } | operand '>' operand { $$ = Expr::makeOpBinary($1, kOpGreater, $3); } | operand LESSEQ operand { $$ = Expr::makeOpBinary($1, kOpLessEq, $3); } | operand GREATEREQ operand { $$ = Expr::makeOpBinary($1, kOpGreaterEq, $3); } ; function_expr: IDENTIFIER '(' ')' { $$ = Expr::makeFunctionRef($1, new std::vector<Expr*>(), false); } | IDENTIFIER '(' opt_distinct expr_list ')' { $$ = Expr::makeFunctionRef($1, $4, $3); } ; extract_expr: EXTRACT '(' datetime_field FROM expr ')' { $$ = Expr::makeExtract($3, $5); } ; datetime_field: SECOND { $$ = kDatetimeSecond; } | MINUTE { $$ = kDatetimeMinute; } | HOUR { $$ = kDatetimeHour; } | DAY { $$ = kDatetimeDay; } | MONTH { $$ = kDatetimeMonth; } | YEAR { $$ = kDatetimeYear; } array_expr: ARRAY '[' expr_list ']' { $$ = Expr::makeArray($3); } ; array_index: operand '[' int_literal ']' { $$ = Expr::makeArrayIndex($1, $3->ival); } ; between_expr: operand BETWEEN operand AND operand { $$ = Expr::makeBetween($1, $3, $5); } ; column_name: IDENTIFIER { $$ = Expr::makeColumnRef($1); } | IDENTIFIER '.' IDENTIFIER { $$ = Expr::makeColumnRef($1, $3); } | '*' { $$ = Expr::makeStar(); } | IDENTIFIER '.' '*' { $$ = Expr::makeStar($1); } ; literal: string_literal | bool_literal | num_literal | null_literal | param_expr ; string_literal: STRING { $$ = Expr::makeLiteral($1); } ; bool_literal: TRUE { $$ = Expr::makeLiteral(true); } | FALSE { $$ = Expr::makeLiteral(false); } ; num_literal: FLOATVAL { $$ = Expr::makeLiteral($1); } | int_literal ; int_literal: INTVAL { $$ = Expr::makeLiteral($1); } ; null_literal: NULL { $$ = Expr::makeNullLiteral(); } ; param_expr: '?' { $$ = Expr::makeParameter(yylloc.total_column); $$->ival2 = yyloc.param_list.size(); yyloc.param_list.push_back($$); } ; /****************************** * Table ******************************/ table_ref: table_ref_atomic | table_ref_commalist ',' table_ref_atomic { $1->push_back($3); auto tbl = new TableRef(kTableCrossProduct); tbl->list = $1; $$ = tbl; } ; table_ref_atomic: nonjoin_table_ref_atomic | join_clause ; nonjoin_table_ref_atomic: table_ref_name | '(' select_statement ')' opt_table_alias { auto tbl = new TableRef(kTableSelect); tbl->select = $2; tbl->alias = $4; $$ = tbl; } ; table_ref_commalist: table_ref_atomic { $$ = new std::vector<TableRef*>(); $$->push_back($1); } | table_ref_commalist ',' table_ref_atomic { $1->push_back($3); $$ = $1; } ; table_ref_name: table_name opt_table_alias { auto tbl = new TableRef(kTableName); tbl->schema = $1.schema; tbl->name = $1.name; tbl->alias = $2; $$ = tbl; } ; table_ref_name_no_alias: table_name { $$ = new TableRef(kTableName); $$->schema = $1.schema; $$->name = $1.name; } ; table_name: IDENTIFIER { $$.schema = nullptr; $$.name = $1;} | IDENTIFIER '.' IDENTIFIER { $$.schema = $1; $$.name = $3; } ; db_name: IDENTIFIER {$$.name = $1;} ; table_alias: alias | AS IDENTIFIER '(' ident_commalist ')' { $$ = new Alias($2, $4); } ; opt_table_alias: table_alias | /* empty */ { $$ = nullptr; } alias: AS IDENTIFIER { $$ = new Alias($2); } | IDENTIFIER { $$ = new Alias($1); } ; opt_alias: alias | /* empty */ { $$ = nullptr; } /****************************** * Join Statements ******************************/ join_clause: table_ref_atomic NATURAL JOIN nonjoin_table_ref_atomic { $$ = new TableRef(kTableJoin); $$->join = new JoinDefinition(); $$->join->type = kJoinNatural; $$->join->left = $1; $$->join->right = $4; } | table_ref_atomic opt_join_type JOIN table_ref_atomic ON join_condition { $$ = new TableRef(kTableJoin); $$->join = new JoinDefinition(); $$->join->type = (JoinType) $2; $$->join->left = $1; $$->join->right = $4; $$->join->condition = $6; } | table_ref_atomic opt_join_type JOIN table_ref_atomic USING '(' column_name ')' { $$ = new TableRef(kTableJoin); $$->join = new JoinDefinition(); $$->join->type = (JoinType) $2; $$->join->left = $1; $$->join->right = $4; auto left_col = Expr::makeColumnRef(strdup($7->name)); if ($7->alias != nullptr) left_col->alias = strdup($7->alias); if ($1->getName() != nullptr) left_col->table = strdup($1->getName()); auto right_col = Expr::makeColumnRef(strdup($7->name)); if ($7->alias != nullptr) right_col->alias = strdup($7->alias); if ($4->getName() != nullptr) right_col->table = strdup($4->getName()); $$->join->condition = Expr::makeOpBinary(left_col, kOpEquals, right_col); delete $7; } ; opt_join_type: INNER { $$ = kJoinInner; } | LEFT OUTER { $$ = kJoinLeft; } | LEFT { $$ = kJoinLeft; } | RIGHT OUTER { $$ = kJoinRight; } | RIGHT { $$ = kJoinRight; } | FULL OUTER { $$ = kJoinFull; } | OUTER { $$ = kJoinFull; } | FULL { $$ = kJoinFull; } | CROSS { $$ = kJoinCross; } | /* empty, default */ { $$ = kJoinInner; } ; join_condition: expr ; /****************************** * Misc ******************************/ opt_semicolon: ';' | /* empty */ ; ident_commalist: IDENTIFIER { $$ = new std::vector<char*>(); $$->push_back($1); } | ident_commalist ',' IDENTIFIER { $1->push_back($3); $$ = $1; } ; %% /********************************* ** Section 4: Additional C code *********************************/ /* empty */ 0707010000003F000081A4000003E800000064000000015C0989F300026AFB000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/src/parser/flex_lexer.cpp#line 2 "flex_lexer.cpp" #line 4 "flex_lexer.cpp" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 #define YY_FLEX_SUBMINOR_VERSION 0 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include <stdio.h> #include <string.h> #include <errno.h> #include <stdlib.h> /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include <inttypes.h> typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T #define YY_TYPEDEF_YY_SCANNER_T typedef void* yyscan_t; #endif /* For convenience, these vars (plus the bison vars far below) are macros in the reentrant scanner. */ #define yyin yyg->yyin_r #define yyout yyg->yyout_r #define yyextra yyg->yyextra_r #define yyleng yyg->yyleng_r #define yytext yyg->yytext_r #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) #define yy_flex_debug yyg->yy_flex_debug_r /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yyg->yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yyg->yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE hsql_restart(yyin ,yyscanner ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = yyg->yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via hsql_restart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] void hsql_restart (FILE *input_file ,yyscan_t yyscanner ); void hsql__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); YY_BUFFER_STATE hsql__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); void hsql__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); void hsql__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); void hsql_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); void hsql_pop_buffer_state (yyscan_t yyscanner ); static void hsql_ensure_buffer_stack (yyscan_t yyscanner ); static void hsql__load_buffer_state (yyscan_t yyscanner ); static void hsql__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); #define YY_FLUSH_BUFFER hsql__flush_buffer(YY_CURRENT_BUFFER ,yyscanner) YY_BUFFER_STATE hsql__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE hsql__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); YY_BUFFER_STATE hsql__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); void *hsql_alloc (yy_size_t ,yyscan_t yyscanner ); void *hsql_realloc (void *,yy_size_t ,yyscan_t yyscanner ); void hsql_free (void * ,yyscan_t yyscanner ); #define yy_new_buffer hsql__create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ hsql_ensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ hsql__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ hsql_ensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ hsql__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define hsql_wrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; typedef int yy_state_type; #define yytext_ptr yytext_r static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); static int yy_get_next_buffer (yyscan_t yyscanner ); #if defined(__GNUC__) && __GNUC__ >= 3 __attribute__((__noreturn__)) #endif static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yyg->yytext_ptr = yy_bp; \ yyleng = (size_t) (yy_cp - yy_bp); \ yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; #define YY_NUM_RULES 174 #define YY_END_OF_BUFFER 175 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[1250] = { 0, 0, 0, 171, 171, 2, 2, 175, 173, 4, 4, 173, 173, 162, 169, 162, 162, 165, 162, 162, 162, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 173, 162, 171, 172, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 157, 0, 1, 165, 164, 163, 159, 158, 156, 160, 168, 168, 168, 168, 168, 168, 129, 168, 130, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 131, 168, 168, 168, 132, 133, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 134, 135, 168, 136, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 137, 168, 168, 168, 168, 168, 168, 168, 168, 168, 0, 161, 171, 170, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 166, 163, 115, 168, 116, 168, 168, 117, 168, 118, 168, 168, 168, 168, 168, 168, 168, 168, 168, 119, 168, 141, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 120, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 121, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 122, 168, 168, 123, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 124, 168, 168, 125, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 126, 168, 168, 168, 168, 168, 127, 168, 168, 168, 168, 168, 128, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 167, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 168, 168, 168, 168, 168, 168, 85, 168, 86, 87, 168, 168, 168, 168, 168, 88, 89, 168, 168, 168, 168, 168, 90, 168, 168, 168, 91, 92, 168, 168, 168, 168, 168, 168, 168, 168, 168, 94, 168, 95, 96, 168, 168, 97, 168, 168, 98, 168, 140, 168, 168, 168, 168, 168, 168, 168, 168, 99, 168, 100, 101, 102, 168, 168, 104, 168, 105, 168, 168, 168, 168, 168, 106, 168, 168, 168, 168, 168, 168, 168, 107, 168, 168, 168, 168, 168, 168, 168, 154, 168, 168, 168, 108, 168, 168, 168, 168, 168, 168, 109, 110, 111, 144, 168, 168, 168, 168, 168, 168, 168, 168, 112, 168, 113, 168, 114, 143, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 64, 65, 168, 66, 168, 168, 168, 168, 168, 168, 168, 168, 67, 168, 168, 168, 168, 168, 68, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 145, 168, 69, 168, 70, 168, 168, 168, 168, 103, 168, 71, 168, 72, 168, 168, 168, 168, 73, 153, 74, 168, 75, 76, 168, 142, 168, 168, 168, 168, 77, 78, 168, 168, 168, 168, 79, 168, 168, 168, 80, 168, 168, 168, 168, 168, 168, 81, 168, 168, 168, 168, 82, 168, 168, 168, 83, 168, 168, 168, 84, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 168, 37, 168, 168, 168, 38, 168, 168, 39, 168, 168, 168, 168, 40, 41, 168, 42, 168, 43, 45, 168, 46, 168, 168, 149, 48, 49, 168, 168, 50, 51, 93, 52, 168, 168, 53, 168, 139, 168, 168, 54, 168, 168, 168, 168, 168, 55, 168, 168, 56, 138, 57, 58, 168, 168, 59, 168, 168, 168, 168, 60, 61, 62, 63, 168, 168, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 19, 20, 21, 168, 22, 168, 23, 168, 168, 24, 25, 168, 168, 44, 26, 27, 47, 168, 28, 29, 168, 168, 30, 168, 168, 168, 168, 31, 32, 147, 168, 33, 34, 168, 168, 168, 168, 168, 35, 36, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 168, 168, 14, 168, 15, 152, 168, 168, 168, 16, 168, 168, 168, 17, 155, 168, 168, 168, 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 12, 168, 13, 168, 168, 9, 168, 168, 168, 148, 10, 168, 11, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 146, 7, 168, 168, 151, 8, 150, 2, 2, 2, 2, 2, 2, 2, 168, 168, 2, 2, 168, 6, 2, 2, 5, 2, 0 } ; static yyconst YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, 1, 1, 6, 1, 7, 6, 6, 6, 6, 6, 8, 9, 6, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 6, 6, 11, 12, 13, 6, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 6, 1, 6, 6, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 6, 69, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst YY_CHAR yy_meta[70] = { 0, 1, 1, 2, 1, 3, 1, 4, 1, 1, 5, 1, 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1 } ; static yyconst flex_uint16_t yy_base[1259] = { 0, 0, 0, 508, 488, 69, 0, 492, 4984, 137, 139, 411, 0, 4984, 4984, 135, 391, 137, 136, 386, 382, 0, 132, 132, 140, 138, 149, 201, 142, 189, 245, 127, 144, 188, 190, 213, 254, 236, 131, 234, 301, 349, 283, 244, 275, 187, 0, 321, 0, 380, 0, 218, 220, 371, 335, 0, 0, 221, 314, 216, 291, 295, 293, 409, 478, 530, 583, 636, 685, 738, 289, 409, 787, 290, 303, 406, 407, 840, 889, 462, 341, 408, 940, 993, 484, 542, 560, 315, 250, 214, 330, 4984, 275, 4984, 343, 265, 259, 4984, 4984, 4984, 4984, 0, 242, 293, 335, 359, 306, 328, 473, 0, 358, 352, 413, 414, 339, 463, 580, 467, 344, 405, 407, 526, 425, 602, 418, 533, 479, 481, 489, 534, 535, 537, 581, 633, 533, 0, 545, 552, 588, 681, 592, 601, 590, 615, 642, 663, 624, 630, 634, 640, 643, 662, 677, 687, 0, 676, 694, 683, 689, 707, 707, 708, 732, 723, 710, 726, 757, 727, 734, 753, 754, 755, 756, 785, 781, 776, 774, 774, 795, 798, 799, 798, 806, 810, 799, 824, 212, 4984, 0, 4984, 0, 383, 0, 245, 0, 440, 233, 228, 0, 0, 0, 0, 843, 845, 867, 879, 925, 916, 855, 919, 849, 956, 981, 1007, 972, 995, 1030, 1083, 1019, 1037, 1026, 1052, 1088, 1093, 1144, 1082, 1126, 1129, 1132, 1143, 1158, 1169, 1175, 1182, 1212, 1076, 974, 1200, 1211, 1205, 1262, 1236, 1218, 1247, 1268, 1272, 1325, 1274, 1298, 1319, 1312, 1337, 1341, 1354, 1363, 1265, 1366, 1388, 1375, 1384, 1400, 1401, 1406, 1430, 1417, 1283, 1440, 1455, 1446, 1473, 1480, 1489, 1482, 1492, 1516, 1379, 1511, 1495, 1522, 1541, 1526, 1551, 1565, 1562, 1560, 1577, 1591, 172, 0, 4984, 198, 0, 846, 0, 852, 869, 0, 917, 0, 921, 940, 973, 1140, 1015, 1033, 1108, 1074, 1057, 0, 1435, 0, 1102, 1126, 1602, 1130, 1162, 1186, 1254, 1247, 1314, 1323, 0, 1348, 1370, 1479, 1542, 1551, 1554, 1554, 1574, 1594, 1605, 0, 1596, 1600, 1615, 1598, 1613, 1614, 1618, 1608, 1609, 1614, 1618, 1625, 1623, 1634, 1632, 1637, 1638, 1643, 1625, 1638, 0, 1633, 1650, 1650, 1657, 1659, 1664, 1661, 135, 1665, 1652, 1655, 1656, 0, 1666, 1661, 1663, 1675, 1680, 1683, 1688, 1678, 1678, 1682, 1694, 1697, 1687, 1682, 1696, 1690, 1706, 1699, 1710, 0, 1695, 1699, 1701, 1706, 1716, 0, 1713, 1718, 1713, 1720, 1730, 0, 1736, 1723, 1729, 1744, 1734, 1730, 1750, 1731, 1735, 1746, 1750, 1747, 4984, 0, 149, 1762, 1765, 1766, 1769, 1772, 1775, 1784, 1791, 1796, 1809, 1798, 1830, 1825, 1815, 1849, 1852, 1840, 1842, 1865, 1851, 1867, 1898, 1905, 1883, 1884, 1908, 1910, 1934, 1896, 1940, 1921, 1943, 1937, 1952, 1970, 1959, 1961, 1983, 1986, 1976, 1999, 2008, 2022, 2013, 2029, 2035, 2040, 2062, 2064, 2065, 2076, 2086, 2087, 2103, 2101, 2098, 2116, 2102, 2132, 2133, 2138, 2147, 2142, 2157, 2145, 2159, 2168, 2198, 2203, 2174, 2189, 2208, 2213, 2215, 2224, 2214, 2247, 2253, 2250, 2265, 2259, 2260, 2290, 2291, 2304, 2309, 2322, 2303, 2334, 2340, 2344, 2353, 2346, 2376, 2359, 2365, 2371, 2390, 2400, 2403, 2402, 2378, 2421, 2427, 2425, 2452, 2434, 2436, 2457, 2471, 2476, 2478, 2488, 2487, 2492, 2510, 2517, 2533, 2544, 2521, 0, 1873, 1878, 1907, 1944, 1964, 2010, 0, 2020, 0, 2021, 2038, 2037, 2059, 2074, 2127, 2158, 0, 2171, 2176, 2201, 2233, 2259, 0, 2276, 2280, 2314, 0, 0, 2320, 2324, 2345, 2364, 2396, 2446, 2469, 2467, 2502, 0, 2507, 0, 0, 2527, 2516, 0, 2530, 113, 0, 2533, 0, 2535, 2552, 2541, 2538, 2552, 2550, 2553, 2566, 0, 2566, 0, 0, 0, 2562, 2564, 0, 2576, 0, 2573, 2586, 2574, 2587, 2580, 0, 2597, 2597, 2588, 2586, 2587, 2594, 2599, 0, 2608, 2612, 2603, 2602, 2617, 2602, 2604, 0, 2612, 2613, 2626, 0, 2629, 2629, 2619, 2635, 2629, 2636, 0, 0, 2628, 0, 2646, 2636, 2630, 2653, 2636, 2651, 2654, 2652, 0, 2640, 0, 2658, 0, 0, 2665, 2675, 2669, 2671, 2687, 2676, 2690, 2702, 2692, 2705, 2731, 2721, 2714, 2732, 2743, 2748, 2736, 2754, 2770, 2772, 2788, 2781, 2787, 2797, 2806, 2804, 2793, 2799, 2830, 2833, 2837, 2843, 2849, 2846, 2855, 2860, 2890, 2873, 2884, 2886, 2895, 2900, 2902, 2905, 2926, 2909, 2916, 2939, 2940, 2942, 2945, 2956, 2952, 2975, 2966, 2978, 3009, 2985, 3008, 2992, 2996, 3018, 3027, 3021, 3025, 3051, 3032, 3048, 3034, 3074, 3064, 3065, 3077, 3083, 3090, 3104, 3107, 3108, 3126, 3119, 3130, 3133, 3144, 3159, 3163, 3170, 3160, 3169, 3175, 3196, 3200, 3215, 3182, 3186, 3222, 3225, 3219, 3236, 3229, 3231, 3238, 3255, 3252, 3262, 3276, 3271, 3298, 3292, 3309, 3305, 3314, 3308, 3327, 3321, 3330, 3331, 3332, 0, 0, 2645, 0, 2680, 2766, 2829, 2921, 2952, 2989, 3062, 3115, 0, 3181, 3255, 3271, 3295, 3316, 0, 3323, 3339, 3354, 3347, 3363, 3349, 3350, 3353, 3364, 3372, 0, 3358, 0, 3366, 0, 3372, 3366, 3368, 3383, 0, 3369, 0, 3385, 0, 3371, 3387, 3374, 3383, 0, 0, 0, 3381, 0, 0, 3397, 0, 3403, 3400, 3389, 3397, 0, 0, 3407, 3393, 3397, 3404, 0, 3419, 3422, 3417, 0, 3427, 3425, 3411, 3429, 3433, 3426, 3419, 3424, 3430, 3425, 3445, 0, 3442, 3444, 3444, 0, 3432, 3454, 3457, 0, 3455, 3459, 3464, 3460, 3462, 3466, 3477, 3491, 3500, 3502, 3496, 3473, 3498, 3527, 3532, 3529, 3533, 3538, 3545, 3554, 3559, 3556, 3571, 3572, 3583, 3590, 3594, 3612, 3617, 3601, 3627, 3628, 3639, 3630, 3651, 3652, 3657, 3634, 3664, 3668, 3666, 3673, 3689, 3695, 3702, 3704, 3706, 3707, 3708, 3719, 3720, 3725, 3729, 3731, 3742, 3764, 3763, 3765, 3769, 3775, 3776, 3781, 3787, 3805, 3814, 3800, 3816, 3821, 3839, 3832, 3854, 3838, 3857, 3876, 3888, 3879, 3881, 3893, 3910, 3917, 3894, 3915, 3920, 3926, 3931, 3944, 3955, 3956, 3961, 3950, 3535, 0, 3558, 3578, 3729, 3744, 3758, 3775, 0, 3784, 3842, 3830, 3862, 0, 0, 3865, 0, 3870, 3940, 0, 3949, 0, 3953, 3951, 0, 0, 0, 3958, 3953, 0, 0, 0, 0, 3969, 3986, 0, 3983, 0, 3981, 3995, 0, 3997, 3980, 3992, 4000, 3982, 0, 4005, 4008, 3993, 0, 0, 0, 4001, 4002, 0, 4016, 4017, 4021, 4003, 0, 0, 0, 0, 4007, 4015, 4027, 4029, 4042, 4032, 4038, 4054, 4043, 4065, 4067, 4069, 4078, 4088, 4110, 4092, 4094, 4101, 4105, 4119, 4124, 4128, 4134, 4135, 4141, 4145, 4146, 4157, 4159, 4171, 4170, 4175, 4180, 4181, 4186, 4197, 4196, 4202, 4211, 4213, 4220, 4236, 4226, 4251, 4237, 4249, 4242, 4258, 4263, 4267, 4294, 4282, 4273, 4288, 4289, 4298, 4303, 4307, 4329, 4332, 4338, 4339, 4341, 4343, 4344, 4345, 4368, 4378, 0, 0, 0, 4031, 0, 4164, 0, 4272, 4280, 0, 0, 4304, 4349, 0, 0, 0, 0, 4370, 0, 0, 4377, 4369, 0, 4370, 4377, 4390, 4384, 0, 0, 0, 4380, 0, 0, 4395, 4386, 4385, 4393, 4404, 0, 0, 4410, 4414, 4415, 4417, 4419, 4420, 4421, 4424, 4450, 4431, 4433, 4456, 4455, 4457, 4460, 4466, 4473, 4487, 4489, 4490, 4502, 4496, 4492, 4513, 4525, 4511, 4536, 4523, 4527, 4529, 4548, 4542, 4552, 4565, 4566, 4582, 4581, 4578, 4583, 4588, 4395, 4578, 4578, 4584, 0, 0, 4594, 4590, 4599, 0, 4611, 4606, 4612, 0, 0, 4602, 4623, 4613, 0, 4628, 4634, 4639, 4645, 4635, 4638, 4664, 4657, 4678, 4675, 4689, 4694, 4690, 4701, 4708, 4711, 4713, 4732, 4720, 0, 4627, 0, 4697, 4703, 0, 4726, 4714, 4731, 0, 0, 4747, 0, 4747, 4750, 4757, 4763, 4766, 4764, 4796, 4769, 4790, 4781, 4799, 4803, 4806, 0, 0, 4750, 4772, 0, 0, 0, 4813, 4820, 4835, 4822, 4825, 4836, 4846, 4806, 4823, 4857, 4858, 4832, 0, 4859, 4862, 0, 4869, 4984, 4936, 4942, 139, 4948, 4953, 4959, 4965, 4971, 4977 } ; static yyconst flex_int16_t yy_def[1259] = { 0, 1249, 1, 1250, 1250, 1249, 5, 1249, 1249, 1249, 1249, 1249, 1251, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1253, 1249, 1254, 1249, 1255, 1255, 1249, 1255, 1256, 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1257, 1257, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 1258, 1255, 1249, 1249, 1251, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1253, 1249, 1254, 1249, 1255, 1255, 1255, 1256, 1255, 1255, 1255, 1255, 1255, 1255, 1255, 1255, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 1258, 1255, 1249, 1249, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1249, 1255, 1255, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 1255, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 1252, 1252, 1252, 1252, 1252, 1252, 1252, 65, 65, 65, 65, 65, 65, 65, 1252, 1252, 65, 65, 1252, 1252, 65, 65, 1252, 65, 0, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249 } ; static yyconst flex_uint16_t yy_nxt[5054] = { 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 21, 45, 21, 8, 46, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 21, 45, 21, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 63, 87, 63, 50, 88, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 63, 87, 63, 89, 90, 90, 90, 90, 93, 101, 94, 96, 94, 97, 98, 102, 108, 103, 115, 804, 110, 141, 116, 104, 413, 105, 117, 111, 142, 106, 107, 161, 118, 130, 112, 119, 109, 113, 114, 131, 120, 602, 121, 102, 108, 103, 115, 122, 110, 141, 116, 104, 123, 105, 117, 111, 142, 106, 107, 161, 118, 130, 112, 119, 109, 113, 114, 131, 120, 132, 121, 185, 143, 290, 146, 122, 144, 133, 147, 534, 123, 124, 145, 134, 148, 191, 90, 90, 90, 125, 197, 195, 126, 149, 194, 127, 195, 132, 128, 185, 143, 129, 146, 413, 144, 133, 147, 150, 196, 124, 145, 134, 148, 151, 152, 412, 158, 125, 162, 411, 126, 149, 163, 127, 181, 291, 128, 159, 164, 129, 135, 136, 182, 160, 290, 150, 137, 138, 139, 153, 95, 151, 152, 140, 158, 289, 162, 154, 288, 155, 163, 156, 181, 291, 157, 159, 164, 190, 135, 136, 182, 160, 183, 184, 137, 138, 139, 153, 198, 199, 201, 140, 200, 202, 202, 154, 178, 155, 179, 156, 231, 180, 157, 165, 242, 166, 232, 243, 167, 196, 183, 184, 292, 202, 202, 168, 169, 90, 90, 286, 170, 202, 202, 297, 178, 190, 179, 202, 231, 180, 298, 165, 242, 166, 232, 243, 167, 96, 94, 202, 292, 202, 202, 168, 169, 202, 293, 286, 170, 171, 172, 297, 303, 173, 294, 202, 174, 175, 298, 295, 308, 262, 296, 176, 317, 202, 177, 202, 192, 301, 191, 90, 189, 202, 293, 187, 302, 171, 172, 100, 303, 173, 294, 99, 174, 175, 95, 295, 308, 262, 296, 176, 317, 202, 177, 190, 190, 301, 190, 190, 190, 190, 190, 190, 302, 190, 190, 190, 91, 233, 244, 247, 263, 202, 245, 248, 264, 234, 306, 318, 246, 249, 265, 235, 304, 319, 305, 322, 307, 328, 202, 202, 202, 202, 197, 195, 190, 233, 244, 247, 263, 202, 245, 248, 264, 234, 306, 318, 246, 249, 265, 235, 304, 319, 305, 322, 307, 328, 202, 202, 202, 202, 259, 190, 190, 190, 202, 190, 190, 190, 190, 190, 190, 260, 190, 190, 190, 1249, 299, 261, 49, 203, 309, 204, 315, 316, 202, 310, 202, 205, 259, 206, 300, 331, 202, 207, 208, 279, 332, 280, 49, 260, 281, 333, 1249, 190, 299, 261, 202, 203, 309, 204, 315, 316, 202, 310, 202, 205, 1249, 206, 300, 331, 1249, 207, 208, 279, 332, 280, 320, 321, 281, 333, 190, 202, 209, 202, 202, 329, 1249, 1249, 1249, 202, 282, 202, 330, 334, 202, 202, 202, 335, 283, 336, 1249, 342, 210, 1249, 320, 321, 343, 1249, 344, 202, 209, 202, 202, 329, 202, 284, 285, 202, 282, 202, 330, 334, 202, 202, 202, 335, 283, 336, 311, 342, 210, 211, 202, 312, 343, 202, 344, 1249, 212, 313, 202, 1249, 202, 284, 285, 213, 314, 337, 214, 215, 338, 345, 323, 351, 324, 202, 311, 352, 325, 211, 202, 312, 353, 202, 1249, 326, 212, 313, 354, 327, 1249, 1249, 1249, 213, 314, 337, 214, 215, 338, 345, 323, 351, 324, 202, 216, 352, 325, 339, 217, 362, 353, 363, 218, 326, 340, 364, 354, 327, 219, 341, 355, 220, 356, 357, 1249, 1249, 1249, 365, 202, 1249, 366, 358, 216, 359, 1249, 339, 217, 362, 1249, 363, 218, 367, 340, 364, 360, 368, 219, 341, 355, 220, 356, 357, 346, 361, 347, 365, 202, 202, 366, 358, 369, 359, 348, 370, 221, 371, 222, 349, 350, 367, 372, 223, 360, 368, 373, 374, 224, 202, 1249, 375, 346, 361, 347, 376, 377, 202, 1249, 1249, 369, 1249, 348, 370, 221, 371, 222, 349, 350, 381, 372, 223, 382, 383, 373, 374, 224, 202, 225, 375, 1249, 387, 202, 376, 377, 378, 226, 379, 1249, 227, 380, 388, 228, 389, 390, 229, 391, 381, 230, 384, 382, 383, 202, 1249, 1249, 1249, 225, 392, 385, 387, 202, 1249, 1249, 378, 226, 379, 386, 227, 380, 388, 228, 389, 390, 229, 391, 396, 230, 384, 397, 398, 202, 202, 236, 237, 399, 392, 385, 393, 238, 239, 240, 402, 394, 400, 386, 241, 401, 403, 395, 404, 406, 202, 1249, 396, 408, 405, 397, 398, 409, 202, 236, 237, 399, 407, 410, 393, 238, 239, 240, 402, 394, 400, 1249, 241, 401, 403, 395, 404, 406, 202, 250, 1249, 408, 405, 202, 1249, 409, 202, 414, 202, 535, 407, 410, 202, 251, 1249, 536, 421, 1249, 202, 252, 253, 1249, 1249, 202, 1249, 1249, 202, 250, 202, 1249, 202, 202, 202, 1249, 202, 414, 202, 535, 202, 537, 202, 251, 202, 536, 421, 415, 202, 252, 253, 416, 202, 202, 202, 254, 202, 1249, 202, 417, 202, 1249, 202, 255, 202, 256, 1249, 257, 202, 537, 258, 1249, 202, 1249, 202, 415, 1249, 1249, 538, 416, 202, 202, 202, 254, 202, 422, 418, 417, 1249, 419, 202, 255, 202, 256, 420, 257, 539, 1249, 258, 423, 1249, 202, 202, 266, 202, 267, 538, 1249, 268, 202, 202, 1249, 202, 422, 418, 269, 270, 419, 202, 1249, 271, 202, 420, 540, 539, 202, 1249, 423, 424, 202, 1249, 266, 202, 267, 1249, 425, 268, 429, 202, 202, 1249, 202, 426, 269, 270, 541, 202, 430, 271, 202, 1249, 540, 1249, 202, 272, 273, 424, 202, 274, 202, 202, 275, 276, 425, 1249, 429, 202, 202, 277, 202, 426, 278, 202, 541, 202, 430, 1249, 431, 202, 427, 202, 428, 272, 273, 202, 202, 274, 202, 202, 275, 276, 202, 202, 544, 202, 202, 277, 438, 439, 278, 202, 441, 202, 1249, 202, 431, 202, 427, 202, 428, 432, 202, 202, 1249, 545, 433, 1249, 202, 440, 202, 202, 544, 202, 202, 1249, 438, 439, 1249, 1249, 441, 202, 442, 202, 1249, 1249, 548, 549, 202, 432, 202, 1249, 202, 545, 433, 434, 202, 440, 202, 202, 435, 202, 443, 444, 202, 451, 436, 445, 465, 202, 442, 1249, 202, 437, 548, 549, 202, 1249, 202, 202, 202, 1249, 546, 434, 202, 552, 202, 202, 435, 202, 443, 444, 202, 451, 436, 445, 465, 202, 553, 547, 202, 437, 452, 1249, 557, 202, 202, 202, 202, 453, 546, 1249, 202, 552, 542, 454, 543, 202, 446, 202, 447, 455, 202, 1249, 448, 202, 553, 547, 202, 456, 452, 449, 557, 202, 202, 450, 202, 453, 558, 202, 202, 457, 542, 454, 543, 202, 446, 202, 447, 455, 202, 202, 448, 202, 202, 458, 202, 456, 202, 449, 1249, 459, 202, 450, 1249, 202, 558, 202, 202, 457, 1249, 202, 460, 202, 1249, 461, 202, 559, 202, 202, 1249, 202, 202, 458, 1249, 466, 202, 202, 202, 459, 462, 467, 468, 202, 202, 1249, 202, 463, 475, 202, 460, 202, 464, 461, 202, 559, 202, 202, 202, 202, 1249, 1249, 202, 466, 202, 202, 202, 1249, 462, 467, 468, 474, 202, 202, 202, 463, 475, 560, 1249, 202, 464, 1249, 202, 1249, 561, 202, 202, 469, 202, 470, 202, 202, 202, 476, 202, 477, 1249, 471, 202, 474, 202, 202, 472, 473, 478, 560, 479, 480, 202, 202, 202, 202, 561, 485, 202, 469, 202, 470, 202, 202, 202, 476, 202, 477, 202, 471, 202, 505, 202, 202, 472, 473, 478, 486, 479, 480, 202, 202, 202, 202, 562, 485, 202, 1249, 202, 202, 202, 481, 202, 482, 1249, 202, 202, 488, 487, 505, 563, 202, 202, 1249, 483, 486, 1249, 202, 1249, 202, 202, 202, 562, 484, 564, 202, 202, 202, 490, 481, 491, 482, 489, 202, 202, 488, 487, 202, 563, 1249, 202, 202, 483, 202, 492, 202, 202, 202, 1249, 202, 565, 484, 564, 202, 202, 202, 490, 1249, 491, 519, 489, 493, 202, 202, 202, 202, 202, 494, 202, 202, 495, 202, 492, 1249, 202, 202, 497, 496, 565, 202, 202, 498, 202, 202, 202, 499, 202, 519, 202, 493, 500, 202, 202, 1249, 202, 494, 202, 202, 495, 504, 202, 202, 1249, 202, 497, 496, 202, 202, 202, 498, 202, 550, 202, 499, 202, 551, 202, 202, 500, 501, 202, 502, 1249, 506, 503, 202, 202, 504, 202, 202, 202, 1249, 1249, 507, 202, 202, 510, 1249, 202, 550, 202, 1249, 508, 551, 1249, 202, 202, 501, 202, 502, 509, 506, 503, 202, 202, 202, 512, 566, 202, 514, 202, 507, 202, 202, 510, 513, 511, 1249, 202, 202, 508, 1249, 202, 202, 202, 202, 1249, 1249, 509, 515, 202, 202, 202, 202, 512, 566, 521, 514, 202, 202, 202, 202, 202, 513, 511, 202, 202, 202, 1249, 520, 202, 202, 202, 202, 516, 525, 202, 515, 202, 517, 202, 202, 1249, 1249, 521, 518, 202, 202, 522, 202, 202, 202, 202, 202, 202, 523, 202, 520, 524, 1249, 202, 202, 516, 525, 202, 526, 567, 517, 568, 202, 531, 202, 529, 518, 202, 202, 522, 569, 570, 202, 202, 202, 527, 523, 202, 530, 524, 202, 528, 202, 202, 571, 202, 526, 567, 202, 568, 533, 531, 202, 529, 202, 532, 202, 572, 569, 570, 202, 554, 202, 527, 573, 555, 530, 574, 202, 528, 575, 202, 571, 202, 202, 576, 202, 577, 533, 578, 556, 579, 202, 532, 580, 572, 581, 582, 202, 554, 583, 584, 573, 555, 585, 574, 586, 587, 575, 588, 589, 590, 202, 576, 593, 577, 591, 578, 556, 579, 594, 595, 580, 596, 581, 582, 592, 597, 583, 584, 598, 599, 585, 600, 586, 587, 601, 588, 589, 590, 603, 604, 593, 605, 591, 606, 607, 608, 594, 595, 609, 596, 610, 611, 592, 597, 612, 613, 598, 599, 615, 600, 616, 617, 601, 618, 619, 620, 603, 604, 621, 605, 622, 606, 607, 608, 614, 623, 609, 624, 610, 611, 625, 626, 612, 613, 627, 628, 615, 629, 616, 617, 630, 618, 619, 620, 631, 632, 621, 633, 622, 634, 635, 636, 614, 623, 639, 624, 640, 637, 625, 626, 641, 642, 627, 628, 643, 629, 638, 644, 630, 645, 646, 647, 631, 632, 650, 633, 648, 634, 635, 636, 649, 651, 639, 202, 640, 637, 652, 202, 641, 642, 653, 1249, 643, 202, 638, 644, 202, 645, 646, 647, 654, 655, 650, 202, 648, 202, 202, 202, 649, 651, 202, 202, 202, 202, 652, 202, 202, 202, 653, 202, 1249, 202, 1249, 1249, 202, 202, 658, 656, 654, 655, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 1249, 1249, 202, 202, 202, 202, 657, 659, 202, 660, 662, 202, 658, 656, 202, 1249, 202, 661, 202, 202, 1249, 202, 202, 202, 202, 202, 663, 665, 202, 202, 202, 202, 202, 666, 657, 659, 202, 660, 662, 202, 667, 202, 202, 664, 668, 661, 202, 202, 202, 202, 202, 202, 202, 669, 663, 665, 202, 202, 202, 202, 674, 666, 202, 675, 202, 769, 202, 202, 667, 202, 770, 664, 668, 670, 202, 679, 202, 202, 202, 202, 671, 669, 202, 202, 672, 1249, 677, 202, 674, 202, 202, 675, 202, 769, 202, 202, 1249, 202, 770, 673, 202, 670, 676, 679, 202, 202, 771, 202, 671, 202, 202, 202, 672, 202, 677, 202, 682, 202, 681, 202, 202, 1249, 202, 202, 678, 202, 680, 673, 202, 683, 676, 202, 202, 202, 771, 202, 202, 202, 202, 202, 202, 202, 202, 772, 682, 685, 681, 202, 202, 202, 202, 202, 678, 686, 680, 689, 773, 683, 202, 202, 202, 202, 202, 684, 202, 202, 202, 202, 202, 202, 202, 772, 688, 685, 690, 202, 687, 202, 202, 202, 1249, 686, 202, 689, 773, 202, 202, 202, 202, 774, 202, 684, 202, 202, 1249, 775, 776, 202, 202, 692, 688, 202, 690, 202, 687, 693, 202, 202, 202, 691, 202, 1249, 202, 202, 202, 202, 1249, 774, 1249, 202, 202, 202, 695, 775, 776, 777, 202, 692, 202, 202, 694, 1249, 778, 693, 202, 202, 202, 691, 1249, 202, 202, 202, 202, 202, 202, 696, 697, 202, 1249, 202, 695, 779, 1249, 777, 1249, 202, 202, 1249, 694, 698, 778, 202, 202, 202, 202, 202, 202, 202, 780, 202, 699, 202, 202, 696, 697, 202, 701, 704, 700, 779, 202, 706, 202, 202, 1249, 202, 202, 698, 702, 202, 703, 202, 202, 202, 202, 202, 780, 202, 699, 705, 202, 202, 202, 202, 701, 704, 700, 1249, 202, 706, 202, 707, 708, 202, 202, 202, 702, 202, 703, 1249, 781, 202, 709, 202, 713, 202, 202, 705, 202, 202, 202, 202, 202, 710, 782, 711, 202, 202, 202, 707, 708, 202, 714, 202, 202, 202, 202, 715, 781, 202, 709, 712, 713, 202, 202, 718, 202, 783, 202, 202, 202, 710, 782, 711, 202, 202, 202, 202, 202, 202, 714, 784, 202, 202, 202, 715, 716, 202, 717, 712, 1249, 202, 202, 718, 202, 783, 202, 202, 202, 720, 719, 1249, 202, 202, 202, 202, 202, 202, 1249, 784, 785, 202, 202, 202, 716, 202, 717, 202, 721, 722, 202, 1249, 202, 202, 202, 202, 202, 720, 1249, 723, 202, 202, 202, 202, 1249, 202, 202, 786, 785, 202, 202, 202, 202, 724, 787, 202, 721, 722, 728, 729, 202, 202, 202, 726, 202, 725, 202, 723, 727, 202, 1249, 202, 202, 788, 202, 786, 1249, 202, 202, 202, 202, 724, 787, 789, 202, 730, 728, 729, 1249, 202, 202, 726, 202, 725, 202, 1249, 727, 202, 736, 732, 202, 788, 202, 202, 731, 1249, 202, 202, 202, 202, 202, 789, 202, 730, 733, 1249, 734, 202, 202, 735, 790, 202, 202, 202, 1249, 1249, 736, 732, 202, 791, 202, 202, 731, 202, 792, 1249, 202, 202, 202, 202, 737, 202, 733, 202, 734, 741, 739, 735, 790, 202, 202, 202, 202, 202, 738, 793, 202, 791, 743, 202, 1249, 202, 792, 202, 202, 202, 740, 202, 737, 202, 202, 202, 202, 741, 739, 202, 1249, 202, 202, 794, 202, 202, 738, 793, 202, 742, 743, 202, 744, 202, 202, 202, 202, 202, 740, 202, 1249, 202, 202, 202, 202, 202, 202, 202, 745, 202, 202, 794, 748, 202, 795, 1249, 202, 742, 746, 747, 744, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 1249, 202, 202, 749, 745, 753, 750, 202, 748, 202, 795, 751, 202, 796, 746, 747, 202, 1249, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 754, 1249, 1249, 749, 752, 753, 750, 202, 797, 755, 798, 751, 202, 796, 202, 202, 202, 759, 202, 202, 202, 202, 1249, 202, 756, 202, 757, 202, 754, 758, 202, 202, 752, 762, 202, 202, 797, 755, 798, 202, 760, 202, 202, 202, 799, 759, 761, 202, 202, 202, 202, 202, 756, 202, 757, 202, 1249, 758, 202, 202, 202, 762, 202, 202, 202, 800, 801, 202, 760, 202, 802, 763, 799, 202, 761, 764, 202, 768, 202, 202, 202, 202, 803, 202, 202, 765, 805, 202, 202, 766, 767, 806, 202, 800, 801, 807, 202, 808, 802, 763, 809, 202, 810, 764, 202, 768, 811, 202, 202, 812, 803, 813, 202, 765, 805, 202, 815, 766, 767, 806, 816, 817, 814, 807, 202, 808, 818, 819, 809, 820, 810, 821, 822, 823, 811, 202, 824, 812, 825, 813, 826, 827, 828, 829, 815, 830, 831, 832, 816, 817, 814, 833, 834, 835, 818, 819, 836, 820, 837, 821, 822, 823, 838, 839, 824, 840, 825, 841, 826, 827, 828, 829, 842, 830, 831, 832, 843, 844, 845, 833, 834, 835, 846, 847, 836, 848, 837, 849, 850, 851, 838, 839, 852, 840, 853, 841, 854, 855, 856, 857, 842, 858, 1249, 1249, 843, 844, 845, 1249, 202, 949, 846, 847, 202, 848, 202, 849, 850, 851, 202, 864, 852, 859, 853, 950, 854, 855, 856, 857, 202, 858, 202, 860, 861, 202, 862, 202, 202, 949, 202, 202, 202, 865, 202, 863, 866, 202, 202, 864, 202, 859, 202, 950, 1249, 202, 1249, 202, 202, 202, 202, 860, 861, 202, 862, 202, 202, 202, 202, 202, 202, 865, 869, 863, 866, 202, 202, 202, 202, 202, 202, 202, 868, 202, 867, 202, 202, 202, 202, 1249, 872, 1249, 870, 202, 202, 202, 202, 202, 202, 202, 869, 202, 871, 1249, 202, 202, 873, 202, 202, 202, 868, 951, 867, 202, 202, 202, 202, 202, 872, 202, 870, 202, 877, 1249, 202, 202, 202, 202, 1249, 202, 871, 874, 202, 202, 873, 202, 202, 875, 202, 951, 878, 202, 202, 202, 202, 202, 202, 202, 876, 202, 877, 202, 202, 202, 202, 879, 880, 1249, 202, 874, 202, 202, 202, 202, 202, 875, 202, 1249, 878, 202, 202, 202, 202, 952, 202, 202, 876, 202, 202, 202, 202, 202, 202, 879, 880, 881, 202, 886, 202, 882, 202, 202, 202, 883, 202, 202, 887, 202, 202, 202, 202, 952, 202, 202, 884, 888, 202, 1249, 202, 885, 202, 202, 1249, 881, 202, 886, 202, 882, 202, 202, 202, 883, 202, 202, 887, 202, 202, 1249, 202, 202, 202, 202, 884, 888, 889, 202, 202, 885, 202, 202, 202, 891, 202, 1249, 890, 202, 202, 202, 202, 202, 202, 202, 1249, 202, 202, 202, 1249, 202, 892, 202, 202, 202, 889, 202, 953, 202, 202, 202, 202, 891, 202, 202, 890, 202, 202, 202, 894, 202, 202, 202, 893, 202, 202, 202, 202, 202, 892, 202, 202, 202, 897, 202, 953, 202, 895, 202, 1249, 202, 202, 202, 896, 202, 202, 1249, 202, 202, 954, 202, 893, 202, 202, 202, 202, 202, 898, 202, 899, 202, 897, 202, 202, 202, 895, 202, 901, 202, 1249, 900, 896, 202, 202, 202, 202, 202, 954, 202, 902, 202, 202, 202, 202, 202, 898, 202, 899, 202, 1249, 955, 202, 202, 202, 202, 901, 202, 202, 900, 903, 202, 202, 202, 905, 202, 1249, 202, 902, 202, 202, 904, 202, 202, 202, 202, 202, 202, 202, 955, 1249, 202, 202, 910, 907, 202, 202, 202, 903, 202, 202, 906, 905, 202, 202, 202, 202, 202, 202, 904, 202, 202, 202, 202, 202, 202, 202, 908, 909, 202, 1249, 910, 907, 202, 202, 202, 913, 202, 202, 906, 202, 956, 202, 202, 202, 202, 202, 914, 202, 202, 915, 202, 202, 202, 202, 908, 909, 911, 912, 916, 1249, 202, 202, 202, 913, 202, 202, 1249, 202, 956, 1249, 202, 202, 202, 202, 914, 202, 202, 915, 202, 202, 202, 202, 917, 957, 911, 912, 916, 202, 918, 919, 202, 921, 202, 202, 202, 202, 202, 922, 202, 202, 202, 202, 920, 202, 202, 1249, 202, 202, 923, 1249, 917, 957, 202, 1249, 202, 202, 918, 919, 202, 921, 202, 202, 202, 202, 202, 922, 202, 202, 202, 202, 920, 202, 202, 924, 926, 202, 923, 202, 202, 925, 202, 927, 202, 202, 1249, 958, 202, 202, 202, 202, 202, 202, 928, 1249, 932, 202, 202, 202, 202, 202, 202, 924, 926, 202, 202, 202, 202, 925, 202, 927, 202, 202, 929, 958, 202, 202, 202, 930, 202, 202, 928, 931, 932, 202, 202, 202, 202, 935, 202, 1249, 202, 202, 202, 202, 933, 1249, 202, 202, 202, 202, 929, 937, 202, 202, 202, 930, 202, 202, 934, 931, 202, 202, 202, 202, 936, 935, 202, 202, 202, 202, 202, 202, 933, 202, 202, 202, 202, 202, 939, 937, 202, 202, 202, 959, 202, 202, 934, 938, 202, 202, 202, 202, 936, 202, 202, 202, 960, 202, 202, 1249, 202, 202, 202, 940, 202, 941, 939, 1249, 202, 202, 202, 959, 942, 961, 202, 938, 202, 202, 202, 1249, 1249, 202, 202, 945, 960, 943, 202, 202, 202, 944, 202, 940, 202, 941, 962, 946, 202, 202, 202, 202, 942, 961, 202, 202, 202, 202, 202, 202, 948, 202, 202, 945, 202, 943, 202, 202, 963, 944, 202, 202, 202, 947, 962, 946, 202, 202, 964, 202, 202, 202, 202, 202, 965, 202, 202, 202, 948, 202, 202, 966, 202, 967, 968, 969, 963, 970, 971, 202, 972, 947, 973, 974, 975, 202, 964, 976, 202, 202, 202, 977, 965, 978, 979, 980, 981, 982, 983, 966, 984, 967, 968, 969, 985, 970, 971, 986, 972, 987, 973, 974, 975, 988, 989, 976, 990, 991, 992, 977, 993, 978, 979, 980, 981, 982, 983, 994, 984, 995, 996, 997, 985, 998, 999, 986, 1000, 987, 1001, 1002, 1003, 988, 989, 1004, 990, 991, 992, 1005, 993, 1006, 1007, 1008, 1009, 1010, 1011, 994, 1012, 995, 996, 997, 1013, 998, 999, 1014, 1000, 202, 1001, 1002, 1003, 202, 202, 1004, 1016, 1249, 202, 1005, 1017, 1006, 1007, 1008, 1009, 1010, 1011, 1023, 1012, 202, 1018, 202, 1013, 202, 202, 1014, 202, 202, 202, 1015, 202, 202, 202, 1019, 1016, 202, 202, 202, 1017, 1249, 202, 202, 202, 1249, 202, 1023, 202, 202, 1018, 202, 1022, 202, 202, 1020, 202, 202, 202, 1015, 202, 1021, 202, 1019, 202, 202, 202, 202, 202, 1024, 202, 202, 202, 202, 202, 202, 202, 1249, 202, 1027, 1022, 1081, 1026, 1020, 1028, 202, 1249, 1249, 1025, 1021, 202, 202, 202, 202, 202, 202, 202, 1024, 202, 202, 202, 202, 1031, 202, 202, 202, 202, 1027, 1249, 1081, 1026, 202, 1028, 1082, 1030, 1029, 1025, 202, 1033, 202, 202, 202, 202, 202, 1083, 202, 202, 202, 202, 202, 1031, 1032, 202, 202, 1249, 1249, 202, 202, 202, 202, 202, 1082, 1030, 1029, 1034, 202, 1033, 202, 202, 202, 202, 1035, 1083, 202, 1036, 1249, 202, 202, 202, 1032, 202, 1038, 1037, 202, 202, 202, 202, 202, 202, 1249, 1249, 1249, 1034, 202, 202, 202, 202, 202, 202, 1035, 1044, 1249, 1036, 202, 202, 202, 202, 1039, 202, 1038, 1037, 202, 1040, 202, 202, 202, 202, 202, 202, 1041, 202, 202, 202, 202, 202, 202, 202, 1249, 1044, 1042, 202, 202, 202, 202, 202, 1039, 1043, 202, 202, 1046, 1040, 202, 202, 202, 202, 202, 202, 1041, 202, 1045, 202, 202, 202, 202, 202, 202, 1249, 1042, 202, 202, 202, 202, 202, 1249, 1043, 202, 202, 1046, 1048, 1249, 202, 202, 202, 202, 202, 202, 1047, 1045, 202, 1050, 202, 202, 202, 202, 1049, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 1048, 1052, 202, 1051, 202, 202, 202, 202, 1047, 202, 202, 1050, 202, 202, 1084, 202, 1049, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 1085, 1052, 1053, 1051, 202, 202, 202, 202, 1054, 202, 202, 202, 202, 1086, 1084, 202, 1249, 202, 202, 202, 1056, 202, 1055, 1057, 1087, 202, 202, 202, 1085, 202, 1053, 202, 202, 202, 202, 202, 1054, 202, 202, 202, 1088, 1086, 202, 202, 1058, 202, 202, 202, 1056, 202, 1055, 1057, 1087, 202, 202, 202, 202, 202, 1061, 202, 1059, 1062, 202, 202, 1249, 202, 202, 202, 1088, 1060, 202, 202, 1058, 1249, 202, 202, 202, 202, 202, 1065, 202, 202, 1089, 202, 202, 1063, 1061, 1090, 1059, 1062, 202, 202, 1064, 1249, 202, 202, 202, 1060, 1249, 202, 202, 202, 202, 1091, 202, 1092, 202, 1065, 202, 202, 1089, 202, 1093, 1063, 1066, 1090, 202, 1067, 202, 202, 1064, 202, 202, 202, 202, 1069, 1068, 202, 202, 202, 202, 1091, 1074, 1092, 1249, 202, 202, 1070, 202, 1249, 1093, 202, 1066, 202, 202, 1067, 202, 202, 1071, 202, 202, 202, 202, 1069, 1068, 202, 202, 202, 202, 202, 1074, 1072, 1075, 202, 202, 1070, 202, 1076, 202, 202, 1249, 202, 202, 1077, 1073, 1249, 1071, 202, 202, 202, 202, 1094, 202, 202, 202, 202, 202, 202, 202, 1072, 1075, 1095, 202, 202, 1079, 1076, 202, 202, 202, 1080, 202, 1077, 1073, 202, 1096, 202, 202, 202, 1097, 1094, 202, 1078, 202, 1098, 202, 1099, 202, 202, 202, 1095, 202, 202, 1079, 202, 1100, 202, 202, 1080, 1101, 1102, 1103, 202, 1096, 1104, 202, 1105, 1097, 1106, 1107, 1078, 202, 1098, 1108, 1099, 1109, 202, 202, 1110, 1111, 1112, 1113, 202, 1100, 1114, 1115, 1116, 1101, 1102, 1103, 1117, 1118, 1104, 1119, 1105, 1120, 1106, 1107, 1249, 1249, 1121, 1108, 202, 1109, 1161, 1123, 1110, 1111, 1112, 1113, 1249, 202, 1114, 1115, 1116, 202, 202, 1249, 1117, 1118, 202, 1119, 202, 1120, 1122, 202, 1124, 202, 1121, 1126, 202, 202, 1161, 1123, 1249, 202, 202, 1249, 202, 202, 202, 1125, 202, 202, 202, 1127, 1249, 202, 202, 1129, 202, 202, 1122, 202, 1124, 202, 1128, 1126, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 1125, 202, 202, 1132, 1127, 202, 202, 1130, 1129, 202, 202, 1249, 202, 1131, 202, 1128, 202, 202, 202, 202, 202, 202, 1249, 1133, 202, 202, 202, 1134, 202, 202, 202, 1132, 202, 202, 202, 1130, 1249, 202, 1135, 202, 202, 1131, 202, 202, 202, 202, 202, 1249, 202, 202, 202, 1133, 202, 202, 1136, 1134, 202, 202, 202, 202, 202, 202, 202, 202, 1137, 202, 1135, 202, 1162, 202, 202, 202, 1249, 202, 202, 202, 202, 202, 202, 202, 202, 202, 1136, 202, 202, 202, 202, 202, 1138, 202, 202, 202, 1137, 202, 1139, 202, 1162, 202, 202, 202, 1141, 202, 202, 202, 202, 202, 202, 202, 1249, 202, 202, 202, 202, 202, 1140, 202, 1138, 202, 202, 1142, 202, 202, 1139, 202, 202, 1249, 202, 202, 1141, 202, 202, 1143, 202, 202, 202, 202, 1144, 202, 202, 1249, 202, 202, 1140, 202, 202, 202, 1148, 1142, 202, 202, 202, 1145, 202, 202, 202, 202, 1146, 1147, 202, 1143, 202, 202, 202, 202, 1144, 202, 202, 202, 202, 202, 1249, 1150, 202, 202, 1148, 202, 1163, 202, 202, 1145, 1164, 202, 1149, 202, 1146, 1147, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 1151, 202, 202, 1150, 1152, 202, 202, 202, 1163, 202, 202, 202, 1164, 1153, 1149, 202, 202, 202, 202, 202, 1154, 1249, 202, 202, 202, 202, 202, 1165, 1151, 202, 202, 202, 1152, 1155, 202, 202, 1156, 202, 202, 202, 202, 1153, 1157, 202, 202, 202, 202, 202, 1154, 202, 202, 202, 202, 202, 202, 1165, 1166, 202, 1249, 202, 202, 1155, 1158, 202, 1156, 202, 202, 202, 202, 202, 1157, 202, 202, 202, 202, 202, 202, 202, 1249, 202, 202, 202, 1167, 1168, 1166, 202, 202, 1169, 202, 1159, 1158, 1170, 1171, 1160, 202, 202, 202, 202, 1172, 202, 202, 202, 1173, 1174, 202, 1175, 202, 1176, 1177, 1178, 1167, 1168, 1179, 1249, 202, 1169, 1199, 1159, 202, 1170, 1171, 1160, 202, 202, 202, 1180, 1172, 202, 1181, 202, 1173, 1174, 1182, 1175, 202, 1176, 1177, 1178, 202, 202, 1179, 202, 202, 202, 1199, 202, 202, 202, 202, 202, 202, 202, 202, 1180, 1183, 202, 1181, 202, 202, 202, 1182, 202, 1185, 202, 202, 202, 202, 202, 202, 202, 202, 202, 1249, 202, 202, 202, 202, 202, 202, 1184, 202, 202, 1183, 202, 202, 202, 202, 202, 202, 202, 1185, 202, 202, 202, 202, 202, 202, 202, 202, 1186, 202, 202, 202, 1249, 202, 1249, 202, 1184, 1187, 202, 202, 202, 202, 202, 1188, 202, 202, 202, 202, 1191, 202, 202, 202, 202, 202, 202, 202, 1186, 202, 202, 202, 202, 202, 202, 1189, 202, 1187, 202, 202, 202, 1190, 202, 1188, 202, 202, 202, 202, 1191, 202, 202, 202, 202, 202, 202, 1192, 202, 202, 202, 202, 202, 202, 202, 1189, 202, 202, 202, 1249, 202, 1190, 202, 202, 1193, 202, 202, 202, 1194, 202, 1249, 202, 202, 202, 202, 1192, 202, 202, 202, 1198, 1195, 202, 202, 202, 202, 202, 202, 202, 1200, 202, 1197, 202, 1193, 1201, 202, 202, 1194, 202, 1196, 202, 1202, 202, 202, 202, 202, 1203, 1204, 1198, 1195, 202, 202, 202, 202, 1205, 202, 202, 1200, 202, 1197, 1206, 1207, 1201, 1208, 1209, 1210, 1211, 1196, 202, 1202, 202, 202, 202, 202, 1203, 1204, 202, 202, 202, 1249, 202, 202, 1205, 1212, 1225, 1213, 1249, 202, 1206, 1207, 202, 1208, 1209, 1210, 1211, 1214, 202, 202, 202, 202, 202, 202, 1215, 1249, 202, 202, 202, 202, 202, 202, 1249, 1212, 1225, 1213, 1217, 202, 1216, 202, 202, 202, 202, 1249, 1249, 1214, 202, 202, 202, 202, 202, 202, 1215, 202, 202, 1218, 202, 202, 202, 202, 1219, 1226, 202, 1221, 1217, 202, 1216, 202, 1249, 202, 202, 1220, 202, 202, 202, 202, 202, 1223, 202, 1249, 1227, 202, 202, 1218, 202, 202, 202, 202, 1219, 1226, 202, 1221, 202, 202, 1228, 1222, 202, 202, 1229, 1220, 202, 202, 202, 202, 202, 1223, 202, 1224, 1227, 1230, 1231, 202, 202, 202, 202, 1249, 202, 1249, 1239, 1249, 202, 202, 1228, 1222, 202, 202, 1229, 1233, 202, 1232, 202, 202, 202, 202, 202, 1224, 1249, 1230, 1231, 202, 1249, 202, 202, 1234, 202, 202, 1239, 202, 202, 202, 202, 1240, 1249, 1236, 202, 1233, 202, 1232, 202, 202, 202, 202, 202, 202, 1235, 202, 1238, 202, 1237, 202, 202, 1234, 1249, 202, 202, 202, 202, 202, 202, 1240, 202, 1236, 202, 202, 202, 1243, 202, 202, 202, 202, 202, 202, 1235, 202, 1238, 202, 1237, 202, 202, 202, 202, 1242, 202, 1241, 202, 202, 202, 1244, 202, 202, 202, 202, 202, 1243, 202, 202, 1247, 202, 202, 202, 202, 202, 202, 202, 1249, 202, 202, 202, 202, 1242, 202, 1241, 202, 202, 202, 1244, 1245, 202, 202, 1249, 1249, 202, 1246, 1248, 1247, 1249, 202, 202, 202, 202, 202, 202, 1249, 202, 202, 1249, 1249, 1249, 202, 1249, 1249, 202, 1249, 1249, 1245, 1249, 1249, 1249, 1249, 202, 1246, 1248, 1249, 1249, 202, 1249, 1249, 1249, 1249, 1249, 1249, 202, 48, 48, 48, 48, 48, 48, 92, 1249, 1249, 92, 92, 92, 186, 1249, 186, 186, 186, 188, 188, 188, 1249, 188, 188, 190, 1249, 190, 190, 190, 190, 193, 1249, 193, 193, 193, 193, 202, 1249, 202, 202, 202, 202, 287, 1249, 287, 287, 287, 287, 7, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249 } ; static yyconst flex_int16_t yy_chk[5054] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 9, 9, 10, 10, 15, 1252, 15, 17, 17, 18, 18, 22, 23, 22, 25, 580, 24, 31, 25, 22, 413, 22, 25, 24, 32, 22, 22, 38, 25, 28, 24, 25, 23, 24, 24, 28, 26, 361, 26, 22, 23, 22, 25, 26, 24, 31, 25, 22, 26, 22, 25, 24, 32, 22, 22, 38, 25, 28, 24, 25, 23, 24, 24, 28, 26, 29, 26, 45, 33, 290, 34, 26, 33, 29, 34, 287, 26, 27, 33, 29, 34, 51, 51, 52, 52, 27, 59, 59, 27, 35, 57, 27, 57, 29, 27, 45, 33, 27, 34, 197, 33, 29, 34, 35, 196, 27, 33, 29, 34, 35, 35, 193, 37, 27, 39, 186, 27, 35, 39, 27, 43, 102, 27, 37, 39, 27, 30, 30, 43, 37, 96, 35, 30, 30, 30, 36, 95, 35, 35, 30, 37, 92, 39, 36, 89, 36, 39, 36, 43, 102, 36, 37, 39, 88, 30, 30, 43, 37, 44, 44, 30, 30, 30, 36, 60, 60, 62, 30, 61, 70, 73, 36, 42, 36, 42, 36, 70, 42, 36, 40, 73, 40, 70, 74, 40, 58, 44, 44, 103, 70, 73, 40, 40, 90, 90, 87, 40, 70, 73, 106, 42, 54, 42, 74, 70, 42, 107, 40, 73, 40, 70, 74, 40, 94, 94, 87, 103, 70, 73, 40, 40, 80, 104, 87, 40, 41, 41, 106, 111, 41, 104, 74, 41, 41, 107, 105, 114, 80, 105, 41, 118, 80, 41, 87, 53, 110, 191, 191, 49, 80, 104, 47, 110, 41, 41, 20, 111, 41, 104, 19, 41, 41, 16, 105, 114, 80, 105, 41, 118, 80, 41, 63, 63, 110, 63, 63, 63, 63, 63, 63, 110, 63, 63, 63, 11, 71, 75, 76, 81, 71, 75, 76, 81, 71, 113, 119, 75, 76, 81, 71, 112, 120, 112, 122, 113, 124, 75, 76, 81, 71, 195, 195, 63, 71, 75, 76, 81, 71, 75, 76, 81, 71, 113, 119, 75, 76, 81, 71, 112, 120, 112, 122, 113, 124, 75, 76, 81, 71, 79, 63, 64, 64, 79, 64, 64, 64, 64, 64, 64, 79, 64, 64, 64, 7, 108, 79, 4, 64, 115, 64, 117, 117, 79, 115, 84, 64, 79, 64, 108, 126, 79, 64, 64, 84, 127, 84, 3, 79, 84, 128, 0, 64, 108, 79, 84, 64, 115, 64, 117, 117, 79, 115, 84, 64, 0, 64, 108, 126, 0, 64, 64, 84, 127, 84, 121, 121, 84, 128, 64, 65, 65, 65, 84, 125, 0, 0, 0, 65, 85, 65, 125, 129, 85, 65, 65, 130, 85, 131, 0, 134, 65, 0, 121, 121, 136, 0, 137, 65, 65, 65, 86, 125, 85, 86, 86, 65, 85, 65, 125, 129, 85, 65, 65, 130, 85, 131, 116, 134, 65, 66, 86, 116, 136, 66, 137, 0, 66, 116, 86, 0, 85, 86, 86, 66, 116, 132, 66, 66, 132, 138, 123, 140, 123, 66, 116, 141, 123, 66, 86, 116, 142, 66, 0, 123, 66, 116, 143, 123, 0, 0, 0, 66, 116, 132, 66, 66, 132, 138, 123, 140, 123, 66, 67, 141, 123, 133, 67, 146, 142, 147, 67, 123, 133, 148, 143, 123, 67, 133, 144, 67, 144, 144, 0, 0, 0, 149, 67, 0, 150, 145, 67, 145, 0, 133, 67, 146, 0, 147, 67, 151, 133, 148, 145, 152, 67, 133, 144, 67, 144, 144, 139, 145, 139, 149, 67, 68, 150, 145, 153, 145, 139, 155, 68, 156, 68, 139, 139, 151, 157, 68, 145, 152, 158, 159, 68, 68, 0, 160, 139, 145, 139, 160, 161, 68, 0, 0, 153, 0, 139, 155, 68, 156, 68, 139, 139, 163, 157, 68, 164, 165, 158, 159, 68, 68, 69, 160, 0, 167, 69, 160, 161, 162, 69, 162, 0, 69, 162, 168, 69, 169, 170, 69, 171, 163, 69, 166, 164, 165, 69, 0, 0, 0, 69, 172, 166, 167, 69, 0, 0, 162, 69, 162, 166, 69, 162, 168, 69, 169, 170, 69, 171, 174, 69, 166, 175, 176, 69, 72, 72, 72, 177, 172, 166, 173, 72, 72, 72, 179, 173, 178, 166, 72, 178, 180, 173, 181, 182, 72, 0, 174, 183, 181, 175, 176, 184, 72, 72, 72, 177, 182, 185, 173, 72, 72, 72, 179, 173, 178, 0, 72, 178, 180, 173, 181, 182, 72, 77, 0, 183, 181, 77, 0, 184, 202, 203, 203, 292, 182, 185, 210, 77, 0, 294, 208, 0, 208, 77, 77, 0, 0, 77, 0, 0, 202, 77, 203, 0, 204, 77, 210, 0, 202, 203, 203, 292, 208, 295, 210, 77, 205, 294, 208, 204, 208, 77, 77, 205, 204, 77, 78, 78, 202, 0, 203, 205, 204, 0, 210, 78, 205, 78, 0, 78, 208, 295, 78, 0, 205, 0, 78, 204, 0, 0, 297, 205, 204, 207, 78, 78, 209, 209, 206, 205, 0, 206, 206, 78, 205, 78, 207, 78, 299, 0, 78, 209, 0, 207, 78, 82, 209, 82, 297, 0, 82, 207, 206, 0, 209, 209, 206, 82, 82, 206, 206, 0, 82, 211, 207, 300, 299, 82, 0, 209, 211, 207, 0, 82, 209, 82, 0, 211, 82, 214, 206, 236, 0, 211, 212, 82, 82, 301, 212, 214, 82, 211, 0, 300, 0, 82, 83, 83, 211, 214, 83, 236, 215, 83, 83, 211, 0, 214, 212, 236, 83, 211, 212, 83, 213, 301, 212, 214, 0, 215, 83, 213, 215, 213, 83, 83, 218, 214, 83, 236, 215, 83, 83, 220, 213, 303, 212, 216, 83, 218, 218, 83, 213, 220, 219, 0, 218, 215, 83, 213, 215, 213, 216, 220, 218, 0, 304, 216, 0, 221, 219, 220, 213, 303, 219, 216, 0, 218, 218, 0, 0, 220, 219, 221, 218, 0, 0, 306, 307, 221, 216, 220, 0, 235, 304, 216, 217, 221, 219, 225, 217, 217, 219, 222, 222, 222, 225, 217, 223, 235, 223, 221, 0, 235, 217, 306, 307, 221, 0, 225, 217, 235, 0, 305, 217, 222, 311, 225, 217, 217, 223, 222, 222, 222, 225, 217, 223, 235, 223, 312, 305, 235, 217, 226, 0, 314, 227, 225, 217, 228, 226, 305, 0, 222, 311, 302, 227, 302, 223, 224, 229, 224, 228, 226, 0, 224, 227, 312, 305, 228, 229, 226, 224, 314, 227, 230, 224, 228, 226, 315, 229, 224, 230, 302, 227, 302, 231, 224, 229, 224, 228, 226, 232, 224, 227, 230, 231, 228, 229, 233, 224, 0, 232, 230, 224, 0, 231, 315, 229, 224, 230, 0, 232, 233, 231, 0, 233, 237, 316, 233, 232, 0, 239, 230, 231, 0, 237, 233, 238, 234, 232, 234, 238, 239, 231, 242, 0, 237, 234, 242, 232, 233, 239, 234, 233, 237, 316, 233, 238, 234, 239, 0, 0, 241, 237, 242, 238, 234, 0, 234, 238, 239, 241, 242, 243, 237, 234, 242, 317, 0, 239, 234, 0, 241, 0, 318, 238, 234, 240, 240, 240, 241, 255, 242, 243, 244, 244, 0, 240, 245, 241, 247, 243, 240, 240, 245, 317, 245, 245, 240, 265, 241, 255, 318, 247, 244, 240, 240, 240, 245, 255, 247, 243, 244, 244, 248, 240, 245, 265, 247, 265, 240, 240, 245, 248, 245, 245, 240, 265, 250, 255, 319, 247, 244, 0, 248, 249, 245, 246, 247, 246, 0, 246, 248, 250, 249, 265, 320, 265, 250, 0, 246, 248, 0, 251, 0, 249, 250, 252, 319, 246, 322, 246, 248, 249, 252, 246, 253, 246, 251, 246, 253, 250, 249, 251, 320, 0, 250, 252, 246, 254, 254, 251, 256, 249, 0, 252, 323, 246, 322, 246, 253, 258, 252, 0, 253, 275, 251, 256, 253, 254, 259, 251, 256, 257, 257, 252, 258, 254, 254, 0, 256, 258, 260, 259, 323, 275, 260, 261, 253, 258, 259, 261, 262, 275, 257, 256, 262, 254, 259, 0, 256, 257, 257, 264, 258, 264, 260, 261, 0, 258, 260, 259, 262, 275, 260, 261, 263, 309, 259, 261, 262, 309, 257, 264, 262, 263, 266, 263, 0, 266, 263, 264, 268, 264, 260, 261, 263, 0, 0, 267, 262, 267, 268, 0, 263, 309, 266, 0, 267, 309, 0, 264, 268, 263, 266, 263, 267, 266, 263, 269, 268, 267, 270, 324, 263, 272, 270, 267, 272, 267, 268, 271, 269, 0, 266, 271, 267, 0, 273, 269, 268, 277, 0, 0, 267, 273, 270, 269, 272, 267, 270, 324, 277, 272, 270, 271, 272, 276, 273, 271, 269, 277, 274, 271, 0, 276, 273, 269, 278, 277, 274, 280, 280, 273, 270, 274, 272, 276, 0, 0, 277, 274, 274, 271, 278, 276, 273, 279, 278, 277, 274, 279, 280, 276, 279, 0, 278, 281, 274, 280, 280, 281, 325, 274, 326, 276, 284, 279, 283, 274, 274, 282, 278, 327, 328, 279, 278, 281, 282, 279, 280, 283, 279, 285, 282, 281, 284, 329, 283, 281, 325, 282, 326, 286, 284, 279, 283, 286, 285, 282, 330, 327, 328, 285, 313, 281, 282, 331, 313, 283, 333, 285, 282, 334, 284, 329, 283, 286, 335, 282, 336, 286, 337, 313, 338, 286, 285, 339, 330, 340, 341, 285, 313, 342, 343, 331, 313, 344, 333, 345, 346, 334, 347, 348, 349, 286, 335, 351, 336, 350, 337, 313, 338, 352, 354, 339, 355, 340, 341, 350, 356, 342, 343, 357, 358, 344, 359, 345, 346, 360, 347, 348, 349, 362, 363, 351, 364, 350, 365, 367, 368, 352, 354, 369, 355, 370, 371, 350, 356, 372, 373, 357, 358, 374, 359, 375, 376, 360, 377, 378, 379, 362, 363, 380, 364, 381, 365, 367, 368, 373, 382, 369, 383, 370, 371, 384, 385, 372, 373, 387, 388, 374, 389, 375, 376, 390, 377, 378, 379, 391, 393, 380, 394, 381, 395, 396, 397, 373, 382, 400, 383, 400, 399, 384, 385, 401, 402, 387, 388, 403, 389, 399, 404, 390, 405, 406, 407, 391, 393, 409, 394, 408, 395, 396, 397, 408, 410, 400, 414, 400, 399, 415, 416, 401, 402, 417, 0, 403, 418, 399, 404, 419, 405, 406, 407, 418, 420, 409, 414, 408, 420, 415, 416, 408, 410, 417, 414, 421, 418, 415, 416, 419, 422, 417, 424, 0, 418, 0, 0, 419, 420, 424, 422, 418, 420, 423, 414, 421, 420, 415, 416, 427, 422, 417, 424, 421, 418, 0, 0, 419, 422, 426, 424, 423, 425, 423, 425, 427, 420, 424, 422, 427, 0, 423, 426, 421, 430, 0, 431, 427, 422, 426, 424, 428, 429, 428, 425, 433, 429, 426, 430, 423, 425, 423, 425, 427, 430, 432, 431, 427, 428, 432, 426, 434, 430, 428, 431, 433, 429, 426, 434, 428, 429, 428, 425, 433, 429, 437, 430, 437, 438, 432, 535, 434, 430, 432, 431, 536, 428, 432, 435, 434, 442, 428, 435, 433, 429, 436, 434, 437, 438, 436, 0, 440, 439, 437, 440, 437, 438, 432, 535, 434, 442, 0, 435, 536, 436, 444, 435, 439, 442, 436, 435, 537, 439, 436, 440, 437, 438, 436, 441, 440, 439, 446, 440, 445, 443, 444, 0, 445, 442, 441, 435, 443, 436, 444, 447, 439, 447, 436, 441, 537, 439, 446, 440, 449, 443, 450, 441, 445, 538, 446, 449, 445, 443, 444, 448, 445, 447, 441, 450, 443, 453, 539, 447, 449, 447, 450, 441, 451, 448, 446, 452, 449, 443, 450, 448, 445, 538, 452, 449, 454, 453, 451, 448, 454, 447, 0, 450, 451, 453, 539, 452, 449, 455, 450, 540, 451, 448, 457, 452, 0, 542, 544, 448, 454, 457, 452, 456, 454, 453, 451, 458, 454, 455, 458, 456, 451, 0, 457, 452, 459, 455, 0, 540, 0, 460, 457, 456, 460, 542, 544, 545, 454, 457, 458, 456, 459, 0, 546, 458, 459, 455, 458, 456, 0, 460, 457, 461, 459, 462, 463, 461, 462, 460, 0, 456, 460, 547, 0, 545, 0, 464, 458, 0, 459, 463, 546, 461, 459, 462, 463, 465, 466, 460, 548, 461, 464, 462, 463, 461, 462, 464, 466, 469, 465, 547, 468, 471, 467, 464, 0, 465, 466, 463, 467, 461, 468, 462, 463, 465, 466, 470, 548, 469, 464, 470, 468, 471, 467, 464, 466, 469, 465, 0, 468, 471, 467, 472, 473, 465, 466, 470, 467, 474, 468, 0, 549, 476, 473, 470, 478, 469, 475, 470, 468, 471, 467, 472, 473, 474, 550, 475, 477, 474, 479, 472, 473, 476, 479, 470, 478, 474, 475, 480, 549, 476, 473, 477, 478, 483, 475, 483, 477, 552, 479, 472, 473, 474, 550, 475, 477, 474, 479, 480, 484, 476, 479, 553, 478, 483, 475, 480, 481, 481, 482, 477, 0, 483, 482, 483, 477, 552, 479, 485, 484, 485, 484, 0, 486, 489, 487, 480, 484, 481, 0, 553, 554, 483, 482, 488, 481, 481, 482, 485, 486, 487, 482, 0, 486, 489, 487, 485, 484, 485, 0, 488, 486, 489, 487, 488, 0, 481, 490, 555, 554, 492, 482, 488, 491, 490, 556, 485, 486, 487, 494, 495, 486, 489, 487, 492, 493, 491, 490, 488, 493, 492, 0, 488, 491, 558, 490, 555, 0, 492, 494, 495, 491, 490, 556, 559, 493, 496, 494, 495, 0, 496, 497, 492, 493, 491, 490, 0, 493, 492, 501, 497, 491, 558, 501, 498, 496, 0, 494, 495, 499, 496, 497, 559, 493, 496, 498, 0, 499, 496, 497, 500, 560, 500, 501, 498, 0, 0, 501, 497, 499, 563, 501, 498, 496, 502, 564, 0, 499, 496, 497, 503, 502, 500, 498, 504, 499, 506, 504, 500, 560, 500, 501, 498, 505, 502, 503, 565, 499, 563, 508, 503, 0, 502, 564, 504, 509, 506, 505, 503, 502, 500, 510, 504, 505, 506, 504, 507, 0, 515, 508, 566, 505, 502, 503, 565, 509, 507, 508, 503, 510, 511, 510, 504, 509, 506, 505, 507, 0, 515, 510, 512, 505, 514, 513, 507, 511, 515, 508, 566, 514, 511, 567, 0, 509, 507, 512, 513, 510, 511, 510, 512, 516, 514, 513, 507, 518, 515, 517, 512, 0, 514, 513, 516, 511, 520, 517, 521, 514, 511, 567, 518, 516, 568, 512, 513, 518, 0, 517, 512, 516, 514, 513, 519, 518, 520, 517, 521, 522, 0, 0, 516, 519, 520, 517, 521, 569, 522, 570, 518, 516, 568, 523, 519, 518, 525, 517, 524, 522, 525, 0, 519, 523, 520, 523, 521, 522, 524, 527, 526, 519, 528, 523, 528, 569, 522, 570, 524, 526, 525, 523, 519, 571, 525, 527, 524, 522, 525, 527, 526, 523, 529, 523, 528, 0, 524, 527, 526, 530, 528, 523, 528, 533, 573, 576, 524, 526, 525, 577, 529, 571, 529, 527, 530, 531, 533, 527, 526, 530, 529, 579, 528, 533, 531, 582, 532, 530, 531, 532, 584, 533, 573, 576, 585, 531, 586, 577, 529, 587, 529, 588, 530, 531, 533, 589, 532, 530, 590, 579, 591, 533, 531, 582, 532, 593, 531, 532, 584, 597, 598, 591, 585, 531, 586, 600, 602, 587, 603, 588, 604, 604, 605, 589, 532, 606, 590, 608, 591, 609, 610, 611, 612, 593, 613, 614, 616, 597, 598, 591, 617, 618, 619, 600, 602, 620, 603, 621, 604, 604, 605, 622, 624, 606, 625, 608, 626, 609, 610, 611, 612, 628, 613, 614, 616, 629, 630, 631, 617, 618, 619, 632, 633, 620, 636, 621, 638, 639, 640, 622, 624, 641, 625, 642, 626, 643, 644, 645, 647, 628, 649, 0, 0, 629, 630, 631, 0, 652, 771, 632, 633, 654, 636, 655, 638, 639, 640, 653, 657, 641, 652, 642, 773, 643, 644, 645, 647, 652, 649, 656, 653, 654, 658, 655, 660, 652, 771, 653, 657, 654, 659, 655, 656, 661, 659, 653, 657, 661, 652, 656, 773, 0, 658, 0, 660, 652, 664, 656, 653, 654, 658, 655, 660, 663, 659, 653, 657, 661, 659, 664, 656, 661, 659, 662, 665, 661, 664, 656, 668, 663, 658, 662, 660, 663, 664, 666, 0, 667, 0, 665, 667, 663, 659, 662, 665, 661, 669, 664, 668, 666, 0, 662, 665, 669, 664, 666, 668, 663, 774, 662, 667, 663, 670, 666, 671, 667, 669, 665, 667, 673, 0, 662, 665, 673, 669, 0, 668, 666, 670, 674, 672, 669, 670, 666, 671, 678, 774, 675, 667, 675, 670, 679, 671, 673, 669, 672, 677, 673, 676, 674, 672, 673, 676, 677, 0, 678, 670, 674, 672, 675, 670, 679, 671, 678, 0, 675, 677, 675, 676, 679, 775, 673, 680, 672, 677, 681, 676, 674, 672, 682, 676, 677, 680, 678, 685, 683, 681, 675, 685, 679, 682, 684, 680, 686, 677, 681, 676, 686, 775, 682, 680, 683, 687, 681, 0, 683, 684, 682, 685, 0, 680, 684, 685, 683, 681, 689, 685, 686, 682, 684, 680, 686, 687, 681, 0, 686, 690, 682, 691, 683, 687, 688, 688, 683, 684, 689, 685, 692, 693, 684, 0, 690, 693, 689, 694, 686, 690, 695, 691, 0, 687, 697, 688, 0, 690, 694, 691, 692, 698, 688, 688, 776, 693, 689, 694, 692, 693, 695, 696, 690, 693, 697, 694, 697, 690, 695, 691, 696, 698, 697, 688, 699, 700, 694, 701, 692, 698, 702, 696, 776, 693, 699, 694, 0, 704, 695, 696, 701, 703, 697, 0, 699, 700, 777, 701, 696, 698, 702, 706, 699, 700, 703, 701, 704, 704, 702, 696, 705, 703, 699, 707, 706, 704, 0, 705, 701, 703, 709, 706, 699, 700, 777, 701, 707, 711, 702, 706, 705, 712, 703, 707, 704, 704, 0, 778, 705, 703, 709, 707, 706, 710, 708, 705, 708, 711, 709, 706, 710, 712, 0, 713, 707, 711, 715, 708, 705, 712, 716, 707, 714, 710, 708, 778, 0, 718, 709, 720, 715, 710, 708, 713, 708, 711, 715, 714, 710, 712, 716, 713, 714, 719, 715, 708, 717, 718, 716, 720, 714, 710, 708, 717, 719, 718, 0, 720, 715, 722, 723, 713, 722, 719, 715, 714, 717, 779, 716, 721, 714, 719, 724, 723, 717, 718, 725, 720, 725, 722, 723, 717, 719, 721, 721, 726, 0, 722, 723, 721, 722, 719, 724, 0, 717, 779, 0, 721, 725, 727, 724, 723, 728, 729, 725, 726, 725, 722, 723, 727, 780, 721, 721, 726, 731, 728, 729, 721, 731, 727, 724, 730, 728, 729, 733, 732, 725, 727, 733, 730, 728, 729, 0, 726, 731, 734, 0, 727, 780, 734, 0, 730, 731, 728, 729, 732, 731, 727, 733, 730, 728, 729, 733, 732, 735, 738, 733, 730, 736, 734, 735, 737, 731, 734, 739, 737, 736, 734, 738, 730, 740, 0, 782, 732, 735, 738, 733, 744, 736, 739, 0, 745, 735, 738, 739, 737, 736, 734, 735, 737, 740, 741, 739, 737, 736, 742, 738, 744, 740, 741, 782, 745, 735, 738, 742, 744, 736, 739, 743, 745, 743, 741, 739, 737, 748, 742, 0, 746, 740, 741, 747, 746, 0, 742, 750, 744, 751, 741, 750, 745, 743, 749, 742, 752, 748, 747, 743, 746, 743, 741, 747, 749, 748, 742, 750, 746, 751, 754, 747, 746, 753, 749, 750, 752, 751, 755, 750, 755, 743, 749, 783, 752, 748, 747, 753, 746, 757, 754, 747, 749, 753, 756, 750, 784, 751, 754, 0, 755, 753, 749, 756, 752, 757, 755, 0, 755, 757, 759, 783, 758, 785, 756, 753, 758, 757, 754, 0, 0, 753, 756, 761, 784, 759, 763, 760, 755, 760, 759, 756, 762, 757, 786, 762, 758, 757, 759, 765, 758, 785, 756, 761, 758, 764, 763, 760, 766, 767, 768, 761, 762, 759, 763, 760, 788, 760, 759, 765, 762, 764, 786, 762, 758, 764, 789, 765, 766, 767, 768, 761, 790, 764, 763, 760, 766, 767, 768, 791, 762, 792, 793, 794, 788, 795, 796, 765, 797, 764, 799, 801, 803, 764, 789, 804, 766, 767, 768, 805, 790, 806, 808, 810, 812, 813, 814, 791, 815, 792, 793, 794, 819, 795, 796, 822, 797, 824, 799, 801, 803, 825, 826, 804, 827, 830, 831, 805, 832, 806, 808, 810, 812, 813, 814, 833, 815, 835, 836, 837, 819, 839, 840, 822, 841, 824, 842, 843, 844, 825, 826, 845, 827, 830, 831, 846, 832, 847, 848, 849, 851, 852, 853, 833, 855, 835, 836, 837, 856, 839, 840, 857, 841, 859, 842, 843, 844, 860, 862, 845, 863, 0, 861, 846, 864, 847, 848, 849, 851, 852, 853, 870, 855, 859, 865, 865, 856, 860, 862, 857, 863, 859, 861, 861, 864, 860, 862, 866, 863, 866, 861, 870, 864, 0, 869, 865, 871, 0, 867, 870, 868, 859, 865, 865, 869, 860, 862, 867, 863, 866, 861, 861, 864, 868, 869, 866, 871, 866, 867, 870, 868, 872, 869, 865, 871, 872, 867, 874, 868, 0, 873, 875, 869, 949, 874, 867, 876, 866, 0, 0, 873, 868, 869, 877, 871, 872, 867, 874, 868, 872, 873, 875, 878, 872, 880, 874, 876, 879, 873, 875, 0, 949, 874, 877, 876, 951, 879, 878, 873, 881, 882, 877, 878, 872, 880, 874, 952, 879, 873, 875, 878, 883, 880, 881, 876, 879, 0, 0, 884, 881, 882, 877, 885, 951, 879, 878, 883, 881, 882, 888, 878, 883, 880, 884, 952, 879, 885, 0, 884, 883, 886, 881, 885, 887, 886, 887, 884, 881, 882, 888, 885, 0, 0, 0, 883, 889, 890, 888, 892, 883, 886, 884, 896, 0, 885, 887, 884, 891, 886, 889, 885, 887, 886, 887, 891, 889, 890, 888, 892, 893, 894, 893, 896, 889, 890, 895, 892, 891, 886, 0, 896, 894, 897, 887, 899, 891, 898, 889, 895, 893, 894, 900, 891, 889, 890, 895, 892, 893, 894, 893, 896, 898, 897, 895, 899, 891, 898, 901, 0, 894, 897, 900, 899, 902, 898, 0, 895, 893, 894, 900, 903, 0, 904, 895, 905, 906, 907, 901, 902, 898, 897, 905, 899, 902, 898, 901, 904, 908, 909, 900, 903, 902, 904, 910, 905, 906, 907, 911, 903, 912, 904, 909, 905, 906, 907, 901, 902, 908, 909, 905, 913, 902, 953, 910, 904, 908, 909, 911, 903, 912, 904, 910, 905, 906, 907, 911, 954, 912, 914, 909, 913, 915, 914, 916, 915, 908, 909, 917, 913, 955, 953, 910, 0, 918, 919, 911, 917, 912, 916, 920, 956, 915, 914, 916, 954, 921, 914, 917, 913, 915, 914, 916, 915, 918, 919, 917, 958, 955, 924, 920, 921, 918, 919, 922, 917, 921, 916, 920, 956, 915, 914, 916, 923, 921, 925, 917, 922, 926, 924, 926, 0, 918, 919, 922, 958, 923, 924, 920, 921, 0, 928, 922, 923, 921, 925, 930, 930, 927, 959, 926, 923, 927, 925, 960, 922, 926, 924, 926, 929, 0, 928, 922, 929, 923, 0, 931, 930, 927, 928, 961, 923, 964, 925, 930, 930, 927, 959, 926, 966, 927, 931, 960, 929, 932, 932, 931, 929, 934, 928, 935, 929, 934, 933, 931, 930, 927, 933, 961, 939, 964, 0, 936, 939, 935, 932, 0, 966, 934, 931, 935, 929, 932, 932, 931, 936, 934, 933, 935, 937, 934, 933, 936, 939, 940, 933, 938, 939, 937, 941, 936, 939, 935, 932, 942, 942, 934, 0, 935, 937, 943, 938, 0, 936, 940, 933, 938, 937, 967, 941, 936, 939, 940, 944, 938, 942, 937, 941, 969, 948, 943, 946, 942, 942, 945, 946, 947, 937, 943, 938, 947, 971, 940, 944, 938, 972, 967, 941, 945, 948, 976, 944, 977, 942, 945, 946, 969, 948, 943, 946, 947, 982, 945, 946, 947, 983, 985, 987, 947, 971, 988, 944, 990, 972, 991, 992, 945, 948, 976, 993, 977, 994, 945, 946, 996, 997, 998, 1002, 947, 982, 1003, 1005, 1006, 983, 985, 987, 1007, 1008, 988, 1013, 990, 1014, 991, 992, 0, 0, 1015, 993, 1016, 994, 1084, 1018, 996, 997, 998, 1002, 0, 1019, 1003, 1005, 1006, 1017, 1021, 0, 1007, 1008, 1015, 1013, 1016, 1014, 1017, 1018, 1019, 1020, 1015, 1021, 1016, 1019, 1084, 1018, 0, 1017, 1021, 0, 1022, 1019, 1023, 1020, 1024, 1017, 1021, 1022, 0, 1020, 1015, 1025, 1016, 1025, 1017, 1018, 1019, 1020, 1024, 1021, 1022, 1019, 1023, 1026, 1024, 1017, 1021, 1028, 1022, 1029, 1023, 1020, 1024, 1025, 1030, 1022, 1030, 1020, 1026, 1025, 1031, 1025, 0, 1026, 1027, 1027, 1024, 1028, 1022, 1029, 1023, 1026, 1024, 0, 1032, 1028, 1030, 1029, 1033, 1033, 1031, 1025, 1030, 1034, 1030, 1027, 1026, 0, 1031, 1035, 1036, 1026, 1027, 1027, 1032, 1028, 1037, 1029, 0, 1033, 1038, 1039, 1032, 1034, 1030, 1037, 1033, 1033, 1031, 1035, 1036, 1034, 1040, 1027, 1041, 1038, 1037, 1035, 1036, 1086, 1038, 1039, 1032, 0, 1037, 1043, 1042, 1033, 1038, 1039, 1044, 1034, 1040, 1037, 1041, 1045, 1046, 1035, 1036, 1042, 1040, 1047, 1041, 1038, 1037, 1043, 1042, 1086, 1038, 1039, 1044, 1049, 1048, 1043, 1042, 1045, 1046, 1050, 1044, 0, 1040, 1047, 1041, 1045, 1046, 1048, 1051, 1042, 1052, 1047, 1051, 1049, 1048, 1043, 1042, 1053, 0, 1050, 1044, 1049, 1048, 1055, 1053, 1045, 1046, 1050, 1051, 1054, 1052, 1047, 0, 1054, 1057, 1048, 1051, 1053, 1052, 1059, 1051, 1049, 1048, 1055, 1056, 1053, 1058, 1050, 1056, 1057, 1058, 1055, 1053, 1054, 1057, 1060, 1051, 1054, 1052, 1059, 1061, 1054, 1057, 0, 1062, 1053, 1058, 1059, 1056, 1088, 1065, 1055, 1056, 1089, 1058, 1060, 1056, 1057, 1058, 1064, 1061, 1054, 1057, 1060, 1062, 1066, 1067, 1059, 1061, 1063, 1065, 1063, 1062, 1064, 1058, 1068, 1056, 1088, 1065, 1064, 1069, 1089, 1068, 1060, 1070, 1066, 1067, 1064, 1061, 1069, 0, 1063, 1062, 1066, 1067, 1068, 1092, 1063, 1065, 1063, 1069, 1064, 1071, 1068, 1070, 1072, 1071, 1064, 1069, 1072, 1068, 1073, 1070, 1066, 1067, 1073, 1074, 1069, 1075, 1063, 1076, 1077, 1078, 1068, 1092, 1093, 1071, 0, 1069, 1072, 1071, 1074, 1070, 1072, 1071, 1073, 1074, 1072, 1075, 1073, 1076, 1077, 1078, 1073, 1074, 1079, 1075, 0, 1076, 1077, 1078, 1098, 1101, 1093, 1071, 1080, 1102, 1072, 1079, 1074, 1104, 1105, 1080, 1073, 1074, 1079, 1075, 1106, 1076, 1077, 1078, 1107, 1111, 1079, 1114, 1080, 1115, 1116, 1117, 1098, 1101, 1118, 0, 1080, 1102, 1161, 1079, 1121, 1104, 1105, 1080, 1122, 1123, 1079, 1124, 1106, 1125, 1126, 1127, 1107, 1111, 1128, 1114, 1080, 1115, 1116, 1117, 1121, 1130, 1118, 1131, 1122, 1123, 1161, 1124, 1121, 1125, 1126, 1127, 1122, 1123, 1128, 1124, 1129, 1125, 1126, 1127, 1129, 1130, 1128, 1131, 1133, 1133, 1132, 1134, 1121, 1130, 1135, 1131, 1122, 1123, 0, 1124, 1136, 1125, 1126, 1127, 1129, 1132, 1128, 1137, 1129, 1133, 1132, 1134, 1129, 1130, 1135, 1131, 1133, 1133, 1132, 1134, 1136, 1138, 1135, 1139, 1140, 1138, 1143, 1137, 1136, 0, 1142, 0, 1129, 1132, 1141, 1137, 1141, 1133, 1132, 1134, 1142, 1138, 1135, 1139, 1140, 1146, 1143, 1144, 1136, 1138, 1142, 1139, 1140, 1138, 1143, 1137, 1141, 1148, 1142, 1145, 1144, 1149, 1141, 1150, 1141, 1146, 1145, 1144, 1142, 1138, 1147, 1139, 1140, 1146, 1143, 1144, 1152, 1148, 1142, 1145, 1147, 1149, 1151, 1150, 1141, 1148, 1153, 1145, 1144, 1149, 1147, 1150, 0, 1146, 1145, 1144, 1152, 1151, 1147, 1154, 1155, 1154, 1151, 0, 1152, 1148, 1153, 1145, 1147, 1149, 1151, 1150, 1158, 1155, 1153, 1157, 1156, 1159, 1147, 1154, 1155, 1162, 1160, 1157, 1152, 1151, 1163, 1154, 1155, 1154, 1151, 1156, 1158, 1164, 1153, 1157, 1156, 1159, 1167, 1168, 1158, 1155, 1160, 1157, 1156, 1159, 1169, 1154, 1155, 1162, 1160, 1157, 1171, 1172, 1163, 1173, 1176, 1177, 1178, 1156, 1158, 1164, 1180, 1157, 1156, 1159, 1167, 1168, 1181, 1184, 1160, 0, 1185, 1182, 1169, 1180, 1200, 1181, 0, 1183, 1171, 1172, 1180, 1173, 1176, 1177, 1178, 1182, 1181, 1184, 1180, 1187, 1185, 1182, 1183, 0, 1181, 1184, 1186, 1183, 1185, 1182, 0, 1180, 1200, 1181, 1187, 1183, 1186, 1189, 1180, 1187, 1188, 0, 0, 1182, 1181, 1184, 1186, 1187, 1185, 1182, 1183, 1190, 1192, 1188, 1186, 1183, 1191, 1189, 1190, 1202, 1188, 1192, 1187, 1193, 1186, 1189, 0, 1187, 1188, 1191, 1194, 1190, 1192, 1195, 1186, 1196, 1191, 0, 1203, 1190, 1192, 1188, 1198, 1193, 1191, 1189, 1190, 1202, 1188, 1192, 1194, 1193, 1205, 1195, 1197, 1196, 1206, 1191, 1194, 1190, 1192, 1195, 1198, 1196, 1191, 1197, 1203, 1207, 1210, 1212, 1198, 1193, 1213, 0, 1197, 0, 1227, 0, 1194, 1214, 1205, 1195, 1197, 1196, 1206, 1215, 1217, 1213, 1216, 1212, 1198, 1219, 1213, 1197, 0, 1207, 1210, 1212, 0, 1214, 1213, 1216, 1197, 1221, 1227, 1215, 1217, 1214, 1216, 1228, 0, 1219, 1220, 1215, 1217, 1213, 1216, 1212, 1218, 1219, 1213, 1222, 1218, 1221, 1223, 1223, 1220, 1214, 1224, 1216, 0, 1221, 1220, 1215, 1217, 1232, 1216, 1228, 1218, 1219, 1220, 1222, 1233, 1239, 1235, 1223, 1218, 1236, 1224, 1222, 1218, 1221, 1223, 1223, 1220, 1232, 1224, 1234, 1237, 1235, 1220, 1234, 1233, 1232, 1235, 1240, 1218, 1236, 1238, 1222, 1233, 1239, 1235, 1223, 1243, 1236, 1224, 1234, 1237, 1241, 1242, 1245, 0, 1232, 1246, 1234, 1237, 1235, 1238, 1234, 1233, 1248, 1235, 1240, 1241, 1236, 1238, 0, 0, 1241, 1242, 1245, 1243, 0, 1246, 1234, 1237, 1241, 1242, 1245, 0, 1248, 1246, 0, 0, 0, 1238, 0, 0, 1248, 0, 0, 1241, 0, 0, 0, 0, 1241, 1242, 1245, 0, 0, 1246, 0, 0, 0, 0, 0, 0, 1248, 1250, 1250, 1250, 1250, 1250, 1250, 1251, 0, 0, 1251, 1251, 1251, 1253, 0, 1253, 1253, 1253, 1254, 1254, 1254, 0, 1254, 1254, 1255, 0, 1255, 1255, 1255, 1255, 1256, 0, 1256, 1256, 1256, 1256, 1257, 0, 1257, 1257, 1257, 1257, 1258, 0, 1258, 1258, 1258, 1258, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249, 1249 } ; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET #line 1 "flex_lexer.l" /** * lexer * * */ /*************************** ** Section 1: Definitions ***************************/ #line 12 "flex_lexer.l" #include "../../include/sqlparser/Expr.h" #include "bison_parser.h" #include <stdio.h> #include <sstream> #define TOKEN(name) { return SQL_##name; } static std::stringstream strbuf; /*************************** ** Section 2: Rules ***************************/ /* Define the output files */ /* Make reentrant */ /* performance tweaks */ /* other flags */ /* %option nodefault */ /*************************** ** Section 3: Rules ***************************/ #line 2003 "flex_lexer.cpp" #define INITIAL 0 #define singlequotedstring 1 #define COMMENT 2 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include <unistd.h> #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif /* Holds the entire state of the reentrant scanner. */ struct yyguts_t { /* User-defined. Not touched by flex. */ YY_EXTRA_TYPE yyextra_r; /* The rest are the same as the globals declared in the non-reentrant scanner. */ FILE *yyin_r, *yyout_r; size_t yy_buffer_stack_top; /**< index of top of stack. */ size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; int yy_n_chars; yy_size_t yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; int yy_did_buffer_switch_on_eof; int yy_start_stack_ptr; int yy_start_stack_depth; int *yy_start_stack; yy_state_type yy_last_accepting_state; char* yy_last_accepting_cpos; int yylineno_r; int yy_flex_debug_r; char *yytext_r; int yy_more_flag; int yy_more_len; YYSTYPE * yylval_r; YYLTYPE * yylloc_r; }; /* end struct yyguts_t */ static int yy_init_globals (yyscan_t yyscanner ); /* This must go here because YYSTYPE and YYLTYPE are included * from bison output in section 1.*/ # define yylval yyg->yylval_r # define yylloc yyg->yylloc_r int hsql_lex_init (yyscan_t* scanner); int hsql_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int hsql_lex_destroy (yyscan_t yyscanner ); int hsql_get_debug (yyscan_t yyscanner ); void hsql_set_debug (int debug_flag ,yyscan_t yyscanner ); YY_EXTRA_TYPE hsql_get_extra (yyscan_t yyscanner ); void hsql_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); FILE *hsql_get_in (yyscan_t yyscanner ); void hsql_set_in (FILE * _in_str ,yyscan_t yyscanner ); FILE *hsql_get_out (yyscan_t yyscanner ); void hsql_set_out (FILE * _out_str ,yyscan_t yyscanner ); yy_size_t hsql_get_leng (yyscan_t yyscanner ); char *hsql_get_text (yyscan_t yyscanner ); int hsql_get_lineno (yyscan_t yyscanner ); void hsql_set_lineno (int _line_number ,yyscan_t yyscanner ); int hsql_get_column (yyscan_t yyscanner ); void hsql_set_column (int _column_no ,yyscan_t yyscanner ); YYSTYPE * hsql_get_lval (yyscan_t yyscanner ); void hsql_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); YYLTYPE *hsql_get_lloc (yyscan_t yyscanner ); void hsql_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int hsql_wrap (yyscan_t yyscanner ); #else extern int hsql_wrap (yyscan_t yyscanner ); #endif #endif #ifndef YY_NO_UNPUT #endif #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner ); #else static int input (yyscan_t yyscanner ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int hsql_lex \ (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); #define YY_DECL int hsql_lex \ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylval = yylval_param; yylloc = yylloc_param; if ( !yyg->yy_init ) { yyg->yy_init = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yyg->yy_start ) yyg->yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { hsql_ensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = hsql__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); } hsql__load_buffer_state(yyscanner ); } { #line 56 "flex_lexer.l" #line 2291 "flex_lexer.cpp" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = yyg->yy_c_buf_p; /* Support of yytext. */ *yy_cp = yyg->yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yyg->yy_start; yy_match: do { YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1250 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_current_state != 1249 ); yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; yy_find_action: yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yyg->yy_hold_char; yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; goto yy_find_action; case 1: YY_RULE_SETUP #line 58 "flex_lexer.l" BEGIN(COMMENT); YY_BREAK case 2: YY_RULE_SETUP #line 59 "flex_lexer.l" /* skipping comment content until a end of line is read */; YY_BREAK case 3: /* rule 3 can match eol */ YY_RULE_SETUP #line 60 "flex_lexer.l" BEGIN(INITIAL); YY_BREAK case 4: /* rule 4 can match eol */ YY_RULE_SETUP #line 62 "flex_lexer.l" /* skip whitespace */; YY_BREAK case 5: YY_RULE_SETUP #line 64 "flex_lexer.l" TOKEN(HIGH_PRIORITY) YY_BREAK case 6: YY_RULE_SETUP #line 65 "flex_lexer.l" TOKEN(LOW_PRIORITY) YY_BREAK case 7: YY_RULE_SETUP #line 66 "flex_lexer.l" TOKEN(DEALLOCATE) YY_BREAK case 8: YY_RULE_SETUP #line 67 "flex_lexer.l" TOKEN(PARAMETERS) YY_BREAK case 9: YY_RULE_SETUP #line 68 "flex_lexer.l" TOKEN(INTERSECT) YY_BREAK case 10: YY_RULE_SETUP #line 69 "flex_lexer.l" TOKEN(TEMPORARY) YY_BREAK case 11: YY_RULE_SETUP #line 70 "flex_lexer.l" TOKEN(TIMESTAMP) YY_BREAK case 12: YY_RULE_SETUP #line 71 "flex_lexer.l" TOKEN(CHARACTER) YY_BREAK case 13: YY_RULE_SETUP #line 72 "flex_lexer.l" TOKEN(DATABASES) YY_BREAK case 14: YY_RULE_SETUP #line 73 "flex_lexer.l" TOKEN(DATABASE) YY_BREAK case 15: YY_RULE_SETUP #line 74 "flex_lexer.l" TOKEN(DISTINCT) YY_BREAK case 16: YY_RULE_SETUP #line 75 "flex_lexer.l" TOKEN(NVARCHAR) YY_BREAK case 17: YY_RULE_SETUP #line 76 "flex_lexer.l" TOKEN(RESTRICT) YY_BREAK case 18: YY_RULE_SETUP #line 77 "flex_lexer.l" TOKEN(TRUNCATE) YY_BREAK case 19: YY_RULE_SETUP #line 78 "flex_lexer.l" TOKEN(ANALYZE) YY_BREAK case 20: YY_RULE_SETUP #line 79 "flex_lexer.l" TOKEN(BETWEEN) YY_BREAK case 21: YY_RULE_SETUP #line 80 "flex_lexer.l" TOKEN(CASCADE) YY_BREAK case 22: YY_RULE_SETUP #line 81 "flex_lexer.l" TOKEN(COLUMNS) YY_BREAK case 23: YY_RULE_SETUP #line 82 "flex_lexer.l" TOKEN(CONTROL) YY_BREAK case 24: YY_RULE_SETUP #line 83 "flex_lexer.l" TOKEN(DEFAULT) YY_BREAK case 25: YY_RULE_SETUP #line 84 "flex_lexer.l" TOKEN(DELAYED) YY_BREAK case 26: YY_RULE_SETUP #line 85 "flex_lexer.l" TOKEN(EXECUTE) YY_BREAK case 27: YY_RULE_SETUP #line 86 "flex_lexer.l" TOKEN(EXPLAIN) YY_BREAK case 28: YY_RULE_SETUP #line 87 "flex_lexer.l" TOKEN(HISTORY) YY_BREAK case 29: YY_RULE_SETUP #line 88 "flex_lexer.l" TOKEN(INTEGER) YY_BREAK case 30: YY_RULE_SETUP #line 89 "flex_lexer.l" TOKEN(NATURAL) YY_BREAK case 31: YY_RULE_SETUP #line 90 "flex_lexer.l" TOKEN(PREPARE) YY_BREAK case 32: YY_RULE_SETUP #line 91 "flex_lexer.l" TOKEN(PRIMARY) YY_BREAK case 33: YY_RULE_SETUP #line 92 "flex_lexer.l" TOKEN(SCHEMAS) YY_BREAK case 34: YY_RULE_SETUP #line 93 "flex_lexer.l" TOKEN(SPATIAL) YY_BREAK case 35: YY_RULE_SETUP #line 94 "flex_lexer.l" TOKEN(VARCHAR) YY_BREAK case 36: YY_RULE_SETUP #line 95 "flex_lexer.l" TOKEN(VIRTUAL) YY_BREAK case 37: YY_RULE_SETUP #line 96 "flex_lexer.l" TOKEN(BEFORE) YY_BREAK case 38: YY_RULE_SETUP #line 97 "flex_lexer.l" TOKEN(COLUMN) YY_BREAK case 39: YY_RULE_SETUP #line 98 "flex_lexer.l" TOKEN(CREATE) YY_BREAK case 40: YY_RULE_SETUP #line 99 "flex_lexer.l" TOKEN(DELETE) YY_BREAK case 41: YY_RULE_SETUP #line 100 "flex_lexer.l" TOKEN(DIRECT) YY_BREAK case 42: YY_RULE_SETUP #line 101 "flex_lexer.l" TOKEN(DOUBLE) YY_BREAK case 43: YY_RULE_SETUP #line 102 "flex_lexer.l" TOKEN(ESCAPE) YY_BREAK case 44: YY_RULE_SETUP #line 103 "flex_lexer.l" TOKEN(ESCAPED) YY_BREAK case 45: YY_RULE_SETUP #line 104 "flex_lexer.l" TOKEN(EXCEPT) YY_BREAK case 46: YY_RULE_SETUP #line 105 "flex_lexer.l" TOKEN(EXISTS) YY_BREAK case 47: YY_RULE_SETUP #line 106 "flex_lexer.l" TOKEN(EXTRACT) YY_BREAK case 48: YY_RULE_SETUP #line 107 "flex_lexer.l" TOKEN(GLOBAL) YY_BREAK case 49: YY_RULE_SETUP #line 108 "flex_lexer.l" TOKEN(HAVING) YY_BREAK case 50: YY_RULE_SETUP #line 109 "flex_lexer.l" TOKEN(IGNORE) YY_BREAK case 51: YY_RULE_SETUP #line 110 "flex_lexer.l" TOKEN(IMPORT) YY_BREAK case 52: YY_RULE_SETUP #line 111 "flex_lexer.l" TOKEN(INSERT) YY_BREAK case 53: YY_RULE_SETUP #line 112 "flex_lexer.l" TOKEN(ISNULL) YY_BREAK case 54: YY_RULE_SETUP #line 113 "flex_lexer.l" TOKEN(OFFSET) YY_BREAK case 55: YY_RULE_SETUP #line 114 "flex_lexer.l" TOKEN(RENAME) YY_BREAK case 56: YY_RULE_SETUP #line 115 "flex_lexer.l" TOKEN(SCHEMA) YY_BREAK case 57: YY_RULE_SETUP #line 116 "flex_lexer.l" TOKEN(SELECT) YY_BREAK case 58: YY_RULE_SETUP #line 117 "flex_lexer.l" TOKEN(SORTED) YY_BREAK case 59: YY_RULE_SETUP #line 118 "flex_lexer.l" TOKEN(TABLES) YY_BREAK case 60: YY_RULE_SETUP #line 119 "flex_lexer.l" TOKEN(UNIQUE) YY_BREAK case 61: YY_RULE_SETUP #line 120 "flex_lexer.l" TOKEN(UNLOAD) YY_BREAK case 62: YY_RULE_SETUP #line 121 "flex_lexer.l" TOKEN(UPDATE) YY_BREAK case 63: YY_RULE_SETUP #line 122 "flex_lexer.l" TOKEN(VALUES) YY_BREAK case 64: YY_RULE_SETUP #line 123 "flex_lexer.l" TOKEN(AFTER) YY_BREAK case 65: YY_RULE_SETUP #line 124 "flex_lexer.l" TOKEN(ALTER) YY_BREAK case 66: YY_RULE_SETUP #line 125 "flex_lexer.l" TOKEN(ARRAY) YY_BREAK case 67: YY_RULE_SETUP #line 126 "flex_lexer.l" TOKEN(CROSS) YY_BREAK case 68: YY_RULE_SETUP #line 127 "flex_lexer.l" TOKEN(DELTA) YY_BREAK case 69: YY_RULE_SETUP #line 128 "flex_lexer.l" TOKEN(FLOAT) YY_BREAK case 70: YY_RULE_SETUP #line 129 "flex_lexer.l" TOKEN(GROUP) YY_BREAK case 71: YY_RULE_SETUP #line 130 "flex_lexer.l" TOKEN(INDEX) YY_BREAK case 72: YY_RULE_SETUP #line 131 "flex_lexer.l" TOKEN(INNER) YY_BREAK case 73: YY_RULE_SETUP #line 132 "flex_lexer.l" TOKEN(LIMIT) YY_BREAK case 74: YY_RULE_SETUP #line 133 "flex_lexer.l" TOKEN(LOCAL) YY_BREAK case 75: YY_RULE_SETUP #line 134 "flex_lexer.l" TOKEN(MERGE) YY_BREAK case 76: YY_RULE_SETUP #line 135 "flex_lexer.l" TOKEN(MINUS) YY_BREAK case 77: YY_RULE_SETUP #line 136 "flex_lexer.l" TOKEN(ORDER) YY_BREAK case 78: YY_RULE_SETUP #line 137 "flex_lexer.l" TOKEN(OUTER) YY_BREAK case 79: YY_RULE_SETUP #line 138 "flex_lexer.l" TOKEN(QUICK) YY_BREAK case 80: YY_RULE_SETUP #line 139 "flex_lexer.l" TOKEN(RIGHT) YY_BREAK case 81: YY_RULE_SETUP #line 140 "flex_lexer.l" TOKEN(TABLE) YY_BREAK case 82: YY_RULE_SETUP #line 141 "flex_lexer.l" TOKEN(UNION) YY_BREAK case 83: YY_RULE_SETUP #line 142 "flex_lexer.l" TOKEN(USING) YY_BREAK case 84: YY_RULE_SETUP #line 143 "flex_lexer.l" TOKEN(WHERE) YY_BREAK case 85: YY_RULE_SETUP #line 144 "flex_lexer.l" TOKEN(CALL) YY_BREAK case 86: YY_RULE_SETUP #line 145 "flex_lexer.l" TOKEN(CASE) YY_BREAK case 87: YY_RULE_SETUP #line 146 "flex_lexer.l" TOKEN(CHAR) YY_BREAK case 88: YY_RULE_SETUP #line 147 "flex_lexer.l" TOKEN(DATA) YY_BREAK case 89: YY_RULE_SETUP #line 148 "flex_lexer.l" TOKEN(DATE) YY_BREAK case 90: YY_RULE_SETUP #line 149 "flex_lexer.l" TOKEN(DESC) YY_BREAK case 91: YY_RULE_SETUP #line 150 "flex_lexer.l" TOKEN(DROP) YY_BREAK case 92: YY_RULE_SETUP #line 151 "flex_lexer.l" TOKEN(ELSE) YY_BREAK case 93: YY_RULE_SETUP #line 152 "flex_lexer.l" TOKEN(INFILE) YY_BREAK case 94: YY_RULE_SETUP #line 153 "flex_lexer.l" TOKEN(FILE) YY_BREAK case 95: YY_RULE_SETUP #line 154 "flex_lexer.l" TOKEN(FROM) YY_BREAK case 96: YY_RULE_SETUP #line 155 "flex_lexer.l" TOKEN(FULL) YY_BREAK case 97: YY_RULE_SETUP #line 156 "flex_lexer.l" TOKEN(HASH) YY_BREAK case 98: YY_RULE_SETUP #line 157 "flex_lexer.l" TOKEN(HINT) YY_BREAK case 99: YY_RULE_SETUP #line 158 "flex_lexer.l" TOKEN(INTO) YY_BREAK case 100: YY_RULE_SETUP #line 159 "flex_lexer.l" TOKEN(JOIN) YY_BREAK case 101: YY_RULE_SETUP #line 160 "flex_lexer.l" TOKEN(LEFT) YY_BREAK case 102: YY_RULE_SETUP #line 161 "flex_lexer.l" TOKEN(LIKE) YY_BREAK case 103: YY_RULE_SETUP #line 162 "flex_lexer.l" TOKEN(ILIKE) YY_BREAK case 104: YY_RULE_SETUP #line 163 "flex_lexer.l" TOKEN(LOAD) YY_BREAK case 105: YY_RULE_SETUP #line 164 "flex_lexer.l" TOKEN(LONG) YY_BREAK case 106: YY_RULE_SETUP #line 165 "flex_lexer.l" TOKEN(NULL) YY_BREAK case 107: YY_RULE_SETUP #line 166 "flex_lexer.l" TOKEN(PLAN) YY_BREAK case 108: YY_RULE_SETUP #line 167 "flex_lexer.l" TOKEN(SHOW) YY_BREAK case 109: YY_RULE_SETUP #line 168 "flex_lexer.l" TOKEN(TEXT) YY_BREAK case 110: YY_RULE_SETUP #line 169 "flex_lexer.l" TOKEN(THEN) YY_BREAK case 111: YY_RULE_SETUP #line 170 "flex_lexer.l" TOKEN(TIME) YY_BREAK case 112: YY_RULE_SETUP #line 171 "flex_lexer.l" TOKEN(VIEW) YY_BREAK case 113: YY_RULE_SETUP #line 172 "flex_lexer.l" TOKEN(WHEN) YY_BREAK case 114: YY_RULE_SETUP #line 173 "flex_lexer.l" TOKEN(WITH) YY_BREAK case 115: YY_RULE_SETUP #line 174 "flex_lexer.l" TOKEN(ADD) YY_BREAK case 116: YY_RULE_SETUP #line 175 "flex_lexer.l" TOKEN(ALL) YY_BREAK case 117: YY_RULE_SETUP #line 176 "flex_lexer.l" TOKEN(AND) YY_BREAK case 118: YY_RULE_SETUP #line 177 "flex_lexer.l" TOKEN(ASC) YY_BREAK case 119: YY_RULE_SETUP #line 178 "flex_lexer.l" TOKEN(CSV) YY_BREAK case 120: YY_RULE_SETUP #line 179 "flex_lexer.l" TOKEN(END) YY_BREAK case 121: YY_RULE_SETUP #line 180 "flex_lexer.l" TOKEN(FOR) YY_BREAK case 122: YY_RULE_SETUP #line 181 "flex_lexer.l" TOKEN(INT) YY_BREAK case 123: YY_RULE_SETUP #line 182 "flex_lexer.l" TOKEN(KEY) YY_BREAK case 124: YY_RULE_SETUP #line 183 "flex_lexer.l" TOKEN(NOT) YY_BREAK case 125: YY_RULE_SETUP #line 184 "flex_lexer.l" TOKEN(OFF) YY_BREAK case 126: YY_RULE_SETUP #line 185 "flex_lexer.l" TOKEN(SET) YY_BREAK case 127: YY_RULE_SETUP #line 186 "flex_lexer.l" TOKEN(TBL) YY_BREAK case 128: YY_RULE_SETUP #line 187 "flex_lexer.l" TOKEN(TOP) YY_BREAK case 129: YY_RULE_SETUP #line 188 "flex_lexer.l" TOKEN(AS) YY_BREAK case 130: YY_RULE_SETUP #line 189 "flex_lexer.l" TOKEN(BY) YY_BREAK case 131: YY_RULE_SETUP #line 190 "flex_lexer.l" TOKEN(IF) YY_BREAK case 132: YY_RULE_SETUP #line 191 "flex_lexer.l" TOKEN(IN) YY_BREAK case 133: YY_RULE_SETUP #line 192 "flex_lexer.l" TOKEN(IS) YY_BREAK case 134: YY_RULE_SETUP #line 193 "flex_lexer.l" TOKEN(OF) YY_BREAK case 135: YY_RULE_SETUP #line 194 "flex_lexer.l" TOKEN(ON) YY_BREAK case 136: YY_RULE_SETUP #line 195 "flex_lexer.l" TOKEN(OR) YY_BREAK case 137: YY_RULE_SETUP #line 196 "flex_lexer.l" TOKEN(TO) YY_BREAK case 138: YY_RULE_SETUP #line 197 "flex_lexer.l" TOKEN(SECOND) YY_BREAK case 139: YY_RULE_SETUP #line 198 "flex_lexer.l" TOKEN(MINUTE) YY_BREAK case 140: YY_RULE_SETUP #line 199 "flex_lexer.l" TOKEN(HOUR) YY_BREAK case 141: YY_RULE_SETUP #line 200 "flex_lexer.l" TOKEN(DAY) YY_BREAK case 142: YY_RULE_SETUP #line 201 "flex_lexer.l" TOKEN(MONTH) YY_BREAK case 143: YY_RULE_SETUP #line 202 "flex_lexer.l" TOKEN(YEAR) YY_BREAK case 144: YY_RULE_SETUP #line 203 "flex_lexer.l" TOKEN(TRUE) YY_BREAK case 145: YY_RULE_SETUP #line 204 "flex_lexer.l" TOKEN(FALSE) YY_BREAK case 146: YY_RULE_SETUP #line 205 "flex_lexer.l" TOKEN(CONCURRENT) YY_BREAK case 147: YY_RULE_SETUP #line 206 "flex_lexer.l" TOKEN(REPLACE) YY_BREAK case 148: YY_RULE_SETUP #line 207 "flex_lexer.l" TOKEN(PARTITION) YY_BREAK case 149: YY_RULE_SETUP #line 208 "flex_lexer.l" TOKEN(FIELDS) YY_BREAK case 150: YY_RULE_SETUP #line 209 "flex_lexer.l" TOKEN(TERMINATED) YY_BREAK case 151: YY_RULE_SETUP #line 210 "flex_lexer.l" TOKEN(OPTIONALLY) YY_BREAK case 152: YY_RULE_SETUP #line 211 "flex_lexer.l" TOKEN(ENCLOSED) YY_BREAK case 153: YY_RULE_SETUP #line 212 "flex_lexer.l" TOKEN(LINES) YY_BREAK case 154: YY_RULE_SETUP #line 213 "flex_lexer.l" TOKEN(ROWS) YY_BREAK case 155: YY_RULE_SETUP #line 214 "flex_lexer.l" TOKEN(STARTING) YY_BREAK /* Allow =/== see https://sqlite.org/lang_expr.html#collateop */ case 156: YY_RULE_SETUP #line 217 "flex_lexer.l" TOKEN(EQUALS) YY_BREAK case 157: YY_RULE_SETUP #line 218 "flex_lexer.l" TOKEN(NOTEQUALS) YY_BREAK case 158: YY_RULE_SETUP #line 219 "flex_lexer.l" TOKEN(NOTEQUALS) YY_BREAK case 159: YY_RULE_SETUP #line 220 "flex_lexer.l" TOKEN(LESSEQ) YY_BREAK case 160: YY_RULE_SETUP #line 221 "flex_lexer.l" TOKEN(GREATEREQ) YY_BREAK case 161: YY_RULE_SETUP #line 222 "flex_lexer.l" TOKEN(CONCAT) YY_BREAK case 162: YY_RULE_SETUP #line 224 "flex_lexer.l" { return yytext[0]; } YY_BREAK case 163: #line 227 "flex_lexer.l" case 164: YY_RULE_SETUP #line 227 "flex_lexer.l" { yylval->fval = atof(yytext); return SQL_FLOATVAL; } YY_BREAK case 165: YY_RULE_SETUP #line 232 "flex_lexer.l" { yylval->ival = atol(yytext); return SQL_INTVAL; } YY_BREAK case 166: YY_RULE_SETUP #line 237 "flex_lexer.l" { // Crop the leading and trailing quote char yylval->sval = hsql::substr(yytext, 1, strlen(yytext)-1); return SQL_IDENTIFIER; } YY_BREAK case 167: YY_RULE_SETUP #line 243 "flex_lexer.l" { // Crop the leading and trailing backtick char yylval->sval = hsql::substr(yytext, 1, strlen(yytext)-1); return SQL_IDENTIFIER; } YY_BREAK case 168: YY_RULE_SETUP #line 249 "flex_lexer.l" { yylval->sval = strdup(yytext); return SQL_IDENTIFIER; } YY_BREAK case 169: YY_RULE_SETUP #line 254 "flex_lexer.l" { BEGIN singlequotedstring; strbuf = std::stringstream{}; } YY_BREAK case 170: YY_RULE_SETUP #line 255 "flex_lexer.l" { strbuf << '\''; } YY_BREAK case 171: /* rule 171 can match eol */ YY_RULE_SETUP #line 256 "flex_lexer.l" { strbuf << yytext; } YY_BREAK case 172: YY_RULE_SETUP #line 257 "flex_lexer.l" { BEGIN 0; yylval->sval = strdup(strbuf.str().c_str()); return SQL_STRING; } YY_BREAK case YY_STATE_EOF(singlequotedstring): #line 258 "flex_lexer.l" { fprintf(stderr, "[SQL-Lexer-Error] Unterminated string\n"); return 0; } YY_BREAK case 173: YY_RULE_SETUP #line 260 "flex_lexer.l" { fprintf(stderr, "[SQL-Lexer-Error] Unknown Character: %c\n", yytext[0]); return 0; } YY_BREAK case 174: YY_RULE_SETUP #line 263 "flex_lexer.l" ECHO; YY_BREAK #line 3236 "flex_lexer.cpp" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(COMMENT): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yyg->yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * hsql_lex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( yyscanner ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yyg->yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; goto yy_find_action; } } else switch ( yy_get_next_buffer( yyscanner ) ) { case EOB_ACT_END_OF_FILE: { yyg->yy_did_buffer_switch_on_eof = 0; if ( hsql_wrap(yyscanner ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( yyscanner ); yy_cp = yyg->yy_c_buf_p; yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yyg->yy_c_buf_p = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; yy_current_state = yy_get_previous_state( yyscanner ); yy_cp = yyg->yy_c_buf_p; yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ } /* end of hsql_lex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = yyg->yytext_ptr; yy_size_t number_to_move, i; int ret_val; if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; else { yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ hsql_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } if ( yyg->yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; hsql_restart(yyin ,yyscanner); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((int) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) hsql_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } yyg->yy_n_chars += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { yy_state_type yy_current_state; char *yy_cp; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_current_state = yyg->yy_start; for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1250 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) { int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ char *yy_cp = yyg->yy_c_buf_p; YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1250 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 1249); (void)yyg; return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner) #else static int input (yyscan_t yyscanner) #endif { int c; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; *yyg->yy_c_buf_p = yyg->yy_hold_char; if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) /* This was really a NUL. */ *yyg->yy_c_buf_p = '\0'; else { /* need more input */ yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ hsql_restart(yyin ,yyscanner); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( hsql_wrap(yyscanner ) ) return EOF; if ( ! yyg->yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(yyscanner); #else return input(yyscanner); #endif } case EOB_ACT_CONTINUE_SCAN: yyg->yy_c_buf_p = yyg->yytext_ptr + offset; break; } } } c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ yyg->yy_hold_char = *++yyg->yy_c_buf_p; return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * @param yyscanner The scanner object. * @note This function does not reset the start condition to @c INITIAL . */ void hsql_restart (FILE * input_file , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! YY_CURRENT_BUFFER ){ hsql_ensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = hsql__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); } hsql__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); hsql__load_buffer_state(yyscanner ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * @param yyscanner The scanner object. */ void hsql__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* TODO. We should be able to replace this entire function body * with * hsql_pop_buffer_state(); * hsql_push_buffer_state(new_buffer); */ hsql_ensure_buffer_stack (yyscanner); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *yyg->yy_c_buf_p = yyg->yy_hold_char; YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } YY_CURRENT_BUFFER_LVALUE = new_buffer; hsql__load_buffer_state(yyscanner ); /* We don't actually know whether we did this switch during * EOF (hsql_wrap()) processing, but the only time this flag * is looked at is after hsql_wrap() is called, so it's safe * to go ahead and always set it. */ yyg->yy_did_buffer_switch_on_eof = 1; } static void hsql__load_buffer_state (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; yyg->yy_hold_char = *yyg->yy_c_buf_p; } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * @param yyscanner The scanner object. * @return the allocated buffer state. */ YY_BUFFER_STATE hsql__create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) hsql_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in hsql__create_buffer()" ); b->yy_buf_size = (yy_size_t)size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) hsql_alloc(b->yy_buf_size + 2 ,yyscanner ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in hsql__create_buffer()" ); b->yy_is_our_buffer = 1; hsql__init_buffer(b,file ,yyscanner); return b; } /** Destroy the buffer. * @param b a buffer created with hsql__create_buffer() * @param yyscanner The scanner object. */ void hsql__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) hsql_free((void *) b->yy_ch_buf ,yyscanner ); hsql_free((void *) b ,yyscanner ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a hsql_restart() or at EOF. */ static void hsql__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) { int oerrno = errno; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; hsql__flush_buffer(b ,yyscanner); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then hsql__init_buffer was _probably_ * called from hsql_restart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * @param yyscanner The scanner object. */ void hsql__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) hsql__load_buffer_state(yyscanner ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * @param yyscanner The scanner object. */ void hsql_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (new_buffer == NULL) return; hsql_ensure_buffer_stack(yyscanner); /* This block is copied from hsql__switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *yyg->yy_c_buf_p = yyg->yy_hold_char; YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) yyg->yy_buffer_stack_top++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from hsql__switch_to_buffer. */ hsql__load_buffer_state(yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * @param yyscanner The scanner object. */ void hsql_pop_buffer_state (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!YY_CURRENT_BUFFER) return; hsql__delete_buffer(YY_CURRENT_BUFFER ,yyscanner); YY_CURRENT_BUFFER_LVALUE = NULL; if (yyg->yy_buffer_stack_top > 0) --yyg->yy_buffer_stack_top; if (YY_CURRENT_BUFFER) { hsql__load_buffer_state(yyscanner ); yyg->yy_did_buffer_switch_on_eof = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void hsql_ensure_buffer_stack (yyscan_t yyscanner) { yy_size_t num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ yyg->yy_buffer_stack = (struct yy_buffer_state**)hsql_alloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in hsql_ensure_buffer_stack()" ); memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); yyg->yy_buffer_stack_max = num_to_alloc; yyg->yy_buffer_stack_top = 0; return; } if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ /* Increase the buffer to prepare for a possible push. */ yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = yyg->yy_buffer_stack_max + grow_size; yyg->yy_buffer_stack = (struct yy_buffer_state**)hsql_realloc (yyg->yy_buffer_stack, num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in hsql_ensure_buffer_stack()" ); /* zero only the new slots.*/ memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); yyg->yy_buffer_stack_max = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ YY_BUFFER_STATE hsql__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) hsql_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in hsql__scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; hsql__switch_to_buffer(b ,yyscanner ); return b; } /** Setup the input buffer state to scan a string. The next call to hsql_lex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * @param yyscanner The scanner object. * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * hsql__scan_bytes() instead. */ YY_BUFFER_STATE hsql__scan_string (yyconst char * yystr , yyscan_t yyscanner) { return hsql__scan_bytes(yystr,strlen(yystr) ,yyscanner); } /** Setup the input buffer state to scan the given bytes. The next call to hsql_lex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ YY_BUFFER_STATE hsql__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; yy_size_t n; yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) hsql_alloc(n ,yyscanner ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in hsql__scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = hsql__scan_buffer(buf,n ,yyscanner); if ( ! b ) YY_FATAL_ERROR( "bad buffer in hsql__scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; (void)yyg; (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = yyg->yy_hold_char; \ yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ yyg->yy_hold_char = *yyg->yy_c_buf_p; \ *yyg->yy_c_buf_p = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the user-defined data for this scanner. * @param yyscanner The scanner object. */ YY_EXTRA_TYPE hsql_get_extra (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyextra; } /** Get the current line number. * @param yyscanner The scanner object. */ int hsql_get_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (! YY_CURRENT_BUFFER) return 0; return yylineno; } /** Get the current column number. * @param yyscanner The scanner object. */ int hsql_get_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (! YY_CURRENT_BUFFER) return 0; return yycolumn; } /** Get the input stream. * @param yyscanner The scanner object. */ FILE *hsql_get_in (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyin; } /** Get the output stream. * @param yyscanner The scanner object. */ FILE *hsql_get_out (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyout; } /** Get the length of the current token. * @param yyscanner The scanner object. */ yy_size_t hsql_get_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; } /** Get the current token. * @param yyscanner The scanner object. */ char *hsql_get_text (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yytext; } /** Set the user-defined data. This data is never touched by the scanner. * @param user_defined The data to be associated with this scanner. * @param yyscanner The scanner object. */ void hsql_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyextra = user_defined ; } /** Set the current line number. * @param _line_number line number * @param yyscanner The scanner object. */ void hsql_set_lineno (int _line_number , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) YY_FATAL_ERROR( "hsql_set_lineno called with no buffer" ); yylineno = _line_number; } /** Set the current column. * @param _column_no column number * @param yyscanner The scanner object. */ void hsql_set_column (int _column_no , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) YY_FATAL_ERROR( "hsql_set_column called with no buffer" ); yycolumn = _column_no; } /** Set the input stream. This does not discard the current * input buffer. * @param _in_str A readable stream. * @param yyscanner The scanner object. * @see hsql__switch_to_buffer */ void hsql_set_in (FILE * _in_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyin = _in_str ; } void hsql_set_out (FILE * _out_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyout = _out_str ; } int hsql_get_debug (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yy_flex_debug; } void hsql_set_debug (int _bdebug , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_flex_debug = _bdebug ; } /* Accessor methods for yylval and yylloc */ YYSTYPE * hsql_get_lval (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylval; } void hsql_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylval = yylval_param; } YYLTYPE *hsql_get_lloc (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylloc; } void hsql_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylloc = yylloc_param; } /* User-visible API */ /* hsql_lex_init is special because it creates the scanner itself, so it is * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ int hsql_lex_init(yyscan_t* ptr_yy_globals) { if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } *ptr_yy_globals = (yyscan_t) hsql_alloc ( sizeof( struct yyguts_t ), NULL ); if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); return yy_init_globals ( *ptr_yy_globals ); } /* hsql_lex_init_extra has the same functionality as hsql_lex_init, but follows the * convention of taking the scanner as the last argument. Note however, that * this is a *pointer* to a scanner, as it will be allocated by this call (and * is the reason, too, why this function also must handle its own declaration). * The user defined value in the first argument will be available to hsql_alloc in * the yyextra field. */ int hsql_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) { struct yyguts_t dummy_yyguts; hsql_set_extra (yy_user_defined, &dummy_yyguts); if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } *ptr_yy_globals = (yyscan_t) hsql_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); hsql_set_extra (yy_user_defined, *ptr_yy_globals); return yy_init_globals ( *ptr_yy_globals ); } static int yy_init_globals (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Initialization is the same as for the non-reentrant scanner. * This function is called from hsql_lex_destroy(), so don't allocate here. */ yyg->yy_buffer_stack = 0; yyg->yy_buffer_stack_top = 0; yyg->yy_buffer_stack_max = 0; yyg->yy_c_buf_p = (char *) 0; yyg->yy_init = 0; yyg->yy_start = 0; yyg->yy_start_stack_ptr = 0; yyg->yy_start_stack_depth = 0; yyg->yy_start_stack = NULL; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * hsql_lex_init() */ return 0; } /* hsql_lex_destroy is for both reentrant and non-reentrant scanners. */ int hsql_lex_destroy (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ hsql__delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; hsql_pop_buffer_state(yyscanner); } /* Destroy the stack itself. */ hsql_free(yyg->yy_buffer_stack ,yyscanner); yyg->yy_buffer_stack = NULL; /* Destroy the start condition stack. */ hsql_free(yyg->yy_start_stack ,yyscanner ); yyg->yy_start_stack = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * hsql_lex() is called, initialization will occur. */ yy_init_globals( yyscanner); /* Destroy the main struct (reentrant only). */ hsql_free ( yyscanner , yyscanner ); yyscanner = NULL; return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; (void)yyg; int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) { int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *hsql_alloc (yy_size_t size , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; (void)yyg; return (void *) malloc( size ); } void *hsql_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; (void)yyg; /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void hsql_free (void * ptr , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; (void)yyg; free( (char *) ptr ); /* see hsql_realloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 263 "flex_lexer.l" /*************************** ** Section 3: User code ***************************/ int yyerror(const char *msg) { fprintf(stderr, "[SQL-Lexer-Error] %s\n",msg); return 0; } 07070100000040000081A4000003E800000064000000015C0989F30000237C000000000000000000000000000000000000003300000000sql-parser-1.5+git20181206/src/parser/flex_lexer.h#ifndef hsql_HEADER_H #define hsql_HEADER_H 1 #define hsql_IN_HEADER 1 #line 6 "flex_lexer.h" #line 8 "flex_lexer.h" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 #define YY_FLEX_SUBMINOR_VERSION 0 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include <stdio.h> #include <string.h> #include <errno.h> #include <stdlib.h> /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include <inttypes.h> typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T #define YY_TYPEDEF_YY_SCANNER_T typedef void* yyscan_t; #endif /* For convenience, these vars (plus the bison vars far below) are macros in the reentrant scanner. */ #define yyin yyg->yyin_r #define yyout yyg->yyout_r #define yyextra yyg->yyextra_r #define yyleng yyg->yyleng_r #define yytext yyg->yytext_r #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) #define yy_flex_debug yyg->yy_flex_debug_r /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ void hsql_restart (FILE *input_file ,yyscan_t yyscanner ); void hsql__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); YY_BUFFER_STATE hsql__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); void hsql__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); void hsql__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); void hsql_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); void hsql_pop_buffer_state (yyscan_t yyscanner ); YY_BUFFER_STATE hsql__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE hsql__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); YY_BUFFER_STATE hsql__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); void *hsql_alloc (yy_size_t ,yyscan_t yyscanner ); void *hsql_realloc (void *,yy_size_t ,yyscan_t yyscanner ); void hsql_free (void * ,yyscan_t yyscanner ); /* Begin user sect3 */ #define hsql_wrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP #define yytext_ptr yytext_r #ifdef YY_HEADER_EXPORT_START_CONDITIONS #define INITIAL 0 #define singlequotedstring 1 #define COMMENT 2 #endif #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include <unistd.h> #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif int hsql_lex_init (yyscan_t* scanner); int hsql_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int hsql_lex_destroy (yyscan_t yyscanner ); int hsql_get_debug (yyscan_t yyscanner ); void hsql_set_debug (int debug_flag ,yyscan_t yyscanner ); YY_EXTRA_TYPE hsql_get_extra (yyscan_t yyscanner ); void hsql_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); FILE *hsql_get_in (yyscan_t yyscanner ); void hsql_set_in (FILE * _in_str ,yyscan_t yyscanner ); FILE *hsql_get_out (yyscan_t yyscanner ); void hsql_set_out (FILE * _out_str ,yyscan_t yyscanner ); yy_size_t hsql_get_leng (yyscan_t yyscanner ); char *hsql_get_text (yyscan_t yyscanner ); int hsql_get_lineno (yyscan_t yyscanner ); void hsql_set_lineno (int _line_number ,yyscan_t yyscanner ); int hsql_get_column (yyscan_t yyscanner ); void hsql_set_column (int _column_no ,yyscan_t yyscanner ); YYSTYPE * hsql_get_lval (yyscan_t yyscanner ); void hsql_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); YYLTYPE *hsql_get_lloc (yyscan_t yyscanner ); void hsql_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int hsql_wrap (yyscan_t yyscanner ); #else extern int hsql_wrap (yyscan_t yyscanner ); #endif #endif #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int hsql_lex \ (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); #define YY_DECL int hsql_lex \ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) #endif /* !YY_DECL */ /* yy_get_previous_state - get the state just before the EOB char was reached */ #undef YY_NEW_FILE #undef YY_FLUSH_BUFFER #undef yy_set_bol #undef yy_new_buffer #undef yy_set_interactive #undef YY_DO_BEFORE_ACTION #ifdef YY_DECL_IS_OURS #undef YY_DECL_IS_OURS #undef YY_DECL #endif #line 263 "flex_lexer.l" #line 364 "flex_lexer.h" #undef hsql_IN_HEADER #endif /* hsql_HEADER_H */ 07070100000041000081A4000003E800000064000000015C0989F30000168B000000000000000000000000000000000000003300000000sql-parser-1.5+git20181206/src/parser/flex_lexer.l/** * lexer * * */ /*************************** ** Section 1: Definitions ***************************/ %{ #include "../../include/sqlparser/Expr.h" #include "bison_parser.h" #include <stdio.h> #include <sstream> #define TOKEN(name) { return SQL_##name; } static std::stringstream strbuf; %} %x singlequotedstring /*************************** ** Section 2: Rules ***************************/ /* Define the output files */ %option header-file="flex_lexer.h" %option outfile="flex_lexer.cpp" /* Make reentrant */ %option reentrant %option bison-bridge /* performance tweaks */ %option never-interactive %option batch /* other flags */ %option noyywrap %option nounput %option warn %option case-insensitive %option prefix="hsql_" %option bison-locations /* %option nodefault */ %s COMMENT /*************************** ** Section 3: Rules ***************************/ %% -- BEGIN(COMMENT); <COMMENT>[^\n]* /* skipping comment content until a end of line is read */; <COMMENT>\n BEGIN(INITIAL); [ \t\n]+ /* skip whitespace */; HIGH_PRIORITY TOKEN(HIGH_PRIORITY) LOW_PRIORITY TOKEN(LOW_PRIORITY) DEALLOCATE TOKEN(DEALLOCATE) PARAMETERS TOKEN(PARAMETERS) INTERSECT TOKEN(INTERSECT) TEMPORARY TOKEN(TEMPORARY) TIMESTAMP TOKEN(TIMESTAMP) CHARACTER TOKEN(CHARACTER) DATABASES TOKEN(DATABASES) DATABASE TOKEN(DATABASE) DISTINCT TOKEN(DISTINCT) NVARCHAR TOKEN(NVARCHAR) RESTRICT TOKEN(RESTRICT) TRUNCATE TOKEN(TRUNCATE) ANALYZE TOKEN(ANALYZE) BETWEEN TOKEN(BETWEEN) CASCADE TOKEN(CASCADE) COLUMNS TOKEN(COLUMNS) CONTROL TOKEN(CONTROL) DEFAULT TOKEN(DEFAULT) DELAYED TOKEN(DELAYED) EXECUTE TOKEN(EXECUTE) EXPLAIN TOKEN(EXPLAIN) HISTORY TOKEN(HISTORY) INTEGER TOKEN(INTEGER) NATURAL TOKEN(NATURAL) PREPARE TOKEN(PREPARE) PRIMARY TOKEN(PRIMARY) SCHEMAS TOKEN(SCHEMAS) SPATIAL TOKEN(SPATIAL) VARCHAR TOKEN(VARCHAR) VIRTUAL TOKEN(VIRTUAL) BEFORE TOKEN(BEFORE) COLUMN TOKEN(COLUMN) CREATE TOKEN(CREATE) DELETE TOKEN(DELETE) DIRECT TOKEN(DIRECT) DOUBLE TOKEN(DOUBLE) ESCAPE TOKEN(ESCAPE) ESCAPED TOKEN(ESCAPED) EXCEPT TOKEN(EXCEPT) EXISTS TOKEN(EXISTS) EXTRACT TOKEN(EXTRACT) GLOBAL TOKEN(GLOBAL) HAVING TOKEN(HAVING) IGNORE TOKEN(IGNORE) IMPORT TOKEN(IMPORT) INSERT TOKEN(INSERT) ISNULL TOKEN(ISNULL) OFFSET TOKEN(OFFSET) RENAME TOKEN(RENAME) SCHEMA TOKEN(SCHEMA) SELECT TOKEN(SELECT) SORTED TOKEN(SORTED) TABLES TOKEN(TABLES) UNIQUE TOKEN(UNIQUE) UNLOAD TOKEN(UNLOAD) UPDATE TOKEN(UPDATE) VALUES TOKEN(VALUES) AFTER TOKEN(AFTER) ALTER TOKEN(ALTER) ARRAY TOKEN(ARRAY) CROSS TOKEN(CROSS) DELTA TOKEN(DELTA) FLOAT TOKEN(FLOAT) GROUP TOKEN(GROUP) INDEX TOKEN(INDEX) INNER TOKEN(INNER) LIMIT TOKEN(LIMIT) LOCAL TOKEN(LOCAL) MERGE TOKEN(MERGE) MINUS TOKEN(MINUS) ORDER TOKEN(ORDER) OUTER TOKEN(OUTER) QUICK TOKEN(QUICK) RIGHT TOKEN(RIGHT) TABLE TOKEN(TABLE) UNION TOKEN(UNION) USING TOKEN(USING) WHERE TOKEN(WHERE) CALL TOKEN(CALL) CASE TOKEN(CASE) CHAR TOKEN(CHAR) DATA TOKEN(DATA) DATE TOKEN(DATE) DESC TOKEN(DESC) DROP TOKEN(DROP) ELSE TOKEN(ELSE) INFILE TOKEN(INFILE) FILE TOKEN(FILE) FROM TOKEN(FROM) FULL TOKEN(FULL) HASH TOKEN(HASH) HINT TOKEN(HINT) INTO TOKEN(INTO) JOIN TOKEN(JOIN) LEFT TOKEN(LEFT) LIKE TOKEN(LIKE) ILIKE TOKEN(ILIKE) LOAD TOKEN(LOAD) LONG TOKEN(LONG) NULL TOKEN(NULL) PLAN TOKEN(PLAN) SHOW TOKEN(SHOW) TEXT TOKEN(TEXT) THEN TOKEN(THEN) TIME TOKEN(TIME) VIEW TOKEN(VIEW) WHEN TOKEN(WHEN) WITH TOKEN(WITH) ADD TOKEN(ADD) ALL TOKEN(ALL) AND TOKEN(AND) ASC TOKEN(ASC) CSV TOKEN(CSV) END TOKEN(END) FOR TOKEN(FOR) INT TOKEN(INT) KEY TOKEN(KEY) NOT TOKEN(NOT) OFF TOKEN(OFF) SET TOKEN(SET) TBL TOKEN(TBL) TOP TOKEN(TOP) AS TOKEN(AS) BY TOKEN(BY) IF TOKEN(IF) IN TOKEN(IN) IS TOKEN(IS) OF TOKEN(OF) ON TOKEN(ON) OR TOKEN(OR) TO TOKEN(TO) SECOND TOKEN(SECOND) MINUTE TOKEN(MINUTE) HOUR TOKEN(HOUR) DAY TOKEN(DAY) MONTH TOKEN(MONTH) YEAR TOKEN(YEAR) TRUE TOKEN(TRUE) FALSE TOKEN(FALSE) CONCURRENT TOKEN(CONCURRENT) REPLACE TOKEN(REPLACE) PARTITION TOKEN(PARTITION) FIELDS TOKEN(FIELDS) TERMINATED TOKEN(TERMINATED) OPTIONALLY TOKEN(OPTIONALLY) ENCLOSED TOKEN(ENCLOSED) LINES TOKEN(LINES) ROWS TOKEN(ROWS) STARTING TOKEN(STARTING) /* Allow =/== see https://sqlite.org/lang_expr.html#collateop */ "==" TOKEN(EQUALS) "!=" TOKEN(NOTEQUALS) "<>" TOKEN(NOTEQUALS) "<=" TOKEN(LESSEQ) ">=" TOKEN(GREATEREQ) "||" TOKEN(CONCAT) [-+*/(){},.;<>=^%:?[\]|] { return yytext[0]; } -?[0-9]+"."[0-9]* | "."[0-9]* { yylval->fval = atof(yytext); return SQL_FLOATVAL; } -?[0-9]+ { yylval->ival = atol(yytext); return SQL_INTVAL; } \"[^\"\n]+\" { // Crop the leading and trailing quote char yylval->sval = hsql::substr(yytext, 1, strlen(yytext)-1); return SQL_IDENTIFIER; } \`[^\`\n]+\` { // Crop the leading and trailing backtick char yylval->sval = hsql::substr(yytext, 1, strlen(yytext)-1); return SQL_IDENTIFIER; } [\@A-Za-z][\@A-Za-z0-9_]* { yylval->sval = strdup(yytext); return SQL_IDENTIFIER; } \' { BEGIN singlequotedstring; strbuf = std::stringstream{}; } <singlequotedstring>\'\' { strbuf << '\''; } <singlequotedstring>[^']* { strbuf << yytext; } <singlequotedstring>\' { BEGIN 0; yylval->sval = strdup(strbuf.str().c_str()); return SQL_STRING; } <singlequotedstring><<EOF>> { fprintf(stderr, "[SQL-Lexer-Error] Unterminated string\n"); return 0; } . { fprintf(stderr, "[SQL-Lexer-Error] Unknown Character: %c\n", yytext[0]); return 0; } %% /*************************** ** Section 3: User code ***************************/ int yyerror(const char *msg) { fprintf(stderr, "[SQL-Lexer-Error] %s\n",msg); return 0; } 07070100000042000081A4000003E800000064000000015C0989F3000003DB000000000000000000000000000000000000003F00000000sql-parser-1.5+git20181206/src/parser/keywordlist_generator.py import math with open("sql_keywords.txt", 'r') as fh: keywords = [line.strip() for line in fh.readlines() if not line.strip().startswith("//") and len(line.strip()) > 0] keywords = sorted(set(keywords)) # Sort by name keywords = sorted(keywords, key=lambda x: len(x), reverse=True) # Sort by length ################# # Flex max_len = len(max(keywords, key=lambda x: len(x))) + 1 max_len = 4 * int(math.ceil(max_len / 4.0)) for keyword in keywords: len_diff = (max_len) - len(keyword) num_tabs = int(math.floor(len_diff / 4.0)) if len_diff % 4 != 0: num_tabs += 1 tabs = ''.join(['\t' for _ in range(num_tabs)]) print "%s%sTOKEN(%s)" % (keyword, tabs, keyword) # ################# ################# # Bison line = "%token" max_len = 60 print "/* SQL Keywords */" for keyword in keywords: if len(line + " " + keyword) > max_len: print line line = "%token " + keyword else: line = line + " " + keyword print line # #################07070100000043000081A4000003E800000064000000015C0989F30000023B000000000000000000000000000000000000003700000000sql-parser-1.5+git20181206/src/parser/parser_typedef.h#ifndef __PARSER_TYPEDEF_H__ #define __PARSER_TYPEDEF_H__ #include <vector> #ifndef YYtypeDEF_YY_SCANNER_T #define YYtypeDEF_YY_SCANNER_T typedef void* yyscan_t; #endif #define YYSTYPE HSQL_STYPE #define YYLTYPE HSQL_LTYPE struct HSQL_CUST_LTYPE { int first_line; int first_column; int last_line; int last_column; int total_column; // Length of the string in the SQL query string int string_length; // Parameters. // int param_id; std::vector<void*> param_list; }; #define HSQL_LTYPE HSQL_CUST_LTYPE #define HSQL_LTYPE_IS_DECLARED 1 #endif07070100000044000081A4000003E800000064000000015C0989F300000497000000000000000000000000000000000000003700000000sql-parser-1.5+git20181206/src/parser/sql_keywords.txt// Possible source for more tokens https://www.sqlite.org/lang_keywords.html ////////////////////////// // Select Statement SELECT TOP FROM WHERE GROUP BY HAVING ORDER ASC DESC LIMIT DISTINCT OFFSET UNION ALL EXCEPT MINUS INTERSECT // Join clause JOIN ON INNER OUTER LEFT RIGHT FULL CROSS USING NATURAL // Select Statement ////////////////////// // Data Definition CREATE TABLE SCHEMA INDEX VIEW IF NOT EXISTS GLOBAL LOCAL TEMPORARY UNIQUE VIRTUAL INDEX UNIQUE HASH SPATIAL PRIMARY KEY ON DROP TABLE SCHEMA RESTRICT CASCADE ALTER ADD COLUMN BEFORE AFTER // Data Definition //////////////////////// // Data Manipulation INSERT VALUES DIRECT SORTED IMPORT CSV FILE TBL CONTROL UPDATE SET DELETE HISTORY TRUNCATE MERGE HISTORY DELTA OF LOAD UNLOAD DELETE // Prepared Statements DEALLOCATE PREPARE EXECUTE /////////////////////////////// // other statements RENAME EXPLAIN PLAN ANALYZE SHOW SCHEMAS TABLES COLUMNS // misc. COLUMN INTO AS SET DEFAULT CALL FOR TO ARRAY // Expressions NOT AND OR NULL LIKE IN IS ISNULL BETWEEN ESCAPE CASE WHEN THEN ELSE END // With WITH HINT PARAMETERS ON OFF // Data types DATE TIME TIMESTAMP INTEGER INT DOUBLE NVARCHAR TEXT 07070100000045000041ED000003E800000064000000025C0989F300000000000000000000000000000000000000000000002300000000sql-parser-1.5+git20181206/src/sql07070100000046000081A4000003E800000064000000015C0989F3000018F5000000000000000000000000000000000000002C00000000sql-parser-1.5+git20181206/src/sql/Expr.cpp#include "../../include/sqlparser/Expr.h" #include <string.h> #include "../../include/sqlparser/SelectStatement.h" namespace hsql { Expr::Expr(ExprType type) : type(type), expr(nullptr), expr2(nullptr), exprList(nullptr), select(nullptr), name(nullptr), table(nullptr), alias(nullptr), fval(0), ival(0), ival2(0), datetimeField(kDatetimeNone), isBoolLiteral(false), opType(kOpNone), distinct(false){}; Expr::~Expr() { delete expr; delete expr2; delete select; free(name); free(table); free(alias); if (exprList != nullptr) { for (Expr* e : *exprList) { delete e; } delete exprList; } } Expr* Expr::make(ExprType type) { Expr* e = new Expr(type); return e; } Expr* Expr::makeOpUnary(OperatorType op, Expr* expr) { Expr* e = new Expr(kExprOperator); e->opType = op; e->expr = expr; e->expr2 = nullptr; return e; } Expr* Expr::makeOpBinary(Expr* expr1, OperatorType op, Expr* expr2) { Expr* e = new Expr(kExprOperator); e->opType = op; e->expr = expr1; e->expr2 = expr2; return e; } Expr* Expr::makeBetween(Expr* expr, Expr* left, Expr* right) { Expr* e = new Expr(kExprOperator); e->expr = expr; e->opType = kOpBetween; e->exprList = new std::vector<Expr*>(); e->exprList->push_back(left); e->exprList->push_back(right); return e; } Expr* Expr::makeCaseList(Expr* caseListElement) { Expr* e = new Expr(kExprOperator); // Case list expressions are temporary and will be integrated into the case // expressions exprList - thus assign operator type kOpNone e->opType = kOpNone; e->exprList = new std::vector<Expr*>(); e->exprList->push_back(caseListElement); return e; } Expr* Expr::makeCaseListElement(Expr* when, Expr* then) { Expr* e = new Expr(kExprOperator); e->opType = kOpCaseListElement; e->expr = when; e->expr2 = then; return e; } Expr* Expr::caseListAppend(Expr* caseList, Expr* caseListElement) { caseList->exprList->push_back(caseListElement); return caseList; } Expr* Expr::makeCase(Expr* expr, Expr* caseList, Expr* elseExpr) { Expr* e = new Expr(kExprOperator); e->opType = kOpCase; e->expr = expr; e->expr2 = elseExpr; e->exprList = caseList->exprList; caseList->exprList = nullptr; delete caseList; return e; } Expr* Expr::makeLiteral(int64_t val) { Expr* e = new Expr(kExprLiteralInt); e->ival = val; return e; } Expr* Expr::makeLiteral(double value) { Expr* e = new Expr(kExprLiteralFloat); e->fval = value; return e; } Expr* Expr::makeLiteral(char* string) { Expr* e = new Expr(kExprLiteralString); e->name = string; return e; } Expr* Expr::makeLiteral(bool val) { Expr* e = new Expr(kExprLiteralInt); e->ival = (int)val; e->isBoolLiteral = true; return e; } Expr* Expr::makeNullLiteral() { Expr* e = new Expr(kExprLiteralNull); return e; } Expr* Expr::makeColumnRef(char* name) { Expr* e = new Expr(kExprColumnRef); e->name = name; return e; } Expr* Expr::makeColumnRef(char* table, char* name) { Expr* e = new Expr(kExprColumnRef); e->name = name; e->table = table; return e; } Expr* Expr::makeStar(void) { Expr* e = new Expr(kExprStar); return e; } Expr* Expr::makeStar(char* table) { Expr* e = new Expr(kExprStar); e->table = table; return e; } Expr* Expr::makeFunctionRef(char* func_name, std::vector<Expr*>* exprList, bool distinct) { Expr* e = new Expr(kExprFunctionRef); e->name = func_name; e->exprList = exprList; e->distinct = distinct; return e; } Expr* Expr::makeArray(std::vector<Expr*>* exprList) { Expr* e = new Expr(kExprArray); e->exprList = exprList; return e; } Expr* Expr::makeArrayIndex(Expr* expr, int64_t index) { Expr* e = new Expr(kExprArrayIndex); e->expr = expr; e->ival = index; return e; } Expr* Expr::makeParameter(int id) { Expr* e = new Expr(kExprParameter); e->ival = id; return e; } Expr* Expr::makeSelect(SelectStatement* select) { Expr* e = new Expr(kExprSelect); e->select = select; return e; } Expr* Expr::makeExists(SelectStatement* select) { Expr* e = new Expr(kExprOperator); e->opType = kOpExists; e->select = select; return e; } Expr* Expr::makeInOperator(Expr* expr, std::vector<Expr*>* exprList) { Expr* e = new Expr(kExprOperator); e->opType = kOpIn; e->expr = expr; e->exprList = exprList; return e; } Expr* Expr::makeInOperator(Expr* expr, SelectStatement* select) { Expr* e = new Expr(kExprOperator); e->opType = kOpIn; e->expr = expr; e->select = select; return e; } Expr* Expr::makeExtract(DatetimeField datetimeField, Expr* expr) { Expr* e = new Expr(kExprFunctionRef); e->name = strdup("EXTRACT"); e->datetimeField = datetimeField; e->expr = expr; return e; } bool Expr::isType(ExprType exprType) const { return exprType == type; } bool Expr::isLiteral() const { return isType(kExprLiteralInt) || isType(kExprLiteralFloat) || isType(kExprLiteralString) || isType(kExprParameter) || isType(kExprLiteralNull); } bool Expr::hasAlias() const { return alias != nullptr; } bool Expr::hasTable() const { return table != nullptr; } const char* Expr::getName() const { if (alias != nullptr) return alias; else return name; } char* substr(const char* source, int from, int to) { int len = to - from; char* copy = (char*)malloc(len + 1); ; strncpy(copy, source + from, len); copy[len] = '\0'; return copy; } void Expr::tablesAccessed(TableAccessMap& accessMap) const { if (expr != nullptr) { expr->tablesAccessed(accessMap); } if (expr2 != nullptr) { expr2->tablesAccessed(accessMap); } if (exprList != nullptr) { for (Expr* e : *exprList) { if (e != nullptr) { e->tablesAccessed(accessMap); } } } if (select != nullptr) { select->tablesAccessed(accessMap); } if (table != nullptr) { TableAccess::addOperation(accessMap, table, nullptr, TableAccess::OpUnknown); } } } // namespace hsql 07070100000047000081ED000003E800000064000000015C0989F300002250000000000000000000000000000000000000003200000000sql-parser-1.5+git20181206/src/sql/statements.cpp#include "../../include/sqlparser/statements.h" namespace hsql { // ColumnDefinition ColumnDefinition::ColumnDefinition(char* name, ColumnType type, bool nullable) : name(name), type(type), nullable(nullable) {}; ColumnDefinition::~ColumnDefinition() { free(name); } ColumnType::ColumnType(DataType data_type, int64_t length) : data_type(data_type), length(length) {}; bool operator==(const ColumnType& lhs, const ColumnType& rhs) { if (lhs.data_type != rhs.data_type) return false; if (lhs.data_type == DataType::VARCHAR || lhs.data_type == DataType::CHAR) { return lhs.length == rhs.length; } return true; } bool operator!=(const ColumnType& lhs, const ColumnType& rhs) { return !(lhs == rhs); } std::ostream& operator<<(std::ostream& stream, const ColumnType& column_type) { switch (column_type.data_type) { case DataType::UNKNOWN: stream << "UNKNOWN"; break; case DataType::INT: stream << "INT"; break; case DataType::LONG: stream << "LONG"; break; case DataType::FLOAT: stream << "FLOAT"; break; case DataType::DOUBLE: stream << "DOUBLE"; break; case DataType::CHAR: stream << "CHAR(" << column_type.length << ")"; break; case DataType::VARCHAR: stream << "VARCHAR(" << column_type.length << ")"; break; case DataType::TEXT: stream << "TEXT"; break; } return stream; } // CreateStatemnet CreateStatement::CreateStatement(CreateType type) : SQLStatement(kStmtCreate), type(type), ifNotExists(false), filePath(nullptr), schema(nullptr), tableName(nullptr), //databaseName(nullptr), columns(nullptr), viewColumns(nullptr), select(nullptr) {}; CreateStatement::~CreateStatement() { free(filePath); free(schema); free(tableName); //free(databaseName); delete select; if (columns != nullptr) { for (ColumnDefinition* def : *columns) { delete def; } delete columns; } if (viewColumns != nullptr) { for (char* column : *viewColumns) { free(column); } delete viewColumns; } } // AlterStatement AlterStatement::AlterStatement(AlterType type) : SQLStatement(kStmtAlter), type(type), schema(nullptr), tableName(nullptr), //databaseName(nullptr), charsetName(nullptr), columns(nullptr) {}; AlterStatement::~AlterStatement() { free(schema); free(tableName); //free(databaseName); delete charsetName; delete columns; } // DeleteStatement DeleteStatement::DeleteStatement() : SQLStatement(kStmtDelete), schema(nullptr), tableName(nullptr), expr(nullptr) {}; DeleteStatement::~DeleteStatement() { free(schema); free(tableName); delete expr; } // DropStatament DropStatement::DropStatement(DropType type) : SQLStatement(kStmtDrop), type(type), schema(nullptr), name(nullptr) {} DropStatement::~DropStatement() { free(schema); free(name); } // ExecuteStatement ExecuteStatement::ExecuteStatement() : SQLStatement(kStmtExecute), name(nullptr), parameters(nullptr) {} ExecuteStatement::~ExecuteStatement() { free(name); if (parameters != nullptr) { for (Expr* param : *parameters) { delete param; } delete parameters; } } // ImportStatement ImportStatement::ImportStatement(ImportType type) : SQLStatement(kStmtImport), type(type), filePath(nullptr), schema(nullptr), tableName(nullptr) {}; ImportStatement::~ImportStatement() { free(filePath); free(schema); free(tableName); } // InsertStatement InsertStatement::InsertStatement(InsertType type) : SQLStatement(kStmtInsert), type(type), schema(nullptr), tableName(nullptr), columns(nullptr), values(nullptr), select(nullptr) {} InsertStatement::~InsertStatement() { free(schema); free(tableName); delete select; if (columns != nullptr) { for (char* column : *columns) { free(column); } delete columns; } if (values != nullptr) { for (Expr* expr : *values) { delete expr; } delete values; } } // ShowStatament ShowStatement::ShowStatement(ShowType type) : SQLStatement(kStmtShow), type(type), schema(nullptr), name(nullptr) {} ShowStatement::~ShowStatement() { free(schema); free(name); } // SelectStatement.h // OrderDescription OrderDescription::OrderDescription(OrderType type, Expr* expr) : type(type), expr(expr) {} OrderDescription::~OrderDescription() { delete expr; } // LimitDescription LimitDescription::LimitDescription(int64_t limit, int64_t offset) : limit(limit >= 0 ? limit : kNoLimit), offset(offset > 0 ? offset : kNoOffset) {} // GroypByDescription GroupByDescription::GroupByDescription() : columns(nullptr), having(nullptr) {} GroupByDescription::~GroupByDescription() { delete having; if (columns != nullptr) { for (Expr* expr : *columns) { delete expr; } delete columns; } } // SelectStatement SelectStatement::SelectStatement() : SQLStatement(kStmtSelect), fromTable(nullptr), selectDistinct(false), selectList(nullptr), whereClause(nullptr), groupBy(nullptr), unionSelect(nullptr), order(nullptr), limit(nullptr) {}; SelectStatement::~SelectStatement() { delete fromTable; delete whereClause; delete groupBy; delete unionSelect; delete limit; // Delete each element in the select list. if (selectList != nullptr) { for (Expr* expr : *selectList) { delete expr; } delete selectList; } if (order != nullptr) { for (OrderDescription* desc : *order) { delete desc; } delete order; } } // UpdateStatement UpdateStatement::UpdateStatement() : SQLStatement(kStmtUpdate), table(nullptr), updates(nullptr), where(nullptr) {} UpdateStatement::~UpdateStatement() { delete table; delete where; if (updates != nullptr) { for (UpdateClause* update : *updates) { free(update->column); delete update->value; delete update; } delete updates; } } // Alias Alias::Alias(char* name, std::vector<char*>* columns) : name(name), columns(columns) {} Alias::~Alias() { free(name); if (columns) { for (char* column : *columns) { free(column); } delete columns; } } // TableRef TableRef::TableRef(TableRefType type) : type(type), schema(nullptr), name(nullptr), alias(nullptr), select(nullptr), list(nullptr), join(nullptr) {} TableRef::~TableRef() { free(schema); free(name); delete select; delete join; delete alias; if (list != nullptr) { for (TableRef* table : *list) { delete table; } delete list; } } bool TableRef::hasSchema() const { return schema != nullptr; } const char* TableRef::getName() const { if (alias) return alias->name; else return name; } void TableRef::tablesAccessed(TableAccessMap& accessMap, const std::string& op) const { switch (type) { case kTableName: if (name != nullptr) { TableAccess::addOperation(accessMap, name, schema, op); } break; case kTableSelect: if (select != nullptr) { select->tablesAccessed(accessMap); } break; case kTableCrossProduct: if (list != nullptr) { for (auto it = list->begin(); it != list->end(); ++it) { (*it)->tablesAccessed(accessMap, op); } } break; case kTableJoin: if (join != nullptr) { join->tablesAccessed(accessMap, op); } } } // JoinDefinition JoinDefinition::JoinDefinition() : left(nullptr), right(nullptr), condition(nullptr), type(kJoinInner) {} JoinDefinition::~JoinDefinition() { delete left; delete right; delete condition; } void JoinDefinition::tablesAccessed(TableAccessMap& accessMap, const std::string& op) const { if (left != nullptr) { left->tablesAccessed(accessMap, op); } if (right != nullptr) { right->tablesAccessed(accessMap, op); } if (condition != nullptr) { condition->tablesAccessed(accessMap); } }; } // namespace hsql 07070100000048000041ED000003E800000064000000025C0989F300000000000000000000000000000000000000000000002400000000sql-parser-1.5+git20181206/src/util07070100000049000081ED000003E800000064000000015C0989F3000021C3000000000000000000000000000000000000003200000000sql-parser-1.5+git20181206/src/util/sqlhelper.cpp #include "sqlhelper.h" #include <iostream> #include <string> namespace hsql { void printOperatorExpression(Expr* expr, uintmax_t numIndent); void printAlias(Alias* alias, uintmax_t numIndent); std::string indent(uintmax_t numIndent) { return std::string(numIndent, '\t'); } void inprint(int64_t val, uintmax_t numIndent) { std::cout << indent(numIndent).c_str() << val << " " << std::endl; } void inprint(double val, uintmax_t numIndent) { std::cout << indent(numIndent).c_str() << val << std::endl; } void inprint(const char* val, uintmax_t numIndent) { std::cout << indent(numIndent).c_str() << val << std::endl; } void inprint(const char* val, const char* val2, uintmax_t numIndent) { std::cout << indent(numIndent).c_str() << val << "->" << val2 << std::endl; } void inprintC(char val, uintmax_t numIndent) { std::cout << indent(numIndent).c_str() << val << std::endl; } void inprintU(uint64_t val, uintmax_t numIndent) { std::cout << indent(numIndent).c_str() << val << std::endl; } void printTableRefInfo(TableRef* table, uintmax_t numIndent) { switch (table->type) { case kTableName: inprint(table->name, numIndent); if(table->schema) { inprint("Schema", numIndent + 1); inprint(table->schema, numIndent + 2); } break; case kTableSelect: printSelectStatementInfo(table->select, numIndent); break; case kTableJoin: inprint("Join Table", numIndent); inprint("Left", numIndent + 1); printTableRefInfo(table->join->left, numIndent + 2); inprint("Right", numIndent + 1); printTableRefInfo(table->join->right, numIndent + 2); inprint("Join Condition", numIndent + 1); printExpression(table->join->condition, numIndent + 2); break; case kTableCrossProduct: for (TableRef* tbl : *table->list) printTableRefInfo(tbl, numIndent); break; } if (table->alias) { printAlias(table->alias, numIndent); } } void printAlias(Alias* alias, uintmax_t numIndent) { inprint("Alias", numIndent + 1); inprint(alias->name, numIndent + 2); if (alias->columns) { for (char* column : *(alias->columns)) { inprint(column, numIndent + 3); } } } void printOperatorExpression(Expr* expr, uintmax_t numIndent) { if (expr == nullptr) { inprint("null", numIndent); return; } switch (expr->opType) { case kOpAnd: inprint("AND", numIndent); break; case kOpOr: inprint("OR", numIndent); break; case kOpNot: inprint("NOT", numIndent); break; default: inprintU(expr->opType, numIndent); break; } printExpression(expr->expr, numIndent + 1); if (expr->expr2 != nullptr) { printExpression(expr->expr2, numIndent + 1); } else if (expr->exprList != nullptr) { for (Expr* e : *expr->exprList) printExpression(e, numIndent + 1); } } void printExpression(Expr* expr, uintmax_t numIndent) { switch (expr->type) { case kExprStar: inprint("*", numIndent); break; case kExprColumnRef: inprint(expr->name, numIndent); if(expr->table) { inprint("Table:", numIndent+1); inprint(expr->table, numIndent+2); } break; // case kExprTableColumnRef: inprint(expr->table, expr->name, numIndent); break; case kExprLiteralFloat: inprint(expr->fval, numIndent); break; case kExprLiteralInt: inprint(expr->ival, numIndent); break; case kExprLiteralString: inprint(expr->name, numIndent); break; case kExprFunctionRef: inprint(expr->name, numIndent); for (Expr* e : *expr->exprList) printExpression(e, numIndent + 1); break; case kExprOperator: printOperatorExpression(expr, numIndent); break; case kExprSelect: printSelectStatementInfo(expr->select, numIndent); break; case kExprParameter: inprint(expr->ival, numIndent); break; case kExprArray: for (Expr* e : *expr->exprList) printExpression(e, numIndent + 1); break; case kExprArrayIndex: printExpression(expr->expr, numIndent + 1); inprint(expr->ival, numIndent); break; default: std::cerr << "Unrecognized expression type " << expr->type << std::endl; return; } if (expr->alias != nullptr) { inprint("Alias", numIndent + 1); inprint(expr->alias, numIndent + 2); } } void printSelectStatementInfo(const SelectStatement* stmt, uintmax_t numIndent) { inprint("SelectStatement", numIndent); inprint("Fields:", numIndent + 1); for (Expr* expr : *stmt->selectList) printExpression(expr, numIndent + 2); if (stmt->fromTable != nullptr) { inprint("Sources:", numIndent + 1); printTableRefInfo(stmt->fromTable, numIndent + 2); } if (stmt->whereClause != nullptr) { inprint("Search Conditions:", numIndent + 1); printExpression(stmt->whereClause, numIndent + 2); } if (stmt->groupBy != nullptr) { inprint("GroupBy:", numIndent + 1); for (Expr* expr : *stmt->groupBy->columns) printExpression(expr, numIndent + 2); if (stmt->groupBy->having != nullptr) { inprint("Having:", numIndent + 1); printExpression(stmt->groupBy->having, numIndent + 2); } } if (stmt->unionSelect != nullptr) { inprint("Union:", numIndent + 1); printSelectStatementInfo(stmt->unionSelect, numIndent + 2); } if (stmt->order != nullptr) { inprint("OrderBy:", numIndent + 1); printExpression(stmt->order->at(0)->expr, numIndent + 2); if (stmt->order->at(0)->type == kOrderAsc) inprint("ascending", numIndent + 2); else inprint("descending", numIndent + 2); } if (stmt->limit != nullptr) { inprint("Limit:", numIndent + 1); inprint(stmt->limit->limit, numIndent + 2); } } void printImportStatementInfo(const ImportStatement* stmt, uintmax_t numIndent) { inprint("ImportStatment", numIndent); inprint(stmt->filePath, numIndent + 1); inprint(stmt->tableName, numIndent + 1); } void printCreateStatementInfo(const CreateStatement* stmt, uintmax_t numIndent) { inprint("CreateStatment", numIndent); inprint(stmt->tableName, numIndent + 1); inprint(stmt->filePath, numIndent + 1); } void printInsertStatementInfo(const InsertStatement* stmt, uintmax_t numIndent) { inprint("InsertStatment", numIndent); inprint(stmt->tableName, numIndent + 1); if (stmt->columns != nullptr) { inprint("Columns", numIndent + 1); for (char* col_name : *stmt->columns) { inprint(col_name, numIndent + 2); } } switch (stmt->type) { case kInsertValues: inprint("Values", numIndent + 1); for (Expr* expr : *stmt->values) { printExpression(expr, numIndent + 2); } break; case kInsertSelect: printSelectStatementInfo(stmt->select, numIndent + 1); break; } } void printStatementInfo(const SQLStatement* stmt) { switch (stmt->type()) { // case kStmtSelect: // printSelectStatementInfo((const SelectStatement*) stmt, 0); // break; // case kStmtInsert: // printInsertStatementInfo((const InsertStatement*) stmt, 0); // break; // case kStmtCreate: // printCreateStatementInfo((const CreateStatement*) stmt, 0); // break; // case kStmtImport: // printImportStatementInfo((const ImportStatement*) stmt, 0); // break; case kStmtSelect: std::cout << "SELECT\n"; break; case kStmtDelete: std::cout << "DELETE\n"; break; case kStmtInsert: std::cout << "INSERT\n"; break; case kStmtUpdate: std::cout << "UPDATE\n"; break; case kStmtCreate: std::cout << "CREATE\n"; break; case kStmtDrop: std::cout << "DROP\n"; break; case kStmtAlter: std::cout << "ALTER\n"; break; case kStmtExecute: std::cout << "EXECUTE\n"; break; case kStmtPrepare: std::cout << "PREPARE\n"; break; case kStmtShow: std::cout << "SHOW\n"; break; default: break; } TableAccessMap t; stmt->tablesAccessed(t); for (auto it = t.begin(); it != t.end(); ++it) { std::cout << it->first << ":"; for (auto i = it->second.begin(); i != it->second.end(); ++i) std::cout << *i << ' '; } } } // namespace hsql 0707010000004A000081A4000003E800000064000000015C0989F3000003E2000000000000000000000000000000000000003000000000sql-parser-1.5+git20181206/src/util/sqlhelper.h#pragma once #include "../../include/sqlparser/statements.h" namespace hsql { // Prints a summary of the given SQLStatement. void printStatementInfo(const SQLStatement* stmt); // Prints a summary of the given SelectStatement with the given indentation. void printSelectStatementInfo(const SelectStatement* stmt, uintmax_t num_indent); // Prints a summary of the given ImportStatement with the given indentation. void printImportStatementInfo(const ImportStatement* stmt, uintmax_t num_indent); // Prints a summary of the given InsertStatement with the given indentation. void printInsertStatementInfo(const InsertStatement* stmt, uintmax_t num_indent); // Prints a summary of the given CreateStatement with the given indentation. void printCreateStatementInfo(const CreateStatement* stmt, uintmax_t num_indent); // Prints a summary of the given Expression with the given indentation. void printExpression(Expr* expr, uintmax_t num_indent); } // namespace hsql 0707010000004B000041ED000003E800000064000000045C0989F300000000000000000000000000000000000000000000002000000000sql-parser-1.5+git20181206/test0707010000004C000081A4000003E800000064000000015C0989F300000B1C000000000000000000000000000000000000003900000000sql-parser-1.5+git20181206/test/auto_query_file_test.cpp#include <stdio.h> #include <string> #include <chrono> #include <fstream> #include <sstream> #include <vector> #include "thirdparty/microtest/microtest.h" #include "SQLParser.h" // Read all lines from the given file path. Skips comment lines. std::vector<std::string> readlines(std::string path); // Read the queries from all files that were supplied to the test // through the -f argument. For all queries it is checked whether they // can be parsed successfully. TEST(AutoQueryFileTest) { const std::vector<std::string>& args = mt::Runtime::args(); std::vector<std::string> query_files; // Parse command line arguments to retrieve query files. uint i = 1; for (; i < args.size(); ++i) { if (args[i] == "-f") { query_files.push_back(args[++i]); } } // Read list of queries from all input files. std::vector<std::string> lines; for (std::string path : query_files) { std::vector<std::string> tmp = readlines(path); lines.insert(lines.end(), tmp.begin(), tmp.end()); } // Execute queries. size_t num_executed = 0; size_t num_failed = 0; for (std::string line : lines) { bool expected_result = true; std::string query = line; // If a line starts with '!' parsing is expected to fail. if (query.at(0) == '!') { expected_result = false; query = query.substr(1); } // Measuring the parsing time. std::chrono::time_point<std::chrono::system_clock> start, end; start = std::chrono::system_clock::now(); // Parse the query. hsql::SQLParserResult result; hsql::SQLParser::parse(query, &result); end = std::chrono::system_clock::now(); std::chrono::duration<double> elapsed_seconds = end - start; double us = elapsed_seconds.count() * 1000 * 1000; if (expected_result == result.isValid()) { printf("\033[0;32m{ ok} (%.1fus)\033[0m %s\n", us, line.c_str()); } else { printf("\033[0;31m{ failed}\033[0m\n"); printf("\t\033[0;31m%s (L%d:%d)\n\033[0m", result.errorMsg(), result.errorLine(), result.errorColumn()); printf("\t%s\n", line.c_str()); ++num_failed; } ++num_executed; } if (num_failed == 0) { printf("\033[0;32m{ ok} \033[0mAll %lu grammar tests completed successfully!\n", num_executed); } else { fprintf(stderr, "\033[0;31m{ failed} \033[0mSome grammar tests failed! %lu out of %lu tests failed!\n", num_failed, num_executed); } ASSERT_EQ(num_failed, 0); } std::vector<std::string> readlines(std::string path) { std::ifstream infile(path); std::vector<std::string> lines; std::string line; while (std::getline(infile, line)) { std::istringstream iss(line); // Skip comments. if (line[0] == '#' || (line[0] == '-' && line[1] == '-')) { continue; } lines.push_back(line); } return lines; } 0707010000004D000081A4000003E800000064000000015C0989F300000A96000000000000000000000000000000000000003200000000sql-parser-1.5+git20181206/test/prepare_tests.cpp #include "thirdparty/microtest/microtest.h" #include "sql_asserts.h" #include "SQLParser.h" using hsql::kExprParameter; using hsql::kExprLiteralInt; using hsql::kStmtDrop; using hsql::kStmtExecute; using hsql::kStmtInsert; using hsql::kStmtPrepare; using hsql::kStmtSelect; using hsql::kDropPreparedStatement; using hsql::DropStatement; using hsql::ExecuteStatement; using hsql::InsertStatement; using hsql::PrepareStatement; using hsql::SelectStatement; TEST(PrepareSingleStatementTest) { TEST_PARSE_SINGLE_SQL( "PREPARE test FROM 'SELECT * FROM students WHERE grade = ?';", kStmtPrepare, PrepareStatement, result, prepare); ASSERT_STREQ(prepare->name, "test"); ASSERT_STREQ(prepare->query, "SELECT * FROM students WHERE grade = ?"); TEST_PARSE_SINGLE_SQL( prepare->query, kStmtSelect, SelectStatement, result2, select); ASSERT_EQ(result2.parameters().size(), 1); ASSERT(select->whereClause->expr2->isType(kExprParameter)) ASSERT_EQ(select->whereClause->expr2->ival, 0) } TEST(DeallocatePrepareStatementTest) { TEST_PARSE_SINGLE_SQL( "DEALLOCATE PREPARE test;", kStmtDrop, DropStatement, result, drop); ASSERT_EQ(drop->type, kDropPreparedStatement); ASSERT_STREQ(drop->name, "test"); } TEST(StatementWithParameters) { TEST_PARSE_SINGLE_SQL( "SELECT * FROM test WHERE a = ? AND b = ?", kStmtSelect, SelectStatement, result, stmt); const hsql::Expr* eq1 = stmt->whereClause->expr; const hsql::Expr* eq2 = stmt->whereClause->expr2; ASSERT_EQ(result.parameters().size(), 2); ASSERT_EQ(eq1->opType, hsql::kOpEquals) ASSERT(eq1->expr->isType(hsql::kExprColumnRef)) ASSERT(eq1->expr2->isType(kExprParameter)) ASSERT_EQ(eq1->expr2->ival, 0) ASSERT_EQ(result.parameters()[0], eq1->expr2); ASSERT_EQ(eq2->opType, hsql::kOpEquals) ASSERT(eq2->expr->isType(hsql::kExprColumnRef)) ASSERT(eq2->expr2->isType(kExprParameter)) ASSERT_EQ(eq2->expr2->ival, 1) ASSERT_EQ(result.parameters()[1], eq2->expr2); } TEST(ExecuteStatementTest) { TEST_PARSE_SINGLE_SQL( "EXECUTE test(1, 2);", kStmtExecute, ExecuteStatement, result, stmt); ASSERT_STREQ(stmt->name, "test"); ASSERT_EQ(stmt->parameters->size(), 2); } TEST(ExecuteStatementTestNoParam) { TEST_PARSE_SINGLE_SQL( "EXECUTE test();", kStmtExecute, ExecuteStatement, result, stmt); ASSERT_STREQ(stmt->name, "test"); ASSERT_EQ(stmt->parameters, 0); } TEST(ExecuteStatementTestNoParamList) { TEST_PARSE_SINGLE_SQL( "EXECUTE test;", kStmtExecute, ExecuteStatement, result, stmt); ASSERT_STREQ(stmt->name, "test"); ASSERT_EQ(stmt->parameters, 0); } 0707010000004E000041ED000003E800000064000000025C0989F300000000000000000000000000000000000000000000002800000000sql-parser-1.5+git20181206/test/queries0707010000004F000081A4000003E800000064000000015C0989F3000001D4000000000000000000000000000000000000003800000000sql-parser-1.5+git20181206/test/queries/queries-bad.sql# This file contains a list of strings that are NOT valid SQL queries. # Each line contains a single SQL query. # Each line starts with a '!' char to indicate that parsing should fail. ! !1 !gibberish; !CREATE TABLE "table" FROM TBL FILE 'students.tbl';gibberish !CREATE TABLE "table" FROM TBL FILE 'students.tbl';1 !INSERT INTO test_table VALUESd (1, 2, 'test'); !SELECT * FROM t WHERE a = ? AND b = ?;gibberish; !SHOW COLUMNS; !select a + 2 as b(spam, eggs) from B; 07070100000050000081ED000003E800000064000000015C0989F30000120E000000000000000000000000000000000000003900000000sql-parser-1.5+git20181206/test/queries/queries-good.sql# This file contains a list of strings that are NOT valid SQL queries. # Each line contains a single SQL query. # SELECT statement SELECT * FROM orders; SELECT a FROM foo WHERE a > 12 OR b > 3 AND NOT c LIMIT 10 SELECT a FROM some_schema.foo WHERE a > 12 OR b > 3 AND NOT c LIMIT 10 SELECT col1 AS myname, col2, 'test' FROM "table", foo AS t WHERE age > 12 AND zipcode = 12345 GROUP BY col1; SELECT * from "table" JOIN table2 ON a = b WHERE (b OR NOT a) AND a = 12.5 (SELECT a FROM foo WHERE a > 12 OR b > 3 AND c NOT LIKE 's%' LIMIT 10); SELECT * FROM "table" LIMIT 10 OFFSET 10; SELECT * FROM another; SELECT * FROM `table 1` LIMIT 10 OFFSET 10; SELECT * FROM another; SELECT * FROM "table 1" LIMIT 10 OFFSET 10; SELECT * FROM another; SELECT * FROM `table 1 and 2` LIMIT 10 OFFSET 10; SELECT * FROM another; SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY col1; SELECT * FROM (SELECT * FROM t1); SELECT * FROM t1 UNION (SELECT * FROM t2 UNION SELECT * FROM t3) ORDER BY col1; SELECT TOP 10 * FROM t1 ORDER BY col1, col2; SELECT a, MAX(b), MAX(c, d), CUSTOM(q, UP(r)) AS f FROM t1; SELECT * FROM t WHERE a BETWEEN 1 and c; SELECT * FROM t WHERE a = ? AND b = ?; SELECT City.name, Product.category, SUM(price) FROM fact INNER JOIN City ON fact.city_id = City.id INNER JOIN Product ON fact.product_id = Product.id GROUP BY City.name, Product.category; SELECT SUBSTR(a, 3, 5) FROM t; # JOIN SELECT t1.a, t1.b, t2.c FROM "table" AS t1 JOIN (SELECT * FROM foo JOIN bar ON foo.id = bar.id) t2 ON t1.a = t2.b WHERE (t1.b OR NOT t1.a) AND t2.c = 12.5 SELECT * FROM t1 JOIN t2 ON c1 = c2; SELECT a, SUM(b) FROM t2 GROUP BY a HAVING SUM(b) > 100; # CREATE statement CREATE DATABASE mysqldb CREATE DATABASE IF NOT EXISTS mysqldb CREATE SCHEMA mysql_schema CREATE SCHEMA IF NOT EXISTS mysql_schema CREATE TABLE "table" FROM TBL FILE 'students.tbl' CREATE TEMPORARY TABLE "table" FROM TBL FILE 'students.tbl' CREATE TABLE IF NOT EXISTS "table" FROM TBL FILE 'students.tbl' CREATE TEMPORARY TABLE IF NOT EXISTS "table" FROM TBL FILE 'students.tbl' CREATE TABLE students (name TEXT, student_number INTEGER, city TEXT, grade DOUBLE) CREATE TABLE `students` (name TEXT, student_number INTEGER, city TEXT, grade DOUBLE) CREATE TABLE `students 1` (name TEXT, student_number INTEGER, city TEXT, grade DOUBLE) CREATE TABLE teachers (name VARCHAR(30), student_number LONG, city CHAR(10), grade FLOAT) # Multiple statements CREATE TABLE "table" FROM TBL FILE 'students.tbl'; SELECT * FROM "table"; # INSERT INSERT INTO test_table VALUES (1, 2, 'test'); INSERT LOW_PRIORITY INTO test_table VALUES (1, 2, 'test'); INSERT DELAYED INTO test_table VALUES (1, 2, 'test'); INSERT HIGH_PRIORITY INTO test_table VALUES (1, 2, 'test'); INSERT IGNORE INTO test_table VALUES (1, 2, 'test'); INSERT LOW_PRIORITY IGNORE INTO test_table VALUES (1, 2, 'test'); INSERT INTO test_table (id, value, name) VALUES (1, 2, 'test'); INSERT INTO test_table SELECT * FROM students; INSERT INTO some_schema.test_table SELECT * FROM another_schema.students; # DELETE DELETE FROM students WHERE grade > 3.0 DELETE LOW_PRIORITY FROM students WHERE grade > 3.0 DELETE QUICK FROM students WHERE grade > 3.0 DELETE IGNORE FROM students WHERE grade > 3.0 DELETE LOW_PRIORITY IGNORE FROM students WHERE grade > 3.0 DELETE FROM students TRUNCATE students # UPDATE UPDATE students SET grade = 1.3 WHERE name = 'Max Mustermann'; UPDATE LOW_PRIORITY students SET grade = 1.3 WHERE name = 'Max Mustermann'; UPDATE IGNORE students SET grade = 1.3 WHERE name = 'Max Mustermann'; UPDATE LOW_PRIORITY IGNORE students SET grade = 1.3 WHERE name = 'Max Mustermann'; UPDATE students SET grade = 1.3, name='Felix Fürstenberg' WHERE name = 'Max Mustermann'; UPDATE students SET grade = 1.0; UPDATE some_schema.students SET grade = 1.0; # ALTER ALTER TABLE students add column Id varchar(20) ALTER DATABASE mysqldb CHARACTER SET charset_name; ALTER DATABASE mysqldb default CHARACTER SET = charset_name ALTER DATABASE mysqldb CHARACTER SET charset_name # DROP DROP TABLE students; DROP TABLE IF EXISTS students; DROP DATABASE mysqldb; DROP DATABASE IF EXISTS mysqldb; DROP VIEW IF EXISTS students; # PREPARE PREPARE prep_inst FROM 'INSERT INTO test VALUES (?, ?, ?)'; PREPARE prep2 FROM 'INSERT INTO test VALUES (?, 0, 0); INSERT INTO test VALUES (0, ?, 0); INSERT INTO test VALUES (0, 0, ?);'; EXECUTE prep_inst(1, 2, 3); EXECUTE prep; DEALLOCATE PREPARE prep; # HINTS SELECT * FROM test WITH HINT(NO_CACHE); SELECT * FROM test WITH HINT(NO_CACHE, NO_SAMPLING); SELECT * FROM test WITH HINT(NO_CACHE, SAMPLE_RATE(0.1), OMW(1.0, 'test')); SHOW TABLES; SHOW DATABASES; SHOW COLUMNS students; 07070100000051000081A4000003E800000064000000015C0989F300000294000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-01.sql-- http://www.sqlserver-dba.com/2011/09/this-is-a-followup-on-my-earlier-post-of-sql-server-test-data-generation-testing-tools-i-had-some-requests-for-my-set-up-pr.html SELECT L_RETURNFLAG, L_LINESTATUS, SUM(L_QUANTITY) AS SUM_QTY, SUM(L_EXTENDEDPRICE) AS SUM_BASE_PRICE, SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT)) AS SUM_DISC_PRICE, SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT)*(1+L_TAX)) AS SUM_CHARGE, AVG(L_QUANTITY) AS AVG_QTY, AVG(L_EXTENDEDPRICE) AS AVG_PRICE, AVG(L_DISCOUNT) AS AVG_DISC, COUNT(*) AS COUNT_ORDER FROM LINEITEM WHERE L_SHIPDATE <= dateadd(dd, -90, cast('1998-12-01' as datetime)) GROUP BY L_RETURNFLAG, L_LINESTATUS ORDER BY L_RETURNFLAG,L_LINESTATUS07070100000052000081A4000003E800000064000000015C0989F3000002FC000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-02.sql-- http://www.sqlserver-dba.com/2011/09/this-is-a-followup-on-my-earlier-post-of-sql-server-test-data-generation-testing-tools-i-had-some-requests-for-my-set-up-pr.html SELECT TOP 100 S_ACCTBAL, S_NAME, N_NAME, P_PARTKEY, P_MFGR, S_ADDRESS, S_PHONE, S_COMMENT FROM PART, SUPPLIER, PARTSUPP, NATION, REGION WHERE P_PARTKEY = PS_PARTKEY AND S_SUPPKEY = PS_SUPPKEY AND P_SIZE = 15 AND P_TYPE LIKE '%%BRASS' AND S_NATIONKEY = N_NATIONKEY AND N_REGIONKEY = R_REGIONKEY AND R_NAME = 'EUROPE' AND PS_SUPPLYCOST = (SELECT MIN(PS_SUPPLYCOST) FROM PARTSUPP, SUPPLIER, NATION, REGION WHERE P_PARTKEY = PS_PARTKEY AND S_SUPPKEY = PS_SUPPKEY AND S_NATIONKEY = N_NATIONKEY AND N_REGIONKEY = R_REGIONKEY AND R_NAME = 'EUROPE') ORDER BY S_ACCTBAL DESC, N_NAME, S_NAME, P_PARTKEY07070100000053000081A4000003E800000064000000015C0989F300000216000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-03.sql-- http://www.sqlserver-dba.com/2011/09/this-is-a-followup-on-my-earlier-post-of-sql-server-test-data-generation-testing-tools-i-had-some-requests-for-my-set-up-pr.html SELECT TOP 10 L_ORDERKEY, SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT)) AS REVENUE, O_ORDERDATE, O_SHIPPRIORITY FROM CUSTOMER, ORDERS, LINEITEM WHERE C_MKTSEGMENT = 'BUILDING' AND C_CUSTKEY = O_CUSTKEY AND L_ORDERKEY = O_ORDERKEY AND O_ORDERDATE < '1995-03-15' AND L_SHIPDATE > '1995-03-15' GROUP BY L_ORDERKEY, O_ORDERDATE, O_SHIPPRIORITY ORDER BY REVENUE DESC, O_ORDERDATE;07070100000054000081A4000003E800000064000000015C0989F3000001DB000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-04.sql-- http://www.sqlserver-dba.com/2011/09/this-is-a-followup-on-my-earlier-post-of-sql-server-test-data-generation-testing-tools-i-had-some-requests-for-my-set-up-pr.html SELECT O_ORDERPRIORITY, COUNT(*) AS ORDER_COUNT FROM ORDERS WHERE O_ORDERDATE >= '1993-07-01' AND O_ORDERDATE < dateadd(mm,3, cast('1993-07-01' as datetime)) AND EXISTS (SELECT * FROM LINEITEM WHERE L_ORDERKEY = O_ORDERKEY AND L_COMMITDATE < L_RECEIPTDATE) GROUP BY O_ORDERPRIORITY ORDER BY O_ORDERPRIORITY07070100000055000081A4000003E800000064000000015C0989F300000267000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-05.sql-- http://www.sqlserver-dba.com/2011/09/this-is-a-followup-on-my-earlier-post-of-sql-server-test-data-generation-testing-tools-i-had-some-requests-for-my-set-up-pr.html SELECT N_NAME, SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT)) AS REVENUE FROM CUSTOMER, ORDERS, LINEITEM, SUPPLIER, NATION, REGION WHERE C_CUSTKEY = O_CUSTKEY AND L_ORDERKEY = O_ORDERKEY AND L_SUPPKEY = S_SUPPKEY AND C_NATIONKEY = S_NATIONKEY AND S_NATIONKEY = N_NATIONKEY AND N_REGIONKEY = R_REGIONKEY AND R_NAME = 'ASIA' AND O_ORDERDATE >= '1994-01-01' AND O_ORDERDATE < DATEADD(YY, 1, cast('1994-01-01' as datetime)) GROUP BY N_NAME ORDER BY REVENUE DESC07070100000056000081A4000003E800000064000000015C0989F30000018E000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-06.sql-- http://www.sqlserver-dba.com/2011/09/this-is-a-followup-on-my-earlier-post-of-sql-server-test-data-generation-testing-tools-i-had-some-requests-for-my-set-up-pr.html SELECT SUM(L_EXTENDEDPRICE*L_DISCOUNT) AS REVENUE FROM LINEITEM WHERE L_SHIPDATE >= '1994-01-01' AND L_SHIPDATE < dateadd(yy, 1, cast('1994-01-01' as datetime)) AND L_DISCOUNT BETWEEN .06 - 0.01 AND .06 + 0.01 AND L_QUANTITY < 2407070100000057000081A4000003E800000064000000015C0989F300000354000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-07.sql-- http://www.sqlserver-dba.com/2011/09/this-is-a-followup-on-my-earlier-post-of-sql-server-test-data-generation-testing-tools-i-had-some-requests-for-my-set-up-pr.html SELECT SUPP_NATION, CUST_NATION, L_YEAR, SUM(VOLUME) AS REVENUE FROM ( SELECT N1.N_NAME AS SUPP_NATION, N2.N_NAME AS CUST_NATION, datepart(yy, L_SHIPDATE) AS L_YEAR, L_EXTENDEDPRICE*(1-L_DISCOUNT) AS VOLUME FROM SUPPLIER, LINEITEM, ORDERS, CUSTOMER, NATION N1, NATION N2 WHERE S_SUPPKEY = L_SUPPKEY AND O_ORDERKEY = L_ORDERKEY AND C_CUSTKEY = O_CUSTKEY AND S_NATIONKEY = N1.N_NATIONKEY AND C_NATIONKEY = N2.N_NATIONKEY AND ((N1.N_NAME = 'FRANCE' AND N2.N_NAME = 'GERMANY') OR (N1.N_NAME = 'GERMANY' AND N2.N_NAME = 'FRANCE')) AND L_SHIPDATE BETWEEN '1995-01-01' AND '1996-12-31' ) AS SHIPPING GROUP BY SUPP_NATION, CUST_NATION, L_YEAR ORDER BY SUPP_NATION, CUST_NATION, L_YEAR07070100000058000081A4000003E800000064000000015C0989F30000033D000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-08.sql-- http://www.sqlserver-dba.com/2011/09/this-is-a-followup-on-my-earlier-post-of-sql-server-test-data-generation-testing-tools-i-had-some-requests-for-my-set-up-pr.html SELECT O_YEAR, SUM(CASE WHEN NATION = 'BRAZIL' THEN VOLUME ELSE 0 END)/SUM(VOLUME) AS MKT_SHARE FROM (SELECT datepart(yy,O_ORDERDATE) AS O_YEAR, L_EXTENDEDPRICE*(1-L_DISCOUNT) AS VOLUME, N2.N_NAME AS NATION FROM "PART", SUPPLIER, LINEITEM, ORDERS, CUSTOMER, NATION N1, NATION N2, REGION WHERE P_PARTKEY = L_PARTKEY AND S_SUPPKEY = L_SUPPKEY AND L_ORDERKEY = O_ORDERKEY AND O_CUSTKEY = C_CUSTKEY AND C_NATIONKEY = N1.N_NATIONKEY AND N1.N_REGIONKEY = R_REGIONKEY AND R_NAME = 'AMERICA' AND S_NATIONKEY = N2.N_NATIONKEY AND O_ORDERDATE BETWEEN '1995-01-01' AND '1996-12-31' AND P_TYPE= 'ECONOMY ANODIZED STEEL') AS ALL_NATIONS GROUP BY O_YEAR ORDER BY O_YEAR07070100000059000081A4000003E800000064000000015C0989F30000029E000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-09.sql-- http://www.sqlserver-dba.com/2011/09/this-is-a-followup-on-my-earlier-post-of-sql-server-test-data-generation-testing-tools-i-had-some-requests-for-my-set-up-pr.html SELECT NATION, O_YEAR, SUM(AMOUNT) AS SUM_PROFIT FROM (SELECT N_NAME AS NATION, datepart(yy, O_ORDERDATE) AS O_YEAR, L_EXTENDEDPRICE*(1-L_DISCOUNT)-PS_SUPPLYCOST*L_QUANTITY AS AMOUNT FROM "PART", SUPPLIER, LINEITEM, PARTSUPP, ORDERS, NATION WHERE S_SUPPKEY = L_SUPPKEY AND PS_SUPPKEY= L_SUPPKEY AND PS_PARTKEY = L_PARTKEY AND P_PARTKEY= L_PARTKEY AND O_ORDERKEY = L_ORDERKEY AND S_NATIONKEY = N_NATIONKEY AND P_NAME LIKE '%%green%%') AS PROFIT GROUP BY NATION, O_YEAR ORDER BY NATION, O_YEAR DESC0707010000005A000081A4000003E800000064000000015C0989F300000282000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-10.sql-- http://www.sqlserver-dba.com/2011/09/this-is-a-followup-on-my-earlier-post-of-sql-server-test-data-generation-testing-tools-i-had-some-requests-for-my-set-up-pr.html SELECT TOP 20 C_CUSTKEY, C_NAME, SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT)) AS REVENUE, C_ACCTBAL, N_NAME, C_ADDRESS, C_PHONE, C_COMMENT FROM CUSTOMER, ORDERS, LINEITEM, NATION WHERE C_CUSTKEY = O_CUSTKEY AND L_ORDERKEY = O_ORDERKEY AND O_ORDERDATE>= '1993-10-01' AND O_ORDERDATE < dateadd(mm, 3, cast('1993-10-01' as datetime)) AND L_RETURNFLAG = 'R' AND C_NATIONKEY = N_NATIONKEY GROUP BY C_CUSTKEY, C_NAME, C_ACCTBAL, C_PHONE, N_NAME, C_ADDRESS, C_COMMENT ORDER BY REVENUE DESC0707010000005B000081A4000003E800000064000000015C0989F300000284000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-11.sql-- http://www.sqlserver-dba.com/2011/09/this-is-a-followup-on-my-earlier-post-of-sql-server-test-data-generation-testing-tools-i-had-some-requests-for-my-set-up-pr.html -- TPC_H Query 11 - Important Stock Identification SELECT PS_PARTKEY, SUM(PS_SUPPLYCOST*PS_AVAILQTY) AS VALUE FROM PARTSUPP, SUPPLIER, NATION WHERE PS_SUPPKEY = S_SUPPKEY AND S_NATIONKEY = N_NATIONKEY AND N_NAME = 'GERMANY' GROUP BY PS_PARTKEY HAVING SUM(PS_SUPPLYCOST*PS_AVAILQTY) > (SELECT SUM(PS_SUPPLYCOST*PS_AVAILQTY) * 0.0001000000 FROM PARTSUPP, SUPPLIER, NATION WHERE PS_SUPPKEY = S_SUPPKEY AND S_NATIONKEY = N_NATIONKEY AND N_NAME = 'GERMANY') ORDER BY VALUE DESC;0707010000005C000081A4000003E800000064000000015C0989F30000024D000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-12.sql-- TPC_H Query 12 - Shipping Modes and Order Priority SELECT L_SHIPMODE, SUM(CASE WHEN O_ORDERPRIORITY = '1-URGENT' OR O_ORDERPRIORITY = '2-HIGH' THEN 1 ELSE 0 END) AS HIGH_LINE_COUNT, SUM(CASE WHEN O_ORDERPRIORITY <> '1-URGENT' AND O_ORDERPRIORITY <> '2-HIGH' THEN 1 ELSE 0 END ) AS LOW_LINE_COUNT FROM ORDERS, LINEITEM WHERE O_ORDERKEY = L_ORDERKEY AND L_SHIPMODE IN ('MAIL','SHIP') AND L_COMMITDATE < L_RECEIPTDATE AND L_SHIPDATE < L_COMMITDATE AND L_RECEIPTDATE >= '1994-01-01' AND L_RECEIPTDATE < dateadd(mm, 1, cast('1995-09-01' as datetime)) GROUP BY L_SHIPMODE ORDER BY L_SHIPMODE;0707010000005D000081A4000003E800000064000000015C0989F300000154000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-13.sql-- TPC_H Query 13 - Customer Distribution SELECT C_COUNT, COUNT(*) AS CUSTDIST FROM (SELECT C_CUSTKEY, COUNT(O_ORDERKEY) FROM CUSTOMER left outer join ORDERS on C_CUSTKEY = O_CUSTKEY AND O_COMMENT not like '%%special%%requests%%' GROUP BY C_CUSTKEY) AS C_ORDERS (C_CUSTKEY, C_COUNT) GROUP BY C_COUNT ORDER BY CUSTDIST DESC, C_COUNT DESC;0707010000005E000081A4000003E800000064000000015C0989F30000013C000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-14.sql-- TPC_H Query 14 - Promotion Effect SELECT 100.00* SUM(CASE WHEN P_TYPE LIKE 'PROMO%%' THEN L_EXTENDEDPRICE*(1-L_DISCOUNT) ELSE 0 END) / SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT)) AS PROMO_REVENUE FROM LINEITEM, PART WHERE L_PARTKEY = P_PARTKEY AND L_SHIPDATE >= '1995-09-01' AND L_SHIPDATE < dateadd(mm, 1, '1995-09-01');0707010000005F000081A4000003E800000064000000015C0989F300000244000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-15.sql-- TPC_H Query 15.1 - Create View for Top Supplier Query CREATE VIEW REVENUE0 (SUPPLIER_NO, TOTAL_REVENUE) AS SELECT L_SUPPKEY, SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT)) FROM LINEITEM WHERE L_SHIPDATE >= '1996-01-01' AND L_SHIPDATE < dateadd(mm, 3, cast('1996-01-01' as datetime)) GROUP BY L_SUPPKEY; -- TPC_H Query 15.2 - Top Supplier SELECT S_SUPPKEY, S_NAME, S_ADDRESS, S_PHONE, TOTAL_REVENUE FROM SUPPLIER, REVENUE0 WHERE S_SUPPKEY = SUPPLIER_NO AND TOTAL_REVENUE = (SELECT MAX(TOTAL_REVENUE) FROM REVENUE0) ORDER BY S_SUPPKEY; -- TPC_H Query 15.3 - Drop View DROP VIEW REVENUE0;07070100000060000081A4000003E800000064000000015C0989F300000283000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-16.sql-- http://www.sqlserver-dba.com/2011/09/this-is-a-followup-on-my-earlier-post-of-sql-server-test-data-generation-testing-tools-i-had-some-requests-for-my-set-up-pr.html -- TPC_H Query 16 - Parts/Supplier Relationship SELECT P_BRAND, P_TYPE, P_SIZE, COUNT(DISTINCT PS_SUPPKEY) AS SUPPLIER_CNT FROM PARTSUPP, "PART" WHERE P_PARTKEY = PS_PARTKEY AND P_BRAND <> 'Brand#45' AND P_TYPE NOT LIKE 'MEDIUM POLISHED%%' AND P_SIZE IN (49, 14, 23, 45, 19, 3, 36, 9) AND PS_SUPPKEY NOT IN (SELECT S_SUPPKEY FROM SUPPLIER WHERE S_COMMENT LIKE '%%Customer%%Complaints%%') GROUP BY P_BRAND, P_TYPE, P_SIZE ORDER BY SUPPLIER_CNT DESC, P_BRAND, P_TYPE, P_SIZE;07070100000061000081A4000003E800000064000000015C0989F30000011E000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-17.sql-- TPC_H Query 17 - Small-Quantity-Order Revenue SELECT SUM(L_EXTENDEDPRICE)/7.0 AS AVG_YEARLY FROM LINEITEM, "PART" WHERE P_PARTKEY = L_PARTKEY AND P_BRAND = 'Brand#23' AND P_CONTAINER = 'MED BOX' AND L_QUANTITY < (SELECT 0.2*AVG(L_QUANTITY) FROM LINEITEM WHERE L_PARTKEY = P_PARTKEY);07070100000062000081A4000003E800000064000000015C0989F3000001AB000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-18.sql-- TPC_H Query 18 - Large Volume Customer SELECT TOP 100 C_NAME, C_CUSTKEY, O_ORDERKEY, O_ORDERDATE, O_TOTALPRICE, SUM(L_QUANTITY) FROM CUSTOMER, ORDERS, LINEITEM WHERE O_ORDERKEY IN (SELECT L_ORDERKEY FROM LINEITEM GROUP BY L_ORDERKEY HAVING SUM(L_QUANTITY) > 300) AND C_CUSTKEY = O_CUSTKEY AND O_ORDERKEY = L_ORDERKEY GROUP BY C_NAME, C_CUSTKEY, O_ORDERKEY, O_ORDERDATE, O_TOTALPRICE ORDER BY O_TOTALPRICE DESC, O_ORDERDATE;07070100000063000081A4000003E800000064000000015C0989F300000397000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-19.sql-- TPC_H Query 19 - Discounted Revenue SELECT SUM(L_EXTENDEDPRICE* (1 - L_DISCOUNT)) AS REVENUE FROM LINEITEM, "PART" WHERE (P_PARTKEY = L_PARTKEY AND P_BRAND = 'Brand#12' AND P_CONTAINER IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG') AND L_QUANTITY >= 1 AND L_QUANTITY <= 1 + 10 AND P_SIZE BETWEEN 1 AND 5 AND L_SHIPMODE IN ('AIR', 'AIR REG') AND L_SHIPINSTRUCT = 'DELIVER IN PERSON') OR (P_PARTKEY = L_PARTKEY AND P_BRAND ='Brand#23' AND P_CONTAINER IN ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK') AND L_QUANTITY >=10 AND L_QUANTITY <=10 + 10 AND P_SIZE BETWEEN 1 AND 10 AND L_SHIPMODE IN ('AIR', 'AIR REG') AND L_SHIPINSTRUCT = 'DELIVER IN PERSON') OR (P_PARTKEY = L_PARTKEY AND P_BRAND = 'Brand#34' AND P_CONTAINER IN ( 'LG CASE', 'LG BOX', 'LG PACK', 'LG PKG') AND L_QUANTITY >=20 AND L_QUANTITY <= 20 + 10 AND P_SIZE BETWEEN 1 AND 15 AND L_SHIPMODE IN ('AIR', 'AIR REG') AND L_SHIPINSTRUCT = 'DELIVER IN PERSON');07070100000064000081A4000003E800000064000000015C0989F3000001EB000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-20.sql-- TPC_H Query 20 - Potential Part Promotion SELECT S_NAME, S_ADDRESS FROM SUPPLIER, NATION WHERE S_SUPPKEY IN (SELECT PS_SUPPKEY FROM PARTSUPP WHERE PS_PARTKEY in (SELECT P_PARTKEY FROM "PART" WHERE P_NAME like 'forest%%') AND PS_AVAILQTY > (SELECT 0.5*sum(L_QUANTITY) FROM LINEITEM WHERE L_PARTKEY = PS_PARTKEY AND L_SUPPKEY = PS_SUPPKEY AND L_SHIPDATE >= '1994-01-01' AND L_SHIPDATE < dateadd(yy,1,'1994-01-01'))) AND S_NATIONKEY = N_NATIONKEY AND N_NAME = 'CANADA' ORDER BY S_NAME;07070100000065000081A4000003E800000064000000015C0989F300000275000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-21.sql-- TPC_H Query 21 - Suppliers Who Kept Orders Waiting SELECT TOP 100 S_NAME, COUNT(*) AS NUMWAIT FROM SUPPLIER, LINEITEM L1, ORDERS, NATION WHERE S_SUPPKEY = L1.L_SUPPKEY AND O_ORDERKEY = L1.L_ORDERKEY AND O_ORDERSTATUS = 'F' AND L1.L_RECEIPTDATE> L1.L_COMMITDATE AND EXISTS (SELECT * FROM LINEITEM L2 WHERE L2.L_ORDERKEY = L1.L_ORDERKEY AND L2.L_SUPPKEY <> L1.L_SUPPKEY) AND NOT EXISTS (SELECT * FROM LINEITEM L3 WHERE L3.L_ORDERKEY = L1.L_ORDERKEY AND L3.L_SUPPKEY <> L1.L_SUPPKEY AND L3.L_RECEIPTDATE > L3.L_COMMITDATE) AND S_NATIONKEY = N_NATIONKEY AND N_NAME = 'SAUDI ARABIA' GROUP BY S_NAME ORDER BY NUMWAIT DESC, S_NAME;07070100000066000081A4000003E800000064000000015C0989F30000021A000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/queries/tpc-h-22.sql-- TPC_H Query 22 - Global Sales Opportunity */ SELECT CNTRYCODE, COUNT(*) AS NUMCUST, SUM(C_ACCTBAL) AS TOTACCTBAL FROM (SELECT SUBSTRING(C_PHONE,1,2) AS CNTRYCODE, C_ACCTBAL FROM CUSTOMER WHERE SUBSTRING(C_PHONE,1,2) IN ('13', '31', '23', '29', '30', '18', '17') AND C_ACCTBAL > (SELECT AVG(C_ACCTBAL) FROM CUSTOMER WHERE C_ACCTBAL > 0.00 AND SUBSTRING(C_PHONE,1,2) IN ('13', '31', '23', '29', '30', '18', '17')) AND NOT EXISTS ( SELECT * FROM ORDERS WHERE O_CUSTKEY = C_CUSTKEY)) AS CUSTSALE GROUP BY CNTRYCODE ORDER BY CNTRYCODE;07070100000067000081A4000003E800000064000000015C0989F30000504A000000000000000000000000000000000000003100000000sql-parser-1.5+git20181206/test/select_tests.cpp #include "thirdparty/microtest/microtest.h" #include "sql_asserts.h" #include "SQLParser.h" using namespace hsql; TEST(SelectTest) { TEST_PARSE_SINGLE_SQL( "SELECT * FROM students;", kStmtSelect, SelectStatement, result, stmt); ASSERT_NULL(stmt->whereClause); ASSERT_NULL(stmt->groupBy); } TEST(SelectExprTest) { TEST_PARSE_SINGLE_SQL( "SELECT a, MAX(b), CUSTOM(c, F(un)) FROM students;", kStmtSelect, SelectStatement, result, stmt); ASSERT_NULL(stmt->whereClause); ASSERT_NULL(stmt->groupBy); ASSERT_EQ(stmt->selectList->size(), 3); ASSERT(stmt->selectList->at(0)->isType(kExprColumnRef)); ASSERT_STREQ(stmt->selectList->at(0)->getName(), "a"); ASSERT(stmt->selectList->at(1)->isType(kExprFunctionRef)); ASSERT_STREQ(stmt->selectList->at(1)->getName(), "MAX"); ASSERT_NOTNULL(stmt->selectList->at(1)->exprList); ASSERT_EQ(stmt->selectList->at(1)->exprList->size(), 1); ASSERT(stmt->selectList->at(1)->exprList->at(0)->isType(kExprColumnRef)); ASSERT_STREQ(stmt->selectList->at(1)->exprList->at(0)->getName(), "b"); ASSERT(stmt->selectList->at(2)->isType(kExprFunctionRef)); ASSERT_STREQ(stmt->selectList->at(2)->getName(), "CUSTOM"); ASSERT_NOTNULL(stmt->selectList->at(2)->exprList); ASSERT_EQ(stmt->selectList->at(2)->exprList->size(), 2); ASSERT(stmt->selectList->at(2)->exprList->at(0)->isType(kExprColumnRef)); ASSERT_STREQ(stmt->selectList->at(2)->exprList->at(0)->getName(), "c"); ASSERT(stmt->selectList->at(2)->exprList->at(1)->isType(kExprFunctionRef)); ASSERT_STREQ(stmt->selectList->at(2)->exprList->at(1)->getName(), "F"); ASSERT_EQ(stmt->selectList->at(2)->exprList->at(1)->exprList->size(), 1); ASSERT(stmt->selectList->at(2)->exprList->at(1)->exprList->at(0)->isType(kExprColumnRef)); ASSERT_STREQ(stmt->selectList->at(2)->exprList->at(1)->exprList->at(0)->getName(), "un"); } TEST(SelectSubstrTest) { TEST_PARSE_SINGLE_SQL( "SELECT SUBSTR(a, 3, 5) FROM students;", kStmtSelect, SelectStatement, result, stmt); ASSERT_NULL(stmt->whereClause); ASSERT_NULL(stmt->groupBy); ASSERT_EQ(stmt->selectList->size(), 1); ASSERT(stmt->selectList->at(0)->isType(kExprFunctionRef)); ASSERT_STREQ(stmt->selectList->at(0)->getName(), "SUBSTR"); ASSERT_NOTNULL(stmt->selectList->at(0)->exprList); ASSERT_EQ(stmt->selectList->at(0)->exprList->size(), 3); ASSERT(stmt->selectList->at(0)->exprList->at(0)->isType(kExprColumnRef)); ASSERT_STREQ(stmt->selectList->at(0)->exprList->at(0)->getName(), "a"); ASSERT(stmt->selectList->at(0)->exprList->at(1)->isType(kExprLiteralInt)); ASSERT_EQ(stmt->selectList->at(0)->exprList->at(1)->ival, 3); ASSERT(stmt->selectList->at(0)->exprList->at(2)->isType(kExprLiteralInt)); ASSERT_EQ(stmt->selectList->at(0)->exprList->at(2)->ival, 5); } TEST(SelectHavingTest) { TEST_PARSE_SINGLE_SQL( "SELECT city, AVG(grade) AS avg_grade FROM students GROUP BY city HAVING AVG(grade) < -2.0", kStmtSelect, SelectStatement, result, stmt); ASSERT_FALSE(stmt->selectDistinct); GroupByDescription* group = stmt->groupBy; ASSERT_NOTNULL(group); ASSERT_EQ(group->columns->size(), 1); ASSERT_EQ(group->having->opType, kOpLess); ASSERT(group->having->expr->isType(kExprFunctionRef)); ASSERT(group->having->expr2->isType(kExprLiteralFloat)); ASSERT_EQ(group->having->expr2->fval, -2.0); } TEST(SelectDistinctTest) { TEST_PARSE_SINGLE_SQL( "SELECT DISTINCT grade, city FROM students;", kStmtSelect, SelectStatement, result, stmt); ASSERT(stmt->selectDistinct); ASSERT_NULL(stmt->whereClause); } TEST(SelectSchemaTest) { TEST_PARSE_SINGLE_SQL( "SELECT grade FROM some_schema.students;", kStmtSelect, SelectStatement, result, stmt); ASSERT(stmt->fromTable); ASSERT_EQ(std::string(stmt->fromTable->schema), "some_schema"); } TEST(SelectGroupDistinctTest) { TEST_PARSE_SINGLE_SQL( "SELECT city, COUNT(name), COUNT(DISTINCT grade) FROM students GROUP BY city;", kStmtSelect, SelectStatement, result, stmt); ASSERT_FALSE(stmt->selectDistinct); ASSERT_EQ(stmt->selectList->size(), 3); ASSERT(!stmt->selectList->at(1)->distinct); ASSERT(stmt->selectList->at(2)->distinct); } TEST(OrderByTest) { TEST_PARSE_SINGLE_SQL( "SELECT grade, city FROM students ORDER BY grade, city DESC;", kStmtSelect, SelectStatement, result, stmt); ASSERT_NULL(stmt->whereClause); ASSERT_NOTNULL(stmt->order); ASSERT_EQ(stmt->order->size(), 2); ASSERT_EQ(stmt->order->at(0)->type, kOrderAsc); ASSERT_STREQ(stmt->order->at(0)->expr->name, "grade"); ASSERT_EQ(stmt->order->at(1)->type, kOrderDesc); ASSERT_STREQ(stmt->order->at(1)->expr->name, "city"); } TEST(SelectBetweenTest) { TEST_PARSE_SINGLE_SQL( "SELECT grade, city FROM students WHERE grade BETWEEN -1 and c;", kStmtSelect, SelectStatement, result, stmt); Expr* where = stmt->whereClause; ASSERT_NOTNULL(where); ASSERT(where->isType(kExprOperator)); ASSERT_EQ(where->opType, kOpBetween); ASSERT_STREQ(where->expr->getName(), "grade"); ASSERT(where->expr->isType(kExprColumnRef)); ASSERT_EQ(where->exprList->size(), 2); ASSERT(where->exprList->at(0)->isType(kExprLiteralInt)); ASSERT_EQ(where->exprList->at(0)->ival, -1); ASSERT(where->exprList->at(1)->isType(kExprColumnRef)); ASSERT_STREQ(where->exprList->at(1)->getName(), "c"); } TEST(SelectConditionalSelectTest) { TEST_PARSE_SINGLE_SQL( "SELECT * FROM t WHERE a = (SELECT MIN(v) FROM tt) AND EXISTS (SELECT * FROM test WHERE x < a);", kStmtSelect, SelectStatement, result, stmt); Expr* where = stmt->whereClause; ASSERT_NOTNULL(where); ASSERT(where->isType(kExprOperator)); ASSERT_EQ(where->opType, kOpAnd); // a = (SELECT ...) Expr* cond1 = where->expr; ASSERT_NOTNULL(cond1); ASSERT_NOTNULL(cond1->expr); ASSERT_EQ(cond1->opType, kOpEquals); ASSERT_STREQ(cond1->expr->getName(), "a"); ASSERT(cond1->expr->isType(kExprColumnRef)); ASSERT_NOTNULL(cond1->expr2); ASSERT(cond1->expr2->isType(kExprSelect)); SelectStatement* select2 = cond1->expr2->select; ASSERT_NOTNULL(select2); ASSERT_STREQ(select2->fromTable->getName(), "tt"); // EXISTS (SELECT ...) Expr* cond2 = where->expr2; ASSERT_EQ(cond2->opType, kOpExists); ASSERT_NOTNULL(cond2->select); SelectStatement* ex_select = cond2->select; ASSERT_STREQ(ex_select->fromTable->getName(), "test"); } TEST(SelectCaseWhen) { TEST_PARSE_SINGLE_SQL( "SELECT MAX(CASE WHEN a = 'foo' THEN x ELSE 0 END) FROM test;", kStmtSelect, SelectStatement, result, stmt); ASSERT_EQ(stmt->selectList->size(), 1); Expr* func = stmt->selectList->at(0); ASSERT_NOTNULL(func); ASSERT(func->isType(kExprFunctionRef)); ASSERT_EQ(func->exprList->size(), 1); Expr* caseExpr = func->exprList->at(0); ASSERT_NOTNULL(caseExpr); ASSERT(caseExpr->isType(kExprOperator)); ASSERT_EQ(caseExpr->opType, kOpCase); ASSERT_NULL(caseExpr->expr); ASSERT_NOTNULL(caseExpr->exprList); ASSERT_NOTNULL(caseExpr->expr2); ASSERT_EQ(caseExpr->exprList->size(), 1); ASSERT(caseExpr->expr2->isType(kExprLiteralInt)); Expr* whenExpr = caseExpr->exprList->at(0); ASSERT(whenExpr->expr->isType(kExprOperator)); ASSERT_EQ(whenExpr->expr->opType, kOpEquals); ASSERT(whenExpr->expr->expr->isType(kExprColumnRef)); ASSERT(whenExpr->expr->expr2->isType(kExprLiteralString)); } TEST(SelectCaseWhenWhen) { TEST_PARSE_SINGLE_SQL( "SELECT CASE WHEN x = 1 THEN 1 WHEN 1.25 < x THEN 2 END FROM test;", kStmtSelect, SelectStatement, result, stmt); ASSERT_EQ(stmt->selectList->size(), 1); Expr* caseExpr = stmt->selectList->at(0); ASSERT_NOTNULL(caseExpr); ASSERT(caseExpr->isType(kExprOperator)); ASSERT_EQ(caseExpr->opType, kOpCase); // CASE [expr] [exprList] [expr2] // [expr] [expr] // [expr] [expr2] [expr] [expr2] // CASE (null) WHEN X = 1 THEN 1 WHEN 1.25 < x THEN 2 (null) ASSERT_NULL(caseExpr->expr); ASSERT_NOTNULL(caseExpr->exprList); ASSERT_NULL(caseExpr->expr2); ASSERT_EQ(caseExpr->exprList->size(), 2); Expr* whenExpr = caseExpr->exprList->at(0); ASSERT_EQ(whenExpr->expr->opType, kOpEquals); ASSERT(whenExpr->expr->expr->isType(kExprColumnRef)); ASSERT(whenExpr->expr->expr2->isType(kExprLiteralInt)); Expr* whenExpr2 = caseExpr->exprList->at(1); ASSERT_EQ(whenExpr2->expr->opType, kOpLess); ASSERT(whenExpr2->expr->expr->isType(kExprLiteralFloat)); ASSERT(whenExpr2->expr->expr2->isType(kExprColumnRef)); } TEST(SelectCaseValueWhenWhenElse) { TEST_PARSE_SINGLE_SQL( "SELECT CASE x WHEN 1 THEN 0 WHEN 2 THEN 3 WHEN 8 THEN 7 ELSE 4 END FROM test;", kStmtSelect, SelectStatement, result, stmt); ASSERT_EQ(stmt->selectList->size(), 1); Expr* caseExpr = stmt->selectList->at(0); ASSERT_NOTNULL(caseExpr); ASSERT(caseExpr->isType(kExprOperator)); ASSERT_EQ(caseExpr->opType, kOpCase); ASSERT_NOTNULL(caseExpr->expr); ASSERT_NOTNULL(caseExpr->exprList); ASSERT_NOTNULL(caseExpr->expr2); ASSERT_EQ(caseExpr->exprList->size(), 3); ASSERT(caseExpr->expr->isType(kExprColumnRef)); Expr* whenExpr = caseExpr->exprList->at(2); ASSERT(whenExpr->expr->isType(kExprLiteralInt)); ASSERT_EQ(whenExpr->expr2->ival, 7); } TEST(SelectJoin) { TEST_PARSE_SINGLE_SQL( "SELECT City.name, Product.category, SUM(price) FROM fact\ INNER JOIN City ON fact.city_id = City.id\ OUTER JOIN Product ON fact.product_id = Product.id\ GROUP BY City.name, Product.category;", kStmtSelect, SelectStatement, result, stmt); const TableRef* table = stmt->fromTable; const JoinDefinition* outer_join = table->join; ASSERT_EQ(table->type, kTableJoin); ASSERT_EQ(outer_join->type, kJoinFull); ASSERT_EQ(outer_join->right->type, kTableName); ASSERT_STREQ(outer_join->right->name, "Product"); ASSERT_EQ(outer_join->condition->opType, kOpEquals); ASSERT_STREQ(outer_join->condition->expr->table, "fact"); ASSERT_STREQ(outer_join->condition->expr->name, "product_id"); ASSERT_STREQ(outer_join->condition->expr2->table, "Product"); ASSERT_STREQ(outer_join->condition->expr2->name, "id"); // Joins are are left associative. // So the second join should be on the left. ASSERT_EQ(outer_join->left->type, kTableJoin); const JoinDefinition* inner_join = outer_join->left->join; ASSERT_EQ(inner_join->type, kJoinInner); ASSERT_EQ(inner_join->left->type, kTableName); ASSERT_STREQ(inner_join->left->name, "fact"); ASSERT_EQ(inner_join->right->type, kTableName); ASSERT_STREQ(inner_join->right->name, "City"); ASSERT_EQ(inner_join->condition->opType, kOpEquals); ASSERT_STREQ(inner_join->condition->expr->table, "fact"); ASSERT_STREQ(inner_join->condition->expr->name, "city_id"); ASSERT_STREQ(inner_join->condition->expr2->table, "City"); ASSERT_STREQ(inner_join->condition->expr2->name, "id"); } TEST(SelectColumnOrder) { TEST_PARSE_SINGLE_SQL( "SELECT *\ FROM a,\ (SELECT a AS b FROM a) b,\ (SELECT a AS c FROM a) c,\ (SELECT a AS d FROM a) d;", kStmtSelect, SelectStatement, result, stmt); ASSERT_EQ(stmt->fromTable->list->size(), 4); // Make sure the order of the table list is corrects ASSERT_STREQ(stmt->fromTable->list->at(0)->name, "a"); ASSERT_STREQ(stmt->fromTable->list->at(1)->alias->name, "b"); ASSERT_STREQ(stmt->fromTable->list->at(2)->alias->name, "c"); ASSERT_STREQ(stmt->fromTable->list->at(3)->alias->name, "d"); } TEST(SelectAliasAbsent) { TEST_PARSE_SINGLE_SQL( "SELECT * FROM students;", kStmtSelect, SelectStatement, result, stmt); ASSERT_NULL(stmt->fromTable->alias); } TEST(SelectAliasSimple) { TEST_PARSE_SINGLE_SQL( "SELECT * FROM students AS s1;", kStmtSelect, SelectStatement, result, stmt); Alias* alias = stmt->fromTable->alias; ASSERT_NOTNULL(alias); ASSERT_STREQ(alias->name, "s1"); ASSERT_NULL(alias->columns); } TEST(SelectAliasWithColumns) { TEST_PARSE_SINGLE_SQL( "SELECT * FROM students AS s1(id, city);", kStmtSelect, SelectStatement, result, stmt); Alias* alias = stmt->fromTable->alias; ASSERT_NOTNULL(alias); ASSERT_NOTNULL(alias->name); ASSERT_STREQ(alias->name, "s1"); ASSERT_NOTNULL(alias->columns); ASSERT_EQ(alias->columns->size(), 2); ASSERT_STREQ(alias->columns->at(0), "id"); ASSERT_STREQ(alias->columns->at(1), "city"); } TEST(Operators) { SelectStatement* stmt; SQLParserResult result; SQLParser::parse("SELECT * FROM foo where a = 1; \ SELECT * FROM foo where a == 2; \ SELECT * FROM foo where a != 1; \ SELECT * FROM foo where a <> 1; \ SELECT * FROM foo where a > 1; \ SELECT * FROM foo where a < 1; \ SELECT * FROM foo where a >= 1; \ SELECT * FROM foo where a <= 1; \ SELECT * FROM foo where a = TRUE; \ SELECT * FROM foo where a = false;", &result); stmt = (SelectStatement*) result.getStatement(0); ASSERT_EQ(stmt->whereClause->opType, kOpEquals); ASSERT_EQ(stmt->whereClause->expr2->ival, 1); ASSERT_EQ(stmt->whereClause->expr2->isBoolLiteral, false); stmt = (SelectStatement*) result.getStatement(1); ASSERT_EQ(stmt->whereClause->opType, kOpEquals); ASSERT_EQ(stmt->whereClause->expr2->ival, 2); stmt = (SelectStatement*) result.getStatement(2); ASSERT_EQ(stmt->whereClause->opType, kOpNotEquals); stmt = (SelectStatement*) result.getStatement(3); ASSERT_EQ(stmt->whereClause->opType, kOpNotEquals); stmt = (SelectStatement*) result.getStatement(4); ASSERT_EQ(stmt->whereClause->opType, kOpGreater); stmt = (SelectStatement*) result.getStatement(5); ASSERT_EQ(stmt->whereClause->opType, kOpLess); stmt = (SelectStatement*) result.getStatement(6); ASSERT_EQ(stmt->whereClause->opType, kOpGreaterEq); stmt = (SelectStatement*) result.getStatement(7); ASSERT_EQ(stmt->whereClause->opType, kOpLessEq); stmt = (SelectStatement*) result.getStatement(8); ASSERT_EQ(stmt->whereClause->opType, kOpEquals); ASSERT_EQ(stmt->whereClause->expr2->ival, 1); ASSERT_EQ(stmt->whereClause->expr2->isBoolLiteral, true); stmt = (SelectStatement*) result.getStatement(9); ASSERT_EQ(stmt->whereClause->opType, kOpEquals); ASSERT_EQ(stmt->whereClause->expr2->ival, 0); ASSERT_EQ(stmt->whereClause->expr2->isBoolLiteral, true); } TEST(JoinTypes) { SelectStatement* stmt; SQLParserResult result; SQLParser::parse("SELECT * FROM x join y on a=b; \ SELECT * FROM x inner join y on a=b; \ SELECT * FROM x left join y on a=b; \ SELECT * FROM x left outer join y on a=b; \ SELECT * FROM x right join y on a=b; \ SELECT * FROM x right outer join y on a=b; \ SELECT * FROM x full join y on a=b; \ SELECT * FROM x outer join y on a=b; \ SELECT * FROM x full outer join y on a=b; \ SELECT * FROM x natural join y; \ SELECT * FROM x cross join y on a=b; \ SELECT * FROM x, y where a = b;", &result); stmt = (SelectStatement*) result.getStatement(0); ASSERT_EQ(stmt->fromTable->join->type, kJoinInner); stmt = (SelectStatement*) result.getStatement(1); ASSERT_EQ(stmt->fromTable->join->type, kJoinInner); stmt = (SelectStatement*) result.getStatement(2); ASSERT_EQ(stmt->fromTable->join->type, kJoinLeft); stmt = (SelectStatement*) result.getStatement(3); ASSERT_EQ(stmt->fromTable->join->type, kJoinLeft); stmt = (SelectStatement*) result.getStatement(4); ASSERT_EQ(stmt->fromTable->join->type, kJoinRight); stmt = (SelectStatement*) result.getStatement(5); ASSERT_EQ(stmt->fromTable->join->type, kJoinRight); stmt = (SelectStatement*) result.getStatement(6); ASSERT_EQ(stmt->fromTable->join->type, kJoinFull); stmt = (SelectStatement*) result.getStatement(7); ASSERT_EQ(stmt->fromTable->join->type, kJoinFull); stmt = (SelectStatement*) result.getStatement(8); ASSERT_EQ(stmt->fromTable->join->type, kJoinFull); stmt = (SelectStatement*) result.getStatement(9); ASSERT_EQ(stmt->fromTable->join->type, kJoinNatural); stmt = (SelectStatement*) result.getStatement(10); ASSERT_EQ(stmt->fromTable->join->type, kJoinCross); stmt = (SelectStatement*) result.getStatement(11); ASSERT_NULL(stmt->fromTable->join); } TEST(SetLimitOffset) { SelectStatement* stmt; TEST_PARSE_SQL_QUERY("select a from t1 limit 1; \ select a from t1 limit 1 offset 1; \ select a from t1 limit 0; \ select a from t1 limit 0 offset 1; \ select a from t1 limit 1 offset 0; \ select a from t1 limit ALL offset 1; \ select a from t1 limit NULL offset 1; \ select a from t1 offset 1; \ select top 10 a from t1; \ select top 20 a from t1 limit 10;", result, 10); stmt = (SelectStatement*) result.getStatement(0); ASSERT_EQ(stmt->limit->limit, 1); ASSERT_EQ(stmt->limit->offset, kNoOffset); stmt = (SelectStatement*) result.getStatement(1); ASSERT_EQ(stmt->limit->limit, 1); ASSERT_EQ(stmt->limit->offset, 1); stmt = (SelectStatement*) result.getStatement(2); ASSERT_EQ(stmt->limit->limit, 0); ASSERT_EQ(stmt->limit->offset, kNoOffset); stmt = (SelectStatement*) result.getStatement(3); ASSERT_EQ(stmt->limit->limit, 0); ASSERT_EQ(stmt->limit->offset, 1); stmt = (SelectStatement*) result.getStatement(4); ASSERT_EQ(stmt->limit->limit, 1); ASSERT_EQ(stmt->limit->offset, kNoOffset); stmt = (SelectStatement*) result.getStatement(5); ASSERT_EQ(stmt->limit->limit, kNoLimit); ASSERT_EQ(stmt->limit->offset, 1); stmt = (SelectStatement*) result.getStatement(6); ASSERT_EQ(stmt->limit->limit, kNoLimit); ASSERT_EQ(stmt->limit->offset, 1); stmt = (SelectStatement*) result.getStatement(7); ASSERT_EQ(stmt->limit->limit, kNoLimit); ASSERT_EQ(stmt->limit->offset, 1); stmt = (SelectStatement*) result.getStatement(8); ASSERT_EQ(stmt->limit->limit, 10); ASSERT_EQ(stmt->limit->offset, kNoOffset); stmt = (SelectStatement*) result.getStatement(9); ASSERT_EQ(stmt->limit->limit, 10); ASSERT_EQ(stmt->limit->offset, kNoOffset); } TEST(Extract) { SelectStatement* stmt; TEST_PARSE_SQL_QUERY("select extract(year from dc) FROM t;" "select x, extract(month from dc) AS t FROM t;" "select x FROM t WHERE extract(minute from dc) > 2011;", result, 3); stmt = (SelectStatement*) result.getStatement(0); ASSERT_TRUE(stmt->selectList); ASSERT_EQ(stmt->selectList->size(), 1u); ASSERT_EQ(stmt->selectList->at(0)->type, kExprFunctionRef); ASSERT_EQ(stmt->selectList->at(0)->name, std::string("EXTRACT")); ASSERT_EQ(stmt->selectList->at(0)->datetimeField, kDatetimeYear); ASSERT_TRUE(stmt->selectList->at(0)->expr); ASSERT_EQ(stmt->selectList->at(0)->expr->type, kExprColumnRef); stmt = (SelectStatement*) result.getStatement(1); ASSERT_TRUE(stmt->selectList); ASSERT_EQ(stmt->selectList->size(), 2u); ASSERT_EQ(stmt->selectList->at(1)->type, kExprFunctionRef); ASSERT_EQ(stmt->selectList->at(1)->name, std::string("EXTRACT")); ASSERT_EQ(stmt->selectList->at(1)->datetimeField, kDatetimeMonth); ASSERT_TRUE(stmt->selectList->at(1)->expr); ASSERT_EQ(stmt->selectList->at(1)->expr->type, kExprColumnRef); ASSERT_TRUE(stmt->selectList->at(1)->alias); ASSERT_EQ(stmt->selectList->at(1)->alias, std::string("t")); stmt = (SelectStatement*) result.getStatement(2); ASSERT_TRUE(stmt->whereClause); ASSERT_TRUE(stmt->whereClause->expr); ASSERT_EQ(stmt->whereClause->expr->type, kExprFunctionRef); ASSERT_EQ(stmt->whereClause->expr->name, std::string("EXTRACT")); ASSERT_EQ(stmt->whereClause->expr->datetimeField, kDatetimeMinute); } TEST(NoFromClause) { TEST_PARSE_SINGLE_SQL( "SELECT 1 + 2;", kStmtSelect, SelectStatement, result, stmt); ASSERT_TRUE(stmt->selectList); ASSERT_FALSE(stmt->fromTable); ASSERT_FALSE(stmt->whereClause); ASSERT_FALSE(stmt->groupBy); ASSERT_EQ(stmt->selectList->size(), 1u); ASSERT_EQ(stmt->selectList->at(0)->type, kExprOperator); ASSERT_EQ(stmt->selectList->at(0)->expr->type, kExprLiteralInt); ASSERT_EQ(stmt->selectList->at(0)->expr2->type, kExprLiteralInt); } 07070100000068000081A4000003E800000064000000015C0989F3000002F1000000000000000000000000000000000000002E00000000sql-parser-1.5+git20181206/test/sql_asserts.h#ifndef __HELPER_H__ #define __HELPER_H__ #define TEST_PARSE_SQL_QUERY(query, result, numStatements) \ hsql::SQLParserResult result; \ hsql::SQLParser::parse(query, &result); \ ASSERT(result.isValid()); \ ASSERT_EQ(result.size(), numStatements); #define TEST_PARSE_SINGLE_SQL(query, stmtType, stmtClass, result, outputVar) \ TEST_PARSE_SQL_QUERY(query, result, 1); \ ASSERT_EQ(result.getStatement(0)->type(), stmtType); \ const stmtClass* outputVar = (const stmtClass*) result.getStatement(0); #define TEST_CAST_STMT(result, stmt_index, stmtType, stmtClass, outputVar) \ ASSERT_EQ(result.getStatement(stmt_index)->type(), stmtType); \ const stmtClass* outputVar = (const stmtClass*) result.getStatement(stmt_index); #endif 07070100000069000081A4000003E800000064000000015C0989F3000004F6000000000000000000000000000000000000002F00000000sql-parser-1.5+git20181206/test/sql_parser.cpp#include "thirdparty/microtest/microtest.h" #include <iostream> #include <map> #include <string> #include "sql_asserts.h" #include "SQLParser.h" #include "parser/bison_parser.h" using namespace hsql; void test_tokens(const std::string& query, const std::vector<int16_t>& expected_tokens) { std::vector<int16_t> tokens; ASSERT(SQLParser::tokenize(query, &tokens)); ASSERT_EQ(expected_tokens.size(), tokens.size()); for (unsigned i = 0; i < expected_tokens.size(); ++i) { ASSERT_EQ(expected_tokens[i], tokens[i]); } } TEST(SQLParserTokenizeTest) { test_tokens("SELECT * FROM test;", { SQL_SELECT, '*', SQL_FROM, SQL_IDENTIFIER, ';' }); test_tokens("SELECT a, 'b' FROM test WITH HINT;", { SQL_SELECT, SQL_IDENTIFIER, ',', SQL_STRING, SQL_FROM, SQL_IDENTIFIER, SQL_WITH, SQL_HINT, ';' }); } TEST(SQLParserTokenizeStringifyTest) { const std::string query = "SELECT * FROM test;"; std::vector<int16_t> tokens; ASSERT(SQLParser::tokenize(query, &tokens)); // Make u16string. std::u16string token_string(tokens.cbegin(), tokens.cend()); // Check if u16 string is cacheable. std::map<std::u16string, std::string> cache; cache[token_string] = query; ASSERT(query == cache[token_string]); ASSERT(&query != &cache[token_string]); } 0707010000006A000081A4000003E800000064000000015C0989F3000018FC000000000000000000000000000000000000002E00000000sql-parser-1.5+git20181206/test/sql_tests.cpp/* * sql_tests.cpp */ #include "thirdparty/microtest/microtest.h" #include "SQLParser.h" #include "util/sqlhelper.h" #include "sql_asserts.h" using namespace hsql; TEST(DeleteStatementTest) { SQLParserResult result; SQLParser::parse("DELETE FROM students WHERE grade > 2.0;", &result); ASSERT(result.isValid()); ASSERT_EQ(result.size(), 1); ASSERT(result.getStatement(0)->type() == kStmtDelete); const DeleteStatement* stmt = (const DeleteStatement*) result.getStatement(0); ASSERT_STREQ(stmt->tableName, "students"); ASSERT_NOTNULL(stmt->expr); ASSERT(stmt->expr->isType(kExprOperator)); ASSERT_STREQ(stmt->expr->expr->name, "grade"); ASSERT_EQ(stmt->expr->expr2->fval, 2.0); } TEST(CreateStatementTest) { SQLParserResult result; SQLParser::parse("CREATE TABLE students (name VARCHAR(50), student_number INT, city INTEGER NULL, grade DOUBLE NOT NULL, comment TEXT)", &result); ASSERT(result.isValid()); ASSERT_EQ(result.size(), 1); ASSERT_EQ(result.getStatement(0)->type(), kStmtCreate); const CreateStatement* stmt = (const CreateStatement*) result.getStatement(0); ASSERT_EQ(stmt->type, kCreateTable); ASSERT_STREQ(stmt->tableName, "students"); ASSERT_NOTNULL(stmt->columns); ASSERT_EQ(stmt->columns->size(), 5); ASSERT_STREQ(stmt->columns->at(0)->name, "name"); ASSERT_STREQ(stmt->columns->at(1)->name, "student_number"); ASSERT_STREQ(stmt->columns->at(2)->name, "city"); ASSERT_STREQ(stmt->columns->at(3)->name, "grade"); ASSERT_STREQ(stmt->columns->at(4)->name, "comment"); ASSERT_EQ(stmt->columns->at(0)->type, (ColumnType{DataType::VARCHAR, 50})); ASSERT_EQ(stmt->columns->at(1)->type, ColumnType{DataType::INT}); ASSERT_EQ(stmt->columns->at(2)->type, ColumnType{DataType::INT}); ASSERT_EQ(stmt->columns->at(3)->type, ColumnType{DataType::DOUBLE}); ASSERT_EQ(stmt->columns->at(4)->type, ColumnType{DataType::TEXT}); ASSERT_EQ(stmt->columns->at(0)->nullable, false); ASSERT_EQ(stmt->columns->at(1)->nullable, false); ASSERT_EQ(stmt->columns->at(2)->nullable, true); ASSERT_EQ(stmt->columns->at(3)->nullable, false); ASSERT_EQ(stmt->columns->at(3)->nullable, false); } TEST(UpdateStatementTest) { SQLParserResult result; SQLParser::parse("UPDATE students SET grade = 5.0, name = 'test' WHERE name = 'Max O''Mustermann';", &result); ASSERT(result.isValid()); ASSERT_EQ(result.size(), 1); ASSERT_EQ(result.getStatement(0)->type(), kStmtUpdate); const UpdateStatement* stmt = (const UpdateStatement*) result.getStatement(0); ASSERT_NOTNULL(stmt->table); ASSERT_STREQ(stmt->table->name, "students"); ASSERT_NOTNULL(stmt->updates); ASSERT_EQ(stmt->updates->size(), 2); ASSERT_STREQ(stmt->updates->at(0)->column, "grade"); ASSERT_STREQ(stmt->updates->at(1)->column, "name"); ASSERT(stmt->updates->at(0)->value->isType(kExprLiteralFloat)); ASSERT(stmt->updates->at(1)->value->isType(kExprLiteralString)); ASSERT_EQ(stmt->updates->at(0)->value->fval, 5.0); ASSERT_STREQ(stmt->updates->at(1)->value->name, "test"); ASSERT_NOTNULL(stmt->where); ASSERT(stmt->where->isType(kExprOperator)); ASSERT_EQ(stmt->where->opType, kOpEquals); ASSERT_STREQ(stmt->where->expr->name, "name"); ASSERT_STREQ(stmt->where->expr2->name, "Max O'Mustermann"); } TEST(InsertStatementTest) { TEST_PARSE_SINGLE_SQL( "INSERT INTO students VALUES ('Max Mustermann', 12345, 'Musterhausen', 2.0)", kStmtInsert, InsertStatement, result, stmt); ASSERT_EQ(stmt->values->size(), 4); // TODO } TEST(DropTableStatementTest) { TEST_PARSE_SINGLE_SQL( "DROP TABLE students", kStmtDrop, DropStatement, result, stmt); ASSERT_FALSE(stmt->ifExists); ASSERT_EQ(stmt->type, kDropTable); ASSERT_NOTNULL(stmt->name); ASSERT_STREQ(stmt->name, "students"); } TEST(DropTableIfExistsStatementTest) { TEST_PARSE_SINGLE_SQL( "DROP TABLE IF EXISTS students", kStmtDrop, DropStatement, result, stmt); ASSERT_TRUE(stmt->ifExists); ASSERT_EQ(stmt->type, kDropTable); ASSERT_NOTNULL(stmt->name); ASSERT_STREQ(stmt->name, "students"); } TEST(ReleaseStatementTest) { TEST_PARSE_SINGLE_SQL( "SELECT * FROM students;", kStmtSelect, SelectStatement, result, stmt); ASSERT_EQ(1, result.size()); ASSERT_NULL(stmt->whereClause); std::vector<SQLStatement*> statements = result.releaseStatements(); ASSERT_EQ(0, result.size()); for (SQLStatement* stmt : statements) { delete stmt; } } TEST(ShowTableStatementTest) { TEST_PARSE_SINGLE_SQL( "SHOW TABLES;", kStmtShow, ShowStatement, result, stmt); ASSERT_EQ(stmt->type, kShowTables); ASSERT_NULL(stmt->name); } TEST(ShowColumnsStatementTest) { TEST_PARSE_SINGLE_SQL( "SHOW COLUMNS students;", kStmtShow, ShowStatement, result, stmt); ASSERT_EQ(stmt->type, kShowColumns); ASSERT_NOTNULL(stmt->name); ASSERT_STREQ(stmt->name, "students"); } SQLParserResult parse_and_move(std::string query) { hsql::SQLParserResult result; hsql::SQLParser::parse(query, &result); // Moves on return. return result; } SQLParserResult move_in_and_back(SQLParserResult res) { // Moves on return. return res; } TEST(MoveSQLResultTest) { SQLParserResult res = parse_and_move("SELECT * FROM test;"); ASSERT(res.isValid()); ASSERT_EQ(1, res.size()); // Moved around. SQLParserResult new_res = move_in_and_back(std::move(res)); // Original object should be invalid. ASSERT_FALSE(res.isValid()); ASSERT_EQ(0, res.size()); ASSERT(new_res.isValid()); ASSERT_EQ(1, new_res.size()); } TEST(HintTest) { TEST_PARSE_SINGLE_SQL( "SELECT * FROM students WITH HINT(NO_CACHE, SAMPLE_RATE(10));", kStmtSelect, SelectStatement, result, stmt); ASSERT_NOTNULL(stmt->hints); ASSERT_EQ(2, stmt->hints->size()); ASSERT_STREQ("NO_CACHE", stmt->hints->at(0)->name); ASSERT_STREQ("SAMPLE_RATE", stmt->hints->at(1)->name); ASSERT_EQ(1, stmt->hints->at(1)->exprList->size()); ASSERT_EQ(10, stmt->hints->at(1)->exprList->at(0)->ival); } TEST(StringLengthTest) { TEST_PARSE_SQL_QUERY( "SELECT * FROM bar; INSERT INTO foo VALUES (4);\t\n SELECT * FROM foo;", result, 3); ASSERT_EQ(result.getStatement(0)->stringLength, 18); ASSERT_EQ(result.getStatement(1)->stringLength, 28); ASSERT_EQ(result.getStatement(2)->stringLength, 21); } TEST_MAIN(); 0707010000006B000081ED000003E800000064000000015C0989F30000091E000000000000000000000000000000000000002800000000sql-parser-1.5+git20181206/test/test.sh#!/bin/bash # Has to be executed from the root of the repository. # Usually invoked by `make test`. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./ # Colors RED='\033[1;31m' GREEN='\033[1;32m' NC='\033[0m' BOLD='\033[1;39m' RET=0 SQL_TEST_RET=0 MEM_LEAK_RET=0 CONFLICT_RET=0 ################################################# # Running SQL parser tests. printf "\n${GREEN}Running SQL parser tests...${NC}\n" bin/tests -f "test/queries/queries-good.sql" -f "test/queries/queries-bad.sql" SQL_TEST_RET=$? if [ $SQL_TEST_RET -eq 0 ]; then printf "${GREEN}SQL parser tests succeeded!${NC}\n" else RET=1 printf "${RED}SQL parser tests failed!${NC}\n" fi ################################################# # Running memory leak checks. printf "\n${GREEN}Running memory leak checks...${NC}\n" valgrind --leak-check=full --error-exitcode=200 --log-fd=3 \ bin/tests -f "test/queries/queries-good.sql" -f "test/queries/queries-bad.sql" \ 3>&1 >/dev/null 2>/dev/null MEM_LEAK_RET=$? if [ $MEM_LEAK_RET -ne 200 ]; then printf "${GREEN}Memory leak check succeeded!${NC}\n" MEM_LEAK_RET=0 else MEM_LEAK_RET=1 RET=1 printf "${RED}Memory leak check failed!${NC}\n" fi ################################################# # Checking if the grammar is conflict free. printf "\n${GREEN}Checking for conflicts in the grammer...${NC}\n" printf "${RED}" make -C src/parser/ test >>/dev/null CONFLICT_RET=$? if [ $CONFLICT_RET -eq 0 ]; then printf "${GREEN}Conflict check succeeded!${NC}\n" else RET=1 printf "${RED}Conflict check failed!${NC}\n" fi # Print a summary of the test results. printf " ---------------------------------- ${BOLD}Summary:\n" if [ $SQL_TEST_RET -eq 0 ]; then printf "SQL Tests: ${GREEN}Success${BOLD}\n"; else printf "SQL Tests: ${RED}Failure${BOLD}\n"; fi if [ $MEM_LEAK_RET -eq 0 ]; then printf "Memory Leak Check: ${GREEN}Success${BOLD}\n"; else printf "Memory Leak Check: ${RED}Failure${BOLD}\n"; fi if [ $CONFLICT_RET -eq 0 ]; then printf "Grammar Conflict Check: ${GREEN}Success${BOLD}\n"; else printf "Grammar Conflict Check: ${RED}Failure${BOLD}\n"; fi if [ $RET -eq 0 ]; then printf "${GREEN}All tests passed!${NC}\n"; else printf "${RED}Some tests failed!${NC}\n"; fi printf "${NC}----------------------------------\n" exit $RET 0707010000006C000041ED000003E800000064000000035C0989F300000000000000000000000000000000000000000000002B00000000sql-parser-1.5+git20181206/test/thirdparty0707010000006D000041ED000003E800000064000000025C0989F300000000000000000000000000000000000000000000003500000000sql-parser-1.5+git20181206/test/thirdparty/microtest0707010000006E000081A4000003E800000064000000015C0989F30000170D000000000000000000000000000000000000004100000000sql-parser-1.5+git20181206/test/thirdparty/microtest/microtest.h// // microtest.h // // URL: https://github.com/torpedro/microtest.h // Author: Pedro Flemming (http://torpedro.com/) // License: MIT License (https://github.com/torpedro/microtest.h/blob/master/LICENSE) // Copyright (c) 2017 Pedro Flemming // // This is a small header-only C++ unit testing framework. // It allows to define small unit tests with set of assertions available. // #ifndef __MICROTEST_H__ #define __MICROTEST_H__ #include <vector> #include <string> #include <iostream> #include <algorithm> //////////////// // Assertions // //////////////// #define ASSERT(cond)\ ASSERT_TRUE(cond); #define ASSERT_TRUE(cond)\ if (!(cond)) throw mt::AssertFailedException(#cond, __FILE__, __LINE__); #define ASSERT_FALSE(cond)\ if (cond) throw mt::AssertFailedException(#cond, __FILE__, __LINE__); #define ASSERT_NULL(value)\ ASSERT_TRUE(value == NULL); #define ASSERT_NOTNULL(value)\ ASSERT_TRUE(value != NULL); #define ASSERT_STREQ(a, b)\ if (std::string(a).compare(std::string(b)) != 0) {\ printf("%s{ info} %s", mt::yellow(), mt::def());\ std::cout << "Actual values: " << a << " != " << b << std::endl;\ throw mt::AssertFailedException(#a " == " #b, __FILE__, __LINE__);\ } #define ASSERT_STRNEQ(a, b)\ if (std::string(a).compare(std::string(b)) !== 0) {\ printf("%s{ info} %s", mt::yellow(), mt::def());\ std::cout << "Actual values: " << a << " == " << b << std::endl;\ throw mt::AssertFailedException(#a " != " #b, __FILE__, __LINE__);\ } #define ASSERT_EQ(a, b)\ if (a != b) {\ printf("%s{ info} %s", mt::yellow(), mt::def());\ std::cout << "Actual values: " << a << " != " << b << std::endl;\ }\ ASSERT(a == b); #define ASSERT_NEQ(a, b)\ if (a == b) {\ printf("%s{ info} %s", mt::yellow(), mt::def());\ std::cout << "Actual values: " << a << " == " << b << std::endl;\ }\ ASSERT(a != b); //////////////// // Unit Tests // //////////////// #define TEST(name) \ void name();\ namespace {\ bool __##name = mt::TestsManager::AddTest(name, #name);\ }\ void name() /////////////// // Framework // /////////////// namespace mt { inline const char* red() { return "\033[1;31m"; } inline const char* green() { return "\033[0;32m"; } inline const char* yellow() { return "\033[0;33m"; } inline const char* def() { return "\033[0m"; } inline void printRunning(const char* message, FILE* file = stdout) { fprintf(file, "%s{ running}%s %s\n", green(), def(), message); } inline void printOk(const char* message, FILE* file = stdout) { fprintf(file, "%s{ ok}%s %s\n", green(), def(), message); } inline void printFailed(const char* message, FILE* file = stdout) { fprintf(file, "%s{ failed} %s%s\n", red(), message, def()); } // Exception that is thrown when an assertion fails. class AssertFailedException : public std::exception { public: AssertFailedException(std::string description, std::string filepath, int line) : std::exception(), description_(description), filepath_(filepath), line_(line) {}; virtual const char* what() const throw() { return description_.c_str(); } inline const char* getFilepath() { return filepath_.c_str(); } inline int getLine() { return line_; } protected: std::string description_; std::string filepath_; int line_; }; class TestsManager { // Note: static initialization fiasco // http://www.parashift.com/c++-faq-lite/static-init-order.html // http://www.parashift.com/c++-faq-lite/static-init-order-on-first-use.html public: struct Test { const char* name; void (*fn)(void); }; static std::vector<Test>& tests() { static std::vector<Test> tests_; return tests_; } // Adds a new test to the current set of tests. // Returns false if a test with the same name already exists. inline static bool AddTest(void (*fn)(void), const char* name) { tests().push_back({ name, fn }); return true; } // Run all tests that are registered. // Returns the number of tests that failed. inline static size_t RunAllTests(FILE* file = stdout) { size_t num_failed = 0; for (const Test& test : tests()) { // Run the test. // If an AsserFailedException is thrown, the test has failed. try { printRunning(test.name, file); (*test.fn)(); printOk(test.name, file); } catch (AssertFailedException& e) { printFailed(test.name, file); fprintf(file, " %sAssertion failed: %s%s\n", red(), e.what(), def()); fprintf(file, " %s%s:%d%s\n", red(), e.getFilepath(), e.getLine(), def()); ++num_failed; } } int return_code = (num_failed > 0) ? 1 : 0; return return_code; } }; // Class that will capture the arguments passed to the program. class Runtime { public: static const std::vector<std::string>& args(int argc = -1, char** argv = NULL) { static std::vector<std::string> args_; if (argc >= 0) { for (int i = 0; i < argc; ++i) { args_.push_back(argv[i]); } } return args_; } }; } #define TEST_MAIN() \ int main(int argc, char *argv[]) {\ mt::Runtime::args(argc, argv);\ \ size_t num_failed = mt::TestsManager::RunAllTests(stdout);\ if (num_failed == 0) {\ fprintf(stdout, "%s{ summary} All tests succeeded!%s\n", mt::green(), mt::def());\ return 0;\ } else {\ double percentage = 100.0 * num_failed / mt::TestsManager::tests().size();\ fprintf(stderr, "%s{ summary} %lu tests failed (%.2f%%)%s\n", mt::red(), num_failed, percentage, mt::def());\ return -1;\ }\ } #endif // __MICROTEST_H__0707010000006F000081A4000003E800000064000000015C0989F300000ED2000000000000000000000000000000000000003000000000sql-parser-1.5+git20181206/test/tpc_h_tests.cpp#include "thirdparty/microtest/microtest.h" #include "SQLParser.h" #include "util/sqlhelper.h" #include "sql_asserts.h" #include <string> #include <fstream> #include <streambuf> #include <iostream> using namespace hsql; std::string readFileContents(std::string file_path) { std::ifstream t(file_path.c_str()); std::string text((std::istreambuf_iterator<char>(t)), std::istreambuf_iterator<char>()); return text; } TEST(TPCHQueryGrammarTests) { std::vector<std::string> files = { "test/queries/tpc-h-01.sql", "test/queries/tpc-h-02.sql", "test/queries/tpc-h-03.sql", "test/queries/tpc-h-04.sql", "test/queries/tpc-h-05.sql", "test/queries/tpc-h-06.sql", "test/queries/tpc-h-07.sql", "test/queries/tpc-h-08.sql", "test/queries/tpc-h-09.sql", "test/queries/tpc-h-10.sql", "test/queries/tpc-h-11.sql", "test/queries/tpc-h-12.sql", "test/queries/tpc-h-13.sql", "test/queries/tpc-h-14.sql", "test/queries/tpc-h-15.sql", "test/queries/tpc-h-16.sql", "test/queries/tpc-h-17.sql", "test/queries/tpc-h-18.sql", "test/queries/tpc-h-19.sql", "test/queries/tpc-h-20.sql", "test/queries/tpc-h-21.sql", "test/queries/tpc-h-22.sql", }; int testsFailed = 0; std::string concatenated = ""; for (const std::string& file_path : files) { std::string query = readFileContents(file_path); concatenated += query; if (concatenated.back() != ';') concatenated += ';'; SQLParserResult result; SQLParser::parse(query.c_str(), &result); if (!result.isValid()) { mt::printFailed(file_path.c_str()); printf("%s %s (L%d:%d)%s\n", mt::red(), result.errorMsg(), result.errorLine(), result.errorColumn(), mt::def()); ++testsFailed; } else { mt::printOk(file_path.c_str()); } } SQLParserResult result; SQLParser::parse(concatenated.c_str(), &result); if (!result.isValid()) { mt::printFailed("TPCHAllConcatenated"); printf("%s %s (L%d:%d)%s\n", mt::red(), result.errorMsg(), result.errorLine(), result.errorColumn(), mt::def()); ++testsFailed; } else { mt::printOk("TPCHAllConcatenated"); } ASSERT_EQ(testsFailed, 0); } TEST(TPCHQueryDetailTest) { std::string query = readFileContents("test/queries/tpc-h-20.sql"); SQLParserResult result; SQLParser::parse(query.c_str(), &result); ASSERT(result.isValid()); ASSERT_EQ(result.size(), 1); const SQLStatement* stmt20 = result.getStatement(0); ASSERT_EQ(stmt20->type(), kStmtSelect); const SelectStatement* select20 = (const SelectStatement*) stmt20; ASSERT_EQ(select20->selectList->size(), 2); ASSERT_STREQ(select20->selectList->at(0)->getName(), "S_NAME"); ASSERT_STREQ(select20->selectList->at(1)->getName(), "S_ADDRESS"); // Test WHERE Clause. Expr* where = select20->whereClause; ASSERT_NOTNULL(where); ASSERT(where->isType(kExprOperator)); ASSERT_EQ(where->opType, kOpAnd); Expr* andExpr2 = where->expr; ASSERT_NOTNULL(andExpr2); ASSERT(andExpr2->isType(kExprOperator)); ASSERT_EQ(andExpr2->opType, kOpAnd); // Test IN expression. Expr* inExpr = andExpr2->expr; ASSERT_NOTNULL(inExpr); ASSERT(inExpr->isType(kExprOperator)); ASSERT_EQ(inExpr->opType, kOpIn); ASSERT_STREQ(inExpr->expr->getName(), "S_SUPPKEY"); ASSERT_NOTNULL(inExpr->select); ASSERT_EQ(inExpr->select->selectList->size(), 1); ASSERT(inExpr->select->selectList->at(0)->isType(kExprColumnRef)); ASSERT_STREQ(inExpr->select->selectList->at(0)->getName(), "PS_SUPPKEY"); // Test ORDER BY clause. ASSERT_NOTNULL(select20->order); ASSERT_EQ(select20->order->size(), 1); ASSERT(select20->order->at(0)->expr->isType(kExprColumnRef)); ASSERT_STREQ(select20->order->at(0)->expr->getName(), "S_NAME"); } 07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!1498 blocks
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor