module OracleSqlParser::Grammar::Condition

grammar Between
  rule between_condition
    target:expr space n:(not_keyword space)? between_keyword space from:expr space and_keyword space to:expr {
      def ast
        OracleSqlParser::Ast::BetweenCondition[
          :target => target.ast,
          :not => not_keyword.ast,
          :from => from.ast,
          :to => to.ast
        ]
      end

      def not_keyword
        n.elements && n.elements.first
      end
    }
  end
end

end