提交 efee1572 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 22f34ef4
...@@ -65,11 +65,11 @@ public class Bnf { ...@@ -65,11 +65,11 @@ public class Bnf {
void addFixedRule(String name, int fixedType) { void addFixedRule(String name, int fixedType) {
Rule rule = new RuleFixed(fixedType); Rule rule = new RuleFixed(fixedType);
addRule(name, 0, "Fixed", rule); addRule(name, "Fixed", rule);
} }
RuleHead addRule(String topic, int id, String section, Rule rule) { RuleHead addRule(String topic, String section, Rule rule) {
RuleHead head = new RuleHead(id, section, topic, rule); RuleHead head = new RuleHead(section, topic, rule);
if (ruleMap.get(StringUtils.toLowerEnglish(topic)) != null) { if (ruleMap.get(StringUtils.toLowerEnglish(topic)) != null) {
throw new Error("already exists: " + topic); throw new Error("already exists: " + topic);
} }
...@@ -106,7 +106,7 @@ public class Bnf { ...@@ -106,7 +106,7 @@ public class Bnf {
if (section.startsWith("Command")) { if (section.startsWith("Command")) {
rule = new RuleList(rule, new RuleElement(";\n\n", currentTopic), false); rule = new RuleList(rule, new RuleElement(";\n\n", currentTopic), false);
} }
RuleHead head = addRule(topic, id, section, rule); RuleHead head = addRule(topic, section, rule);
if (section.startsWith("Function")) { if (section.startsWith("Function")) {
if (functions == null) { if (functions == null) {
functions = rule; functions = rule;
...@@ -117,7 +117,7 @@ public class Bnf { ...@@ -117,7 +117,7 @@ public class Bnf {
statements.add(head); statements.add(head);
} }
} }
addRule("@func@", 0, "Function", functions); addRule("@func@", "Function", functions);
addFixedRule("@ymd@", RuleFixed.YMD); addFixedRule("@ymd@", RuleFixed.YMD);
addFixedRule("@hms@", RuleFixed.HMS); addFixedRule("@hms@", RuleFixed.HMS);
addFixedRule("@nanos@", RuleFixed.NANOS); addFixedRule("@nanos@", RuleFixed.NANOS);
...@@ -295,7 +295,7 @@ public class Bnf { ...@@ -295,7 +295,7 @@ public class Bnf {
topic = StringUtils.toLowerEnglish(topic); topic = StringUtils.toLowerEnglish(topic);
RuleHead head = (RuleHead) ruleMap.get(topic); RuleHead head = (RuleHead) ruleMap.get(topic);
if (head == null) { if (head == null) {
head = new RuleHead(0, "db", topic, rule); head = new RuleHead("db", topic, rule);
ruleMap.put(topic, head); ruleMap.put(topic, head);
statements.add(head); statements.add(head);
} else { } else {
......
...@@ -8,13 +8,11 @@ package org.h2.bnf; ...@@ -8,13 +8,11 @@ package org.h2.bnf;
* Represents the head of a BNF rule. * Represents the head of a BNF rule.
*/ */
public class RuleHead { public class RuleHead {
int id;
String section; String section;
Rule rule; Rule rule;
private String topic; private String topic;
RuleHead(int id, String section, String topic, Rule rule) { RuleHead(String section, String topic, Rule rule) {
this.id = id;
this.section = section; this.section = section;
this.topic = topic; this.topic = topic;
this.rule = rule; this.rule = rule;
......
...@@ -29,6 +29,7 @@ public class TableFunction extends Expression implements FunctionCall { ...@@ -29,6 +29,7 @@ public class TableFunction extends Expression implements FunctionCall {
private Column[] columnList; private Column[] columnList;
public Value getValue(Session session) throws SQLException { public Value getValue(Session session) throws SQLException {
int todoClassIsNotUsed;
return getTable(session, args, false, distinct); return getTable(session, args, false, distinct);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论