From a0bd4bd88e5a62e962d84942f7f0737ee56e50eb Mon Sep 17 00:00:00 2001 From: kpouer Date: Thu, 13 Feb 2003 13:36:22 +0000 Subject: [PATCH] *** empty log message *** --- net.sourceforge.phpeclipse/src/test/PHPParser2.jj | 46 +++++++++----------- .../src/test/PHPParserTestCase2.java | 9 ++-- 2 files changed, 25 insertions(+), 30 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/test/PHPParser2.jj b/net.sourceforge.phpeclipse/src/test/PHPParser2.jj index 66fae21..370824c 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser2.jj +++ b/net.sourceforge.phpeclipse/src/test/PHPParser2.jj @@ -9,7 +9,7 @@ options { ERROR_REPORTING = true; JAVA_UNICODE_ESCAPE = false; UNICODE_INPUT = false; - IGNORE_CASE = false; + IGNORE_CASE = true; USER_TOKEN_MANAGER = false; USER_CHAR_STREAM = false; BUILD_PARSER = true; @@ -188,39 +188,21 @@ TOKEN : < STRING_LITERAL: ( | | )> | < STRING_1: "\"" - ( (~["\"","\\","\n","\r"]) - | ("\\" - ( ["n","t","b","r","f","\\","'","\""] - | ["0"-"7"] ( ["0"-"7"] )? - | ["0"-"3"] ["0"-"7"] ["0"-"7"] - ) - ) + ( (~["\""]) + | "\\\"" )* "\"" > | < STRING_2: "'" - ( (~["\"","\\","\n","\r"]) - | ("\\" - ( ["n","t","b","r","f","\\","'","\""] - | ["0"-"7"] ( ["0"-"7"] )? - | ["0"-"3"] ["0"-"7"] ["0"-"7"] - ) - ) - )* + ( (~["'"]))* + "'" > | < STRING_3: "`" - ( (~["\"","\\","\n","\r"]) - | ("\\" - ( ["n","t","b","r","f","\\","'","\""] - | ["0"-"7"] ( ["0"-"7"] )? - | ["0"-"3"] ["0"-"7"] ["0"-"7"] - ) - ) - )* - "" + ( (~["`"]))* + "`" > } @@ -361,7 +343,9 @@ void VariableName(): { "this" | - + "{" Expression() "}" +| + ("{" Expression() "}") * | "$" VariableName() } @@ -709,6 +693,8 @@ void Statement() : EchoStatement() | StaticStatement() +| + GlobalStatement() } void EchoStatement() : @@ -824,6 +810,14 @@ void WhileStatement() : "while" "(" Expression() ")" Statement() } +void WhileStatement0() : +{} +{ + ":" Statement() "endwhile;" +| + Statement() +} + void DoStatement() : {} { diff --git a/net.sourceforge.phpeclipse/src/test/PHPParserTestCase2.java b/net.sourceforge.phpeclipse/src/test/PHPParserTestCase2.java index 04cf8cc..f890b38 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParserTestCase2.java +++ b/net.sourceforge.phpeclipse/src/test/PHPParserTestCase2.java @@ -97,7 +97,6 @@ public class PHPParserTestCase2 extends TestCase { checkPHP("/* \n overLib is from Eric Bosrup (http://www.bosrup.com/web/overlib/) \n */"); checkPHP("if ($arrAtchCookie[1]==0 && $IdAtchPostId!=null){ } "); checkPHP("$arrAtchCookie[1] -= filesize(realpath($AtchTempDir).\"/\".$xattachlist)/ 1024; "); - checkPHP("do {$array[] = array(\"$myrow[uid]\" => \"$myrow[uname]\"); } while($myrow = mysql_fetch_array($result));"); checkPHP("$ol = new Overlib();"); checkPHP("$risultato = mysql_query($sql) or\n die(mysql_error());"); checkPHP( @@ -109,14 +108,16 @@ public class PHPParserTestCase2 extends TestCase { checkPHP("while (eregi(\"footer.php\",$PHP_SELF)) {\n" + "Header(\"Location: index.php\");\n" + "die();\n" + "}\n"); checkPHP("while (eregi(\"footer.php\",$PHP_SELF)) :\n" + "Header(\"Location: index.php\");\n" + "die();\n" + "endwhile;\n"); checkPHP("if ($term{0}!=$firstChar) {}"); - checkPHP("$this->highlightfile->linkscripts{$category}"); - checkPHP("$code = call_user_method($this->highlightfile->linkscripts{$category}, $this->highlightfile, $oldword, $this->output_module)"); + checkPHP("$this->highlightfile->linkscripts{$category};"); + checkPHP("$code = call_user_method($this->highlightfile->linkscripts{$category}, $this->highlightfile, $oldword, $this->output_module);"); checkPHP("call_user_method_array($function_name[1], ${$objectname}, $arguments);"); - checkPHP("global ${$objectname}; "); + checkPHP("global ${$objectname};"); + checkPHP("do {$array[] = array(\"$myrow[uid]\" => \"$myrow[uname]\"); } while($myrow = mysql_fetch_array($result));"); } private void checkPHP(String strEval) { try { + System.out.println("strEval = " + strEval); phpparser.ReInit(new CharArrayReader(strEval.toCharArray())); phpparser.parse(); } catch (ParseException e) { -- 1.7.1