Skip to content

Commit

Permalink
MOV: files into subnamespaces
Browse files Browse the repository at this point in the history
git-svn-id: https://php-sql-parser.googlecode.com/svn/trunk@1311 44dcfd11-89b7-3d55-2063-5c365055f77f
  • Loading branch information
phosco@gmx.de committed Apr 15, 2014
1 parent 5808b6b commit 0244c80
Show file tree
Hide file tree
Showing 46 changed files with 37 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .settings/org.eclipse.ltk.core.refactoring.prefs
@@ -0,0 +1,3 @@
#Tue Apr 15 09:40:02 CEST 2014
eclipse.preferences.version=1
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
4 changes: 3 additions & 1 deletion .settings/org.eclipse.php.core.prefs
@@ -1,4 +1,6 @@
#Mon Dec 16 10:31:31 CET 2013
#Tue Apr 15 09:40:02 CEST 2014
eclipse.preferences.version=1
include_path=0;/PHP-SQL-Parser
org.eclipse.php.core.phpDoc=false
phpVersion=php5.3
useShortTags=true
@@ -0,0 +1,9 @@
#Tue Apr 15 09:40:02 CEST 2014
DefaultProjectBasePath=/PHP-SQL-Parser
eclipse.preferences.version=1
org.eclipse.php.debug.core.use-project-settings=true
org.eclipse.php.debug.coredefaultPHP=PHP 5.3.2 (CGI)
org.eclipse.php.debug.coreoutput_encoding=UTF-8
org.eclipse.php.debug.corephp_debugger_id=org.eclipse.php.debug.core.zendDebugger
org.eclipse.php.debug.corestop_at_first_line_string=true
org.eclipse.php.debug.coretransfer_encoding=UTF-8
Expand Up @@ -39,6 +39,8 @@
*
*/

namespace PHPSQLParser\processors;

require_once dirname(__FILE__) . '/../utils/ExpressionType.php';
require_once dirname(__FILE__) . '/../lexer/PHPSQLLexer.php';

Expand All @@ -62,7 +64,7 @@ public abstract function process($tokens);
* tokens for the SQL processor
*/
public function splitSQLIntoTokens($sql) {
$lexer = new PHPSQLLexer();
$lexer = new PHPSQLParser\lexer\PHPSQLLexer();
return $lexer->split($sql);
}

Expand Down Expand Up @@ -201,14 +203,14 @@ protected function getVariableType($expression) {

switch ($type) {
case 'GLOBAL':
$type = ExpressionType::GLOBAL_VARIABLE;
$type = PHPSQLParser\utils\ExpressionType::GLOBAL_VARIABLE;
break;
case 'LOCAL':
$type = ExpressionType::LOCAL_VARIABLE;
$type = PHPSQLParser\utils\ExpressionType::LOCAL_VARIABLE;
break;
case 'SESSION':
default:
$type = ExpressionType::SESSION_VARIABLE;
$type = PHPSQLParser\utils\ExpressionType::SESSION_VARIABLE;
break;
}
return $type;
Expand All @@ -228,39 +230,39 @@ protected function isCommentToken($token) {
}

protected function isColumnReference($out) {
return (isset($out['expr_type']) && $out['expr_type'] === ExpressionType::COLREF);
return (isset($out['expr_type']) && $out['expr_type'] === PHPSQLParser\utils\ExpressionType::COLREF);
}

protected function isReserved($out) {
return (isset($out['expr_type']) && $out['expr_type'] === ExpressionType::RESERVED);
return (isset($out['expr_type']) && $out['expr_type'] === PHPSQLParser\utils\ExpressionType::RESERVED);
}

protected function isConstant($out) {
return (isset($out['expr_type']) && $out['expr_type'] === ExpressionType::CONSTANT);
return (isset($out['expr_type']) && $out['expr_type'] === PHPSQLParser\utils\ExpressionType::CONSTANT);
}

protected function isAggregateFunction($out) {
return (isset($out['expr_type']) && $out['expr_type'] === ExpressionType::AGGREGATE_FUNCTION);
return (isset($out['expr_type']) && $out['expr_type'] === PHPSQLParser\utils\ExpressionType::AGGREGATE_FUNCTION);
}

protected function isCustomFunction($out) {
return (isset($out['expr_type']) && $out['expr_type'] === ExpressionType::CUSTOM_FUNCTION);
return (isset($out['expr_type']) && $out['expr_type'] === PHPSQLParser\utils\ExpressionType::CUSTOM_FUNCTION);
}

protected function isFunction($out) {
return (isset($out['expr_type']) && $out['expr_type'] === ExpressionType::SIMPLE_FUNCTION);
return (isset($out['expr_type']) && $out['expr_type'] === PHPSQLParser\utils\ExpressionType::SIMPLE_FUNCTION);
}

protected function isExpression($out) {
return (isset($out['expr_type']) && $out['expr_type'] === ExpressionType::EXPRESSION);
return (isset($out['expr_type']) && $out['expr_type'] === PHPSQLParser\utils\ExpressionType::EXPRESSION);
}

protected function isBracketExpression($out) {
return (isset($out['expr_type']) && $out['expr_type'] === ExpressionType::BRACKET_EXPRESSION);
return (isset($out['expr_type']) && $out['expr_type'] === PHPSQLParser\utils\ExpressionType::BRACKET_EXPRESSION);
}

protected function isSubQuery($out) {
return (isset($out['expr_type']) && $out['expr_type'] === ExpressionType::SUBQUERY);
return (isset($out['expr_type']) && $out['expr_type'] === PHPSQLParser\utils\ExpressionType::SUBQUERY);
}

/**
Expand Down
Expand Up @@ -39,6 +39,7 @@
*
*/

namespace PHPSQLParser\processors;
require_once dirname(__FILE__) . '/../utils/ExpressionType.php';
require_once dirname(__FILE__) . '/DefaultProcessor.php';
require_once dirname(__FILE__) . '/AbstractProcessor.php';
Expand All @@ -56,7 +57,7 @@ protected function processTopLevel($sql) {
$processor = new DefaultProcessor();
return $processor->process($sql);
}

public function process($tokens) {

$token = $this->removeParenthesisFromStart($tokens[0]);
Expand All @@ -68,12 +69,14 @@ public function process($tokens) {
}

if (isset($subtree['SELECT'])) {
$subtree = array(array('expr_type' => ExpressionType::QUERY, 'base_expr' => $token, 'sub_tree' => $subtree));
$subtree = array(
array('expr_type' => PHPSQLParser\utils\ExpressionType::QUERY, 'base_expr' => $token,
'sub_tree' => $subtree));
}

return array(
array('expr_type' => ExpressionType::BRACKET_EXPRESSION, 'base_expr' => trim($tokens[0]),
'sub_tree' => $subtree));
array('expr_type' => PHPSQLParser\utils\ExpressionType::BRACKET_EXPRESSION,
'base_expr' => trim($tokens[0]), 'sub_tree' => $subtree));
}

}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0244c80

Please sign in to comment.