Exemplo n.º 1
0
 function cqlToSql($query)
 {
     $parser = new CQLParser(stripslashes($query));
     $nodeTree = $parser->query();
     $tables = array();
     $terms = array();
     $order = array();
     $where = $this->cqlNodeWalker($nodeTree, $tables, $terms, $order);
     return array("tables" => $tables, "terms" => $terms, "where" => $where, "order" => $order);
 }
Exemplo n.º 2
0
function &parse($query)
{
    $p = new CQLParser($query);
    $o =& $p->query();
    if ($p->current && get_class($o) != "diagnostic") {
        return new Diagnostic("Unprocessed tokens in query");
    } else {
        return $o;
    }
}