Changeset View
Changeset View
Standalone View
Standalone View
src/parser/generate_parser_code.sh
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | |||||
64 | cat << EOF > generated/sqlparser.h | 64 | cat << EOF > generated/sqlparser.h | ||
65 | /**************************************************************************** | 65 | /**************************************************************************** | ||
66 | * Created by $me | 66 | * Created by $me | ||
67 | * WARNING! All changes made in this file will be lost! | 67 | * WARNING! All changes made in this file will be lost! | ||
68 | ****************************************************************************/ | 68 | ****************************************************************************/ | ||
69 | #ifndef KDBSQLPARSER_H | 69 | #ifndef KDBSQLPARSER_H | ||
70 | #define KDBSQLPARSER_H | 70 | #define KDBSQLPARSER_H | ||
71 | 71 | | |||
72 | #include "KDbDateTime.h" | ||||
72 | #include "KDbExpression.h" | 73 | #include "KDbExpression.h" | ||
73 | #include "KDbField.h" | 74 | #include "KDbField.h" | ||
74 | #include "KDbOrderByColumn.h" | 75 | #include "KDbOrderByColumn.h" | ||
75 | 76 | | |||
76 | struct OrderByColumnInternal; | 77 | struct OrderByColumnInternal; | ||
77 | struct SelectOptionsInternal; | 78 | struct SelectOptionsInternal; | ||
78 | 79 | | |||
79 | EOF | 80 | EOF | ||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 148 | public: | |||
151 | inline KDbToken() : v(0) {} | 152 | inline KDbToken() : v(0) {} | ||
152 | 153 | | |||
153 | KDbToken(const KDbToken &other) : v(other.v) {} | 154 | KDbToken(const KDbToken &other) : v(other.v) {} | ||
154 | 155 | | |||
155 | //! Creates a single-character token | 156 | //! Creates a single-character token | ||
156 | //! Only characters that belong to the grammar are accepted: | 157 | //! Only characters that belong to the grammar are accepted: | ||
157 | EOF | 158 | EOF | ||
158 | (echo -n " //! "; grep "\"'.'\"," generated/sqlparser.cpp \ | 159 | (echo -n " //! "; grep "\"'.'\"," generated/sqlparser.cpp \ | ||
159 | | sed -e ":a;N;s/\"\('.'\)\",/\1/g;s/\n//g;s/\".*,//g;s/^ *//g;s/ *$//g;") >> generated/KDbToken.h | 160 | | sed -e "s/\"\('.'\)\",/\1/g;s/\"[0-9A-Za-z_$]*\",[ ]*//g;" | tr --delete '\n' \ | ||
161 | | sed -e "s/ $//g;") >> generated/KDbToken.h | ||||
160 | 162 | | |||
161 | cat << EOF >> generated/KDbToken.h | 163 | cat << EOF >> generated/KDbToken.h | ||
164 | | ||||
162 | //! Invalid KDbToken is created for character that is not accepted. | 165 | //! Invalid KDbToken is created for character that is not accepted. | ||
163 | KDbToken(char charToken); | 166 | KDbToken(char charToken); | ||
164 | 167 | | |||
165 | //! @return true if this token is valid | 168 | //! @return true if this token is valid | ||
166 | inline bool isValid() const { return v != 0; } | 169 | inline bool isValid() const { return v != 0; } | ||
167 | 170 | | |||
168 | //! @return name of this token | 171 | //! @return name of this token | ||
169 | //! Useful for debugging. | 172 | //! Useful for debugging. | ||
▲ Show 20 Lines • Show All 222 Lines • Show Last 20 Lines |