From: kpouer Date: Fri, 13 Jun 2003 15:52:38 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.phpeclipse.com?hp=161cdbbdc82c4cce12d1fe7a135809b6bbee999d *** empty log message *** --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Block.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Block.java index ce9fd59..145fb87 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Block.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Block.java @@ -27,6 +27,11 @@ public class Block extends Statement { return statements == null; } + /** + * Return the block as String. + * @param tab how many tabs + * @return the string representation of the block + */ public String toString(int tab) { final String s = AstNode.tabString(tab); final StringBuffer buff = new StringBuffer(s); @@ -34,6 +39,7 @@ public class Block extends Statement { if (this.statements == null) { for (int i = 0; i < statements.length; i++) { buff.append(statements[i].toString(tab+1)).append(";\n");//$NON-NLS-1$ + buff.append(statements[i].getClass().getName()).append(";\n");//$NON-NLS-1$ } } buff.append("}\n"); //$NON-NLS-1$ diff --git a/net.sourceforge.phpeclipse/src/test/PHPParser.java b/net.sourceforge.phpeclipse/src/test/PHPParser.java index f0ea36f..aba9b11 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.java +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.java @@ -39,8 +39,6 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon private static final String PARSE_WARNING_STRING = "Warning"; //$NON-NLS-1$ static PHPOutlineInfo outlineInfo; - private static boolean assigning; - /** The error level of the current ParseException. */ private static int errorLevel = ERROR; /** The message of the current ParseException. If it's null it's because the parse exception wasn't handled */ @@ -363,9 +361,11 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon */ static final public void PhpBlock() throws ParseException { final int start = SimpleCharStream.getPosition(); + final PHPEchoBlock phpEchoBlock; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PHPECHOSTART: - phpEchoBlock(); + phpEchoBlock = phpEchoBlock(); + pushOnAstNodes(phpEchoBlock); break; case PHPSTARTSHORT: case PHPSTARTLONG: @@ -559,7 +559,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon jj_consume_token(EXTENDS); try { superclassName = jj_consume_token(IDENTIFIER); - superclassNameImage = superclassName .image.toCharArray(); + superclassNameImage = superclassName.image.toCharArray(); } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', identifier expected"; errorLevel = ERROR; @@ -787,7 +787,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon jj_la1[11] = jj_gen; ; } - if (expression == null && !assigning) { + if (expression == null) { {if (true) return token.image.substring(1);} } buff = new StringBuffer(token.image); @@ -809,6 +809,10 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon throw new Error("Missing return statement in function"); } +/** + * A Variable name (without the $) + * @return a variable name String + */ static final public String VariableName() throws ParseException { final StringBuffer buff; String expr = null; @@ -5030,24 +5034,6 @@ final int startBlock, endBlock; return retval; } - static final private boolean jj_3R_77() { - if (jj_scan_token(BOOLEAN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - static final private boolean jj_3R_76() { - if (jj_scan_token(BOOL)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - static final private boolean jj_3R_43() { - if (jj_3R_52()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - static final private boolean jj_3R_75() { if (jj_scan_token(STRING)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -5955,41 +5941,41 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3R_94() { - if (jj_scan_token(DOLLAR_ID)) return true; + static final private boolean jj_3R_48() { + if (jj_scan_token(CLASSACCESS)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_59()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_98()) jj_scanpos = xsp; - else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_61() { + static final private boolean jj_3R_40() { Token xsp; xsp = jj_scanpos; - if (jj_3R_94()) { + if (jj_3R_48()) { jj_scanpos = xsp; - if (jj_3R_95()) return true; + if (jj_3R_49()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_48() { - if (jj_scan_token(CLASSACCESS)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_59()) return true; + static final private boolean jj_3R_94() { + if (jj_scan_token(DOLLAR_ID)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_98()) jj_scanpos = xsp; + else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_40() { + static final private boolean jj_3R_61() { Token xsp; xsp = jj_scanpos; - if (jj_3R_48()) { + if (jj_3R_94()) { jj_scanpos = xsp; - if (jj_3R_49()) return true; + if (jj_3R_95()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; @@ -6067,12 +6053,6 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3_1() { - if (jj_3R_40()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - static final private boolean jj_3R_187() { if (jj_3R_50()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6108,15 +6088,9 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3R_50() { - if (jj_3R_61()) return true; + static final private boolean jj_3_1() { + if (jj_3R_40()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_1()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } return false; } @@ -6133,6 +6107,18 @@ final int startBlock, endBlock; return false; } + static final private boolean jj_3R_50() { + if (jj_3R_61()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_1()) { jj_scanpos = xsp; break; } + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } + return false; + } + static final private boolean jj_3R_96() { if (jj_3R_102()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6584,6 +6570,24 @@ final int startBlock, endBlock; return false; } + static final private boolean jj_3R_77() { + if (jj_scan_token(BOOLEAN)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_76() { + if (jj_scan_token(BOOL)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_43() { + if (jj_3R_52()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + static private boolean jj_initialized_once = false; static public PHPParserTokenManager token_source; static SimpleCharStream jj_input_stream; diff --git a/net.sourceforge.phpeclipse/src/test/PHPParser.jj b/net.sourceforge.phpeclipse/src/test/PHPParser.jj index 28764a7..2b4a1e9 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.jj +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.jj @@ -60,8 +60,6 @@ public final class PHPParser extends PHPParserSuperclass { private static final String PARSE_WARNING_STRING = "Warning"; //$NON-NLS-1$ static PHPOutlineInfo outlineInfo; - private static boolean assigning; - /** The error level of the current ParseException. */ private static int errorLevel = ERROR; /** The message of the current ParseException. If it's null it's because the parse exception wasn't handled */ @@ -635,9 +633,11 @@ void phpFile() : void PhpBlock() : { final int start = SimpleCharStream.getPosition(); + final PHPEchoBlock phpEchoBlock; } { - phpEchoBlock() + phpEchoBlock = phpEchoBlock() + {pushOnAstNodes(phpEchoBlock);} | [ | @@ -710,7 +710,7 @@ ClassDeclaration ClassDeclaration() : try { superclassName = - {superclassNameImage = superclassName .image.toCharArray();} + {superclassNameImage = superclassName.image.toCharArray();} } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', identifier expected"; errorLevel = ERROR; @@ -894,7 +894,7 @@ String Variable(): { token = [ expression = Expression() ] { - if (expression == null && !assigning) { + if (expression == null) { return token.image.substring(1); } buff = new StringBuffer(token.image); @@ -908,6 +908,10 @@ String Variable(): {return "$" + expr;} } +/** + * A Variable name (without the $) + * @return a variable name String + */ String VariableName(): { final StringBuffer buff;