grammar SQLSelect include SQLRowSupport include SQLSelectClause include SQLFromClause include SQLWhereCondition include SQLOrderByClause include SQLLimit include SQLHelpers rule select_expression select from where_tree limit_condition_or_empty order_by_condition_or_empty { def eval SelectExpression.new({ :string => self.text_value, :select => select.eval, :from => from.eval, :where => where_tree.where_condition_or_empty.eval, :limit => limit_condition_or_empty.eval, :order_by => order_by_condition_or_empty.eval }) end def query_type :select end def tree { :select => select.columns, :from => from.tables, :where => where_tree.eval, :limit => limit_condition_or_empty.eval, :order_by => order_by_condition_or_empty.eval } end } end end