本文整理汇总了C#中Deveel.Data.Sql.Parser.Token类的典型用法代码示例。如果您正苦于以下问题:C# Token类的具体用法?C# Token怎么用?C# Token使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Token类属于Deveel.Data.Sql.Parser命名空间,在下文中一共展示了Token类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RefType
public static DataType RefType(Token tokRef, ObjectName objRef, bool rowType, bool extRef)
{
if (extRef)
throw new NotSupportedException();
if (objRef == null && tokRef != null)
objRef = ObjectName(tokRef.image);
return rowType ? (DataType) PrimitiveTypes.RowType(objRef) : PrimitiveTypes.ColumnType(objRef);
}
示例2: PlSql
public PlSql(System.IO.TextReader stream)
{
mcc_input_stream = new SimpleCharStream(stream, 1, 1);
token_source = new PlSqlTokenManager(mcc_input_stream);
token = new Token();
mcc_ntk = -1;
mcc_gen = 0;
for (int i = 0; i < 239; i++) mcc_la1[i] = -1;
for (int i = 0; i < mcc_2_rtns.Length; i++) mcc_2_rtns[i] = new MccCalls();
}
示例3: PrimitiveType
public static DataType PrimitiveType(SqlType sqlType, Token sizeToken, Token scaleToken)
{
int size = -1;
byte scale = 0;
if (sizeToken != null) {
if (!Int32.TryParse(sizeToken.image, out size))
throw new ParseException();
}
if (scaleToken != null) {
if (!Byte.TryParse(scaleToken.image, out scale))
throw new ParseException();
}
return PrimitiveTypes.Type(sqlType, size, scale);
}
示例4: MakeLabel
public static String MakeLabel(Token start, Token end)
{
StringBuilder buf = new StringBuilder();
Token t = start.next;
bool last_letter = false;
while (t != end) {
bool is_letter_token = Char.IsLetter(t.image[0]);
if (is_letter_token) {
if (last_letter) {
buf.Append(' ');
}
last_letter = true;
} else {
last_letter = false;
}
buf.Append(t.image);
t = t.next;
}
buf.Append(t.image);
return buf.ToString();
}
示例5: AsNonQuotedRef
public static String AsNonQuotedRef(Token token)
{
if (token.kind == SqlParserConstants.QUOTED_VARIABLE)
// Strip " from start and end if a quoted variable
return token.image.Substring(1, token.image.Length - 2);
if (token.kind == SqlParserConstants.QUOTED_DELIMINATED_REF ||
token.kind == SqlParserConstants.QUOTEDGLOBVARIABLE) {
// Remove all " from the string
string image = token.image;
StringBuilder b = new StringBuilder();
int sz = image.Length;
for (int i = 0; i < sz; ++i) {
char c = image[i];
if (c != '\"') {
b.Append(c);
}
}
return b.ToString();
}
return token.image;
}
示例6: mcc_3_59
private bool mcc_3_59()
{
if (mcc_3R_66()) return true;
Token xsp;
xsp = mcc_scanpos;
if (mcc_3R_261()) mcc_scanpos = xsp;
return false;
}
示例7: mcc_3_54
private bool mcc_3_54()
{
if (mcc_3R_66()) return true;
Token xsp;
while (true) {
xsp = mcc_scanpos;
if (mcc_3R_213()) { mcc_scanpos = xsp; break; }
}
return false;
}
示例8: mcc_3_56
private bool mcc_3_56()
{
Token xsp;
xsp = mcc_scanpos;
if (mcc_3R_77()) mcc_scanpos = xsp;
xsp = mcc_scanpos;
if (mcc_3_55()) {
mcc_scanpos = xsp;
if (mcc_3R_78()) return true;
}
return false;
}
示例9: ParseNumberToken
public static SqlObject ParseNumberToken(Token token, bool negative)
{
if (negative)
return new SqlObject(BigNumber.Parse("-" + token.image));
return new SqlObject(BigNumber.Parse(token.image));
}
示例10: mcc_3R_96
private bool mcc_3R_96()
{
Token xsp;
xsp = mcc_scanpos;
if (mcc_3R_121()) {
mcc_scanpos = xsp;
if (mcc_3_27()) return true;
}
return false;
}
示例11: mcc_3_36
private bool mcc_3_36()
{
Token xsp;
xsp = mcc_scanpos;
if (mcc_3R_69()) mcc_scanpos = xsp;
if (mcc_3R_70()) return true;
return false;
}
示例12: mcc_scan_token
private bool mcc_scan_token(int kind)
{
if (mcc_scanpos == mcc_lastpos) {
mcc_la--;
if (mcc_scanpos.next == null) {
mcc_lastpos = mcc_scanpos = mcc_scanpos.next = token_source.GetNextToken();
} else {
mcc_lastpos = mcc_scanpos = mcc_scanpos.next;
}
} else {
mcc_scanpos = mcc_scanpos.next;
}
if (mcc_rescan) {
int i = 0; Token tok = token;
while (tok != null && tok != mcc_scanpos) { i++; tok = tok.next; }
if (tok != null) mcc_add_error_token(kind, i);
}
if (mcc_scanpos.kind != kind) return true;
if (mcc_la == 0 && mcc_scanpos == mcc_lastpos) throw mcc_ls;
return false;
}
示例13: mcc_3_2
private bool mcc_3_2()
{
Token xsp;
xsp = mcc_scanpos;
lookingAhead = true;
mcc_semLA = !seeTYPE();
lookingAhead = false;
if (!mcc_semLA || mcc_3R_46()) {
mcc_scanpos = xsp;
lookingAhead = true;
mcc_semLA = !seeTYPE();
lookingAhead = false;
if (!mcc_semLA || mcc_3R_47()) return true;
}
return false;
}
示例14: mcc_3_21
private bool mcc_3_21()
{
Token xsp;
xsp = mcc_scanpos;
if (mcc_scan_token(144)) {
mcc_scanpos = xsp;
if (mcc_scan_token(116)) return true;
}
if (mcc_scan_token(169)) return true;
if (mcc_3R_54()) return true;
return false;
}
示例15: mcc_3_1
private bool mcc_3_1()
{
Token xsp;
xsp = mcc_scanpos;
lookingAhead = true;
mcc_semLA = seeTYPE();
lookingAhead = false;
if (!mcc_semLA || mcc_3R_42()) {
mcc_scanpos = xsp;
if (mcc_3R_43()) {
mcc_scanpos = xsp;
if (mcc_3R_44()) {
mcc_scanpos = xsp;
if (mcc_3R_45()) return true;
}
}
}
return false;
}