提交 2fa4a835 编写于 作者: C codefairy08

Add SQLServer DDL table related statements Parser

上级 36886d16
package io.shardingsphere.core.parsing.antler.parser.sqlserver;
import org.antlr.v4.runtime.CommonToken;
import org.antlr.v4.runtime.RecognitionException;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.TokenStream;
import io.shardingsphere.core.parsing.antler.AdvancedErrorStrategy;
import io.shardingsphere.core.parsing.antler.AdvancedParserATNSimulator;
import io.shardingsphere.parser.antlr.sqlserver.SQLServerAlterTableParser;
public class SQLServerAdvancedAlterTableParser extends SQLServerAlterTableParser {
public SQLServerAdvancedAlterTableParser(TokenStream input) {
super(input);
_interp = new AdvancedParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache, ID);
this._errHandler = new AdvancedErrorStrategy(ID);
}
public Token match(int ttype) throws RecognitionException {
Token t = getCurrentToken();
boolean compatID = false;
if (ID == ttype && ID > t.getType()) {
compatID = true;
}
if (t.getType() == ttype || compatID) {
if (ttype == Token.EOF) {
matchedEOF = true;
}
if (!matchedEOF && compatID && (t instanceof CommonToken)) {
CommonToken commonToken = (CommonToken) t;
commonToken.setType(ID);
}
_errHandler.reportMatch(this);
consume();
} else {
t = _errHandler.recoverInline(this);
if (_buildParseTrees && t.getTokenIndex() == -1) {
// we must have conjured up a new token during single token insertion
// if it's not the current symbol
_ctx.addErrorNode(createErrorNode(_ctx, t));
}
}
return t;
}
}
package io.shardingsphere.core.parsing.antler.parser.sqlserver;
import org.antlr.v4.runtime.CommonToken;
import org.antlr.v4.runtime.RecognitionException;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.TokenStream;
import io.shardingsphere.core.parsing.antler.AdvancedErrorStrategy;
import io.shardingsphere.core.parsing.antler.AdvancedParserATNSimulator;
import io.shardingsphere.parser.antlr.sqlserver.SQLServerCreateTableParser;
public class SQLServerAdvancedCreateTableParser extends SQLServerCreateTableParser {
public SQLServerAdvancedCreateTableParser(TokenStream input) {
super(input);
_interp = new AdvancedParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache, ID);
this._errHandler = new AdvancedErrorStrategy(ID);
}
public Token match(int ttype) throws RecognitionException {
Token t = getCurrentToken();
boolean compatID = false;
if (ID == ttype && ID > t.getType()) {
compatID = true;
}
if (t.getType() == ttype || compatID) {
if (ttype == Token.EOF) {
matchedEOF = true;
}
if (!matchedEOF && compatID && (t instanceof CommonToken)) {
CommonToken commonToken = (CommonToken) t;
commonToken.setType(ID);
}
_errHandler.reportMatch(this);
consume();
} else {
t = _errHandler.recoverInline(this);
if (_buildParseTrees && t.getTokenIndex() == -1) {
// we must have conjured up a new token during single token insertion
// if it's not the current symbol
_ctx.addErrorNode(createErrorNode(_ctx, t));
}
}
return t;
}
}
package io.shardingsphere.core.parsing.antler.parser.sqlserver;
import org.antlr.v4.runtime.CommonToken;
import org.antlr.v4.runtime.RecognitionException;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.TokenStream;
import io.shardingsphere.core.parsing.antler.AdvancedErrorStrategy;
import io.shardingsphere.core.parsing.antler.AdvancedParserATNSimulator;
import io.shardingsphere.parser.antlr.sqlserver.SQLServerDropTableParser;
public class SQLServerAdvancedDropTableParser extends SQLServerDropTableParser {
public SQLServerAdvancedDropTableParser(TokenStream input) {
super(input);
_interp = new AdvancedParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache, ID);
this._errHandler = new AdvancedErrorStrategy(ID);
}
public Token match(int ttype) throws RecognitionException {
Token t = getCurrentToken();
boolean compatID = false;
if (ID == ttype && ID > t.getType()) {
compatID = true;
}
if (t.getType() == ttype || compatID) {
if (ttype == Token.EOF) {
matchedEOF = true;
}
if (!matchedEOF && compatID && (t instanceof CommonToken)) {
CommonToken commonToken = (CommonToken) t;
commonToken.setType(ID);
}
_errHandler.reportMatch(this);
consume();
} else {
t = _errHandler.recoverInline(this);
if (_buildParseTrees && t.getTokenIndex() == -1) {
// we must have conjured up a new token during single token insertion
// if it's not the current symbol
_ctx.addErrorNode(createErrorNode(_ctx, t));
}
}
return t;
}
}
package io.shardingsphere.core.parsing.antler.parser.sqlserver;
import org.antlr.v4.runtime.CommonToken;
import org.antlr.v4.runtime.RecognitionException;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.TokenStream;
import io.shardingsphere.core.parsing.antler.AdvancedErrorStrategy;
import io.shardingsphere.core.parsing.antler.AdvancedParserATNSimulator;
import io.shardingsphere.parser.antlr.sqlserver.SQLServerTruncateTableParser;
public class SQLServerAdvancedTruncateTableParser extends SQLServerTruncateTableParser {
public SQLServerAdvancedTruncateTableParser(TokenStream input) {
super(input);
_interp = new AdvancedParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache, ID);
this._errHandler = new AdvancedErrorStrategy(ID);
}
public Token match(int ttype) throws RecognitionException {
Token t = getCurrentToken();
boolean compatID = false;
if (ID == ttype && ID > t.getType()) {
compatID = true;
}
if (t.getType() == ttype || compatID) {
if (ttype == Token.EOF) {
matchedEOF = true;
}
if (!matchedEOF && compatID && (t instanceof CommonToken)) {
CommonToken commonToken = (CommonToken) t;
commonToken.setType(ID);
}
_errHandler.reportMatch(this);
consume();
} else {
t = _errHandler.recoverInline(this);
if (_buildParseTrees && t.getTokenIndex() == -1) {
// we must have conjured up a new token during single token insertion
// if it's not the current symbol
_ctx.addErrorNode(createErrorNode(_ctx, t));
}
}
return t;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册