return TokenName.LPAREN;
}
+ /**
+ *
+ *
+ */
public void consumeStringInterpolated() throws InvalidInputException {
try {
// consume next character
}
}
+ /**
+ *
+ *
+ */
public void consumeStringLiteral() throws InvalidInputException {
try {
int openDollarBrace = 0;
- // consume next character
- unicodeAsBackSlash = false;
- currentCharacter = source[currentPosition++];
- while (currentCharacter != '"' || openDollarBrace > 0) {
- /** ** in PHP \r and \n are valid in string literals *** */
+
+ unicodeAsBackSlash = false;
+ currentCharacter = source[currentPosition++]; // consume next character
+
+ while (currentCharacter != '"' || // As long as the ending '"' isn't found, or
+ openDollarBrace > 0) { // the last '}' isn't found
if (currentCharacter == '\\') {
- int escapeSize = currentPosition;
+ 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();
+ 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);
+
+ 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
+ }
+ else { // overwrite the / in the buffer
withoutUnicodeBuffer[withoutUnicodePtr] = currentCharacter;
- if (backSlashAsUnicodeInString) { // there are TWO \
- // in the stream
- // where only one is correct
+
+ if (backSlashAsUnicodeInString) { // there are TWO \ in the stream where only one is correct
withoutUnicodePtr--;
}
}
- } else if (currentCharacter == '$'
- && source[currentPosition] == '{') {
+ }
+ else if (currentCharacter == '$' && source[currentPosition] == '{') { // If found '${'
openDollarBrace++;
- } else if (currentCharacter == '{'
- && source[currentPosition] == '$') {
+ currentCharacter = source[currentPosition++]; // consume next character, or we count one open brace to much!
+ }
+ else if (currentCharacter == '{' && source[currentPosition] == '$') { // If found '{$'
openDollarBrace++;
- } else if (currentCharacter == '}') {
+ }
+ else if (currentCharacter == '}') { // If found '}'
openDollarBrace--;
- } else if ((currentCharacter == '\r')
- || (currentCharacter == '\n')) {
+ }
+ else if ((currentCharacter == '\r') || (currentCharacter == '\n')) { // In PHP \r and \n are valid in string literals
if (recordLineSeparator) {
- pushLineSeparator();
+ pushLineSeparator ();
}
}
- // consume next character
+
unicodeAsBackSlash = false;
- currentCharacter = source[currentPosition++];
+ currentCharacter = source[currentPosition++]; // consume next character
+
if (withoutUnicodePtr != 0) {
withoutUnicodeBuffer[++withoutUnicodePtr] = currentCharacter;
}
}
throw e; // rethrow
}
- if (checkNonExternalizedStringLiterals) { // check for presence of NLS
- // tags
- // //$NON-NLS-?$ where ? is an
- // int.
+
+ if (checkNonExternalizedStringLiterals) { // check for presence of NLS tags
+ // $NON-NLS-?$ where ? is an int.
if (currentLine == null) {
- currentLine = new NLSLine();
- lines.add(currentLine);
+ currentLine = new NLSLine ();
+ lines.add (currentLine);
}
- currentLine.add(new StringLiteral(getCurrentTokenSourceString(),
- startPosition, currentPosition - 1));
+ currentLine.add (new StringLiteral (getCurrentTokenSourceString (), startPosition, currentPosition - 1));
}
}
+ /**
+ *
+ */
public TokenName getNextToken() throws InvalidInputException {
if (!phpMode) {
return getInlinedHTMLToken(currentPosition);
while ((currentCharacter == ' ') || Character.isWhitespace(currentCharacter)) {
if ((currentCharacter == '\r') || (currentCharacter == '\n')) {
checkNonExternalizeString();
-
+
if (recordLineSeparator) {
pushLineSeparator();
} else {
startPosition = currentPosition;
currentCharacter = source[currentPosition++];
}
-
+
if (tokenizeWhiteSpace && (whiteStart != currentPosition - 1)) {
// reposition scanner in case we are interested by
// spaces as tokens
}
// ---------other side---------
i = -1;
+
int max = newEntry4;
while (++i <= max) {
char[] charArray = table[i];
// }
// }
}
+