File: sql_parser.rb

# sql_parser.rb

Path: | test/src/sql_parser.rb
Last Update: | Thu Mar 18 18:26:38 -0600 2010

### Required files

import

### Methods

assemble calculate_full_cases calculate_simple_cases comma ctor expression join_maker keyword list logical_operator make make_between make_between_clause make_comparison_predicate make_exists make_expression make_in make_in_relation make_not_between make_not_exists make_not_in make_not_in_relation make_predicate make_relation operator outer_join paren predicate rctor relation union_maker word

### Included Modules

RParsec

### Constants

QuotedName | = | char(?[) >> not_char(?]).many_.fragment << char(?])
Variable | = | char(?$) >> word
MyLexer | = | number.token(:number) | StringLiteral.token(:string) | Variable.token(:var) | QuotedName.token(:word) | MyKeywords.lexer | MyOperators.lexer
MyLexeme | = | MyLexer.lexeme(whitespaces | comment_line('#')) << eof

### Public Instance methods

assemble()
calculate_full_cases(cases, default)
calculate_simple_cases(val, cases, default)

expression parser ###############################

comma()
ctor(cls)
expression()

put together ###############################

join_maker(rel, pred)
keyword()

utilities #########################################

list(expr)
logical_operator(op)

predicate parser #############################

make(parser)
make_between(expr)
make_between_clause(expr, &maker)
make_comparison_predicate(expr, rel)
make_exists(rel)
make_expression(predicate, rel)
make_in(expr)
make_in_relation(rel)
make_not_between(expr)
make_not_exists(rel)
make_not_in(expr)
make_not_in_relation(rel)
make_predicate(expr, rel)
make_relation(expr, pred)

relation parser ###############################

operator()
outer_join(kind)
paren(parser)
predicate()
rctor(cls, arity=2)
relation()
union_maker()
word(&block)

[Validate]