Parses a column declaration.
961396
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")) {
      /*
      if (length < 0) {
        throw error(L.l("VARCHAR needs a defined length"));
      }
      */

      // factory.addVarchar(name, length);
      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("tinytext")) {
      factory.addTinytext(name);
    }
    */
    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));

    /*
    token = scanToken();
    if (token == IDENTIFIER && _lexeme.equalsIgnoreCase("default")) {
      Expr defaultExpr = parseExpr();

      factory.setDefault(name, defaultExpr);
    }
    else {
      _token = token;
    }
    */

    while (true) {
      token = scanToken();

      // XXX: stuff like NOT NULL

      switch (token) {
      case RPAREN:
      case COMMA:
        _token = token;
        return;

        /*
      case UNIQUE:
        factory.setUnique(name);
        break;
        */

      case PRIMARY:
        token = scanToken();
        if (token != Token.KEY)
          throw error("expected key at {0}", token);

        factory.setPrimaryKey(name);
        break;

        /*
      case CHECK:
        if ((token = scanToken()) != '(')
          throw error(L.l("Expected '(' at '{0}'", tokenName(token)));

        parseExpr();

        if ((token = scanToken()) != ')')
          throw error(L.l("Expected ')' at '{0}'", tokenName(token)));
        break;
        */

        /*
      case IDENTIFIER:
        String id = _lexeme;
        if (id.equalsIgnoreCase("references")) {
          ArrayList<String> foreignKey = new ArrayList<String>();
          foreignKey.add(name);
          parseReferences(foreignKey);
        }
        else if (id.equalsIgnoreCase("default")) {
          Expr expr = parseExpr();
        }
        else if (id.equalsIgnoreCase("auto_increment")) {
          factory.setAutoIncrement(name, 1);
        }
        else if (id.equalsIgnoreCase("unsigned")) {
        }
        else if (id.equalsIgnoreCase("binary")) {
        }
        else
          throw error(L.l("unexpected token '{0}'", tokenName(token)));
        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);
      }
    }
  }
775526
def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'name'
          @name = value.value.to_s
        when 'showColumnStripes'
          @show_column_stripes = attribute_enabled?(value)
        when 'showFirstColumn'
          @show_first_column = attribute_enabled?(value)
        when 'showLastColumn'
          @show_last_column = attribute_enabled?(value)
        when 'showRowStripes'
          @show_row_stripes = attribute_enabled?(value)
        end
      end
      self
    end
372024
private void extractAndAssignValue(String line, int lineNumber, ColumnInfo<Object> columnInfo, String columnStr,
			int linePos, Object target, ParseError parseError) {
		Object value = extractValue(line, lineNumber, columnInfo, columnStr, linePos, target, parseError);
		if (value == null) {
			assignParseErrorFields(parseError, columnInfo, columnStr);
			// either error or no value
			return;
		}
		try {
			columnInfo.setValue(target, value);
		} catch (Exception e) {
			parseError.setErrorType(ErrorType.INTERNAL_ERROR);
			parseError
					.setMessage("setting value for field '" + columnInfo.getFieldName() + "' error: " + e.getMessage());
			assignParseErrorFields(parseError, columnInfo, columnStr);
			parseError.setLinePos(linePos);
		}
	}
906178
function parseConstLetDeclaration(kind) {
        var declarations;

        expectKeyword(kind);

        declarations = parseVariableDeclarationList(kind);

        consumeSemicolon();

        return {
            type: Syntax.VariableDeclaration,
            declarations: declarations,
            kind: kind
        };
    }
1253447
public ParsedColInfo toTVE(int indx, int diff) {
       TupleValueExpression exp = new TupleValueExpression(m_tableName, m_tableAlias,
               m_columnName, m_alias, m_expression, indx);
       exp.setDifferentiator(diff);
       m_expression = exp;
       return this;
    }
681425
private function parseColumnNameArrayFromKeyDefinition($strKeyDefinition)
    {
        $strKeyDefinition = trim($strKeyDefinition);

        // Get rid of the opening "(" and the closing ")"
        $intPosition = strpos($strKeyDefinition, '(');
        if ($intPosition === false) {
            throw new \Exception("Invalid Key Definition: $strKeyDefinition");
        }
        $strKeyDefinition = trim(substr($strKeyDefinition, $intPosition + 1));

        $intPosition = strpos($strKeyDefinition, ')');
        if ($intPosition === false) {
            throw new \Exception("Invalid Key Definition: $strKeyDefinition");
        }
        $strKeyDefinition = trim(substr($strKeyDefinition, 0, $intPosition));

        // Create the Array
        // TODO: Current method doesn't support key names with commas or parenthesis in them!
        $strToReturn = explode(',', $strKeyDefinition);

        // Take out trailing and leading "`" character in each name (if applicable)
        for ($intIndex = 0; $intIndex < count($strToReturn); $intIndex++) {
            $strColumn = $strToReturn[$intIndex];

            if (substr($strColumn, 0, 1) == '`') {
                $strColumn = substr($strColumn, 1, strpos($strColumn, '`', 1) - 1);
            }

            $strToReturn[$intIndex] = $strColumn;
        }

        return $strToReturn;
    }
754880
public void parse(final InsertStatement insertStatement) {
        lexerEngine.unsupportedIfEqual(getUnsupportedKeywordsBeforeInto());
        lexerEngine.skipUntil(DefaultKeyword.INTO);
        lexerEngine.nextToken();
        tableReferencesClauseParser.parse(insertStatement, true);
        skipBetweenTableAndValues(insertStatement);
    }
430499
private ColumnSpec[] parseColumnSpecs() {
        List encodedColumnSpecs = split(source, 0);
        int columnCount = encodedColumnSpecs.size();
        ColumnSpec[] columnSpecs = new ColumnSpec[columnCount];
        for (int i = 0; i < columnCount; i++) {
            String encodedSpec = (String) encodedColumnSpecs.get(i);
            columnSpecs[i] = ColumnSpec.decodeExpanded(encodedSpec);
        }
        return columnSpecs;
    }
298079
function () {
		var columns = this.columns,
			col = columns.length;

		while (col--) {
			this.parseColumn(columns[col], col);
		}

	}
637047
def parse_column_key(setting_string):
        
        if ':' in setting_string:
            # splits <column>:<key> into <column> and <key>
            column, key = setting_string.split(':', 1)
        else:
            # stores <column> and <value>=None
            column = setting_string
            key = None

        return column, key
453179
def parse_create_table(sql):
    
    column_types = {}
    for line in sql.splitlines()[1:]:  # first line = CREATE TABLE
        sline = line.strip()

        if not sline.startswith('`'):
            # We've finished parsing the columns
            break

        bits = sline.split('`')
        assert len(bits) == 3
        column_name = bits[1]
        column_spec = bits[2].lstrip().rstrip(',')

        column_types[column_name] = column_spec
    return column_types
1003416
function columns(column) {
    if (!column) {
      return this;
    }
    this._statements.push({
      grouping: 'columns',
      value: normalizeArr.apply(null, arguments)
    });
    return this;
  }
597898
public void parse(final SelectStatement selectStatement) {
        if (!lexerEngine.skipIfEqual(SQLServerKeyword.TOP)) {
            return;
        }
        int beginPosition = lexerEngine.getCurrentToken().getEndPosition();
        if (!lexerEngine.skipIfEqual(Symbol.LEFT_PAREN)) {
            beginPosition = lexerEngine.getCurrentToken().getEndPosition() - lexerEngine.getCurrentToken().getLiterals().length();
        }
        SQLExpression sqlExpression = basicExpressionParser.parse(selectStatement);
        lexerEngine.skipIfEqual(Symbol.RIGHT_PAREN);
        LimitValue rowCountValue;
        if (sqlExpression instanceof SQLNumberExpression) {
            int rowCount = ((SQLNumberExpression) sqlExpression).getNumber().intValue();
            rowCountValue = new LimitValue(rowCount, -1, false);
            selectStatement.addSQLToken(new RowCountToken(beginPosition, rowCount));
        } else if (sqlExpression instanceof SQLParameterMarkerExpression) {
            rowCountValue = new LimitValue(-1, ((SQLParameterMarkerExpression) sqlExpression).getIndex(), false);
        } else {
            throw new SQLParsingException(lexerEngine);
        }
        lexerEngine.unsupportedIfEqual(SQLServerKeyword.PERCENT);
        lexerEngine.skipIfEqual(DefaultKeyword.WITH, SQLServerKeyword.TIES);
        if (null == selectStatement.getLimit()) {
            Limit limit = new Limit();
            limit.setRowCount(rowCountValue);
            selectStatement.setLimit(limit);
        } else {
            selectStatement.getLimit().setRowCount(rowCountValue);
        }
    }
120903
private Object extractValue(String line, int lineNumber, ColumnInfo<Object> columnInfo, String columnStr,
			int linePos, Object target, ParseError parseError) {

		Converter<Object, ?> converter = columnInfo.getConverter();
		if (alwaysTrimInput || columnInfo.isTrimInput() || converter.isAlwaysTrimInput()) {
			columnStr = columnStr.trim();
		}
		if (columnStr.isEmpty() && columnInfo.getDefaultValue() != null) {
			columnStr = columnInfo.getDefaultValue();
		}
		if (columnStr.isEmpty() && columnInfo.isMustNotBeBlank()) {
			parseError.setErrorType(ErrorType.MUST_NOT_BE_BLANK);
			parseError.setMessage("field '" + columnInfo.getFieldName() + "' must not be blank");
			assignParseErrorFields(parseError, columnInfo, columnStr);
			parseError.setLinePos(linePos);
			return null;
		}

		try {
			return converter.stringToJava(line, lineNumber, linePos, columnInfo, columnStr, parseError);
		} catch (ParseException e) {
			parseError.setErrorType(ErrorType.INVALID_FORMAT);
			parseError.setMessage("field '" + columnInfo.getFieldName() + "' parse-error: " + e.getMessage());
			parseError.setLinePos(linePos);
			return null;
		} catch (Exception e) {
			parseError.setErrorType(ErrorType.INTERNAL_ERROR);
			parseError.setMessage("field '" + columnInfo.getFieldName() + "' error: " + e.getMessage());
			parseError.setLinePos(linePos);
			return null;
		}
	}
615918
private void processColumnAnnotation() {
      Column columnAnnotation = field.getAnnotation(Column.class);
      String columnName = columnAnnotation.name();
      setColumnName(columnName);

      this.columnTableName = columnAnnotation.table();
      insertable = columnAnnotation.insertable();
      updatable = columnAnnotation.updatable();
   }
1191323
function (columns) {
        var i, j, k,
            totalCol = 0,
            flag = [];

        for (i = 0; i < columns[0].length; i++) {
            totalCol += columns[0][i].colspan || 1;
        }

        for (i = 0; i < columns.length; i++) {
            flag[i] = [];
            for (j = 0; j < totalCol; j++) {
                flag[i][j] = false;
            }
        }

        for (i = 0; i < columns.length; i++) {
            for (j = 0; j < columns[i].length; j++) {
                var r = columns[i][j],
                    rowspan = r.rowspan || 1,
                    colspan = r.colspan || 1,
                    index = $.inArray(false, flag[i]);

                if (colspan === 1) {
                    r.fieldIndex = index;
                    // when field is undefined, use index instead
                    if (typeof r.field === 'undefined') {
                        r.field = index;
                    }
                }

                for (k = 0; k < rowspan; k++) {
                    flag[i + k][index] = true;
                }
                for (k = 0; k < colspan; k++) {
                    flag[i][index + k] = true;
                }
            }
        }
    }
989442
function deserialize (value, columnDefinitions) {

    var deserializedValue = {};
    
    try {
        Validate.notNull(columnDefinitions, 'columnDefinitions');
        Validate.isObject(columnDefinitions);

        Validate.notNull(value);
        Validate.isObject(value);

        for (var property in value) {
            var columnName = storeHelper.getColumnName(columnDefinitions, property); // this helps us deserialize with proper case for the property name
            deserializedValue[columnName] = deserializeMember(value[property], storeHelper.getColumnType(columnDefinitions, property));
        }
        
    } catch (error) {
        throw new verror.VError(error, 'Failed to deserialize value ' + JSON.stringify(value) + '. Column definitions: ' + JSON.stringify(columnDefinitions));
    }

    return deserializedValue;
}