|
static String | parse (String sql) |
|
Definition at line 10 of file HeavyAIEscapeParser.java.
static String ai.heavy.jdbc.HeavyAIEscapeParser.parse |
( |
String |
sql | ) |
|
|
inlinestatic |
static Parser_return ai.heavy.jdbc.HeavyAIEscapeParser.parse |
( |
String |
sql, |
|
|
int |
bracket_cnt |
|
) |
| |
|
inlinestaticprivate |
Definition at line 139 of file HeavyAIEscapeParser.java.
References ai.heavy.jdbc.HeavyAIEscapeParser.parse(), and ai.heavy.jdbc.HeavyAIEscapeParser.process_sql().
141 boolean in_quote =
false;
144 if (sql.charAt(index) ==
'\'') {
145 in_quote = !in_quote;
146 }
else if (sql.charAt(index) ==
'{' && !in_quote) {
147 if (index + 1 == sql.length()) {
150 throw new RuntimeException(
"Invalid java escape syntax - badly matched '{'");
152 Parser_return pR =
parse(sql.substring(index + 1), ++bracket_cnt);
153 bracket_cnt = pR.bracket_cnt;
154 String sql_snippet = pR.sql_value;
155 sql = sql.substring(0, index) +
" " + sql_snippet;
157 }
else if (sql.charAt(index) ==
'}' && !in_quote) {
158 Pair ptr =
new Pair(0);
160 Parser_return pR =
new Parser_return();
162 pR.bracket_cnt = --bracket_cnt;
163 pR.end_idx = ptr.end + 1;
167 }
while (index < sql.length());
169 throw new RuntimeException(
"Invalid java escape syntax - badly matched '''");
172 Parser_return pR =
new Parser_return();
174 pR.bracket_cnt = bracket_cnt;
175 pR.end_idx = sql.length();
static String parse(String sql)
static String process_sql(String sql, Pair index)
static String ai.heavy.jdbc.HeavyAIEscapeParser.process_sql |
( |
String |
sql, |
|
|
Pair |
index |
|
) |
| |
|
inlinestaticprivate |
final char [] ai.heavy.jdbc.HeavyAIEscapeParser.QUOTE_OR_ALPHABETIC_MARKER = {'\"', '0'} |
|
staticprivate |
final char [] ai.heavy.jdbc.HeavyAIEscapeParser.SINGLE_QUOTE = {'\''} |
|
staticprivate |
The documentation for this class was generated from the following file: