示例#1
0
class ComparisonArgumentExpression(Grammar):
    grammar = LIST_OF(AdditiveArgumentExpression,
                      sep=(ComparisonOperator, OPTIONAL(NewLines)))
示例#2
0
class CreateKeyspaceStatement(Grammar):
    grammar = (CK('create'), CK('keyspace'), Name, CK('with'), LIST_OF((OptionName, OP('='), OptionValue), sep=CK('and')))
示例#3
0
class SelectWhereClause(Grammar):
    grammar = OR(LIST_OF(Relation, sep=CK('and')), (Term, CK('in'), LPar, LIST_OF(Term), RPar))
示例#4
0
class UpdateStatement(Grammar):
    grammar = (CK('update'), Name, OPTIONAL(UsingClause), CK('set'), LIST_OF(Assignment), CK('where'), UpdateWhereClause)
示例#5
0
class BatchStatement(Grammar):
    grammar = (CK('begin'), CK('batch'), OPTIONAL(UsingClause), LIST_OF(BatchStatementMember, sep=';'), CK('apply'), CK('batch'))
示例#6
0
class ElseIfClauses(Grammar):
    grammar = LIST_OF(ElseIfClause, sep=OPTIONAL(WHITESPACE))
示例#7
0
class InsertStatement(Grammar):
    grammar = (CK('insert'), CK('into'), Name, LPar, LIST_OF(Term), RPar, CK('values'), LPar, LIST_OF(Term), RPar, OPTIONAL(UsingClause))
示例#8
0
class RangeExpression(Grammar):
    grammar = LIST_OF(ArrayLiteralExpression, sep=("..", OPTIONAL(NewLines)))
示例#9
0
class FormatExpression(Grammar):
    grammar = LIST_OF(RangeExpression,
                      sep=(OPTIONAL(WHITESPACE), FormatOperator,
                           OPTIONAL(WHITESPACE), OPTIONAL(NewLines)))
示例#10
0
class HashLiteralBody(Grammar):
    grammar = LIST_OF(HashEntry,
                      sep=(OPTIONAL(WHITESPACE),
                           OPTIONAL(HashLiteralBodyPrime),
                           OPTIONAL(WHITESPACE)))
示例#11
0
class ArrayLiteralExpression(Grammar):
    grammar = LIST_OF(UnaryExpression,
                      sep=(OPTIONAL(WHITESPACE), ",", OPTIONAL(WHITESPACE)))
示例#12
0
class ArgumentExpressionList(Grammar):
    grammar_whitespace_mode = "optional"
    grammar = LIST_OF(LogicalArgumentExpression,
                      sep=(OPTIONAL(NewLines), ",", OPTIONAL(WHITESPACE)))
示例#13
0
class LogicalArgumentExpression(Grammar):
    grammar = LIST_OF(BitwiseArgumentExpression,
                      sep=(OR(RE_LITERAL("-and"), RE_LITERAL("-or"),
                              RE_LITERAL("-xor")), OPTIONAL(NewLines)))
示例#14
0
class BitwiseArgumentExpression(Grammar):
    grammar = LIST_OF(ComparisonArgumentExpression,
                      sep=(OR(RE_LITERAL("-band"), RE_LITERAL("-bor"),
                              RE_LITERAL("-bxor")), OPTIONAL(NewLines)))
示例#15
0
class CommandElements(Grammar):
    grammar = LIST_OF(CommandElement, sep=OPTIONAL(WHITESPACE))
示例#16
0
class MultiplicativeExpression(Grammar):
    grammar = LIST_OF(FormatExpression,
                      sep=((OPTIONAL(WHITESPACE), OR("*", "/", "%"),
                            OPTIONAL(WHITESPACE)), OPTIONAL(NewLines)))
示例#17
0
class DataCommandsList(Grammar):
    grammar = LIST_OF(DataCommand,
                      sep=(OPTIONAL(WHITESPACE), ",", OPTIONAL(WHITESPACE)))
示例#18
0
class AdditiveExpression(Grammar):
    grammar = LIST_OF(MultiplicativeExpression,
                      sep=(OPTIONAL(WHITESPACE), OR("+", Dash),
                           OPTIONAL(WHITESPACE), OPTIONAL(NewLines)))
示例#19
0
class UsingClause(Grammar):
    grammar = (CK('using'), LIST_OF(UsingOption, sep=CK('and')))
示例#20
0
class ComparisonExpression(Grammar):
    grammar = LIST_OF(AdditiveExpression,
                      sep=(OPTIONAL(WHITESPACE), ComparisonOperator,
                           OPTIONAL(WHITESPACE), OPTIONAL(NewLines)))
示例#21
0
class UpdateWhereClause(Grammar):
    grammar = OR((Term, OP('='), Term), (Term, CK('in'), LPar, LIST_OF(Term), RPar))
示例#22
0
class BitwiseExpression(Grammar):
    grammar = LIST_OF(ComparisonExpression,
                      sep=(OPTIONAL(WHITESPACE),
                           OR(RE_LITERAL("-band"), RE_LITERAL("-bor"),
                              RE_LITERAL("-bxor")), OPTIONAL(WHITESPACE),
                           OPTIONAL(NewLines)))
示例#23
0
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)
示例#24
0
class LogicalExpression(Grammar):
    grammar = LIST_OF(BitwiseExpression,
                      sep=(OPTIONAL(WHITESPACE),
                           OR(RE_LITERAL("-and"), RE_LITERAL("-or"),
                              RE_LITERAL("-xor")), OPTIONAL(WHITESPACE),
                           OPTIONAL(NewLines)))
示例#25
0
class OptionName(Grammar):
    grammar = LIST_OF(Identifier, sep=':')
示例#26
0
class AttributeArguments(Grammar):
    grammar = LIST_OF(AttributeArgument,
                      sep=(OPTIONAL(WHITESPACE), ",", OPTIONAL(WHITESPACE)))
示例#27
0
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')))
    )
示例#28
0
class AttributeList(Grammar):
    grammar = LIST_OF(Attribute, sep=OPTIONAL(WHITESPACE))
示例#29
0
class WhatToSelect(Grammar):
    grammar = OR(
        (OPTIONAL(CK('first'), Integer, OPTIONAL(CK('reversed'))), ColumnRange),
        (FN('count'), LPar, CountTarget, RPar), LIST_OF(Term)
    )
示例#30
0
class AdditiveArgumentExpression(Grammar):
    grammar = LIST_OF(MultiplicativeArgumentExpression,
                      sep=(OR("+", Dash), OPTIONAL(NewLines)))