Examples of RuleHead


Examples of org.h2.bnf.RuleHead

        ArrayList<RuleHead> all = config.getStatements();

        // go backwards so we can append at the end
        for (int i = all.size() - 1; i >= 0; i--) {
            RuleHead r = all.get(i);
            String topic = r.getTopic().toLowerCase();
            int weight = 0;
            if (topic.equals("select")) {
                weight = 10;
            } else if (topic.equals("create table")) {
                weight = 20;
            } else if (topic.equals("insert")) {
                weight = 5;
            } else if (topic.startsWith("update")) {
                weight = 3;
            } else if (topic.startsWith("delete")) {
                weight = 3;
            } else if (topic.startsWith("drop")) {
                weight = 2;
            }
            if (SHOW_SYNTAX) {
                System.out.println(r.getTopic());
            }
            for (int j = 0; j < weight; j++) {
                statements.add(r);
            }
        }
View Full Code Here

Examples of org.h2.bnf.RuleHead

    }

    public String getRandomSQL() {
        int sid = random.nextInt(statements.size());

        RuleHead r = statements.get(sid);
        level = 0;
        r.getRule().accept(this);
        sql = sql.trim();

        if (sql.length() > 0) {
            if (sql.indexOf("TRACE_LEVEL_") < 0 && sql.indexOf("COLLATION") < 0
                    && sql.indexOf("SCRIPT ") < 0 && sql.indexOf("CSVWRITE") < 0
View Full Code Here

Examples of org.h2.bnf.RuleHead

     * @param bnf the BNF
     * @param token the token
     * @return the HTML link
     */
    String getLink(Bnf bnf, String token) {
        RuleHead found = null;
        String key = Bnf.getRuleMapKey(token);
        for (int i = 0; i < token.length(); i++) {
            String test = StringUtils.toLowerEnglish(key.substring(i));
            RuleHead r = bnf.getRuleHead(test);
            if (r != null) {
                found = r;
                break;
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.