class ComparisonArgumentExpression(Grammar): grammar = LIST_OF(AdditiveArgumentExpression, sep=(ComparisonOperator, OPTIONAL(NewLines)))
class CreateKeyspaceStatement(Grammar): grammar = (CK('create'), CK('keyspace'), Name, CK('with'), LIST_OF((OptionName, OP('='), OptionValue), sep=CK('and')))
class SelectWhereClause(Grammar): grammar = OR(LIST_OF(Relation, sep=CK('and')), (Term, CK('in'), LPar, LIST_OF(Term), RPar))
class UpdateStatement(Grammar): grammar = (CK('update'), Name, OPTIONAL(UsingClause), CK('set'), LIST_OF(Assignment), CK('where'), UpdateWhereClause)
class BatchStatement(Grammar): grammar = (CK('begin'), CK('batch'), OPTIONAL(UsingClause), LIST_OF(BatchStatementMember, sep=';'), CK('apply'), CK('batch'))
class ElseIfClauses(Grammar): grammar = LIST_OF(ElseIfClause, sep=OPTIONAL(WHITESPACE))
class InsertStatement(Grammar): grammar = (CK('insert'), CK('into'), Name, LPar, LIST_OF(Term), RPar, CK('values'), LPar, LIST_OF(Term), RPar, OPTIONAL(UsingClause))
class RangeExpression(Grammar): grammar = LIST_OF(ArrayLiteralExpression, sep=("..", OPTIONAL(NewLines)))
class FormatExpression(Grammar): grammar = LIST_OF(RangeExpression, sep=(OPTIONAL(WHITESPACE), FormatOperator, OPTIONAL(WHITESPACE), OPTIONAL(NewLines)))
class HashLiteralBody(Grammar): grammar = LIST_OF(HashEntry, sep=(OPTIONAL(WHITESPACE), OPTIONAL(HashLiteralBodyPrime), OPTIONAL(WHITESPACE)))
class ArrayLiteralExpression(Grammar): grammar = LIST_OF(UnaryExpression, sep=(OPTIONAL(WHITESPACE), ",", OPTIONAL(WHITESPACE)))
class ArgumentExpressionList(Grammar): grammar_whitespace_mode = "optional" grammar = LIST_OF(LogicalArgumentExpression, sep=(OPTIONAL(NewLines), ",", OPTIONAL(WHITESPACE)))
class LogicalArgumentExpression(Grammar): grammar = LIST_OF(BitwiseArgumentExpression, sep=(OR(RE_LITERAL("-and"), RE_LITERAL("-or"), RE_LITERAL("-xor")), OPTIONAL(NewLines)))
class BitwiseArgumentExpression(Grammar): grammar = LIST_OF(ComparisonArgumentExpression, sep=(OR(RE_LITERAL("-band"), RE_LITERAL("-bor"), RE_LITERAL("-bxor")), OPTIONAL(NewLines)))
class CommandElements(Grammar): grammar = LIST_OF(CommandElement, sep=OPTIONAL(WHITESPACE))
class MultiplicativeExpression(Grammar): grammar = LIST_OF(FormatExpression, sep=((OPTIONAL(WHITESPACE), OR("*", "/", "%"), OPTIONAL(WHITESPACE)), OPTIONAL(NewLines)))
class DataCommandsList(Grammar): grammar = LIST_OF(DataCommand, sep=(OPTIONAL(WHITESPACE), ",", OPTIONAL(WHITESPACE)))
class AdditiveExpression(Grammar): grammar = LIST_OF(MultiplicativeExpression, sep=(OPTIONAL(WHITESPACE), OR("+", Dash), OPTIONAL(WHITESPACE), OPTIONAL(NewLines)))
class UsingClause(Grammar): grammar = (CK('using'), LIST_OF(UsingOption, sep=CK('and')))
class ComparisonExpression(Grammar): grammar = LIST_OF(AdditiveExpression, sep=(OPTIONAL(WHITESPACE), ComparisonOperator, OPTIONAL(WHITESPACE), OPTIONAL(NewLines)))
class UpdateWhereClause(Grammar): grammar = OR((Term, OP('='), Term), (Term, CK('in'), LPar, LIST_OF(Term), RPar))
class BitwiseExpression(Grammar): grammar = LIST_OF(ComparisonExpression, sep=(OPTIONAL(WHITESPACE), OR(RE_LITERAL("-band"), RE_LITERAL("-bor"), RE_LITERAL("-bxor")), OPTIONAL(WHITESPACE), OPTIONAL(NewLines)))
class DeleteStatement(Grammar): grammar = (CK('delete'), OPTIONAL(LIST_OF(Term)), CK('from'), Name, OPTIONAL(CK('using'), LIST_OF(DeleteOption, sep=CK('and'))), CK('where'), UpdateWhereClause)
class LogicalExpression(Grammar): grammar = LIST_OF(BitwiseExpression, sep=(OPTIONAL(WHITESPACE), OR(RE_LITERAL("-and"), RE_LITERAL("-or"), RE_LITERAL("-xor")), OPTIONAL(WHITESPACE), OPTIONAL(NewLines)))
class OptionName(Grammar): grammar = LIST_OF(Identifier, sep=':')
class AttributeArguments(Grammar): grammar = LIST_OF(AttributeArgument, sep=(OPTIONAL(WHITESPACE), ",", OPTIONAL(WHITESPACE)))
class CreateColumnFamilyStatement(Grammar): grammar = ( CK('create'), CK('columnfamily'), Name, LPar, Term, StorageType, CK('primary'), CK('key'), ZERO_OR_MORE((OP(','), Term, StorageType)), RPar, OPTIONAL(CK('with'), LIST_OF((Identifier, OP('='), ColumFamilyOptionValue), sep=CK('and'))) )
class AttributeList(Grammar): grammar = LIST_OF(Attribute, sep=OPTIONAL(WHITESPACE))
class WhatToSelect(Grammar): grammar = OR( (OPTIONAL(CK('first'), Integer, OPTIONAL(CK('reversed'))), ColumnRange), (FN('count'), LPar, CountTarget, RPar), LIST_OF(Term) )
class AdditiveArgumentExpression(Grammar): grammar = LIST_OF(MultiplicativeArgumentExpression, sep=(OR("+", Dash), OPTIONAL(NewLines)))