public final static int TokenNameswitch = 1009;
- public final static int TokenNamecase = 10010;
+ public final static int TokenNamecase = 1010;
public final static int TokenNameendswitch = 1011;
public final static int TokenNameMETHOD_C = 1073;
public final static int TokenNameFUNC_C = 1074;
-
+
+ public final static int TokenNameNamespace = 1075;
+
+ public final static int TokenNameForwardSlash = 1076;
+
// special tokens not normally used in the parser
public final static int TokenNamethis_PHP_COMPLETION = 2000;
}
getNextToken();
}
return statement;
+ } else if(token == TokenNameconst){
+ getNextToken();
+ if(token == TokenNameIdentifier){
+ getNextToken();
+ if(token == TokenNameEQUAL){
+ getNextToken();
+ }
+ //throwSyntaxError("'Ed i know your here");
+ }
} else if (token == TokenNamestatic) {
getNextToken();
static_var_list();
case TokenNameinclude_once:
case TokenNamerequire:
case TokenNamerequire_once:
+ case TokenNameNamespace:
+ case TokenNameconst:
internal_functions_in_yacc();
break;
// | '(' expr ')'
// T_REQUIRE_ONCE expr
checkFileName(token);
break;
+ case TokenNameNamespace:
+ // NAMESPACE expr
+ checkNameSpaceName();
+ break;
+ case TokenNameconst:
+ getNextToken();
+ expr();
+ break;
}
}
-
+
+ /**
+ * parse and check the namespace name
+ * @since 1.2.3
+ * @param namespaceToken
+ */
+ private void checkNameSpaceName(){
+ getNextToken();
+ while (true) {
+ if (token == TokenNameSEMICOLON) {
+ break;
+ }
+ getNextToken();
+ }
+
+ }
/**
* Parse and check the include file name
*
return TokenNameCOLON;
case '@':
return TokenNameAT;
+ case '\\':
+ return TokenNameForwardSlash;
case '\'':
consumeStringConstant();
return TokenNameStringSingleQuote;
if ((data[++index] == 'e') && (data[++index] == 'w'))
return TokenNamenew;
return TokenNameIdentifier;
+ case 9:
+ //namespace
+ if ((data[++index] == 'a') && (data[++index] == 'm')
+ && (data[++index] == 'e') && (data[++index] == 's')
+ && (data[++index] == 'p') && (data[++index] == 'a')
+ && (data[++index] == 'c') && (data[++index] == 'e'))
+ return TokenNameNamespace;
+ return TokenNameIdentifier;
// case 4 :
// if ((data[++index] == 'u') && (data[++index] == 'l')
// && (data[++index] == 'l'))
return "require"; //$NON-NLS-1$
case TokenNamerequire_once:
return "require_once"; //$NON-NLS-1$
+ case TokenNameNamespace:
+ return "namespace"; //$NON-NLS-1$
case TokenNamereturn:
return "return"; //$NON-NLS-1$
// case TokenNameself:
<s k="include_once" />
<s k="require" />
<s k="require_once" />
+<s k="namespace" />
<s k="die" />
<s k="exit" />
<s k="print" />