private void parseCreateColumn(TableBuilderKraken factory,String name){
  Token token;
  if ((token=scanToken()) != Token.IDENTIFIER) {
    throw error(L.l("expected column type at {0}",token));
  }
  String type=_lexeme;
  int length=-1;
  int scale=-1;
  if (type.equalsIgnoreCase("double")) {
    if ((token=peekToken()) == Token.IDENTIFIER) {
      scanToken();
      if (_lexeme.equalsIgnoreCase("precision")) {
      }
 else       throw error(L.l("unexpected double type at {0}",_lexeme));
    }
  }
  if ((token=peekToken()) == Token.LPAREN) {
    scanToken();
    if ((token=scanToken()) != Token.INTEGER) {
      throw error("expected column width at '{0}'",token);
    }
    length=Integer.parseInt(_lexeme);
    if ((token=scanToken()) == Token.COMMA) {
      if ((token=scanToken()) != Token.INTEGER) {
        throw error("expected column scale at '{0}'",token);
      }
      scale=Integer.parseInt(_lexeme);
      token=scanToken();
    }
    if (token != Token.RPAREN) {
      throw error("expected ')' at '{0}'",token);
    }
  }
  if (type.equalsIgnoreCase("varchar")) {
    factory.addVarchar(name,length);
  }
 else   if (type.equalsIgnoreCase("blob")) {
    factory.addBlob(name);
  }
 else   if (type.equalsIgnoreCase("string")) {
    factory.addString(name);
  }
 else   if (type.equalsIgnoreCase("object")) {
    factory.addObject(name);
  }
 else   if (type.equalsIgnoreCase("char")) {
    length=Math.max(length,1);
    factory.addVarchar(name,length);
  }
 else   if (type.equalsIgnoreCase("varbinary")) {
    if (length < 0) {
      throw error("VARBINARY needs a defined length");
    }
    factory.addVarbinary(name,length);
  }
 else   if (type.equalsIgnoreCase("binary") || type.equalsIgnoreCase("bytes")) {
    if (length < 0)     throw error(L.l("BINARY needs a defined length"));
    factory.addBytes(name,length);
  }
 else   if (type.equalsIgnoreCase("mediumtext")) {
    factory.addVarchar(name,256);
  }
 else   if (type.equalsIgnoreCase("longtext")) {
    factory.addVarchar(name,512);
  }
 else   if (type.equalsIgnoreCase("bit") || type.equalsIgnoreCase("bool")) {
    factory.addBool(name);
  }
 else   if (type.equalsIgnoreCase("tinyint") || type.equalsIgnoreCase("bit") || type.equalsIgnoreCase("int8")) {
    factory.addInt8(name);
  }
 else   if (type.equalsIgnoreCase("smallint") || type.equalsIgnoreCase("int16")) {
    factory.addInt16(name);
  }
 else   if (type.equalsIgnoreCase("integer") || type.equalsIgnoreCase("int") || type.equalsIgnoreCase("mediumint")|| type.equalsIgnoreCase("int32")) {
    factory.addInt32(name);
  }
 else   if (type.equalsIgnoreCase("bigint") || type.equalsIgnoreCase("long") || type.equalsIgnoreCase("int64")) {
    factory.addInt64(name);
  }
 else   if (type.equalsIgnoreCase("double") || type.equalsIgnoreCase("float64") || type.equalsIgnoreCase("real")) {
    factory.addDouble(name);
  }
 else   if (type.equalsIgnoreCase("float") || type.equalsIgnoreCase("float32")) {
    factory.addFloat(name);
  }
 else   if (type.equalsIgnoreCase("datetime") || type.equalsIgnoreCase("timestamp")) {
    factory.addDateTime(name);
  }
 else   if (type.equalsIgnoreCase("text") || type.equalsIgnoreCase("clob")) {
    factory.addVarchar(name,255);
  }
 else   if (type.equalsIgnoreCase("identity")) {
    factory.addIdentity(name);
  }
 else   throw error(L.l("Unknown type {0}",type));
  while (true) {
    token=scanToken();
switch (token) {
case RPAREN:
case COMMA:
      _token=token;
    return;
case PRIMARY:
  token=scanToken();
if (token != Token.KEY) throw error("expected key at {0}",token);
factory.setPrimaryKey(name);
break;
case NULL:
break;
case NOT:
if ((token=scanToken()) == Token.NULL) factory.setNotNull(name);
 else throw error("unexpected token '{0}'",token);
break;
default :
throw error("unexpected token '{0}'",token);
}
}
}

private void parseCreateColumn ( TableBuilderKraken factory , String name ) { Token token ; if ( ( token = scanToken ( ) ) != Token . IDENTIFIER ) { throw error ( L . l ( "expected column type at {0}" , token ) ) ; } String type = _lexeme ; int length = - 1 ; int scale = - 1 ; if ( type . equalsIgnoreCase ( "double" ) ) { if ( ( token = peekToken ( ) ) == Token . IDENTIFIER ) { scanToken ( ) ; if ( _lexeme . equalsIgnoreCase ( "precision" ) ) { } else throw error ( L . l ( "unexpected double type at {0}" , _lexeme ) ) ; } } if ( ( token = peekToken ( ) ) == Token . LPAREN ) { scanToken ( ) ; if ( ( token = scanToken ( ) ) != Token . INTEGER ) { throw error ( "expected column width at '{0}'" , token ) ; } length = Integer . parseInt ( _lexeme ) ; if ( ( token = scanToken ( ) ) == Token . COMMA ) { if ( ( token = scanToken ( ) ) != Token . INTEGER ) { throw error ( "expected column scale at '{0}'" , token ) ; } scale = Integer . parseInt ( _lexeme ) ; token = scanToken ( ) ; } if ( token != Token . RPAREN ) { throw error ( "expected ')' at '{0}'" , token ) ; } } if ( type . equalsIgnoreCase ( "varchar" ) ) { factory . addVarchar ( name , length ) ; } else if ( type . equalsIgnoreCase ( "blob" ) ) { factory . addBlob ( name ) ; } else if ( type . equalsIgnoreCase ( "string" ) ) { factory . addString ( name ) ; } else if ( type . equalsIgnoreCase ( "object" ) ) { factory . addObject ( name ) ; } else if ( type . equalsIgnoreCase ( "char" ) ) { length = Math . max ( length , 1 ) ; factory . addVarchar ( name , length ) ; } else if ( type . equalsIgnoreCase ( "varbinary" ) ) { if ( length < 0 ) { throw error ( "VARBINARY needs a defined length" ) ; } factory . addVarbinary ( name , length ) ; } else if ( type . equalsIgnoreCase ( "binary" ) || type . equalsIgnoreCase ( "bytes" ) ) { if ( length < 0 ) throw error ( L . l ( "BINARY needs a defined length" ) ) ; factory . addBytes ( name , length ) ; } else if ( type . equalsIgnoreCase ( "mediumtext" ) ) { factory . addVarchar ( name , 256 ) ; } else if ( type . equalsIgnoreCase ( "longtext" ) ) { factory . addVarchar ( name , 512 ) ; } else if ( type . equalsIgnoreCase ( "bit" ) || type . equalsIgnoreCase ( "bool" ) ) { factory . addBool ( name ) ; } else if ( type . equalsIgnoreCase ( "tinyint" ) || type . equalsIgnoreCase ( "bit" ) || type . equalsIgnoreCase ( "int8" ) ) { factory . addInt8 ( name ) ; } else if ( type . equalsIgnoreCase ( "smallint" ) || type . equalsIgnoreCase ( "int16" ) ) { factory . addInt16 ( name ) ; } else if ( type . equalsIgnoreCase ( "integer" ) || type . equalsIgnoreCase ( "int" ) || type . equalsIgnoreCase ( "mediumint" ) || type . equalsIgnoreCase ( "int32" ) ) { factory . addInt32 ( name ) ; } else if ( type . equalsIgnoreCase ( "bigint" ) || type . equalsIgnoreCase ( "long" ) || type . equalsIgnoreCase ( "int64" ) ) { factory . addInt64 ( name ) ; } else if ( type . equalsIgnoreCase ( "double" ) || type . equalsIgnoreCase ( "float64" ) || type . equalsIgnoreCase ( "real" ) ) { factory . addDouble ( name ) ; } else if ( type . equalsIgnoreCase ( "float" ) || type . equalsIgnoreCase ( "float32" ) ) { factory . addFloat ( name ) ; } else if ( type . equalsIgnoreCase ( "datetime" ) || type . equalsIgnoreCase ( "timestamp" ) ) { factory . addDateTime ( name ) ; } else if ( type . equalsIgnoreCase ( "text" ) || type . equalsIgnoreCase ( "clob" ) ) { factory . addVarchar ( name , 255 ) ; } else if ( type . equalsIgnoreCase ( "identity" ) ) { factory . addIdentity ( name ) ; } else throw error ( L . l ( "Unknown type {0}" , type ) ) ; while ( true ) { token = scanToken ( ) ; switch ( token ) { case RPAREN : case COMMA : _token = token ; return ; case PRIMARY : token = scanToken ( ) ; if ( token != Token . KEY ) throw error ( "expected key at {0}" , token ) ; factory . setPrimaryKey ( name ) ; break ; case NULL : break ; case NOT : if ( ( token = scanToken ( ) ) == Token . NULL ) factory . setNotNull ( name ) ; else throw error ( "unexpected token '{0}'" , token ) ; break ; default : throw error ( "unexpected token '{0}'" , token ) ; } } }
parses a column declaration .
