Putting in quick change to support namespace and const. This change only adds a few...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / parser / Scanner.java
index e4ed1ce..5d9f191 100644 (file)
@@ -20,18 +20,19 @@ import net.sourceforge.phpdt.internal.compiler.env.ICompilationUnit;
 
 public class Scanner implements IScanner, ITerminalSymbols {
        /*
-        * APIs ares - getNextToken() which return the current type of the token (this
-        * value is not memorized by the scanner) - getCurrentTokenSource() which
-        * provides with the token "REAL" source (aka all unicode have been
-        * transformed into a correct char) - sourceStart gives the position into the
-        * stream - currentPosition-1 gives the sourceEnd position into the stream
+        * APIs ares - getNextToken() which return the current type of the token
+        * (this value is not memorized by the scanner) - getCurrentTokenSource()
+        * which provides with the token "REAL" source (aka all unicode have been
+        * transformed into a correct char) - sourceStart gives the position into
+        * the stream - currentPosition-1 gives the sourceEnd position into the
+        * stream
         */
        // 1.4 feature
-//     private boolean assertMode;
-
+       // private boolean assertMode;
        public boolean useAssertAsAnIndentifier = false;
 
-       // flag indicating if processed source contains occurrences of keyword assert
+       // flag indicating if processed source contains occurrences of keyword
+       // assert
        public boolean containsAssertKeyword = false;
 
        public boolean recordLineSeparator;
@@ -40,9 +41,15 @@ public class Scanner implements IScanner, ITerminalSymbols {
 
        public boolean phpMode = false;
 
-       public boolean phpExpressionTag = false;
-
-       // public Stack encapsedStringStack = null;
+       /**
+        * This token is set to TokenNameecho if a short tag block begins (i.e.
+        * >?= ... ) Directly after the "=" character the
+        * getNextToken() method returns TokenNameINLINE_HTML In the next call to
+        * the getNextToken() method the value of fFillerToken (==TokenNameecho) is
+        * returned
+        * 
+        */
+       int fFillerToken = TokenNameEOF;
 
        public char currentCharacter;
 
@@ -119,25 +126,39 @@ public class Scanner implements IScanner, ITerminalSymbols {
        public static final String INVALID_CHAR_IN_STRING = "Invalid_Char_In_String"; //$NON-NLS-1$
 
        // ----------------optimized identifier managment------------------
-       static final char[] charArray_a = new char[] { 'a' }, charArray_b = new char[] { 'b' }, charArray_c = new char[] { 'c' },
-                       charArray_d = new char[] { 'd' }, charArray_e = new char[] { 'e' }, charArray_f = new char[] { 'f' },
-                       charArray_g = new char[] { 'g' }, charArray_h = new char[] { 'h' }, charArray_i = new char[] { 'i' },
-                       charArray_j = new char[] { 'j' }, charArray_k = new char[] { 'k' }, charArray_l = new char[] { 'l' },
-                       charArray_m = new char[] { 'm' }, charArray_n = new char[] { 'n' }, charArray_o = new char[] { 'o' },
-                       charArray_p = new char[] { 'p' }, charArray_q = new char[] { 'q' }, charArray_r = new char[] { 'r' },
-                       charArray_s = new char[] { 's' }, charArray_t = new char[] { 't' }, charArray_u = new char[] { 'u' },
-                       charArray_v = new char[] { 'v' }, charArray_w = new char[] { 'w' }, charArray_x = new char[] { 'x' },
-                       charArray_y = new char[] { 'y' }, charArray_z = new char[] { 'z' };
-
-       static final char[] charArray_va = new char[] { '$', 'a' }, charArray_vb = new char[] { '$', 'b' }, charArray_vc = new char[] {
-                       '$', 'c' }, charArray_vd = new char[] { '$', 'd' }, charArray_ve = new char[] { '$', 'e' }, charArray_vf = new char[] { '$',
-                       'f' }, charArray_vg = new char[] { '$', 'g' }, charArray_vh = new char[] { '$', 'h' },
-                       charArray_vi = new char[] { '$', 'i' }, charArray_vj = new char[] { '$', 'j' }, charArray_vk = new char[] { '$', 'k' },
-                       charArray_vl = new char[] { '$', 'l' }, charArray_vm = new char[] { '$', 'm' }, charArray_vn = new char[] { '$', 'n' },
-                       charArray_vo = new char[] { '$', 'o' }, charArray_vp = new char[] { '$', 'p' }, charArray_vq = new char[] { '$', 'q' },
-                       charArray_vr = new char[] { '$', 'r' }, charArray_vs = new char[] { '$', 's' }, charArray_vt = new char[] { '$', 't' },
-                       charArray_vu = new char[] { '$', 'u' }, charArray_vv = new char[] { '$', 'v' }, charArray_vw = new char[] { '$', 'w' },
-                       charArray_vx = new char[] { '$', 'x' }, charArray_vy = new char[] { '$', 'y' }, charArray_vz = new char[] { '$', 'z' };
+       static final char[] charArray_a = new char[] { 'a' },
+                       charArray_b = new char[] { 'b' }, charArray_c = new char[] { 'c' },
+                       charArray_d = new char[] { 'd' }, charArray_e = new char[] { 'e' },
+                       charArray_f = new char[] { 'f' }, charArray_g = new char[] { 'g' },
+                       charArray_h = new char[] { 'h' }, charArray_i = new char[] { 'i' },
+                       charArray_j = new char[] { 'j' }, charArray_k = new char[] { 'k' },
+                       charArray_l = new char[] { 'l' }, charArray_m = new char[] { 'm' },
+                       charArray_n = new char[] { 'n' }, charArray_o = new char[] { 'o' },
+                       charArray_p = new char[] { 'p' }, charArray_q = new char[] { 'q' },
+                       charArray_r = new char[] { 'r' }, charArray_s = new char[] { 's' },
+                       charArray_t = new char[] { 't' }, charArray_u = new char[] { 'u' },
+                       charArray_v = new char[] { 'v' }, charArray_w = new char[] { 'w' },
+                       charArray_x = new char[] { 'x' }, charArray_y = new char[] { 'y' },
+                       charArray_z = new char[] { 'z' };
+
+       static final char[] charArray_va = new char[] { '$', 'a' },
+                       charArray_vb = new char[] { '$', 'b' }, charArray_vc = new char[] {
+                                       '$', 'c' }, charArray_vd = new char[] { '$', 'd' },
+                       charArray_ve = new char[] { '$', 'e' }, charArray_vf = new char[] {
+                                       '$', 'f' }, charArray_vg = new char[] { '$', 'g' },
+                       charArray_vh = new char[] { '$', 'h' }, charArray_vi = new char[] {
+                                       '$', 'i' }, charArray_vj = new char[] { '$', 'j' },
+                       charArray_vk = new char[] { '$', 'k' }, charArray_vl = new char[] {
+                                       '$', 'l' }, charArray_vm = new char[] { '$', 'm' },
+                       charArray_vn = new char[] { '$', 'n' }, charArray_vo = new char[] {
+                                       '$', 'o' }, charArray_vp = new char[] { '$', 'p' },
+                       charArray_vq = new char[] { '$', 'q' }, charArray_vr = new char[] {
+                                       '$', 'r' }, charArray_vs = new char[] { '$', 's' },
+                       charArray_vt = new char[] { '$', 't' }, charArray_vu = new char[] {
+                                       '$', 'u' }, charArray_vv = new char[] { '$', 'v' },
+                       charArray_vw = new char[] { '$', 'w' }, charArray_vx = new char[] {
+                                       '$', 'x' }, charArray_vy = new char[] { '$', 'y' },
+                       charArray_vz = new char[] { '$', 'z' };
 
        public final static int MAX_OBVIOUS = 256;
 
@@ -170,7 +191,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                ObviousIdentCharNatures[12] = C_SPACE; // \ u000c: FORM FEED
                ObviousIdentCharNatures[13] = C_SPACE; // \ u000d: CARRIAGE RETURN
                ObviousIdentCharNatures[32] = C_SPACE; // \ u0020: SPACE
-               ObviousIdentCharNatures[9] = C_SPACE; // \ u0009: HORIZONTAL TABULATION
+               ObviousIdentCharNatures[9] = C_SPACE; // \ u0009: HORIZONTAL
+                                                                                               // TABULATION
 
                ObviousIdentCharNatures['.'] = C_SEPARATOR;
                ObviousIdentCharNatures[':'] = C_SEPARATOR;
@@ -199,7 +221,9 @@ public class Scanner implements IScanner, ITerminalSymbols {
                ObviousIdentCharNatures['"'] = C_SEPARATOR;
                ObviousIdentCharNatures['\''] = C_SEPARATOR;
        }
-       static final char[] initCharArray = new char[] { '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000' };
+
+       static final char[] initCharArray = new char[] { '\u0000', '\u0000',
+                       '\u0000', '\u0000', '\u0000', '\u0000' };
 
        static final int TableSize = 30, InternalTableSize = 6;
 
@@ -242,7 +266,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                }
        }
 
-       static int newEntry2 = 0, newEntry3 = 0, newEntry4 = 0, newEntry5 = 0, newEntry6 = 0;
+       static int newEntry2 = 0, newEntry3 = 0, newEntry4 = 0, newEntry5 = 0,
+                       newEntry6 = 0;
 
        public static final int RoundBracket = 0;
 
@@ -276,33 +301,37 @@ public class Scanner implements IScanner, ITerminalSymbols {
        public ICompilationUnit compilationUnit = null;
 
        /**
-        * Determines if the specified character is permissible as the first character
-        * in a PHP identifier or variable
-        *
+        * Determines if the specified character is permissible as the first
+        * character in a PHP identifier or variable
+        * 
         * The '$' character for PHP variables is regarded as a correct first
         * character !
-        *
+        * 
         */
        public static boolean isPHPIdentOrVarStart(char ch) {
                if (ch < MAX_OBVIOUS) {
-                       return ObviousIdentCharNatures[ch]==C_LETTER || ObviousIdentCharNatures[ch]==C_DOLLAR;
+                       return ObviousIdentCharNatures[ch] == C_LETTER
+                                       || ObviousIdentCharNatures[ch] == C_DOLLAR;
                }
                return false;
-               //return Character.isLetter(ch) || (ch == '$') || (ch == '_') || (0x7F <= ch && ch <= 0xFF);
+               // return Character.isLetter(ch) || (ch == '$') || (ch == '_') || (0x7F
+               // <=
+               // ch && ch <= 0xFF);
        }
 
        /**
-        * Determines if the specified character is permissible as the first character
-        * in a PHP identifier.
-        *
+        * Determines if the specified character is permissible as the first
+        * character in a PHP identifier.
+        * 
         * The '$' character for PHP variables isn't regarded as the first character !
         */
        public static boolean isPHPIdentifierStart(char ch) {
                if (ch < MAX_OBVIOUS) {
-                       return ObviousIdentCharNatures[ch]==C_LETTER;
+                       return ObviousIdentCharNatures[ch] == C_LETTER;
                }
                return false;
-//             return Character.isLetter(ch) || (ch == '_') || (0x7F <= ch && ch <= 0xFF);
+               // return Character.isLetter(ch) || (ch == '_') || (0x7F <= ch && ch <=
+               // 0xFF);
        }
 
        /**
@@ -311,15 +340,19 @@ public class Scanner implements IScanner, ITerminalSymbols {
         */
        public static boolean isPHPIdentifierPart(char ch) {
                if (ch < MAX_OBVIOUS) {
-                       return ObviousIdentCharNatures[ch]==C_LETTER || ObviousIdentCharNatures[ch]==C_DIGIT;
+                       return ObviousIdentCharNatures[ch] == C_LETTER
+                                       || ObviousIdentCharNatures[ch] == C_DIGIT;
                }
                return false;
-//             return Character.isLetterOrDigit(ch) || (ch == '_') || (0x7F <= ch && ch <= 0xFF);
+               // return Character.isLetterOrDigit(ch) || (ch == '_') || (0x7F <= ch &&
+               // ch
+               // <= 0xFF);
        }
 
        public static boolean isSQLIdentifierPart(char ch) {
                if (ch < MAX_OBVIOUS) {
-                       return ObviousIdentCharNatures[ch]==C_LETTER || ObviousIdentCharNatures[ch]==C_DIGIT;
+                       return ObviousIdentCharNatures[ch] == C_LETTER
+                                       || ObviousIdentCharNatures[ch] == C_DIGIT;
                }
                return false;
        }
@@ -334,7 +367,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                // return the token REAL source (aka unicodes are precomputed)
                char[] result;
                // if (withoutUnicodePtr != 0)
-               // //0 is used as a fast test flag so the real first char is in position 1
+               // //0 is used as a fast test flag so the real first char is in position
+               // 1
                // System.arraycopy(
                // withoutUnicodeBuffer,
                // 1,
@@ -358,7 +392,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        return optimizedCurrentTokenSource6();
                }
                // no optimization
-               System.arraycopy(source, startPosition, result = new char[length], 0, length);
+               System.arraycopy(source, startPosition, result = new char[length], 0,
+                               length);
                // }
                return result;
        }
@@ -371,7 +406,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                // Return the token REAL source (aka unicodes are precomputed)
                char[] result;
                // if (withoutUnicodePtr != 0)
-               // // 0 is used as a fast test flag so the real first char is in position 1
+               // // 0 is used as a fast test flag so the real first char is in
+               // position 1
                // System.arraycopy(
                // withoutUnicodeBuffer,
                // 1,
@@ -380,7 +416,9 @@ public class Scanner implements IScanner, ITerminalSymbols {
                // withoutUnicodePtr);
                // else {
                int length;
-               System.arraycopy(source, startPosition, result = new char[length = currentPosition - startPosition], 0, length);
+               System.arraycopy(source, startPosition,
+                               result = new char[length = currentPosition - startPosition], 0,
+                               length);
                // }
                return result;
        }
@@ -389,7 +427,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                // Return the token REAL source (aka unicodes are precomputed)
                char[] result;
                // if (withoutUnicodePtr != 0)
-               // // 0 is used as a fast test flag so the real first char is in position 1
+               // // 0 is used as a fast test flag so the real first char is in
+               // position 1
                // System.arraycopy(
                // withoutUnicodeBuffer,
                // 1,
@@ -398,7 +437,9 @@ public class Scanner implements IScanner, ITerminalSymbols {
                // withoutUnicodePtr);
                // else {
                int length;
-               System.arraycopy(source, startPos, result = new char[length = currentPosition - startPos], 0, length);
+               System.arraycopy(source, startPos,
+                               result = new char[length = currentPosition - startPos], 0,
+                               length);
                // }
                return result;
        }
@@ -408,21 +449,38 @@ public class Scanner implements IScanner, ITerminalSymbols {
                // REMOVE the two " that are at the beginning and the end.
                char[] result;
                if (withoutUnicodePtr != 0)
-                       // 0 is used as a fast test flag so the real first char is in position 1
+                       // 0 is used as a fast test flag so the real first char is in
+                       // position 1
                        System.arraycopy(withoutUnicodeBuffer, 2,
-                       // 2 is 1 (real start) + 1 (to jump over the ")
-                                       result = new char[withoutUnicodePtr - 2], 0, withoutUnicodePtr - 2);
+                                       // 2 is 1 (real start) + 1 (to jump over the ")
+                                       result = new char[withoutUnicodePtr - 2], 0,
+                                       withoutUnicodePtr - 2);
                else {
                        int length;
-                       System.arraycopy(source, startPosition + 1, result = new char[length = currentPosition - startPosition - 2], 0, length);
+                       System.arraycopy(source, startPosition + 1,
+                                       result = new char[length = currentPosition - startPosition
+                                                       - 2], 0, length);
                }
                return result;
        }
 
+       public final boolean equalsCurrentTokenSource(char[] word) {
+               if (word.length != currentPosition - startPosition) {
+                       return false;
+               }
+               for (int i = 0; i < word.length; i++) {
+                       if (word[i] != source[startPosition + i]) {
+                               return false;
+                       }
+               }
+               return true;
+       }
+
        public final char[] getRawTokenSourceEnd() {
                int length = this.eofPosition - this.currentPosition - 1;
                char[] sourceEnd = new char[length];
-               System.arraycopy(this.source, this.currentPosition, sourceEnd, 0, length);
+               System.arraycopy(this.source, this.currentPosition, sourceEnd, 0,
+                               length);
                return sourceEnd;
        }
 
@@ -442,7 +500,10 @@ public class Scanner implements IScanner, ITerminalSymbols {
                }
                char[] result;
                int length;
-               System.arraycopy(source, startPosition + 1, result = new char[length = currentPosition - startPosition - 2], 0, length);
+               System
+                               .arraycopy(source, startPosition + 1,
+                                               result = new char[length = currentPosition
+                                                               - startPosition - 2], 0, length);
                // }
                return result;
        }
@@ -451,17 +512,20 @@ public class Scanner implements IScanner, ITerminalSymbols {
                // Return the token REAL source (aka unicodes are precomputed)
                char[] result;
                int length;
-               System.arraycopy(source, startPos + 1, result = new char[length = currentPosition - startPos - 2], 0, length);
+               System.arraycopy(source, startPos + 1,
+                               result = new char[length = currentPosition - startPos - 2], 0,
+                               length);
                // }
                return result;
        }
 
        /*
-        * Search the source position corresponding to the end of a given line number
-        *
+        * Search the source position corresponding to the end of a given line
+        * number
+        * 
         * Line numbers are 1-based, and relative to the scanner initialPosition.
         * Character positions are 0-based.
-        *
+        * 
         * In case the given line number is inconsistent, answers -1.
         */
        public final int getLineEnd(int lineNumber) {
@@ -480,12 +544,12 @@ public class Scanner implements IScanner, ITerminalSymbols {
        /**
         * Search the source position corresponding to the beginning of a given line
         * number
-        *
+        * 
         * Line numbers are 1-based, and relative to the scanner initialPosition.
         * Character positions are 0-based.
-        *
+        * 
         * e.g. getLineStart(1) --> 0 i.e. first line starts at character 0.
-        *
+        * 
         * In case the given line number is inconsistent, answers -1.
         */
        public final int getLineStart(int lineNumber) {
@@ -526,13 +590,17 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        // unicodeSize++;
                        // }
                        //
-                       // if (((c1 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // if (((c1 = Character.getNumericValue(source[currentPosition++]))
+                       // > 15
                        // || c1 < 0)
-                       // || ((c2 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // || ((c2 = Character.getNumericValue(source[currentPosition++])) >
+                       // 15
                        // || c2 < 0)
-                       // || ((c3 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // || ((c3 = Character.getNumericValue(source[currentPosition++])) >
+                       // 15
                        // || c3 < 0)
-                       // || ((c4 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // || ((c4 = Character.getNumericValue(source[currentPosition++])) >
+                       // 15
                        // || c4 < 0)) {
                        // currentPosition = temp;
                        // return false;
@@ -548,7 +616,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        // //need the unicode buffer
                        // if (withoutUnicodePtr == 0) {
                        // //buffer all the entries that have been left aside....
-                       // withoutUnicodePtr = currentPosition - unicodeSize - startPosition;
+                       // withoutUnicodePtr = currentPosition - unicodeSize -
+                       // startPosition;
                        // System.arraycopy(
                        // source,
                        // startPosition,
@@ -605,13 +674,17 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        // unicodeSize++;
                        // }
                        //
-                       // if (((c1 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // if (((c1 = Character.getNumericValue(source[currentPosition++]))
+                       // > 15
                        // || c1 < 0)
-                       // || ((c2 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // || ((c2 = Character.getNumericValue(source[currentPosition++])) >
+                       // 15
                        // || c2 < 0)
-                       // || ((c3 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // || ((c3 = Character.getNumericValue(source[currentPosition++])) >
+                       // 15
                        // || c3 < 0)
-                       // || ((c4 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // || ((c4 = Character.getNumericValue(source[currentPosition++])) >
+                       // 15
                        // || c4 < 0)) {
                        // currentPosition = temp;
                        // return 2;
@@ -630,7 +703,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        // //need the unicode buffer
                        // if (withoutUnicodePtr == 0) {
                        // //buffer all the entries that have been left aside....
-                       // withoutUnicodePtr = currentPosition - unicodeSize - startPosition;
+                       // withoutUnicodePtr = currentPosition - unicodeSize -
+                       // startPosition;
                        // System.arraycopy(
                        // source,
                        // startPosition,
@@ -685,13 +759,17 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        // unicodeSize++;
                        // }
                        //
-                       // if (((c1 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // if (((c1 = Character.getNumericValue(source[currentPosition++]))
+                       // > 15
                        // || c1 < 0)
-                       // || ((c2 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // || ((c2 = Character.getNumericValue(source[currentPosition++])) >
+                       // 15
                        // || c2 < 0)
-                       // || ((c3 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // || ((c3 = Character.getNumericValue(source[currentPosition++])) >
+                       // 15
                        // || c3 < 0)
-                       // || ((c4 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // || ((c4 = Character.getNumericValue(source[currentPosition++])) >
+                       // 15
                        // || c4 < 0)) {
                        // currentPosition = temp;
                        // return false;
@@ -706,7 +784,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        // //need the unicode buffer
                        // if (withoutUnicodePtr == 0) {
                        // //buffer all the entries that have been left aside....
-                       // withoutUnicodePtr = currentPosition - unicodeSize - startPosition;
+                       // withoutUnicodePtr = currentPosition - unicodeSize -
+                       // startPosition;
                        // System.arraycopy(
                        // source,
                        // startPosition,
@@ -740,7 +819,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                // internal values
                // At the end of this method currentCharacter holds the new visited char
                // and currentPosition points right next after it
-               // Both previous lines are true if the currentCharacter is a digit base on
+               // Both previous lines are true if the currentCharacter is a digit base
+               // on
                // radix
                // On false, no side effect has occured.
                // ALL getNextChar.... ARE OPTIMIZED COPIES
@@ -758,13 +838,17 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        // unicodeSize++;
                        // }
                        //
-                       // if (((c1 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // if (((c1 = Character.getNumericValue(source[currentPosition++]))
+                       // > 15
                        // || c1 < 0)
-                       // || ((c2 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // || ((c2 = Character.getNumericValue(source[currentPosition++])) >
+                       // 15
                        // || c2 < 0)
-                       // || ((c3 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // || ((c3 = Character.getNumericValue(source[currentPosition++])) >
+                       // 15
                        // || c3 < 0)
-                       // || ((c4 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // || ((c4 = Character.getNumericValue(source[currentPosition++])) >
+                       // 15
                        // || c4 < 0)) {
                        // currentPosition = temp;
                        // return false;
@@ -779,7 +863,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        // //need the unicode buffer
                        // if (withoutUnicodePtr == 0) {
                        // //buffer all the entries that have been left aside....
-                       // withoutUnicodePtr = currentPosition - unicodeSize - startPosition;
+                       // withoutUnicodePtr = currentPosition - unicodeSize -
+                       // startPosition;
                        // System.arraycopy(
                        // source,
                        // startPosition,
@@ -831,13 +916,17 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        // unicodeSize++;
                        // }
                        //
-                       // if (((c1 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // if (((c1 = Character.getNumericValue(source[currentPosition++]))
+                       // > 15
                        // || c1 < 0)
-                       // || ((c2 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // || ((c2 = Character.getNumericValue(source[currentPosition++])) >
+                       // 15
                        // || c2 < 0)
-                       // || ((c3 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // || ((c3 = Character.getNumericValue(source[currentPosition++])) >
+                       // 15
                        // || c3 < 0)
-                       // || ((c4 = Character.getNumericValue(source[currentPosition++])) > 15
+                       // || ((c4 = Character.getNumericValue(source[currentPosition++])) >
+                       // 15
                        // || c4 < 0)) {
                        // currentPosition = temp;
                        // return false;
@@ -852,7 +941,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        // //need the unicode buffer
                        // if (withoutUnicodePtr == 0) {
                        // //buffer all the entries that have been left aside....
-                       // withoutUnicodePtr = currentPosition - unicodeSize - startPosition;
+                       // withoutUnicodePtr = currentPosition - unicodeSize -
+                       // startPosition;
                        // System.arraycopy(
                        // source,
                        // startPosition,
@@ -889,8 +979,9 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        do {
                                currentCharacter = source[currentPosition++];
                        } while (currentCharacter == ' ' || currentCharacter == '\t');
-                       while (ObviousIdentCharNatures[currentCharacter]==C_LETTER) {
-                               //      while((currentCharacter >= 'a' && currentCharacter <= 'z') || (currentCharacter >= 'A' && currentCharacter <= 'Z')) {
+                       while (ObviousIdentCharNatures[currentCharacter] == C_LETTER) {
+                               // while((currentCharacter >= 'a' && currentCharacter <= 'z') ||
+                               // (currentCharacter >= 'A' && currentCharacter <= 'Z')) {
                                buf.append(currentCharacter);
                                currentCharacter = source[currentPosition++];
                        }
@@ -900,19 +991,23 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                switch (data.length) {
                                case 3:
                                        // int
-                                       if ((data[index] == 'i') && (data[++index] == 'n') && (data[++index] == 't')) {
+                                       if ((data[index] == 'i') && (data[++index] == 'n')
+                                                       && (data[++index] == 't')) {
                                                found = true;
                                                tempToken = TokenNameintCAST;
                                        }
                                        break;
                                case 4:
                                        // bool real
-                                       if ((data[index] == 'b') && (data[++index] == 'o') && (data[++index] == 'o') && (data[++index] == 'l')) {
+                                       if ((data[index] == 'b') && (data[++index] == 'o')
+                                                       && (data[++index] == 'o') && (data[++index] == 'l')) {
                                                found = true;
                                                tempToken = TokenNameboolCAST;
                                        } else {
                                                index = 0;
-                                               if ((data[index] == 'r') && (data[++index] == 'e') && (data[++index] == 'a') && (data[++index] == 'l')) {
+                                               if ((data[index] == 'r') && (data[++index] == 'e')
+                                                               && (data[++index] == 'a')
+                                                               && (data[++index] == 'l')) {
                                                        found = true;
                                                        tempToken = TokenNamedoubleCAST;
                                                }
@@ -920,19 +1015,24 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                        break;
                                case 5:
                                        // array unset float
-                                       if ((data[index] == 'a') && (data[++index] == 'r') && (data[++index] == 'r') && (data[++index] == 'a')
+                                       if ((data[index] == 'a') && (data[++index] == 'r')
+                                                       && (data[++index] == 'r') && (data[++index] == 'a')
                                                        && (data[++index] == 'y')) {
                                                found = true;
                                                tempToken = TokenNamearrayCAST;
                                        } else {
                                                index = 0;
-                                               if ((data[index] == 'u') && (data[++index] == 'n') && (data[++index] == 's') && (data[++index] == 'e')
+                                               if ((data[index] == 'u') && (data[++index] == 'n')
+                                                               && (data[++index] == 's')
+                                                               && (data[++index] == 'e')
                                                                && (data[++index] == 't')) {
                                                        found = true;
                                                        tempToken = TokenNameunsetCAST;
                                                } else {
                                                        index = 0;
-                                                       if ((data[index] == 'f') && (data[++index] == 'l') && (data[++index] == 'o') && (data[++index] == 'a')
+                                                       if ((data[index] == 'f') && (data[++index] == 'l')
+                                                                       && (data[++index] == 'o')
+                                                                       && (data[++index] == 'a')
                                                                        && (data[++index] == 't')) {
                                                                found = true;
                                                                tempToken = TokenNamedoubleCAST;
@@ -942,20 +1042,27 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                        break;
                                case 6:
                                        // object string double
-                                       if ((data[index] == 'o') && (data[++index] == 'b') && (data[++index] == 'j') && (data[++index] == 'e')
+                                       if ((data[index] == 'o') && (data[++index] == 'b')
+                                                       && (data[++index] == 'j') && (data[++index] == 'e')
                                                        && (data[++index] == 'c') && (data[++index] == 't')) {
                                                found = true;
                                                tempToken = TokenNameobjectCAST;
                                        } else {
                                                index = 0;
-                                               if ((data[index] == 's') && (data[++index] == 't') && (data[++index] == 'r') && (data[++index] == 'i')
-                                                               && (data[++index] == 'n') && (data[++index] == 'g')) {
+                                               if ((data[index] == 's') && (data[++index] == 't')
+                                                               && (data[++index] == 'r')
+                                                               && (data[++index] == 'i')
+                                                               && (data[++index] == 'n')
+                                                               && (data[++index] == 'g')) {
                                                        found = true;
                                                        tempToken = TokenNamestringCAST;
                                                } else {
                                                        index = 0;
-                                                       if ((data[index] == 'd') && (data[++index] == 'o') && (data[++index] == 'u') && (data[++index] == 'b')
-                                                                       && (data[++index] == 'l') && (data[++index] == 'e')) {
+                                                       if ((data[index] == 'd') && (data[++index] == 'o')
+                                                                       && (data[++index] == 'u')
+                                                                       && (data[++index] == 'b')
+                                                                       && (data[++index] == 'l')
+                                                                       && (data[++index] == 'e')) {
                                                                found = true;
                                                                tempToken = TokenNamedoubleCAST;
                                                        }
@@ -964,14 +1071,20 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                        break;
                                case 7:
                                        // boolean integer
-                                       if ((data[index] == 'b') && (data[++index] == 'o') && (data[++index] == 'o') && (data[++index] == 'l')
-                                                       && (data[++index] == 'e') && (data[++index] == 'a') && (data[++index] == 'n')) {
+                                       if ((data[index] == 'b') && (data[++index] == 'o')
+                                                       && (data[++index] == 'o') && (data[++index] == 'l')
+                                                       && (data[++index] == 'e') && (data[++index] == 'a')
+                                                       && (data[++index] == 'n')) {
                                                found = true;
                                                tempToken = TokenNameboolCAST;
                                        } else {
                                                index = 0;
-                                               if ((data[index] == 'i') && (data[++index] == 'n') && (data[++index] == 't') && (data[++index] == 'e')
-                                                               && (data[++index] == 'g') && (data[++index] == 'e') && (data[++index] == 'r')) {
+                                               if ((data[index] == 'i') && (data[++index] == 'n')
+                                                               && (data[++index] == 't')
+                                                               && (data[++index] == 'e')
+                                                               && (data[++index] == 'g')
+                                                               && (data[++index] == 'e')
+                                                               && (data[++index] == 'r')) {
                                                        found = true;
                                                        tempToken = TokenNameintCAST;
                                                }
@@ -1012,7 +1125,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                /** ** in PHP \r and \n are valid in string literals *** */
                                // if ((currentCharacter == '\n')
                                // || (currentCharacter == '\r')) {
-                               // // relocate if finding another quote fairly close: thus unicode
+                               // // relocate if finding another quote fairly close: thus
+                               // unicode
                                // '/u000D' will be fully consumed
                                // for (int lookAhead = 0; lookAhead < 50; lookAhead++) {
                                // if (currentPosition + lookAhead == source.length)
@@ -1029,23 +1143,28 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                if (currentCharacter == '\\') {
                                        int escapeSize = currentPosition;
                                        boolean backSlashAsUnicodeInString = unicodeAsBackSlash;
-                                       // scanEscapeCharacter make a side effect on this value and we need
+                                       // scanEscapeCharacter make a side effect on this value and
+                                       // we need
                                        // the previous value few lines down this one
                                        scanDoubleQuotedEscapeCharacter();
                                        escapeSize = currentPosition - escapeSize;
                                        if (withoutUnicodePtr == 0) {
                                                // buffer all the entries that have been left aside....
-                                               withoutUnicodePtr = currentPosition - escapeSize - 1 - startPosition;
-                                               System.arraycopy(source, startPosition, withoutUnicodeBuffer, 1, withoutUnicodePtr);
+                                               withoutUnicodePtr = currentPosition - escapeSize - 1
+                                                               - startPosition;
+                                               System.arraycopy(source, startPosition,
+                                                               withoutUnicodeBuffer, 1, withoutUnicodePtr);
                                                withoutUnicodeBuffer[++withoutUnicodePtr] = currentCharacter;
                                        } else { // overwrite the / in the buffer
                                                withoutUnicodeBuffer[withoutUnicodePtr] = currentCharacter;
-                                               if (backSlashAsUnicodeInString) { // there are TWO \ in the stream
+                                               if (backSlashAsUnicodeInString) { // there are TWO \
+                                                                                                                       // in the stream
                                                        // where only one is correct
                                                        withoutUnicodePtr--;
                                                }
                                        }
-                               } else if ((currentCharacter == '\r') || (currentCharacter == '\n')) {
+                               } else if ((currentCharacter == '\r')
+                                               || (currentCharacter == '\n')) {
                                        if (recordLineSeparator) {
                                                pushLineSeparator();
                                        }
@@ -1083,14 +1202,16 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        }
                        throw e; // rethrow
                }
-               if (checkNonExternalizedStringLiterals) { // check for presence of NLS tags
+               if (checkNonExternalizedStringLiterals) { // check for presence of NLS
+                                                                                                       // tags
                        // //$NON-NLS-?$ where ? is an
                        // int.
                        if (currentLine == null) {
                                currentLine = new NLSLine();
                                lines.add(currentLine);
                        }
-                       currentLine.add(new StringLiteral(getCurrentTokenSourceString(), startPosition, currentPosition - 1));
+                       currentLine.add(new StringLiteral(getCurrentTokenSourceString(),
+                                       startPosition, currentPosition - 1));
                }
        }
 
@@ -1112,7 +1233,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                /** ** in PHP \r and \n are valid in string literals *** */
                                // if ((currentCharacter == '\n')
                                // || (currentCharacter == '\r')) {
-                               // // relocate if finding another quote fairly close: thus unicode
+                               // // relocate if finding another quote fairly close: thus
+                               // unicode
                                // '/u000D' will be fully consumed
                                // for (int lookAhead = 0; lookAhead < 50; lookAhead++) {
                                // if (currentPosition + lookAhead == source.length)
@@ -1129,23 +1251,28 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                if (currentCharacter == '\\') {
                                        int escapeSize = currentPosition;
                                        boolean backSlashAsUnicodeInString = unicodeAsBackSlash;
-                                       // scanEscapeCharacter make a side effect on this value and we need
+                                       // scanEscapeCharacter make a side effect on this value and
+                                       // we need
                                        // the previous value few lines down this one
                                        scanSingleQuotedEscapeCharacter();
                                        escapeSize = currentPosition - escapeSize;
                                        if (withoutUnicodePtr == 0) {
                                                // buffer all the entries that have been left aside....
-                                               withoutUnicodePtr = currentPosition - escapeSize - 1 - startPosition;
-                                               System.arraycopy(source, startPosition, withoutUnicodeBuffer, 1, withoutUnicodePtr);
+                                               withoutUnicodePtr = currentPosition - escapeSize - 1
+                                                               - startPosition;
+                                               System.arraycopy(source, startPosition,
+                                                               withoutUnicodeBuffer, 1, withoutUnicodePtr);
                                                withoutUnicodeBuffer[++withoutUnicodePtr] = currentCharacter;
                                        } else { // overwrite the / in the buffer
                                                withoutUnicodeBuffer[withoutUnicodePtr] = currentCharacter;
-                                               if (backSlashAsUnicodeInString) { // there are TWO \ in the stream
+                                               if (backSlashAsUnicodeInString) { // there are TWO \
+                                                                                                                       // in the stream
                                                        // where only one is correct
                                                        withoutUnicodePtr--;
                                                }
                                        }
-                               } else if ((currentCharacter == '\r') || (currentCharacter == '\n')) {
+                               } else if ((currentCharacter == '\r')
+                                               || (currentCharacter == '\n')) {
                                        if (recordLineSeparator) {
                                                pushLineSeparator();
                                        }
@@ -1183,51 +1310,60 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        }
                        throw e; // rethrow
                }
-               if (checkNonExternalizedStringLiterals) { // check for presence of NLS tags
+               if (checkNonExternalizedStringLiterals) { // check for presence of NLS
+                                                                                                       // tags
                        // //$NON-NLS-?$ where ? is an
                        // int.
                        if (currentLine == null) {
                                currentLine = new NLSLine();
                                lines.add(currentLine);
                        }
-                       currentLine.add(new StringLiteral(getCurrentTokenSourceString(), startPosition, currentPosition - 1));
+                       currentLine.add(new StringLiteral(getCurrentTokenSourceString(),
+                                       startPosition, currentPosition - 1));
                }
        }
 
        public void consumeStringLiteral() throws InvalidInputException {
                try {
-                       boolean openDollarBrace = false;
+                       int openDollarBrace = 0;
                        // consume next character
                        unicodeAsBackSlash = false;
                        currentCharacter = source[currentPosition++];
-                       while (currentCharacter != '"' || openDollarBrace) {
+                       while (currentCharacter != '"' || openDollarBrace > 0) {
                                /** ** in PHP \r and \n are valid in string literals *** */
                                if (currentCharacter == '\\') {
                                        int escapeSize = currentPosition;
                                        boolean backSlashAsUnicodeInString = unicodeAsBackSlash;
-                                       // scanEscapeCharacter make a side effect on this value and we need
+                                       // scanEscapeCharacter make a side effect on this value and
+                                       // we need
                                        // the previous value few lines down this one
                                        scanDoubleQuotedEscapeCharacter();
                                        escapeSize = currentPosition - escapeSize;
                                        if (withoutUnicodePtr == 0) {
                                                // buffer all the entries that have been left aside....
-                                               withoutUnicodePtr = currentPosition - escapeSize - 1 - startPosition;
-                                               System.arraycopy(source, startPosition, withoutUnicodeBuffer, 1, withoutUnicodePtr);
+                                               withoutUnicodePtr = currentPosition - escapeSize - 1
+                                                               - startPosition;
+                                               System.arraycopy(source, startPosition,
+                                                               withoutUnicodeBuffer, 1, withoutUnicodePtr);
                                                withoutUnicodeBuffer[++withoutUnicodePtr] = currentCharacter;
                                        } else { // overwrite the / in the buffer
                                                withoutUnicodeBuffer[withoutUnicodePtr] = currentCharacter;
-                                               if (backSlashAsUnicodeInString) { // there are TWO \ in the stream
+                                               if (backSlashAsUnicodeInString) { // there are TWO \
+                                                                                                                       // in the stream
                                                        // where only one is correct
                                                        withoutUnicodePtr--;
                                                }
                                        }
-                               } else if (currentCharacter == '$' && source[currentPosition] == '{') {
-                                       openDollarBrace = true;
-                               } else if (currentCharacter == '{' && source[currentPosition] == '$') {
-                                       openDollarBrace = true;
+                               } else if (currentCharacter == '$'
+                                               && source[currentPosition] == '{') {
+                                       openDollarBrace++;
+                               } else if (currentCharacter == '{'
+                                               && source[currentPosition] == '$') {
+                                       openDollarBrace++;
                                } else if (currentCharacter == '}') {
-                                       openDollarBrace = false;
-                               } else if ((currentCharacter == '\r') || (currentCharacter == '\n')) {
+                                       openDollarBrace--;
+                               } else if ((currentCharacter == '\r')
+                                               || (currentCharacter == '\n')) {
                                        if (recordLineSeparator) {
                                                pushLineSeparator();
                                        }
@@ -1260,181 +1396,50 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        }
                        throw e; // rethrow
                }
-               if (checkNonExternalizedStringLiterals) { // check for presence of NLS tags
+               if (checkNonExternalizedStringLiterals) { // check for presence of NLS
+                                                                                                       // tags
                        // //$NON-NLS-?$ where ? is an
                        // int.
                        if (currentLine == null) {
                                currentLine = new NLSLine();
                                lines.add(currentLine);
                        }
-                       currentLine.add(new StringLiteral(getCurrentTokenSourceString(), startPosition, currentPosition - 1));
+                       currentLine.add(new StringLiteral(getCurrentTokenSourceString(),
+                                       startPosition, currentPosition - 1));
                }
        }
 
        public int getNextToken() throws InvalidInputException {
-               phpExpressionTag = false;
                if (!phpMode) {
                        return getInlinedHTMLToken(currentPosition);
-               }
-               if (phpMode) {
+               } else {
+                       if (fFillerToken != TokenNameEOF) {
+                               int tempToken;
+                               startPosition = currentPosition;
+                               tempToken = fFillerToken;
+                               fFillerToken = TokenNameEOF;
+                               return tempToken;
+                       }
                        this.wasAcr = false;
                        if (diet) {
                                jumpOverMethodBody();
                                diet = false;
-                               return currentPosition > source.length ? TokenNameEOF : TokenNameRBRACE;
+                               return currentPosition > source.length ? TokenNameEOF
+                                               : TokenNameRBRACE;
                        }
                        try {
                                while (true) {
                                        withoutUnicodePtr = 0;
-                                       // start with a new token
-                                       char encapsedChar = ' ';
-                                       // if (!encapsedStringStack.isEmpty()) {
-                                       // encapsedChar = ((Character)
-                                       // encapsedStringStack.peek()).charValue();
-                                       // }
-                                       // if (encapsedChar != '$' && encapsedChar != ' ') {
-                                       // currentCharacter = source[currentPosition++];
-                                       // if (currentCharacter == encapsedChar) {
-                                       // switch (currentCharacter) {
-                                       // case '`':
-                                       // return TokenNameEncapsedString0;
-                                       // case '\'':
-                                       // return TokenNameEncapsedString1;
-                                       // case '"':
-                                       // return TokenNameEncapsedString2;
-                                       // }
-                                       // }
-                                       // while (currentCharacter != encapsedChar) {
-                                       // /** ** in PHP \r and \n are valid in string literals *** */
-                                       // switch (currentCharacter) {
-                                       // case '\\':
-                                       // int escapeSize = currentPosition;
-                                       // boolean backSlashAsUnicodeInString = unicodeAsBackSlash;
-                                       // //scanEscapeCharacter make a side effect on this value and
-                                       // // we need the previous value few lines down this one
-                                       // scanDoubleQuotedEscapeCharacter();
-                                       // escapeSize = currentPosition - escapeSize;
-                                       // if (withoutUnicodePtr == 0) {
-                                       // //buffer all the entries that have been left aside....
-                                       // withoutUnicodePtr = currentPosition - escapeSize - 1 -
-                                       // startPosition;
-                                       // System.arraycopy(source, startPosition, withoutUnicodeBuffer, 1,
-                                       // withoutUnicodePtr);
-                                       // withoutUnicodeBuffer[++withoutUnicodePtr] = currentCharacter;
-                                       // } else { //overwrite the / in the buffer
-                                       // withoutUnicodeBuffer[withoutUnicodePtr] = currentCharacter;
-                                       // if (backSlashAsUnicodeInString) { //there are TWO \ in
-                                       // withoutUnicodePtr--;
-                                       // }
-                                       // }
-                                       // break;
-                                       // case '\r':
-                                       // case '\n':
-                                       // if (recordLineSeparator) {
-                                       // pushLineSeparator();
-                                       // }
-                                       // break;
-                                       // case '$':
-                                       // if (isPHPIdentifierStart(source[currentPosition]) ||
-                                       // source[currentPosition] == '{') {
-                                       // currentPosition--;
-                                       // encapsedStringStack.push(new Character('$'));
-                                       // return TokenNameSTRING;
-                                       // }
-                                       // break;
-                                       // case '{':
-                                       // if (source[currentPosition] == '$') { // CURLY_OPEN
-                                       // currentPosition--;
-                                       // encapsedStringStack.push(new Character('$'));
-                                       // return TokenNameSTRING;
-                                       // }
-                                       // }
-                                       // // consume next character
-                                       // unicodeAsBackSlash = false;
-                                       // currentCharacter = source[currentPosition++];
-                                       // if (withoutUnicodePtr != 0) {
-                                       // withoutUnicodeBuffer[++withoutUnicodePtr] = currentCharacter;
-                                       // }
-                                       // // }
-                                       // } // end while
-                                       // currentPosition--;
-                                       // return TokenNameSTRING;
-                                       // }
-                                       // ---------Consume white space and handles startPosition---------
+                                       // ---------Consume white space and handles
+                                       // startPosition---------
                                        int whiteStart = currentPosition;
                                        startPosition = currentPosition;
                                        currentCharacter = source[currentPosition++];
-                                       // if (encapsedChar == '$') {
-                                       // switch (currentCharacter) {
-                                       // case '\\':
-                                       // currentCharacter = source[currentPosition++];
-                                       // return TokenNameSTRING;
-                                       // case '{':
-                                       // if (encapsedChar == '$') {
-                                       // if (getNextChar('$'))
-                                       // return TokenNameLBRACE_DOLLAR;
-                                       // }
-                                       // return TokenNameLBRACE;
-                                       // case '}':
-                                       // return TokenNameRBRACE;
-                                       // case '[':
-                                       // return TokenNameLBRACKET;
-                                       // case ']':
-                                       // return TokenNameRBRACKET;
-                                       // case '\'':
-                                       // if (tokenizeStrings) {
-                                       // consumeStringConstant();
-                                       // return TokenNameStringSingleQuote;
-                                       // }
-                                       // return TokenNameEncapsedString1;
-                                       // case '"':
-                                       // return TokenNameEncapsedString2;
-                                       // case '`':
-                                       // if (tokenizeStrings) {
-                                       // consumeStringInterpolated();
-                                       // return TokenNameStringInterpolated;
-                                       // }
-                                       // return TokenNameEncapsedString0;
-                                       // case '-':
-                                       // if (getNextChar('>'))
-                                       // return TokenNameMINUS_GREATER;
-                                       // return TokenNameSTRING;
-                                       // default:
-                                       // if (currentCharacter == '$') {
-                                       // int oldPosition = currentPosition;
-                                       // try {
-                                       // currentCharacter = source[currentPosition++];
-                                       // if (currentCharacter == '{') {
-                                       // return TokenNameDOLLAR_LBRACE;
-                                       // }
-                                       // if (isPHPIdentifierStart(currentCharacter)) {
-                                       // return scanIdentifierOrKeyword(true);
-                                       // } else {
-                                       // currentPosition = oldPosition;
-                                       // return TokenNameSTRING;
-                                       // }
-                                       // } catch (IndexOutOfBoundsException e) {
-                                       // currentPosition = oldPosition;
-                                       // return TokenNameSTRING;
-                                       // }
-                                       // }
-                                       // if (isPHPIdentifierStart(currentCharacter))
-                                       // return scanIdentifierOrKeyword(false);
-                                       // if (Character.isDigit(currentCharacter))
-                                       // return scanNumber(false);
-                                       // return TokenNameERROR;
-                                       // }
-                                       // }
-                                       // boolean isWhiteSpace;
 
-                                       while ((currentCharacter == ' ') || Character.isWhitespace(currentCharacter)) {
-                                               startPosition = currentPosition;
-                                               currentCharacter = source[currentPosition++];
-                                               // if (((currentCharacter = source[currentPosition++]) == '\\')
-                                               // && (source[currentPosition] == 'u')) {
-                                               // isWhiteSpace = jumpOverUnicodeWhiteSpace();
-                                               // } else {
-                                               if ((currentCharacter == '\r') || (currentCharacter == '\n')) {
+                                       while ((currentCharacter == ' ')
+                                                       || Character.isWhitespace(currentCharacter)) {
+                                               if ((currentCharacter == '\r')
+                                                               || (currentCharacter == '\n')) {
                                                        checkNonExternalizeString();
                                                        if (recordLineSeparator) {
                                                                pushLineSeparator();
@@ -1442,17 +1447,19 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                                currentLine = null;
                                                        }
                                                }
-                                               // isWhiteSpace = (currentCharacter == ' ')
-                                               // || Character.isWhitespace(currentCharacter);
-                                               // }
+                                               startPosition = currentPosition;
+                                               currentCharacter = source[currentPosition++];
                                        }
-                                       if (tokenizeWhiteSpace && (whiteStart != currentPosition - 1)) {
-                                               // reposition scanner in case we are interested by spaces as tokens
+                                       if (tokenizeWhiteSpace
+                                                       && (whiteStart != currentPosition - 1)) {
+                                               // reposition scanner in case we are interested by
+                                               // spaces as tokens
                                                currentPosition--;
                                                startPosition = whiteStart;
                                                return TokenNameWHITESPACE;
                                        }
-                                       // little trick to get out in the middle of a source compuation
+                                       // little trick to get out in the middle of a source
+                                       // compuation
                                        if (currentPosition > eofPosition)
                                                return TokenNameEOF;
                                        // ---------Identify the next token-------------
@@ -1548,7 +1555,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                                while (isPHPIdentifierPart(currentCharacter)) {
                                                                        currentCharacter = source[currentPosition++];
                                                                }
-                                                               heredocLength = currentPosition - heredocStart - 1;
+                                                               heredocLength = currentPosition - heredocStart
+                                                                               - 1;
                                                                // heredoc end-tag determination
                                                                boolean endTag = true;
                                                                char ch;
@@ -1561,7 +1569,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                                                        currentLine = null;
                                                                                }
                                                                                for (int i = 0; i < heredocLength; i++) {
-                                                                                       if (source[currentPosition + i] != source[heredocStart + i]) {
+                                                                                       if (source[currentPosition + i] != source[heredocStart
+                                                                                                       + i]) {
                                                                                                endTag = false;
                                                                                                break;
                                                                                        }
@@ -1639,6 +1648,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                return TokenNameCOLON;
                                        case '@':
                                                return TokenNameAT;
+                                       case '\\':
+                                               return TokenNameForwardSlash;
                                        case '\'':
                                                consumeStringConstant();
                                                return TokenNameStringSingleQuote;
@@ -1646,14 +1657,14 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                // if (tokenizeStrings) {
                                                consumeStringLiteral();
                                                return TokenNameStringDoubleQuote;
-                                       // }
-                                       // return TokenNameEncapsedString2;
+                                               // }
+                                               // return TokenNameEncapsedString2;
                                        case '`':
                                                // if (tokenizeStrings) {
                                                consumeStringInterpolated();
                                                return TokenNameStringInterpolated;
-                                       // }
-                                       // return TokenNameEncapsedString0;
+                                               // }
+                                               // return TokenNameEncapsedString0;
                                        case '#':
                                        case '/': {
                                                char startChar = currentCharacter;
@@ -1661,16 +1672,19 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                        return TokenNameDIVIDE_EQUAL;
                                                }
                                                int test;
-                                               if ((startChar == '#') || (test = getNextChar('/', '*')) == 0) {
+                                               if ((startChar == '#')
+                                                               || (test = getNextChar('/', '*')) == 0) {
                                                        // line comment
                                                        this.lastCommentLinePosition = this.currentPosition;
                                                        int endPositionForLineComment = 0;
                                                        try { // get the next char
                                                                currentCharacter = source[currentPosition++];
-                                                               // if (((currentCharacter = source[currentPosition++])
+                                                               // if (((currentCharacter =
+                                                               // source[currentPosition++])
                                                                // == '\\')
                                                                // && (source[currentPosition] == 'u')) {
-                                                               // //-------------unicode traitement ------------
+                                                               // //-------------unicode traitement
+                                                               // ------------
                                                                // int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
                                                                // currentPosition++;
                                                                // while (source[currentPosition] == 'u') {
@@ -1696,7 +1710,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                                // InvalidInputException(INVALID_UNICODE_ESCAPE);
                                                                // } else {
                                                                // currentCharacter =
-                                                               // (char) (((c1 * 16 + c2) * 16 + c3) * 16 + c4);
+                                                               // (char) (((c1 * 16 + c2) * 16 + c3) * 16 +
+                                                               // c4);
                                                                // }
                                                                // }
                                                                // handle the \\u case manually into comment
@@ -1705,7 +1720,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                                // currentPosition++;
                                                                // } //jump over the \\
                                                                boolean isUnicode = false;
-                                                               while (currentCharacter != '\r' && currentCharacter != '\n') {
+                                                               while (currentCharacter != '\r'
+                                                                               && currentCharacter != '\n') {
                                                                        this.lastCommentLinePosition = this.currentPosition;
                                                                        if (currentCharacter == '?') {
                                                                                if (getNextChar('>')) {
@@ -1718,11 +1734,13 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                                        // get the next char
                                                                        isUnicode = false;
                                                                        currentCharacter = source[currentPosition++];
-                                                                       // if (((currentCharacter = source[currentPosition++])
+                                                                       // if (((currentCharacter =
+                                                                       // source[currentPosition++])
                                                                        // == '\\')
                                                                        // && (source[currentPosition] == 'u')) {
                                                                        // isUnicode = true;
-                                                                       // //-------------unicode traitement ------------
+                                                                       // //-------------unicode traitement
+                                                                       // ------------
                                                                        // int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
                                                                        // currentPosition++;
                                                                        // while (source[currentPosition] == 'u') {
@@ -1751,7 +1769,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                                        // InvalidInputException(INVALID_UNICODE_ESCAPE);
                                                                        // } else {
                                                                        // currentCharacter =
-                                                                       // (char) (((c1 * 16 + c2) * 16 + c3) * 16 + c4);
+                                                                       // (char) (((c1 * 16 + c2) * 16 + c3) * 16 +
+                                                                       // c4);
                                                                        // }
                                                                        // }
                                                                        // handle the \\u case manually into comment
@@ -1768,8 +1787,10 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                                // recordComment(false);
                                                                recordComment(TokenNameCOMMENT_LINE);
                                                                if (this.taskTags != null)
-                                                                       checkTaskTag(this.startPosition, this.currentPosition);
-                                                               if ((currentCharacter == '\r') || (currentCharacter == '\n')) {
+                                                                       checkTaskTag(this.startPosition,
+                                                                                       this.currentPosition);
+                                                               if ((currentCharacter == '\r')
+                                                                               || (currentCharacter == '\n')) {
                                                                        checkNonExternalizeString();
                                                                        if (recordLineSeparator) {
                                                                                if (isUnicode) {
@@ -1788,7 +1809,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                                        }
                                                                        return TokenNameCOMMENT_LINE;
                                                                }
-                                                       } catch (IndexOutOfBoundsException e) { // an eof will them
+                                                       } catch (IndexOutOfBoundsException e) { // an eof
+                                                                                                                                       // will them
                                                                // be generated
                                                                if (tokenizeComments) {
                                                                        currentPosition--;
@@ -1804,7 +1826,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                        // consume next character
                                                        unicodeAsBackSlash = false;
                                                        currentCharacter = source[currentPosition++];
-                                                       // if (((currentCharacter = source[currentPosition++]) ==
+                                                       // if (((currentCharacter =
+                                                       // source[currentPosition++]) ==
                                                        // '\\')
                                                        // && (source[currentPosition] == 'u')) {
                                                        // getNextUnicodeChar();
@@ -1818,7 +1841,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                                isJavadoc = true;
                                                                star = true;
                                                        }
-                                                       if ((currentCharacter == '\r') || (currentCharacter == '\n')) {
+                                                       if ((currentCharacter == '\r')
+                                                                       || (currentCharacter == '\n')) {
                                                                checkNonExternalizeString();
                                                                if (recordLineSeparator) {
                                                                        pushLineSeparator();
@@ -1828,10 +1852,12 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                        }
                                                        try { // get the next char
                                                                currentCharacter = source[currentPosition++];
-                                                               // if (((currentCharacter = source[currentPosition++])
+                                                               // if (((currentCharacter =
+                                                               // source[currentPosition++])
                                                                // == '\\')
                                                                // && (source[currentPosition] == 'u')) {
-                                                               // //-------------unicode traitement ------------
+                                                               // //-------------unicode traitement
+                                                               // ------------
                                                                // getNextUnicodeChar();
                                                                // }
                                                                // handle the \\u case manually into comment
@@ -1846,7 +1872,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                                }
                                                                // loop until end of comment */
                                                                while ((currentCharacter != '/') || (!star)) {
-                                                                       if ((currentCharacter == '\r') || (currentCharacter == '\n')) {
+                                                                       if ((currentCharacter == '\r')
+                                                                                       || (currentCharacter == '\n')) {
                                                                                checkNonExternalizeString();
                                                                                if (recordLineSeparator) {
                                                                                        pushLineSeparator();
@@ -1857,10 +1884,12 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                                        star = currentCharacter == '*';
                                                                        // get next char
                                                                        currentCharacter = source[currentPosition++];
-                                                                       // if (((currentCharacter = source[currentPosition++])
+                                                                       // if (((currentCharacter =
+                                                                       // source[currentPosition++])
                                                                        // == '\\')
                                                                        // && (source[currentPosition] == 'u')) {
-                                                                       // //-------------unicode traitement ------------
+                                                                       // //-------------unicode traitement
+                                                                       // ------------
                                                                        // getNextUnicodeChar();
                                                                        // }
                                                                        // handle the \\u case manually into comment
@@ -1883,12 +1912,14 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                                }
 
                                                                if (this.taskTags != null) {
-                                                                       checkTaskTag(this.startPosition, this.currentPosition);
+                                                                       checkTaskTag(this.startPosition,
+                                                                                       this.currentPosition);
                                                                }
                                                        } catch (IndexOutOfBoundsException e) {
                                                                // reset end position for error reporting
                                                                currentPosition -= 2;
-                                                               throw new InvalidInputException(UNTERMINATED_COMMENT);
+                                                               throw new InvalidInputException(
+                                                                               UNTERMINATED_COMMENT);
                                                        }
                                                        break;
                                                }
@@ -1897,7 +1928,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                        case '\u001a':
                                                if (atEnd())
                                                        return TokenNameEOF;
-                                               // the atEnd may not be <currentPosition == source.length> if
+                                               // the atEnd may not be <currentPosition ==
+                                               // source.length> if
                                                // source is only some part of a real (external) stream
                                                throw new InvalidInputException("Ctrl-Z"); //$NON-NLS-1$
                                        default:
@@ -1935,6 +1967,7 @@ public class Scanner implements IScanner, ITerminalSymbols {
         * @throws InvalidInputException
         */
        private int getInlinedHTMLToken(int start) throws InvalidInputException {
+               boolean phpShortTag = false; // true, if <?= detected
                if (currentPosition > source.length) {
                        currentPosition = source.length;
                        return TokenNameEOF;
@@ -1946,30 +1979,43 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                if (currentCharacter == '<') {
                                        if (getNextChar('?')) {
                                                currentCharacter = source[currentPosition++];
-                                               if ((currentCharacter != 'P') && (currentCharacter != 'p')) {
+                                               if ((currentCharacter != 'P')
+                                                               && (currentCharacter != 'p')) {
                                                        if (currentCharacter != '=') { // <?=
                                                                currentPosition--;
+                                                               phpShortTag = false;
                                                        } else {
-                                                               phpExpressionTag = true;
+                                                               phpShortTag = true;
                                                        }
                                                        // <?
                                                        if (ignorePHPOneLiner) { // for CodeFormatter
                                                                if (lookAheadLinePHPTag() == TokenNameINLINE_HTML) {
                                                                        phpMode = true;
+                                                                       if (phpShortTag) {
+                                                                               fFillerToken = TokenNameECHO_INVISIBLE;
+                                                                       }
                                                                        return TokenNameINLINE_HTML;
                                                                }
                                                        } else {
-                                                               phpMode = true;
+                                                               boolean foundXML = false;
+                                                               if (getNextChar('X', 'x') >= 0) {
+                                                                       if (getNextChar('M', 'm') >= 0) {
+                                                                               if (getNextChar('L', 'l') >= 0) {
+                                                                                       foundXML = true;
+                                                                               }
+                                                                       }
+                                                               }
+                                                               if (!foundXML) {
+                                                                       phpMode = true;
+                                                               }
+                                                               if (phpShortTag) {
+                                                                       fFillerToken = TokenNameECHO_INVISIBLE;
+                                                               }
                                                                return TokenNameINLINE_HTML;
                                                        }
                                                } else {
-                                                       // boolean phpStart = (currentCharacter == 'P') ||
-                                                       // (currentCharacter == 'p');
-                                                       // if (phpStart) {
-                                                       int test = getNextChar('H', 'h');
-                                                       if (test >= 0) {
-                                                               test = getNextChar('P', 'p');
-                                                               if (test >= 0) {
+                                                       if (getNextChar('H', 'h') >= 0) {
+                                                               if (getNextChar('P', 'p') >= 0) {
                                                                        // <?PHP <?php
                                                                        if (ignorePHPOneLiner) {
                                                                                if (lookAheadLinePHPTag() == TokenNameINLINE_HTML) {
@@ -2006,10 +2052,11 @@ public class Scanner implements IScanner, ITerminalSymbols {
        }
 
        /**
+        * check if the PHP is only in this line (for CodeFormatter)
+        * 
         * @return
         */
        private int lookAheadLinePHPTag() {
-               // check if the PHP is only in this line (for CodeFormatter)
                int currentPositionInLine = currentPosition;
                char previousCharInLine = ' ';
                char currentCharInLine = ' ';
@@ -2066,13 +2113,15 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                        }
                                        break;
                                case '/':
-                                       if (previousCharInLine == '/' && !singleQuotedStringActive && !doubleQuotedStringActive) {
+                                       if (previousCharInLine == '/' && !singleQuotedStringActive
+                                                       && !doubleQuotedStringActive) {
                                                phpMode = true;
                                                return TokenNameINLINE_HTML;
                                        }
                                        break;
                                case '*':
-                                       if (previousCharInLine == '/' && !singleQuotedStringActive && !doubleQuotedStringActive) {
+                                       if (previousCharInLine == '/' && !singleQuotedStringActive
+                                                       && !doubleQuotedStringActive) {
                                                phpMode = true;
                                                return TokenNameINLINE_HTML;
                                        }
@@ -2081,7 +2130,7 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        }
                } catch (IndexOutOfBoundsException e) {
                        phpMode = true;
-                       currentPosition = currentPositionInLine;
+                       currentPosition = currentPositionInLine - 1;
                        return TokenNameINLINE_HTML;
                }
        }
@@ -2132,23 +2181,27 @@ public class Scanner implements IScanner, ITerminalSymbols {
        // unicodeAsBackSlash = currentCharacter == '\\';
        // }
        /*
-        * Tokenize a method body, assuming that curly brackets are properly balanced.
+        * Tokenize a method body, assuming that curly brackets are properly
+        * balanced.
         */
        public final void jumpOverMethodBody() {
                this.wasAcr = false;
                int found = 1;
                try {
                        while (true) { // loop for jumping over comments
-                               // ---------Consume white space and handles startPosition---------
+                               // ---------Consume white space and handles
+                               // startPosition---------
                                boolean isWhiteSpace;
                                do {
                                        startPosition = currentPosition;
                                        currentCharacter = source[currentPosition++];
-                                       // if (((currentCharacter = source[currentPosition++]) == '\\')
+                                       // if (((currentCharacter = source[currentPosition++]) ==
+                                       // '\\')
                                        // && (source[currentPosition] == 'u')) {
                                        // isWhiteSpace = jumpOverUnicodeWhiteSpace();
                                        // } else {
-                                       if (recordLineSeparator && ((currentCharacter == '\r') || (currentCharacter == '\n')))
+                                       if (recordLineSeparator
+                                                       && ((currentCharacter == '\r') || (currentCharacter == '\n')))
                                                pushLineSeparator();
                                        isWhiteSpace = Character.isWhitespace(currentCharacter);
                                        // }
@@ -2176,7 +2229,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                // try { // consume next character
                                                unicodeAsBackSlash = false;
                                                currentCharacter = source[currentPosition++];
-                                               // if (((currentCharacter = source[currentPosition++]) == '\\')
+                                               // if (((currentCharacter = source[currentPosition++])
+                                               // == '\\')
                                                // && (source[currentPosition] == 'u')) {
                                                // getNextUnicodeChar();
                                                // } else {
@@ -2195,7 +2249,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                // try { // consume next character
                                                unicodeAsBackSlash = false;
                                                currentCharacter = source[currentPosition++];
-                                               // if (((currentCharacter = source[currentPosition++]) == '\\')
+                                               // if (((currentCharacter = source[currentPosition++])
+                                               // == '\\')
                                                // && (source[currentPosition] == 'u')) {
                                                // getNextUnicodeChar();
                                                // } else {
@@ -2226,7 +2281,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                        // try { // consume next character
                                                        unicodeAsBackSlash = false;
                                                        currentCharacter = source[currentPosition++];
-                                                       // if (((currentCharacter = source[currentPosition++]) == '\\')
+                                                       // if (((currentCharacter =
+                                                       // source[currentPosition++]) == '\\')
                                                        // && (source[currentPosition] == 'u')) {
                                                        // getNextUnicodeChar();
                                                        // } else {
@@ -2248,7 +2304,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                try {
                                                        // get the next char
                                                        currentCharacter = source[currentPosition++];
-                                                       // if (((currentCharacter = source[currentPosition++]) ==
+                                                       // if (((currentCharacter =
+                                                       // source[currentPosition++]) ==
                                                        // '\\')
                                                        // && (source[currentPosition] == 'u')) {
                                                        // //-------------unicode traitement ------------
@@ -2281,13 +2338,16 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                        // (char) (((c1 * 16 + c2) * 16 + c3) * 16 + c4);
                                                        // }
                                                        // }
-                                                       while (currentCharacter != '\r' && currentCharacter != '\n') {
+                                                       while (currentCharacter != '\r'
+                                                                       && currentCharacter != '\n') {
                                                                // get the next char
                                                                currentCharacter = source[currentPosition++];
-                                                               // if (((currentCharacter = source[currentPosition++])
+                                                               // if (((currentCharacter =
+                                                               // source[currentPosition++])
                                                                // == '\\')
                                                                // && (source[currentPosition] == 'u')) {
-                                                               // //-------------unicode traitement ------------
+                                                               // //-------------unicode traitement
+                                                               // ------------
                                                                // int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
                                                                // currentPosition++;
                                                                // while (source[currentPosition] == 'u') {
@@ -2314,11 +2374,13 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                                // } //something different from \n and \r
                                                                // else {
                                                                // currentCharacter =
-                                                               // (char) (((c1 * 16 + c2) * 16 + c3) * 16 + c4);
+                                                               // (char) (((c1 * 16 + c2) * 16 + c3) * 16 +
+                                                               // c4);
                                                                // }
                                                                // }
                                                        }
-                                                       if (recordLineSeparator && ((currentCharacter == '\r') || (currentCharacter == '\n')))
+                                                       if (recordLineSeparator
+                                                                       && ((currentCharacter == '\r') || (currentCharacter == '\n')))
                                                                pushLineSeparator();
                                                } catch (IndexOutOfBoundsException e) {
                                                } // an eof will them be generated
@@ -2330,7 +2392,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                // try { // consume next character
                                                unicodeAsBackSlash = false;
                                                currentCharacter = source[currentPosition++];
-                                               // if (((currentCharacter = source[currentPosition++]) == '\\')
+                                               // if (((currentCharacter = source[currentPosition++])
+                                               // == '\\')
                                                // && (source[currentPosition] == 'u')) {
                                                // getNextUnicodeChar();
                                                // } else {
@@ -2343,11 +2406,13 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                if (currentCharacter == '*') {
                                                        star = true;
                                                }
-                                               if (recordLineSeparator && ((currentCharacter == '\r') || (currentCharacter == '\n')))
+                                               if (recordLineSeparator
+                                                               && ((currentCharacter == '\r') || (currentCharacter == '\n')))
                                                        pushLineSeparator();
                                                try { // get the next char
                                                        currentCharacter = source[currentPosition++];
-                                                       // if (((currentCharacter = source[currentPosition++]) ==
+                                                       // if (((currentCharacter =
+                                                       // source[currentPosition++]) ==
                                                        // '\\')
                                                        // && (source[currentPosition] == 'u')) {
                                                        // //-------------unicode traitement ------------
@@ -2382,15 +2447,18 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                        // }
                                                        // loop until end of comment */
                                                        while ((currentCharacter != '/') || (!star)) {
-                                                               if (recordLineSeparator && ((currentCharacter == '\r') || (currentCharacter == '\n')))
+                                                               if (recordLineSeparator
+                                                                               && ((currentCharacter == '\r') || (currentCharacter == '\n')))
                                                                        pushLineSeparator();
                                                                star = currentCharacter == '*';
                                                                // get next char
                                                                currentCharacter = source[currentPosition++];
-                                                               // if (((currentCharacter = source[currentPosition++])
+                                                               // if (((currentCharacter =
+                                                               // source[currentPosition++])
                                                                // == '\\')
                                                                // && (source[currentPosition] == 'u')) {
-                                                               // //-------------unicode traitement ------------
+                                                               // //-------------unicode traitement
+                                                               // ------------
                                                                // int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
                                                                // currentPosition++;
                                                                // while (source[currentPosition] == 'u') {
@@ -2417,7 +2485,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                                // } //something different from * and /
                                                                // else {
                                                                // currentCharacter =
-                                                               // (char) (((c1 * 16 + c2) * 16 + c3) * 16 + c4);
+                                                               // (char) (((c1 * 16 + c2) * 16 + c3) * 16 +
+                                                               // c4);
                                                                // }
                                                                // }
                                                        }
@@ -2429,7 +2498,7 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                        break;
                                }
                                default:
-                                       if (isPHPIdentOrVarStart(currentCharacter) ) {
+                                       if (isPHPIdentOrVarStart(currentCharacter)) {
                                                try {
                                                        scanIdentifierOrKeyword((currentCharacter == '$'));
                                                } catch (InvalidInputException ex) {
@@ -2437,8 +2506,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                ;
                                                break;
                                        }
-                               if ( ObviousIdentCharNatures[currentCharacter]==C_DIGIT) {
-//                                     if (Character.isDigit(currentCharacter)) {
+                                       if (ObviousIdentCharNatures[currentCharacter] == C_DIGIT) {
+                                               // if (Character.isDigit(currentCharacter)) {
                                                try {
                                                        scanNumber(false);
                                                } catch (InvalidInputException ex) {
@@ -2502,7 +2571,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
        public final int[] getLineEnds() {
                // return a bounded copy of this.lineEnds
                int[] copy;
-               System.arraycopy(lineEnds, 0, copy = new int[linePtr + 1], 0, linePtr + 1);
+               System.arraycopy(lineEnds, 0, copy = new int[linePtr + 1], 0,
+                               linePtr + 1);
                return copy;
        }
 
@@ -2582,7 +2652,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                c1 = source[startPosition + 1];
                if (c0 == '$') {
                        // return always the same char[] build only once
-                       // optimization at no speed cost of 99.5 % of the singleCharIdentifier
+                       // optimization at no speed cost of 99.5 % of the
+                       // singleCharIdentifier
                        switch (c1) {
                        case 'a':
                                return charArray_va;
@@ -2667,13 +2738,15 @@ public class Scanner implements IScanner, ITerminalSymbols {
        final char[] optimizedCurrentTokenSource3() {
                // try to return the same char[] build only once
                char c0, c1, c2;
-               int hash = (((c0 = source[startPosition]) << 12) + ((c1 = source[startPosition + 1]) << 6) + (c2 = source[startPosition + 2]))
+               int hash = (((c0 = source[startPosition]) << 12)
+                               + ((c1 = source[startPosition + 1]) << 6) + (c2 = source[startPosition + 2]))
                                % TableSize;
                char[][] table = charArray_length[1][hash];
                int i = newEntry3;
                while (++i < InternalTableSize) {
                        char[] charArray = table[i];
-                       if ((c0 == charArray[0]) && (c1 == charArray[1]) && (c2 == charArray[2]))
+                       if ((c0 == charArray[0]) && (c1 == charArray[1])
+                                       && (c2 == charArray[2]))
                                return charArray;
                }
                // ---------other side---------
@@ -2681,7 +2754,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                int max = newEntry3;
                while (++i <= max) {
                        char[] charArray = table[i];
-                       if ((c0 == charArray[0]) && (c1 == charArray[1]) && (c2 == charArray[2]))
+                       if ((c0 == charArray[0]) && (c1 == charArray[1])
+                                       && (c2 == charArray[2]))
                                return charArray;
                }
                // --------add the entry-------
@@ -2696,14 +2770,16 @@ public class Scanner implements IScanner, ITerminalSymbols {
        final char[] optimizedCurrentTokenSource4() {
                // try to return the same char[] build only once
                char c0, c1, c2, c3;
-               long hash = ((((long) (c0 = source[startPosition])) << 18) + ((c1 = source[startPosition + 1]) << 12)
+               long hash = ((((long) (c0 = source[startPosition])) << 18)
+                               + ((c1 = source[startPosition + 1]) << 12)
                                + ((c2 = source[startPosition + 2]) << 6) + (c3 = source[startPosition + 3]))
                                % TableSize;
                char[][] table = charArray_length[2][(int) hash];
                int i = newEntry4;
                while (++i < InternalTableSize) {
                        char[] charArray = table[i];
-                       if ((c0 == charArray[0]) && (c1 == charArray[1]) && (c2 == charArray[2]) && (c3 == charArray[3]))
+                       if ((c0 == charArray[0]) && (c1 == charArray[1])
+                                       && (c2 == charArray[2]) && (c3 == charArray[3]))
                                return charArray;
                }
                // ---------other side---------
@@ -2711,7 +2787,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                int max = newEntry4;
                while (++i <= max) {
                        char[] charArray = table[i];
-                       if ((c0 == charArray[0]) && (c1 == charArray[1]) && (c2 == charArray[2]) && (c3 == charArray[3]))
+                       if ((c0 == charArray[0]) && (c1 == charArray[1])
+                                       && (c2 == charArray[2]) && (c3 == charArray[3]))
                                return charArray;
                }
                // --------add the entry-------
@@ -2726,14 +2803,18 @@ public class Scanner implements IScanner, ITerminalSymbols {
        final char[] optimizedCurrentTokenSource5() {
                // try to return the same char[] build only once
                char c0, c1, c2, c3, c4;
-               long hash = ((((long) (c0 = source[startPosition])) << 24) + (((long) (c1 = source[startPosition + 1])) << 18)
-                               + ((c2 = source[startPosition + 2]) << 12) + ((c3 = source[startPosition + 3]) << 6) + (c4 = source[startPosition + 4]))
+               long hash = ((((long) (c0 = source[startPosition])) << 24)
+                               + (((long) (c1 = source[startPosition + 1])) << 18)
+                               + ((c2 = source[startPosition + 2]) << 12)
+                               + ((c3 = source[startPosition + 3]) << 6) + (c4 = source[startPosition + 4]))
                                % TableSize;
                char[][] table = charArray_length[3][(int) hash];
                int i = newEntry5;
                while (++i < InternalTableSize) {
                        char[] charArray = table[i];
-                       if ((c0 == charArray[0]) && (c1 == charArray[1]) && (c2 == charArray[2]) && (c3 == charArray[3]) && (c4 == charArray[4]))
+                       if ((c0 == charArray[0]) && (c1 == charArray[1])
+                                       && (c2 == charArray[2]) && (c3 == charArray[3])
+                                       && (c4 == charArray[4]))
                                return charArray;
                }
                // ---------other side---------
@@ -2741,7 +2822,9 @@ public class Scanner implements IScanner, ITerminalSymbols {
                int max = newEntry5;
                while (++i <= max) {
                        char[] charArray = table[i];
-                       if ((c0 == charArray[0]) && (c1 == charArray[1]) && (c2 == charArray[2]) && (c3 == charArray[3]) && (c4 == charArray[4]))
+                       if ((c0 == charArray[0]) && (c1 == charArray[1])
+                                       && (c2 == charArray[2]) && (c3 == charArray[3])
+                                       && (c4 == charArray[4]))
                                return charArray;
                }
                // --------add the entry-------
@@ -2756,16 +2839,19 @@ public class Scanner implements IScanner, ITerminalSymbols {
        final char[] optimizedCurrentTokenSource6() {
                // try to return the same char[] build only once
                char c0, c1, c2, c3, c4, c5;
-               long hash = ((((long) (c0 = source[startPosition])) << 32) + (((long) (c1 = source[startPosition + 1])) << 24)
-                               + (((long) (c2 = source[startPosition + 2])) << 18) + ((c3 = source[startPosition + 3]) << 12)
+               long hash = ((((long) (c0 = source[startPosition])) << 32)
+                               + (((long) (c1 = source[startPosition + 1])) << 24)
+                               + (((long) (c2 = source[startPosition + 2])) << 18)
+                               + ((c3 = source[startPosition + 3]) << 12)
                                + ((c4 = source[startPosition + 4]) << 6) + (c5 = source[startPosition + 5]))
                                % TableSize;
                char[][] table = charArray_length[4][(int) hash];
                int i = newEntry6;
                while (++i < InternalTableSize) {
                        char[] charArray = table[i];
-                       if ((c0 == charArray[0]) && (c1 == charArray[1]) && (c2 == charArray[2]) && (c3 == charArray[3]) && (c4 == charArray[4])
-                                       && (c5 == charArray[5]))
+                       if ((c0 == charArray[0]) && (c1 == charArray[1])
+                                       && (c2 == charArray[2]) && (c3 == charArray[3])
+                                       && (c4 == charArray[4]) && (c5 == charArray[5]))
                                return charArray;
                }
                // ---------other side---------
@@ -2773,8 +2859,9 @@ public class Scanner implements IScanner, ITerminalSymbols {
                int max = newEntry6;
                while (++i <= max) {
                        char[] charArray = table[i];
-                       if ((c0 == charArray[0]) && (c1 == charArray[1]) && (c2 == charArray[2]) && (c3 == charArray[3]) && (c4 == charArray[4])
-                                       && (c5 == charArray[5]))
+                       if ((c0 == charArray[0]) && (c1 == charArray[1])
+                                       && (c2 == charArray[2]) && (c3 == charArray[3])
+                                       && (c4 == charArray[4]) && (c5 == charArray[5]))
                                return charArray;
                }
                // --------add the entry-------
@@ -2852,7 +2939,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
        }
 
        public final void pushUnicodeLineSeparator() {
-               // isUnicode means that the \r or \n has been read as a unicode character
+               // isUnicode means that the \r or \n has been read as a unicode
+               // character
                // see comment on isLineDelimiter(char) for the use of '\n' and '\r'
                final int INCREMENT = 250;
                // currentCharacter is at position currentPosition-1
@@ -2928,9 +3016,11 @@ public class Scanner implements IScanner, ITerminalSymbols {
                // a new comment is recorded
                int length = this.commentStops.length;
                if (++this.commentPtr >= length) {
-                       System.arraycopy(this.commentStops, 0, this.commentStops = new int[length + 30], 0, length);
+                       System.arraycopy(this.commentStops, 0,
+                                       this.commentStops = new int[length + 30], 0, length);
                        // grows the positions buffers too
-                       System.arraycopy(this.commentStarts, 0, this.commentStarts = new int[length + 30], 0, length);
+                       System.arraycopy(this.commentStarts, 0,
+                                       this.commentStarts = new int[length + 30], 0, length);
                }
                this.commentStops[this.commentPtr] = stopPosition;
                this.commentStarts[this.commentPtr] = this.startPosition;
@@ -2947,7 +3037,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
        // int[] oldStack = commentStops;
        // commentStops = new int[oldStackLength + 30];
        // System.arraycopy(oldStack, 0, commentStops, 0, oldStackLength);
-       // commentStops[commentPtr] = isJavadoc ? currentPosition : -currentPosition;
+       // commentStops[commentPtr] = isJavadoc ? currentPosition :
+       // -currentPosition;
        // //grows the positions buffers too
        // int[] old = commentStarts;
        // commentStarts = new int[oldStackLength + 30];
@@ -2964,7 +3055,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                commentPtr = -1; // reset comment stack
        }
 
-       public final void scanSingleQuotedEscapeCharacter() throws InvalidInputException {
+       public final void scanSingleQuotedEscapeCharacter()
+                       throws InvalidInputException {
                // the string with "\\u" is a legal string of two chars \ and u
                // thus we use a direct access to the source (for regular cases).
                // if (unicodeAsBackSlash) {
@@ -2993,7 +3085,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                }
        }
 
-       public final void scanDoubleQuotedEscapeCharacter() throws InvalidInputException {
+       public final void scanDoubleQuotedEscapeCharacter()
+                       throws InvalidInputException {
                currentCharacter = source[currentPosition++];
                switch (currentCharacter) {
                // case 'b' :
@@ -3031,29 +3124,37 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        int number = Character.getNumericValue(currentCharacter);
                        if (number >= 0 && number <= 7) {
                                boolean zeroToThreeNot = number > 3;
-                               if (Character.isDigit(currentCharacter = source[currentPosition++])) {
+                               if (Character
+                                               .isDigit(currentCharacter = source[currentPosition++])) {
                                        int digit = Character.getNumericValue(currentCharacter);
                                        if (digit >= 0 && digit <= 7) {
                                                number = (number * 8) + digit;
-                                               if (Character.isDigit(currentCharacter = source[currentPosition++])) {
-                                                       if (zeroToThreeNot) { // has read \NotZeroToThree OctalDigit
+                                               if (Character
+                                                               .isDigit(currentCharacter = source[currentPosition++])) {
+                                                       if (zeroToThreeNot) { // has read \NotZeroToThree
+                                                                                                       // OctalDigit
                                                                // Digit --> ignore last character
                                                                currentPosition--;
                                                        } else {
-                                                               digit = Character.getNumericValue(currentCharacter);
+                                                               digit = Character
+                                                                               .getNumericValue(currentCharacter);
                                                                if (digit >= 0 && digit <= 7) {
-                                                                       // has read \ZeroToThree OctalDigit OctalDigit
+                                                                       // has read \ZeroToThree OctalDigit
+                                                                       // OctalDigit
                                                                        number = (number * 8) + digit;
-                                                               } else { // has read \ZeroToThree OctalDigit NonOctalDigit
+                                                               } else { // has read \ZeroToThree OctalDigit
+                                                                                       // NonOctalDigit
                                                                        // --> ignore last character
                                                                        currentPosition--;
                                                                }
                                                        }
-                                               } else { // has read \OctalDigit NonDigit--> ignore last
+                                               } else { // has read \OctalDigit NonDigit--> ignore
+                                                                       // last
                                                        // character
                                                        currentPosition--;
                                                }
-                                       } else { // has read \OctalDigit NonOctalDigit--> ignore last
+                                       } else { // has read \OctalDigit NonOctalDigit--> ignore
+                                                               // last
                                                // character
                                                currentPosition--;
                                        }
@@ -3064,15 +3165,16 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                        throw new InvalidInputException(INVALID_ESCAPE);
                                currentCharacter = (char) number;
                        }
-               // else
-               // throw new InvalidInputException(INVALID_ESCAPE);
+                       // else
+                       // throw new InvalidInputException(INVALID_ESCAPE);
                }
        }
 
        // public int scanIdentifierOrKeyword() throws InvalidInputException {
        // return scanIdentifierOrKeyword( false );
        // }
-       public int scanIdentifierOrKeyword(boolean isVariable) throws InvalidInputException {
+       public int scanIdentifierOrKeyword(boolean isVariable)
+                       throws InvalidInputException {
                // test keywords
                // first dispatch on the first char.
                // then the length. If there are several
@@ -3092,7 +3194,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                char[] data;
                char firstLetter;
                // if (withoutUnicodePtr == 0)
-               // quick test on length == 1 but not on length > 12 while most identifier
+               // quick test on length == 1 but not on length > 12 while most
+               // identifier
                // have a length which is <= 12...but there are lots of identifier with
                // only one char....
                // {
@@ -3121,32 +3224,43 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        switch (length) {
                        case 8:
                                // __FILE__
-                               if ((data[++index] == '_') && (data[++index] == 'f') && (data[++index] == 'i') && (data[++index] == 'l')
-                                               && (data[++index] == 'e') && (data[++index] == '_') && (data[++index] == '_'))
+                               if ((data[++index] == '_') && (data[++index] == 'f')
+                                               && (data[++index] == 'i') && (data[++index] == 'l')
+                                               && (data[++index] == 'e') && (data[++index] == '_')
+                                               && (data[++index] == '_'))
                                        return TokenNameFILE;
                                index = 0; // __LINE__
-                               if ((data[++index] == '_') && (data[++index] == 'l') && (data[++index] == 'i') && (data[++index] == 'n')
-                                               && (data[++index] == 'e') && (data[++index] == '_') && (data[++index] == '_'))
+                               if ((data[++index] == '_') && (data[++index] == 'l')
+                                               && (data[++index] == 'i') && (data[++index] == 'n')
+                                               && (data[++index] == 'e') && (data[++index] == '_')
+                                               && (data[++index] == '_'))
                                        return TokenNameLINE;
                                break;
                        case 9:
                                // __CLASS__
-                               if ((data[++index] == '_') && (data[++index] == 'c') && (data[++index] == 'l') && (data[++index] == 'a')
-                                               && (data[++index] == 's') && (data[++index] == 's') && (data[++index] == '_') && (data[++index] == '_'))
+                               if ((data[++index] == '_') && (data[++index] == 'c')
+                                               && (data[++index] == 'l') && (data[++index] == 'a')
+                                               && (data[++index] == 's') && (data[++index] == 's')
+                                               && (data[++index] == '_') && (data[++index] == '_'))
                                        return TokenNameCLASS_C;
                                break;
                        case 11:
                                // __METHOD__
-                               if ((data[++index] == '_') && (data[++index] == 'm') && (data[++index] == 'e') && (data[++index] == 't')
-                                               && (data[++index] == 'h') && (data[++index] == 'o') && (data[++index] == 'd') && (data[++index] == '_')
+                               if ((data[++index] == '_') && (data[++index] == 'm')
+                                               && (data[++index] == 'e') && (data[++index] == 't')
+                                               && (data[++index] == 'h') && (data[++index] == 'o')
+                                               && (data[++index] == 'd') && (data[++index] == '_')
                                                && (data[++index] == '_'))
                                        return TokenNameMETHOD_C;
                                break;
                        case 12:
                                // __FUNCTION__
-                               if ((data[++index] == '_') && (data[++index] == 'f') && (data[++index] == 'u') && (data[++index] == 'n')
-                                               && (data[++index] == 'c') && (data[++index] == 't') && (data[++index] == 'i') && (data[++index] == 'o')
-                                               && (data[++index] == 'n') && (data[++index] == '_') && (data[++index] == '_'))
+                               if ((data[++index] == '_') && (data[++index] == 'f')
+                                               && (data[++index] == 'u') && (data[++index] == 'n')
+                                               && (data[++index] == 'c') && (data[++index] == 't')
+                                               && (data[++index] == 'i') && (data[++index] == 'o')
+                                               && (data[++index] == 'n') && (data[++index] == '_')
+                                               && (data[++index] == '_'))
                                        return TokenNameFUNC_C;
                                break;
                        }
@@ -3158,73 +3272,73 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                // as
                                if ((data[++index] == 's')) {
                                        return TokenNameas;
-                               } else {
-                                       return TokenNameIdentifier;
                                }
+                               return TokenNameIdentifier;
                        case 3:
                                // and
                                if ((data[++index] == 'n') && (data[++index] == 'd')) {
                                        return TokenNameand;
-                               } else {
-                                       return TokenNameIdentifier;
                                }
+                               return TokenNameIdentifier;
                        case 5:
                                // array
-                               if ((data[++index] == 'r') && (data[++index] == 'r') && (data[++index] == 'a') && (data[++index] == 'y'))
+                               if ((data[++index] == 'r') && (data[++index] == 'r')
+                                               && (data[++index] == 'a') && (data[++index] == 'y'))
                                        return TokenNamearray;
-                               else
-                                       return TokenNameIdentifier;
+                               return TokenNameIdentifier;
                        case 8:
-                               if ((data[++index] == 'b') && (data[++index] == 's') && (data[++index] == 't') && (data[++index] == 'r')
-                                               && (data[++index] == 'a') && (data[++index] == 'c') && (data[++index] == 't'))
+                               if ((data[++index] == 'b') && (data[++index] == 's')
+                                               && (data[++index] == 't') && (data[++index] == 'r')
+                                               && (data[++index] == 'a') && (data[++index] == 'c')
+                                               && (data[++index] == 't'))
                                        return TokenNameabstract;
-                               else
-                                       return TokenNameIdentifier;
-                       default:
                                return TokenNameIdentifier;
                        }
+                       return TokenNameIdentifier;
                case 'b':
                        // break
                        switch (length) {
                        case 5:
-                               if ((data[++index] == 'r') && (data[++index] == 'e') && (data[++index] == 'a') && (data[++index] == 'k'))
+                               if ((data[++index] == 'r') && (data[++index] == 'e')
+                                               && (data[++index] == 'a') && (data[++index] == 'k'))
                                        return TokenNamebreak;
-                               else
-                                       return TokenNameIdentifier;
-                       default:
                                return TokenNameIdentifier;
                        }
+                       return TokenNameIdentifier;
                case 'c':
                        // case catch class clone const continue
                        switch (length) {
                        case 4:
-                               if ((data[++index] == 'a') && (data[++index] == 's') && (data[++index] == 'e'))
+                               if ((data[++index] == 'a') && (data[++index] == 's')
+                                               && (data[++index] == 'e'))
                                        return TokenNamecase;
-                               else
-                                       return TokenNameIdentifier;
+                               return TokenNameIdentifier;
                        case 5:
-                               if ((data[++index] == 'a') && (data[++index] == 't') && (data[++index] == 'c') && (data[++index] == 'h'))
+                               if ((data[++index] == 'a') && (data[++index] == 't')
+                                               && (data[++index] == 'c') && (data[++index] == 'h'))
                                        return TokenNamecatch;
                                index = 0;
-                               if ((data[++index] == 'l') && (data[++index] == 'a') && (data[++index] == 's') && (data[++index] == 's'))
+                               if ((data[++index] == 'l') && (data[++index] == 'a')
+                                               && (data[++index] == 's') && (data[++index] == 's'))
                                        return TokenNameclass;
                                index = 0;
-                               if ((data[++index] == 'l') && (data[++index] == 'o') && (data[++index] == 'n') && (data[++index] == 'e'))
+                               if ((data[++index] == 'l') && (data[++index] == 'o')
+                                               && (data[++index] == 'n') && (data[++index] == 'e'))
                                        return TokenNameclone;
                                index = 0;
-                               if ((data[++index] == 'o') && (data[++index] == 'n') && (data[++index] == 's') && (data[++index] == 't'))
+                               if ((data[++index] == 'o') && (data[++index] == 'n')
+                                               && (data[++index] == 's') && (data[++index] == 't'))
                                        return TokenNameconst;
-                               else
-                                       return TokenNameIdentifier;
+                               return TokenNameIdentifier;
                        case 8:
-                               if ((data[++index] == 'o') && (data[++index] == 'n') && (data[++index] == 't') && (data[++index] == 'i')
-                                               && (data[++index] == 'n') && (data[++index] == 'u') && (data[++index] == 'e'))
+                               if ((data[++index] == 'o') && (data[++index] == 'n')
+                                               && (data[++index] == 't') && (data[++index] == 'i')
+                                               && (data[++index] == 'n') && (data[++index] == 'u')
+                                               && (data[++index] == 'e'))
                                        return TokenNamecontinue;
-                               else
-                                       return TokenNameIdentifier;
-                       default:
                                return TokenNameIdentifier;
                        }
+                       return TokenNameIdentifier;
                case 'd':
                        // declare default do die
                        // TODO delete define ==> no keyword !
@@ -3232,135 +3346,146 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        case 2:
                                if ((data[++index] == 'o'))
                                        return TokenNamedo;
-                               else
-                                       return TokenNameIdentifier;
-                       // case 6 :
-                       // if ((data[++index] == 'e')
-                       // && (data[++index] == 'f')
-                       // && (data[++index] == 'i')
-                       // && (data[++index] == 'n')
-                       // && (data[++index] == 'e'))
-                       // return TokenNamedefine;
-                       // else
-                       // return TokenNameIdentifier;
+                               return TokenNameIdentifier;
+                               // case 6 :
+                               // if ((data[++index] == 'e')
+                               // && (data[++index] == 'f')
+                               // && (data[++index] == 'i')
+                               // && (data[++index] == 'n')
+                               // && (data[++index] == 'e'))
+                               // return TokenNamedefine;
+                               // else
+                               // return TokenNameIdentifier;
                        case 7:
-                               if ((data[++index] == 'e') && (data[++index] == 'c') && (data[++index] == 'l') && (data[++index] == 'a')
+                               if ((data[++index] == 'e') && (data[++index] == 'c')
+                                               && (data[++index] == 'l') && (data[++index] == 'a')
                                                && (data[++index] == 'r') && (data[++index] == 'e'))
                                        return TokenNamedeclare;
                                index = 0;
-                               if ((data[++index] == 'e') && (data[++index] == 'f') && (data[++index] == 'a') && (data[++index] == 'u')
+                               if ((data[++index] == 'e') && (data[++index] == 'f')
+                                               && (data[++index] == 'a') && (data[++index] == 'u')
                                                && (data[++index] == 'l') && (data[++index] == 't'))
                                        return TokenNamedefault;
-                               else
-                                       return TokenNameIdentifier;
-                       default:
                                return TokenNameIdentifier;
                        }
+                       return TokenNameIdentifier;
                case 'e':
                        // echo else exit elseif extends eval
                        switch (length) {
                        case 4:
-                               if ((data[++index] == 'c') && (data[++index] == 'h') && (data[++index] == 'o'))
+                               if ((data[++index] == 'c') && (data[++index] == 'h')
+                                               && (data[++index] == 'o'))
                                        return TokenNameecho;
-                               else if ((data[index] == 'l') && (data[++index] == 's') && (data[++index] == 'e'))
+                               else if ((data[index] == 'l') && (data[++index] == 's')
+                                               && (data[++index] == 'e'))
                                        return TokenNameelse;
-                               else if ((data[index] == 'x') && (data[++index] == 'i') && (data[++index] == 't'))
+                               else if ((data[index] == 'x') && (data[++index] == 'i')
+                                               && (data[++index] == 't'))
                                        return TokenNameexit;
-                               else if ((data[index] == 'v') && (data[++index] == 'a') && (data[++index] == 'l'))
+                               else if ((data[index] == 'v') && (data[++index] == 'a')
+                                               && (data[++index] == 'l'))
                                        return TokenNameeval;
-                               else
-                                       return TokenNameIdentifier;
+                               return TokenNameIdentifier;
                        case 5:
                                // endif empty
-                               if ((data[++index] == 'n') && (data[++index] == 'd') && (data[++index] == 'i') && (data[++index] == 'f'))
+                               if ((data[++index] == 'n') && (data[++index] == 'd')
+                                               && (data[++index] == 'i') && (data[++index] == 'f'))
                                        return TokenNameendif;
-                               if ((data[index] == 'm') && (data[++index] == 'p') && (data[++index] == 't') && (data[++index] == 'y'))
+                               if ((data[index] == 'm') && (data[++index] == 'p')
+                                               && (data[++index] == 't') && (data[++index] == 'y'))
                                        return TokenNameempty;
-                               else
-                                       return TokenNameIdentifier;
+                               return TokenNameIdentifier;
                        case 6:
                                // endfor
-                               if ((data[++index] == 'n') && (data[++index] == 'd') && (data[++index] == 'f') && (data[++index] == 'o')
+                               if ((data[++index] == 'n') && (data[++index] == 'd')
+                                               && (data[++index] == 'f') && (data[++index] == 'o')
                                                && (data[++index] == 'r'))
                                        return TokenNameendfor;
-                               else if ((data[index] == 'l') && (data[++index] == 's') && (data[++index] == 'e') && (data[++index] == 'i')
+                               else if ((data[index] == 'l') && (data[++index] == 's')
+                                               && (data[++index] == 'e') && (data[++index] == 'i')
                                                && (data[++index] == 'f'))
                                        return TokenNameelseif;
-                               else
-                                       return TokenNameIdentifier;
+                               return TokenNameIdentifier;
                        case 7:
-                               if ((data[++index] == 'x') && (data[++index] == 't') && (data[++index] == 'e') && (data[++index] == 'n')
+                               if ((data[++index] == 'x') && (data[++index] == 't')
+                                               && (data[++index] == 'e') && (data[++index] == 'n')
                                                && (data[++index] == 'd') && (data[++index] == 's'))
                                        return TokenNameextends;
-                               else
-                                       return TokenNameIdentifier;
+                               return TokenNameIdentifier;
                        case 8:
                                // endwhile
-                               if ((data[++index] == 'n') && (data[++index] == 'd') && (data[++index] == 'w') && (data[++index] == 'h')
-                                               && (data[++index] == 'i') && (data[++index] == 'l') && (data[++index] == 'e'))
+                               if ((data[++index] == 'n') && (data[++index] == 'd')
+                                               && (data[++index] == 'w') && (data[++index] == 'h')
+                                               && (data[++index] == 'i') && (data[++index] == 'l')
+                                               && (data[++index] == 'e'))
                                        return TokenNameendwhile;
-                               else
-                                       return TokenNameIdentifier;
+                               return TokenNameIdentifier;
                        case 9:
                                // endswitch
-                               if ((data[++index] == 'n') && (data[++index] == 'd') && (data[++index] == 's') && (data[++index] == 'w')
-                                               && (data[++index] == 'i') && (data[++index] == 't') && (data[++index] == 'c') && (data[++index] == 'h'))
+                               if ((data[++index] == 'n') && (data[++index] == 'd')
+                                               && (data[++index] == 's') && (data[++index] == 'w')
+                                               && (data[++index] == 'i') && (data[++index] == 't')
+                                               && (data[++index] == 'c') && (data[++index] == 'h'))
                                        return TokenNameendswitch;
-                               else
-                                       return TokenNameIdentifier;
+                               return TokenNameIdentifier;
                        case 10:
                                // enddeclare
-                               if ((data[++index] == 'n') && (data[++index] == 'd') && (data[++index] == 'd') && (data[++index] == 'e')
-                                               && (data[++index] == 'c') && (data[++index] == 'l') && (data[++index] == 'a') && (data[++index] == 'r')
+                               if ((data[++index] == 'n') && (data[++index] == 'd')
+                                               && (data[++index] == 'd') && (data[++index] == 'e')
+                                               && (data[++index] == 'c') && (data[++index] == 'l')
+                                               && (data[++index] == 'a') && (data[++index] == 'r')
                                                && (data[++index] == 'e'))
                                        return TokenNameenddeclare;
                                index = 0;
                                if ((data[++index] == 'n') // endforeach
-                                               && (data[++index] == 'd') && (data[++index] == 'f') && (data[++index] == 'o') && (data[++index] == 'r')
-                                               && (data[++index] == 'e') && (data[++index] == 'a') && (data[++index] == 'c') && (data[++index] == 'h'))
+                                               && (data[++index] == 'd')
+                                               && (data[++index] == 'f')
+                                               && (data[++index] == 'o')
+                                               && (data[++index] == 'r')
+                                               && (data[++index] == 'e')
+                                               && (data[++index] == 'a')
+                                               && (data[++index] == 'c') && (data[++index] == 'h'))
                                        return TokenNameendforeach;
-                               else
-                                       return TokenNameIdentifier;
-                       default:
                                return TokenNameIdentifier;
                        }
+                       return TokenNameIdentifier;
                case 'f':
                        // for false final function
                        switch (length) {
                        case 3:
                                if ((data[++index] == 'o') && (data[++index] == 'r'))
                                        return TokenNamefor;
-                               else
-                                       return TokenNameIdentifier;
+                               return TokenNameIdentifier;
                        case 5:
                                // if ((data[++index] == 'a') && (data[++index] == 'l')
                                // && (data[++index] == 's') && (data[++index] == 'e'))
                                // return TokenNamefalse;
-                               if ((data[++index] == 'i') && (data[++index] == 'n') && (data[++index] == 'a') && (data[++index] == 'l'))
+                               if ((data[++index] == 'i') && (data[++index] == 'n')
+                                               && (data[++index] == 'a') && (data[++index] == 'l'))
                                        return TokenNamefinal;
-                               else
-                                       return TokenNameIdentifier;
+                               return TokenNameIdentifier;
                        case 7:
                                // foreach
-                               if ((data[++index] == 'o') && (data[++index] == 'r') && (data[++index] == 'e') && (data[++index] == 'a')
+                               if ((data[++index] == 'o') && (data[++index] == 'r')
+                                               && (data[++index] == 'e') && (data[++index] == 'a')
                                                && (data[++index] == 'c') && (data[++index] == 'h'))
                                        return TokenNameforeach;
-                               else
-                                       return TokenNameIdentifier;
+                               return TokenNameIdentifier;
                        case 8:
                                // function
-                               if ((data[++index] == 'u') && (data[++index] == 'n') && (data[++index] == 'c') && (data[++index] == 't')
-                                               && (data[++index] == 'i') && (data[++index] == 'o') && (data[++index] == 'n'))
+                               if ((data[++index] == 'u') && (data[++index] == 'n')
+                                               && (data[++index] == 'c') && (data[++index] == 't')
+                                               && (data[++index] == 'i') && (data[++index] == 'o')
+                                               && (data[++index] == 'n'))
                                        return TokenNamefunction;
-                               else
-                                       return TokenNameIdentifier;
-                       default:
                                return TokenNameIdentifier;
                        }
+                       return TokenNameIdentifier;
                case 'g':
                        // global
                        if (length == 6) {
-                               if ((data[++index] == 'l') && (data[++index] == 'o') && (data[++index] == 'b') && (data[++index] == 'a')
+                               if ((data[++index] == 'l') && (data[++index] == 'o')
+                                               && (data[++index] == 'b') && (data[++index] == 'a')
                                                && (data[++index] == 'l')) {
                                        return TokenNameglobal;
                                }
@@ -3372,57 +3497,62 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        case 2:
                                if (data[++index] == 'f')
                                        return TokenNameif;
-                               else
-                                       return TokenNameIdentifier;
-                       // case 3 :
-                       // if ((data[++index] == 'n') && (data[++index] == 't'))
-                       // return TokenNameint;
-                       // else
-                       // return TokenNameIdentifier;
+                               return TokenNameIdentifier;
+                               // case 3 :
+                               // if ((data[++index] == 'n') && (data[++index] == 't'))
+                               // return TokenNameint;
+                               // else
+                               // return TokenNameIdentifier;
                        case 5:
-                               if ((data[++index] == 's') && (data[++index] == 's') && (data[++index] == 'e') && (data[++index] == 't'))
+                               if ((data[++index] == 's') && (data[++index] == 's')
+                                               && (data[++index] == 'e') && (data[++index] == 't'))
                                        return TokenNameisset;
-                               else
-                                       return TokenNameIdentifier;
+                               return TokenNameIdentifier;
                        case 7:
-                               if ((data[++index] == 'n') && (data[++index] == 'c') && (data[++index] == 'l') && (data[++index] == 'u')
+                               if ((data[++index] == 'n') && (data[++index] == 'c')
+                                               && (data[++index] == 'l') && (data[++index] == 'u')
                                                && (data[++index] == 'd') && (data[++index] == 'e'))
                                        return TokenNameinclude;
-                               else
-                                       return TokenNameIdentifier;
+                               return TokenNameIdentifier;
                        case 9:
                                // interface
-                               if ((data[++index] == 'n') && (data[++index] == 't') && (data[++index] == 'e') && (data[++index] == 'r')
-                                               && (data[++index] == 'f') && (data[++index] == 'a') && (data[++index] == 'c') && (data[++index] == 'e'))
+                               if ((data[++index] == 'n') && (data[++index] == 't')
+                                               && (data[++index] == 'e') && (data[++index] == 'r')
+                                               && (data[++index] == 'f') && (data[++index] == 'a')
+                                               && (data[++index] == 'c') && (data[++index] == 'e'))
                                        return TokenNameinterface;
-                               else
-                                       return TokenNameIdentifier;
+                               return TokenNameIdentifier;
                        case 10:
                                // instanceof
-                               if ((data[++index] == 'n') && (data[++index] == 's') && (data[++index] == 't') && (data[++index] == 'a')
-                                               && (data[++index] == 'n') && (data[++index] == 'c') && (data[++index] == 'e') && (data[++index] == 'o')
+                               if ((data[++index] == 'n') && (data[++index] == 's')
+                                               && (data[++index] == 't') && (data[++index] == 'a')
+                                               && (data[++index] == 'n') && (data[++index] == 'c')
+                                               && (data[++index] == 'e') && (data[++index] == 'o')
                                                && (data[++index] == 'f'))
                                        return TokenNameinstanceof;
-                               if ((data[index] == 'm') && (data[++index] == 'p') && (data[++index] == 'l') && (data[++index] == 'e')
-                                               && (data[++index] == 'm') && (data[++index] == 'e') && (data[++index] == 'n') && (data[++index] == 't')
+                               if ((data[index] == 'm') && (data[++index] == 'p')
+                                               && (data[++index] == 'l') && (data[++index] == 'e')
+                                               && (data[++index] == 'm') && (data[++index] == 'e')
+                                               && (data[++index] == 'n') && (data[++index] == 't')
                                                && (data[++index] == 's'))
                                        return TokenNameimplements;
-                               else
-                                       return TokenNameIdentifier;
+                               return TokenNameIdentifier;
                        case 12:
-                               if ((data[++index] == 'n') && (data[++index] == 'c') && (data[++index] == 'l') && (data[++index] == 'u')
-                                               && (data[++index] == 'd') && (data[++index] == 'e') && (data[++index] == '_') && (data[++index] == 'o')
-                                               && (data[++index] == 'n') && (data[++index] == 'c') && (data[++index] == 'e'))
+                               if ((data[++index] == 'n') && (data[++index] == 'c')
+                                               && (data[++index] == 'l') && (data[++index] == 'u')
+                                               && (data[++index] == 'd') && (data[++index] == 'e')
+                                               && (data[++index] == '_') && (data[++index] == 'o')
+                                               && (data[++index] == 'n') && (data[++index] == 'c')
+                                               && (data[++index] == 'e'))
                                        return TokenNameinclude_once;
-                               else
-                                       return TokenNameIdentifier;
-                       default:
                                return TokenNameIdentifier;
                        }
+                       return TokenNameIdentifier;
                case 'l':
                        // list
                        if (length == 4) {
-                               if ((data[++index] == 'i') && (data[++index] == 's') && (data[++index] == 't')) {
+                               if ((data[++index] == 'i') && (data[++index] == 's')
+                                               && (data[++index] == 't')) {
                                        return TokenNamelist;
                                }
                        }
@@ -3433,17 +3563,23 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        case 3:
                                if ((data[++index] == 'e') && (data[++index] == 'w'))
                                        return TokenNamenew;
-                               else
-                                       return TokenNameIdentifier;
-                       // case 4 :
-                       // if ((data[++index] == 'u') && (data[++index] == 'l')
-                       // && (data[++index] == 'l'))
-                       // return TokenNamenull;
-                       // else
-                       // return TokenNameIdentifier;
-                       default:
                                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 TokenNamenull;
+                               // else
+                               // return TokenNameIdentifier;
                        }
+                       return TokenNameIdentifier;
                case 'o':
                        // or old_function
                        if (length == 2) {
@@ -3471,89 +3607,101 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        // print public private protected
                        switch (length) {
                        case 5:
-                               if ((data[++index] == 'r') && (data[++index] == 'i') && (data[++index] == 'n') && (data[++index] == 't')) {
+                               if ((data[++index] == 'r') && (data[++index] == 'i')
+                                               && (data[++index] == 'n') && (data[++index] == 't')) {
                                        return TokenNameprint;
-                               } else
-                                       return TokenNameIdentifier;
+                               }
+                               return TokenNameIdentifier;
                        case 6:
-                               if ((data[++index] == 'u') && (data[++index] == 'b') && (data[++index] == 'l') && (data[++index] == 'i')
+                               if ((data[++index] == 'u') && (data[++index] == 'b')
+                                               && (data[++index] == 'l') && (data[++index] == 'i')
                                                && (data[++index] == 'c')) {
                                        return TokenNamepublic;
-                               } else
-                                       return TokenNameIdentifier;
+                               }
+                               return TokenNameIdentifier;
                        case 7:
-                               if ((data[++index] == 'r') && (data[++index] == 'i') && (data[++index] == 'v') && (data[++index] == 'a')
+                               if ((data[++index] == 'r') && (data[++index] == 'i')
+                                               && (data[++index] == 'v') && (data[++index] == 'a')
                                                && (data[++index] == 't') && (data[++index] == 'e')) {
                                        return TokenNameprivate;
-                               } else
-                                       return TokenNameIdentifier;
+                               }
+                               return TokenNameIdentifier;
                        case 9:
-                               if ((data[++index] == 'r') && (data[++index] == 'o') && (data[++index] == 't') && (data[++index] == 'e')
-                                               && (data[++index] == 'c') && (data[++index] == 't') && (data[++index] == 'e') && (data[++index] == 'd')) {
+                               if ((data[++index] == 'r') && (data[++index] == 'o')
+                                               && (data[++index] == 't') && (data[++index] == 'e')
+                                               && (data[++index] == 'c') && (data[++index] == 't')
+                                               && (data[++index] == 'e') && (data[++index] == 'd')) {
                                        return TokenNameprotected;
-                               } else
-                                       return TokenNameIdentifier;
+                               }
+                               return TokenNameIdentifier;
                        }
                        return TokenNameIdentifier;
                case 'r':
                        // return require require_once
                        if (length == 6) {
-                               if ((data[++index] == 'e') && (data[++index] == 't') && (data[++index] == 'u') && (data[++index] == 'r')
+                               if ((data[++index] == 'e') && (data[++index] == 't')
+                                               && (data[++index] == 'u') && (data[++index] == 'r')
                                                && (data[++index] == 'n')) {
                                        return TokenNamereturn;
                                }
                        } else if (length == 7) {
-                               if ((data[++index] == 'e') && (data[++index] == 'q') && (data[++index] == 'u') && (data[++index] == 'i')
+                               if ((data[++index] == 'e') && (data[++index] == 'q')
+                                               && (data[++index] == 'u') && (data[++index] == 'i')
                                                && (data[++index] == 'r') && (data[++index] == 'e')) {
                                        return TokenNamerequire;
                                }
                        } else if (length == 12) {
-                               if ((data[++index] == 'e') && (data[++index] == 'q') && (data[++index] == 'u') && (data[++index] == 'i')
-                                               && (data[++index] == 'r') && (data[++index] == 'e') && (data[++index] == '_') && (data[++index] == 'o')
-                                               && (data[++index] == 'n') && (data[++index] == 'c') && (data[++index] == 'e')) {
+                               if ((data[++index] == 'e') && (data[++index] == 'q')
+                                               && (data[++index] == 'u') && (data[++index] == 'i')
+                                               && (data[++index] == 'r') && (data[++index] == 'e')
+                                               && (data[++index] == '_') && (data[++index] == 'o')
+                                               && (data[++index] == 'n') && (data[++index] == 'c')
+                                               && (data[++index] == 'e')) {
                                        return TokenNamerequire_once;
                                }
-                       } else
-                               return TokenNameIdentifier;
+                       }
+                       return TokenNameIdentifier;
                case 's':
-                       // static switch
+                       // self static switch
                        switch (length) {
+                       // case 4:
+                       // if ((data[++index] == 'e') && (data[++index] == 'l') &&
+                       // (data[++index]
+                       // == 'f')) {
+                       // return TokenNameself;
+                       // }
+                       // return TokenNameIdentifier;
                        case 6:
                                if (data[++index] == 't')
-                                       if ((data[++index] == 'a') && (data[++index] == 't') && (data[++index] == 'i') && (data[++index] == 'c')) {
+                                       if ((data[++index] == 'a') && (data[++index] == 't')
+                                                       && (data[++index] == 'i') && (data[++index] == 'c')) {
                                                return TokenNamestatic;
                                        } else
                                                return TokenNameIdentifier;
-                               else if ((data[index] == 'w') && (data[++index] == 'i') && (data[++index] == 't') && (data[++index] == 'c')
+                               else if ((data[index] == 'w') && (data[++index] == 'i')
+                                               && (data[++index] == 't') && (data[++index] == 'c')
                                                && (data[++index] == 'h'))
                                        return TokenNameswitch;
-                               else
-                                       return TokenNameIdentifier;
-                       default:
-                               return TokenNameIdentifier;
                        }
+                       return TokenNameIdentifier;
                case 't':
                        // try true throw
                        switch (length) {
                        case 3:
                                if ((data[++index] == 'r') && (data[++index] == 'y'))
                                        return TokenNametry;
-                               else
-                                       return TokenNameIdentifier;
-                       // case 4 :
-                       // if ((data[++index] == 'r') && (data[++index] == 'u')
-                       // && (data[++index] == 'e'))
-                       // return TokenNametrue;
-                       // else
-                       // return TokenNameIdentifier;
+                               // case 4 :
+                               // if ((data[++index] == 'r') && (data[++index] == 'u')
+                               // && (data[++index] == 'e'))
+                               // return TokenNametrue;
+                                else
+                                        return TokenNameIdentifier;
                        case 5:
-                               if ((data[++index] == 'h') && (data[++index] == 'r') && (data[++index] == 'o') && (data[++index] == 'w'))
+                               if ((data[++index] == 'h') && (data[++index] == 'r')
+                                               && (data[++index] == 'o') && (data[++index] == 'w'))
                                        return TokenNamethrow;
-                               else
-                                       return TokenNameIdentifier;
-                       default:
-                               return TokenNameIdentifier;
                        }
+                       return TokenNameIdentifier;
                case 'u':
                        // use unset
                        switch (length) {
@@ -3563,41 +3711,34 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                else
                                        return TokenNameIdentifier;
                        case 5:
-                               if ((data[++index] == 'n') && (data[++index] == 's') && (data[++index] == 'e') && (data[++index] == 't'))
+                               if ((data[++index] == 'n') && (data[++index] == 's')
+                                               && (data[++index] == 'e') && (data[++index] == 't'))
                                        return TokenNameunset;
-                               else
-                                       return TokenNameIdentifier;
-                       default:
-                               return TokenNameIdentifier;
                        }
+                       return TokenNameIdentifier;
                case 'v':
                        // var
                        switch (length) {
                        case 3:
                                if ((data[++index] == 'a') && (data[++index] == 'r'))
                                        return TokenNamevar;
-                               else
-                                       return TokenNameIdentifier;
-                       default:
-                               return TokenNameIdentifier;
                        }
+                       return TokenNameIdentifier;
                case 'w':
                        // while
                        switch (length) {
                        case 5:
-                               if ((data[++index] == 'h') && (data[++index] == 'i') && (data[++index] == 'l') && (data[++index] == 'e'))
+                               if ((data[++index] == 'h') && (data[++index] == 'i')
+                                               && (data[++index] == 'l') && (data[++index] == 'e'))
                                        return TokenNamewhile;
-                               else
-                                       return TokenNameIdentifier;
-                       // case 6:if ( (data[++index] =='i') && (data[++index]=='d') &&
-                       // (data[++index]=='e') && (data[++index]=='f')&&
-                       // (data[++index]=='p'))
-                       // return TokenNamewidefp ;
-                       // else
-                       // return TokenNameIdentifier;
-                       default:
-                               return TokenNameIdentifier;
+                               // case 6:if ( (data[++index] =='i') && (data[++index]=='d') &&
+                               // (data[++index]=='e') && (data[++index]=='f')&&
+                               // (data[++index]=='p'))
+                               // return TokenNamewidefp ;
+                               // else
+                               // return TokenNameIdentifier;
                        }
+                       return TokenNameIdentifier;
                case 'x':
                        // xor
                        switch (length) {
@@ -3606,12 +3747,10 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                        return TokenNamexor;
                                else
                                        return TokenNameIdentifier;
-                       default:
-                               return TokenNameIdentifier;
                        }
-               default:
                        return TokenNameIdentifier;
                }
+               return TokenNameIdentifier;
        }
 
        public int scanNumber(boolean dotPrefix) throws InvalidInputException {
@@ -3670,19 +3809,23 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                        // consume next character
                                                        unicodeAsBackSlash = false;
                                                        currentCharacter = source[currentPosition++];
-                                                       // if (((currentCharacter = source[currentPosition++]) == '\\')
+                                                       // if (((currentCharacter =
+                                                       // source[currentPosition++]) == '\\')
                                                        // && (source[currentPosition] == 'u')) {
                                                        // getNextUnicodeChar();
                                                        // } else {
                                                        // if (withoutUnicodePtr != 0) {
-                                                       // withoutUnicodeBuffer[++withoutUnicodePtr] = currentCharacter;
+                                                       // withoutUnicodeBuffer[++withoutUnicodePtr] =
+                                                       // currentCharacter;
                                                        // }
                                                        // }
-                                                       if ((currentCharacter == '-') || (currentCharacter == '+')) {
+                                                       if ((currentCharacter == '-')
+                                                                       || (currentCharacter == '+')) {
                                                                // consume next character
                                                                unicodeAsBackSlash = false;
                                                                currentCharacter = source[currentPosition++];
-                                                               // if (((currentCharacter = source[currentPosition++]) == '\\')
+                                                               // if (((currentCharacter =
+                                                               // source[currentPosition++]) == '\\')
                                                                // && (source[currentPosition] == 'u')) {
                                                                // getNextUnicodeChar();
                                                                // } else {
@@ -3715,7 +3858,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                ;
                // if ((!dotPrefix) && (getNextChar('l', 'L') >= 0))
                // return TokenNameLongLiteral;
-               if ((!dotPrefix) && (getNextChar('.'))) { // decimal part that can be empty
+               if ((!dotPrefix) && (getNextChar('.'))) { // decimal part that can be
+                                                                                                       // empty
                        while (getNextCharAsDigit()) {
                        }
                        ;
@@ -3765,7 +3909,7 @@ public class Scanner implements IScanner, ITerminalSymbols {
 
        /**
         * Search the line number corresponding to a specific position
-        *
+        * 
         */
        public final int getLineNumber(int position) {
                if (lineEnds == null)
@@ -3811,6 +3955,7 @@ public class Scanner implements IScanner, ITerminalSymbols {
                initialPosition = currentPosition = 0;
                containsAssertKeyword = false;
                withoutUnicodeBuffer = new char[this.source.length];
+               fFillerToken = TokenNameEOF;
                // encapsedStringStack = new Stack();
        }
 
@@ -3830,19 +3975,26 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        middle = new char[0];
                }
                char end[] = new char[source.length - (currentPosition - 1)];
-               System.arraycopy(source, (currentPosition - 1) + 1, end, 0, source.length - (currentPosition - 1) - 1);
-               return new String(front) + "\n===============================\nStarts here -->" //$NON-NLS-1$
-                               + new String(middle) + "<-- Ends here\n===============================\n" //$NON-NLS-1$
+               System.arraycopy(source, (currentPosition - 1) + 1, end, 0,
+                               source.length - (currentPosition - 1) - 1);
+               return new String(front)
+                               + "\n===============================\nStarts here -->" //$NON-NLS-1$
+                               + new String(middle)
+                               + "<-- Ends here\n===============================\n" //$NON-NLS-1$
                                + new String(end);
        }
 
        public final String toStringAction(int act) {
                switch (act) {
                case TokenNameERROR:
-                       return "ScannerError"; // + new String(getCurrentTokenSource()) + ")";
-               // //$NON-NLS-1$
+                       return "ScannerError"; // + new String(getCurrentTokenSource()) +
+                                                                       // ")";
+                       // //$NON-NLS-1$
                case TokenNameINLINE_HTML:
                        return "Inline-HTML(" + new String(getCurrentTokenSource()) + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+               case TokenNameECHO_INVISIBLE:
+                       // 0-length token
+                       return "";
                case TokenNameIdentifier:
                        return "Identifier(" + new String(getCurrentTokenSource()) + ")"; //$NON-NLS-1$ //$NON-NLS-2$
                case TokenNameVariable:
@@ -3873,8 +4025,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        return "continue"; //$NON-NLS-1$
                case TokenNamedefault:
                        return "default"; //$NON-NLS-1$
-               // case TokenNamedefine :
-               // return "define"; //$NON-NLS-1$
+                       // case TokenNamedefine :
+                       // return "define"; //$NON-NLS-1$
                case TokenNamedo:
                        return "do"; //$NON-NLS-1$
                case TokenNameecho:
@@ -3897,8 +4049,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        return "exit";
                case TokenNameextends:
                        return "extends"; //$NON-NLS-1$
-               // case TokenNamefalse :
-               // return "false"; //$NON-NLS-1$
+                       // case TokenNamefalse :
+                       // return "false"; //$NON-NLS-1$
                case TokenNamefinal:
                        return "final"; //$NON-NLS-1$
                case TokenNamefor:
@@ -3927,8 +4079,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        return "list"; //$NON-NLS-1$
                case TokenNamenew:
                        return "new"; //$NON-NLS-1$
-               // case TokenNamenull :
-               // return "null"; //$NON-NLS-1$
+                       // case TokenNamenull :
+                       // return "null"; //$NON-NLS-1$
                case TokenNameor:
                        return "OR"; //$NON-NLS-1$
                case TokenNameprint:
@@ -3943,14 +4095,18 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        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:
+                       // return "self"; //$NON-NLS-1$
                case TokenNamestatic:
                        return "static"; //$NON-NLS-1$
                case TokenNameswitch:
                        return "switch"; //$NON-NLS-1$
-               // case TokenNametrue :
-               // return "true"; //$NON-NLS-1$
+                       // case TokenNametrue :
+                       // return "true"; //$NON-NLS-1$
                case TokenNameunset:
                        return "unset"; //$NON-NLS-1$
                case TokenNamevar:
@@ -3959,8 +4115,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        return "while"; //$NON-NLS-1$
                case TokenNamexor:
                        return "XOR"; //$NON-NLS-1$
-               // case TokenNamethis :
-               // return "$this"; //$NON-NLS-1$
+                       // case TokenNamethis :
+                       // return "$this"; //$NON-NLS-1$
                case TokenNameIntegerLiteral:
                        return "Integer(" + new String(getCurrentTokenSource()) + ")"; //$NON-NLS-1$ //$NON-NLS-2$
                case TokenNameDoubleLiteral:
@@ -4099,9 +4255,9 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        return "COMMENT_BLOCK(" + new String(getCurrentTokenSource()) + ")"; //$NON-NLS-1$
                case TokenNameCOMMENT_PHPDOC:
                        return "COMMENT_PHPDOC(" + new String(getCurrentTokenSource()) + ")"; //$NON-NLS-1$
-               // case TokenNameHTML :
-               // return "HTML(" + new String(getCurrentTokenSource()) + ")";
-               // //$NON-NLS-1$
+                       // case TokenNameHTML :
+                       // return "HTML(" + new String(getCurrentTokenSource()) + ")";
+                       // //$NON-NLS-1$
                case TokenNameFILE:
                        return "__FILE__"; //$NON-NLS-1$
                case TokenNameLINE:
@@ -4135,23 +4291,29 @@ public class Scanner implements IScanner, ITerminalSymbols {
                this(tokenizeComments, tokenizeWhiteSpace, false);
        }
 
-       public Scanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean checkNonExternalizedStringLiterals) {
-               this(tokenizeComments, tokenizeWhiteSpace, checkNonExternalizedStringLiterals, false);
+       public Scanner(boolean tokenizeComments, boolean tokenizeWhiteSpace,
+                       boolean checkNonExternalizedStringLiterals) {
+               this(tokenizeComments, tokenizeWhiteSpace,
+                               checkNonExternalizedStringLiterals, false);
        }
 
-       public Scanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean checkNonExternalizedStringLiterals,
-                       boolean assertMode) {
-               this(tokenizeComments, tokenizeWhiteSpace, checkNonExternalizedStringLiterals, assertMode, false, null, null, true);
+       public Scanner(boolean tokenizeComments, boolean tokenizeWhiteSpace,
+                       boolean checkNonExternalizedStringLiterals, boolean assertMode) {
+               this(tokenizeComments, tokenizeWhiteSpace,
+                               checkNonExternalizedStringLiterals, assertMode, false, null,
+                               null, true);
        }
 
-       public Scanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean checkNonExternalizedStringLiterals,
-                       boolean assertMode, boolean tokenizeStrings, char[][] taskTags, char[][] taskPriorities, boolean isTaskCaseSensitive) {
+       public Scanner(boolean tokenizeComments, boolean tokenizeWhiteSpace,
+                       boolean checkNonExternalizedStringLiterals, boolean assertMode,
+                       boolean tokenizeStrings, char[][] taskTags,
+                       char[][] taskPriorities, boolean isTaskCaseSensitive) {
                this.eofPosition = Integer.MAX_VALUE;
                this.tokenizeComments = tokenizeComments;
                this.tokenizeWhiteSpace = tokenizeWhiteSpace;
                this.tokenizeStrings = tokenizeStrings;
                this.checkNonExternalizedStringLiterals = checkNonExternalizedStringLiterals;
-//             this.assertMode = assertMode;
+               // this.assertMode = assertMode;
                // this.encapsedStringStack = null;
                this.taskTags = taskTags;
                this.taskPriorities = taskPriorities;
@@ -4198,7 +4360,9 @@ public class Scanner implements IScanner, ITerminalSymbols {
                }
                this.wasNonExternalizedStringLiteral = true;
                if (nonNLSCounter != lineLength) {
-                       System.arraycopy(this.nonNLSStrings, 0, (this.nonNLSStrings = new StringLiteral[nonNLSCounter]), 0, nonNLSCounter);
+                       System.arraycopy(this.nonNLSStrings, 0,
+                                       (this.nonNLSStrings = new StringLiteral[nonNLSCounter]), 0,
+                                       nonNLSCounter);
                }
                currentLine = null;
        }
@@ -4252,29 +4416,37 @@ public class Scanner implements IScanner, ITerminalSymbols {
                        int number = Character.getNumericValue(currentCharacter);
                        if (number >= 0 && number <= 7) {
                                boolean zeroToThreeNot = number > 3;
-                               if (Character.isDigit(currentCharacter = source[currentPosition++])) {
+                               if (Character
+                                               .isDigit(currentCharacter = source[currentPosition++])) {
                                        int digit = Character.getNumericValue(currentCharacter);
                                        if (digit >= 0 && digit <= 7) {
                                                number = (number * 8) + digit;
-                                               if (Character.isDigit(currentCharacter = source[currentPosition++])) {
-                                                       if (zeroToThreeNot) { // has read \NotZeroToThree OctalDigit
+                                               if (Character
+                                                               .isDigit(currentCharacter = source[currentPosition++])) {
+                                                       if (zeroToThreeNot) { // has read \NotZeroToThree
+                                                                                                       // OctalDigit
                                                                // Digit --> ignore last character
                                                                currentPosition--;
                                                        } else {
-                                                               digit = Character.getNumericValue(currentCharacter);
-                                                               if (digit >= 0 && digit <= 7) { // has read \ZeroToThree
+                                                               digit = Character
+                                                                               .getNumericValue(currentCharacter);
+                                                               if (digit >= 0 && digit <= 7) { // has read
+                                                                                                                               // \ZeroToThree
                                                                        // OctalDigit OctalDigit
                                                                        number = (number * 8) + digit;
-                                                               } else { // has read \ZeroToThree OctalDigit NonOctalDigit
+                                                               } else { // has read \ZeroToThree OctalDigit
+                                                                                       // NonOctalDigit
                                                                        // --> ignore last character
                                                                        currentPosition--;
                                                                }
                                                        }
-                                               } else { // has read \OctalDigit NonDigit--> ignore last
+                                               } else { // has read \OctalDigit NonDigit--> ignore
+                                                                       // last
                                                        // character
                                                        currentPosition--;
                                                }
-                                       } else { // has read \OctalDigit NonOctalDigit--> ignore last
+                                       } else { // has read \OctalDigit NonOctalDigit--> ignore
+                                                               // last
                                                // character
                                                currentPosition--;
                                        }
@@ -4295,12 +4467,14 @@ public class Scanner implements IScanner, ITerminalSymbols {
                char[] src = this.source;
 
                // only look for newer task: tags
-               if (this.foundTaskCount > 0 && this.foundTaskPositions[this.foundTaskCount - 1][0] >= commentStart) {
+               if (this.foundTaskCount > 0
+                               && this.foundTaskPositions[this.foundTaskCount - 1][0] >= commentStart) {
                        return;
                }
                int foundTaskIndex = this.foundTaskCount;
                char previous = src[commentStart + 1]; // should be '*' or '/'
-               nextChar: for (int i = commentStart + 2; i < commentEnd && i < this.eofPosition; i++) {
+               nextChar: for (int i = commentStart + 2; i < commentEnd
+                               && i < this.eofPosition; i++) {
                        char[] tag = null;
                        char[] priority = null;
                        // check for tag occurrence only if not ambiguous with javadoc tag
@@ -4311,7 +4485,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                        if (tagLength == 0)
                                                continue nextTag;
 
-                                       // ensure tag is not leaded with letter if tag starts with a letter
+                                       // ensure tag is not leaded with letter if tag starts with a
+                                       // letter
                                        if (Scanner.isPHPIdentifierStart(tag[0])) {
                                                if (Scanner.isPHPIdentifierPart(previous)) {
                                                        continue nextTag;
@@ -4323,17 +4498,24 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                int x = i + t;
                                                if (x >= this.eofPosition || x >= commentEnd)
                                                        continue nextTag;
-                                               if ((sc = src[i + t]) != (tc = tag[t])) { // case sensitive check
-                                                       if (this.isTaskCaseSensitive || (Character.toLowerCase(sc) != Character.toLowerCase(tc))) { // case
-                                                                                                                                                                                                                                                                                                                                                                                                                                       // insensitive
-                                                                                                                                                                                                                                                                                                                                                                                                                                       // check
+                                               if ((sc = src[i + t]) != (tc = tag[t])) { // case
+                                                                                                                                       // sensitive
+                                                                                                                                       // check
+                                                       if (this.isTaskCaseSensitive
+                                                                       || (Character.toLowerCase(sc) != Character
+                                                                                       .toLowerCase(tc))) { // case
+                                                               // insensitive
+                                                               // check
                                                                continue nextTag;
                                                        }
                                                }
                                        }
-                                       // ensure tag is not followed with letter if tag finishes with a
+                                       // ensure tag is not followed with letter if tag finishes
+                                       // with a
                                        // letter
-                                       if (i + tagLength < commentEnd && Scanner.isPHPIdentifierPart(src[i + tagLength - 1])) {
+                                       if (i + tagLength < commentEnd
+                                                       && Scanner.isPHPIdentifierPart(src[i + tagLength
+                                                                       - 1])) {
                                                if (Scanner.isPHPIdentifierPart(src[i + tagLength]))
                                                        continue nextTag;
                                        }
@@ -4343,21 +4525,40 @@ public class Scanner implements IScanner, ITerminalSymbols {
                                                this.foundTaskPriorities = new char[5][];
                                                this.foundTaskPositions = new int[5][];
                                        } else if (this.foundTaskCount == this.foundTaskTags.length) {
-                                               System.arraycopy(this.foundTaskTags, 0, this.foundTaskTags = new char[this.foundTaskCount * 2][], 0,
-                                                               this.foundTaskCount);
-                                               System.arraycopy(this.foundTaskMessages, 0, this.foundTaskMessages = new char[this.foundTaskCount * 2][], 0,
-                                                               this.foundTaskCount);
-                                               System.arraycopy(this.foundTaskPriorities, 0, this.foundTaskPriorities = new char[this.foundTaskCount * 2][], 0,
-                                                               this.foundTaskCount);
-                                               System.arraycopy(this.foundTaskPositions, 0, this.foundTaskPositions = new int[this.foundTaskCount * 2][], 0,
-                                                               this.foundTaskCount);
+                                               System
+                                                               .arraycopy(
+                                                                               this.foundTaskTags,
+                                                                               0,
+                                                                               this.foundTaskTags = new char[this.foundTaskCount * 2][],
+                                                                               0, this.foundTaskCount);
+                                               System
+                                                               .arraycopy(
+                                                                               this.foundTaskMessages,
+                                                                               0,
+                                                                               this.foundTaskMessages = new char[this.foundTaskCount * 2][],
+                                                                               0, this.foundTaskCount);
+                                               System
+                                                               .arraycopy(
+                                                                               this.foundTaskPriorities,
+                                                                               0,
+                                                                               this.foundTaskPriorities = new char[this.foundTaskCount * 2][],
+                                                                               0, this.foundTaskCount);
+                                               System
+                                                               .arraycopy(
+                                                                               this.foundTaskPositions,
+                                                                               0,
+                                                                               this.foundTaskPositions = new int[this.foundTaskCount * 2][],
+                                                                               0, this.foundTaskCount);
                                        }
 
-                                       priority = this.taskPriorities != null && itag < this.taskPriorities.length ? this.taskPriorities[itag] : null;
+                                       priority = this.taskPriorities != null
+                                                       && itag < this.taskPriorities.length ? this.taskPriorities[itag]
+                                                       : null;
 
                                        this.foundTaskTags[this.foundTaskCount] = tag;
                                        this.foundTaskPriorities[this.foundTaskCount] = priority;
-                                       this.foundTaskPositions[this.foundTaskCount] = new int[] { i, i + tagLength - 1 };
+                                       this.foundTaskPositions[this.foundTaskCount] = new int[] {
+                                                       i, i + tagLength - 1 };
                                        this.foundTaskMessages[this.foundTaskCount] = CharOperation.NO_CHAR;
                                        this.foundTaskCount++;
                                        i += tagLength - 1; // will be incremented when looping
@@ -4368,11 +4569,14 @@ public class Scanner implements IScanner, ITerminalSymbols {
                }
                for (int i = foundTaskIndex; i < this.foundTaskCount; i++) {
                        // retrieve message start and end positions
-                       int msgStart = this.foundTaskPositions[i][0] + this.foundTaskTags[i].length;
-                       int max_value = i + 1 < this.foundTaskCount ? this.foundTaskPositions[i + 1][0] - 1 : commentEnd - 1;
+                       int msgStart = this.foundTaskPositions[i][0]
+                                       + this.foundTaskTags[i].length;
+                       int max_value = i + 1 < this.foundTaskCount ? this.foundTaskPositions[i + 1][0] - 1
+                                       : commentEnd - 1;
                        // at most beginning of next task
                        if (max_value < msgStart) {
-                               max_value = msgStart; // would only occur if tag is before EOF.
+                               max_value = msgStart; // would only occur if tag is before
+                                                                               // EOF.
                        }
                        int end = -1;
                        char c;
@@ -4412,7 +4616,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
        // chech presence of task: tags
        // public void checkTaskTag(int commentStart, int commentEnd) {
        // // only look for newer task: tags
-       // if (this.foundTaskCount > 0 && this.foundTaskPositions[this.foundTaskCount
+       // if (this.foundTaskCount > 0 &&
+       // this.foundTaskPositions[this.foundTaskCount
        // - 1][0] >= commentStart) {
        // return;
        // }
@@ -4424,7 +4629,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
        // // check for tag occurrence
        // nextTag: for (int itag = 0; itag < this.taskTags.length; itag++) {
        // tag = this.taskTags[itag];
-       // priority = this.taskPriorities != null && itag < this.taskPriorities.length
+       // priority = this.taskPriorities != null && itag <
+       // this.taskPriorities.length
        // ? this.taskPriorities[itag] : null;
        // int tagLength = tag.length;
        // for (int t = 0; t < tagLength; t++) {
@@ -4445,13 +4651,15 @@ public class Scanner implements IScanner, ITerminalSymbols {
        // System.arraycopy(this.foundTaskPriorities, 0, this.foundTaskPriorities =
        // new char[this.foundTaskCount * 2][], 0,
        // this.foundTaskCount);
-       // System.arraycopy(this.foundTaskPositions, 0, this.foundTaskPositions = new
+       // System.arraycopy(this.foundTaskPositions, 0, this.foundTaskPositions =
+       // new
        // int[this.foundTaskCount * 2][], 0,
        // this.foundTaskCount);
        // }
        // this.foundTaskTags[this.foundTaskCount] = tag;
        // this.foundTaskPriorities[this.foundTaskCount] = priority;
-       // this.foundTaskPositions[this.foundTaskCount] = new int[] { i, i + tagLength
+       // this.foundTaskPositions[this.foundTaskCount] = new int[] { i, i +
+       // tagLength
        // - 1 };
        // this.foundTaskMessages[this.foundTaskCount] = CharOperation.NO_CHAR;
        // this.foundTaskCount++;