private char quoteStart() { return parserConfig.quoting().string.charAt(0); }
private char quoteStart() { return parserConfig.quoting().string.charAt(0); }
private String replaceQuotes(SqlParser.Config parserConfig, String sql) { char openQuote = parserConfig.quoting().string.charAt(0); char closeQuote = openQuote == '[' ? ']' : openQuote; return sql.replace('[', openQuote).replace(']', closeQuote); }
new StrTokenizer(storeTablePath, '.', config.quoting().string.charAt(0)) .setIgnoreEmptyTokens(true) .getTokenList();
Tokenizer tokenizer = new Tokenizer(sql, hintToken, parserConfig.quoting()); List<Token> list = new ArrayList<>(); while (true) {
Tokenizer tokenizer = new Tokenizer(sql, hintToken, parserConfig.quoting()); List<Token> list = new ArrayList<>(); while (true) {
private SqlParser(SqlAbstractParserImpl parser, Config config) { this.parser = parser; parser.setTabSize(1); parser.setQuotedCasing(config.quotedCasing()); parser.setUnquotedCasing(config.unquotedCasing()); parser.setIdentifierMaxLength(config.identifierMaxLength()); parser.setConformance(config.conformance()); switch (config.quoting()) { case DOUBLE_QUOTE: parser.switchTo("DQID"); break; case BACK_TICK: parser.switchTo("BTID"); break; case BRACKET: parser.switchTo("DEFAULT"); break; } }
private SqlParser(String s, SqlAbstractParserImpl parser, Config config) { this.originalInput = s; this.parser = parser; parser.setOriginalSql(s); parser.setTabSize(1); parser.setQuotedCasing(config.quotedCasing()); parser.setUnquotedCasing(config.unquotedCasing()); parser.setIdentifierMaxLength(config.identifierMaxLength()); parser.setConformance(config.conformance()); switch (config.quoting()) { case DOUBLE_QUOTE: parser.switchTo("DQID"); break; case BACK_TICK: parser.switchTo("BTID"); break; case BRACKET: parser.switchTo("DEFAULT"); break; } }
private void assertTokenizesTo(String sql, String expected) { SqlSimpleParser.Tokenizer tokenizer = new SqlSimpleParser.Tokenizer(sql, "xxxxx", tester.getFactory().getParserConfig().quoting()); StringBuilder buf = new StringBuilder(); while (true) { SqlSimpleParser.Token token = tokenizer.nextToken(); if (token == null) { break; } buf.append(token).append("\n"); } Assert.assertEquals(expected, buf.toString()); }
private void assertTokenizesTo(String sql, String expected) { SqlSimpleParser.Tokenizer tokenizer = new SqlSimpleParser.Tokenizer(sql, "xxxxx", tester.getFactory().getParserConfig().quoting()); StringBuilder buf = new StringBuilder(); while (true) { SqlSimpleParser.Token token = tokenizer.nextToken(); if (token == null) { break; } buf.append(token).append("\n"); } Assert.assertEquals(expected, buf.toString()); }
private String replaceQuotes(SqlParser.Config parserConfig, String sql) { char openQuote = parserConfig.quoting().string.charAt(0); char closeQuote = openQuote == '[' ? ']' : openQuote; return sql.replace('[', openQuote).replace(']', closeQuote); }
/** Sets configuration identical to a given {@link Config}. */ public ConfigBuilder setConfig(Config config) { this.quotedCasing = config.quotedCasing(); this.unquotedCasing = config.unquotedCasing(); this.quoting = config.quoting(); this.identifierMaxLength = config.identifierMaxLength(); this.conformance = config.conformance(); this.parserFactory = config.parserFactory(); return this; }
/** Sets configuration identical to a given {@link Config}. */ public ConfigBuilder setConfig(Config config) { this.quotedCasing = config.quotedCasing(); this.unquotedCasing = config.unquotedCasing(); this.quoting = config.quoting(); this.identifierMaxLength = config.identifierMaxLength(); this.conformance = config.conformance(); this.parserFactory = config.parserFactory(); return this; }