Package org.eclipse.jdt.core.compiler

Examples of org.eclipse.jdt.core.compiler.InvalidInputException


public static boolean isDigit(char c) throws InvalidInputException {
  if(c < ScannerHelper.MAX_OBVIOUS) {
    return (ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[c] & ScannerHelper.C_DIGIT) != 0;
  }
  if (Character.isDigit(c)) {
    throw new InvalidInputException(Scanner.INVALID_DIGIT);
  }
  return false;
}
View Full Code Here


        break nextArg;
      }
    }

    // Something wrong happened => Invalid input
    throw new InvalidInputException();
  }
View Full Code Here

          consumeToken();
          break;

        case TerminalTokens.TokenNameDOT :
          if ((iToken & 1) == 0) { // dots must be even tokens
            throw new InvalidInputException();
          }
          consumeToken();
          break;

        case TerminalTokens.TokenNameabstract:
        case TerminalTokens.TokenNameassert:
        case TerminalTokens.TokenNameboolean:
        case TerminalTokens.TokenNamebreak:
        case TerminalTokens.TokenNamebyte:
        case TerminalTokens.TokenNamecase:
        case TerminalTokens.TokenNamecatch:
        case TerminalTokens.TokenNamechar:
        case TerminalTokens.TokenNameclass:
        case TerminalTokens.TokenNamecontinue:
        case TerminalTokens.TokenNamedefault:
        case TerminalTokens.TokenNamedo:
        case TerminalTokens.TokenNamedouble:
        case TerminalTokens.TokenNameelse:
        case TerminalTokens.TokenNameextends:
        case TerminalTokens.TokenNamefalse:
        case TerminalTokens.TokenNamefinal:
        case TerminalTokens.TokenNamefinally:
        case TerminalTokens.TokenNamefloat:
        case TerminalTokens.TokenNamefor:
        case TerminalTokens.TokenNameif:
        case TerminalTokens.TokenNameimplements:
        case TerminalTokens.TokenNameimport:
        case TerminalTokens.TokenNameinstanceof:
        case TerminalTokens.TokenNameint:
        case TerminalTokens.TokenNameinterface:
        case TerminalTokens.TokenNamelong:
        case TerminalTokens.TokenNamenative:
        case TerminalTokens.TokenNamenew:
        case TerminalTokens.TokenNamenull:
        case TerminalTokens.TokenNamepackage:
        case TerminalTokens.TokenNameprivate:
        case TerminalTokens.TokenNameprotected:
        case TerminalTokens.TokenNamepublic:
        case TerminalTokens.TokenNameshort:
        case TerminalTokens.TokenNamestatic:
        case TerminalTokens.TokenNamestrictfp:
        case TerminalTokens.TokenNamesuper:
        case TerminalTokens.TokenNameswitch:
        case TerminalTokens.TokenNamesynchronized:
        case TerminalTokens.TokenNamethis:
        case TerminalTokens.TokenNamethrow:
        case TerminalTokens.TokenNametransient:
        case TerminalTokens.TokenNametrue:
        case TerminalTokens.TokenNametry:
        case TerminalTokens.TokenNamevoid:
        case TerminalTokens.TokenNamevolatile:
        case TerminalTokens.TokenNamewhile:
          if (iToken == 0) {
            pushIdentifier(true, true);
            primitiveToken = token;
            consumeToken();
            break nextToken;
          }
          // Fall through default case to verify that we do not leave on a dot
          //$FALL-THROUGH$
        default :
          if (iToken == 0) {
            if (this.identifierPtr>=0) {
              this.lastIdentifierEndPosition = (int) this.identifierPositionStack[this.identifierPtr];
            }
            return null;
          }
          if ((iToken & 1) == 0) { // cannot leave on a dot
            switch (parserKind) {
              case COMPLETION_PARSER:
                if (this.identifierPtr>=0) {
                  this.lastIdentifierEndPosition = (int) this.identifierPositionStack[this.identifierPtr];
                }
                return syntaxRecoverQualifiedName(primitiveToken);
              case DOM_PARSER:
                if (this.currentTokenType != -1) {
                  // Reset position: we want to rescan last token
                  this.index = this.tokenPreviousPosition;
                  this.scanner.currentPosition = this.tokenPreviousPosition;
                  this.currentTokenType = -1;
                }
                // $FALL-THROUGH$ - fall through default case to raise exception
              default:
                throw new InvalidInputException();
            }
          }
          break nextToken;
      }
    }
View Full Code Here

      }
      if (argNamePos >= 0) argEnd = (int) argNamePos;
      return new JavadocArgumentExpression(name, argTypeRef.sourceStart, argEnd, argTypeRef);
    }
    catch (ClassCastException ex) {
      throw new InvalidInputException();
    }
  }
View Full Code Here

      field.tagSourceEnd = this.tagSourceEnd;
      field.tagValue = this.tagValue;
      return field;
    }
    catch (ClassCastException ex) {
      throw new InvalidInputException();
    }
  }
View Full Code Here

              }
              return null;
            }
          }
        } else {
          throw new InvalidInputException();
        }
      }
      // Create node
      if (arguments == null) {
        if (isConstructor) {
          JavadocAllocationExpression allocation = new JavadocAllocationExpression(this.identifierPositionStack[length-1]);
          allocation.type = typeRef;
          allocation.tagValue = this.tagValue;
          allocation.sourceEnd = this.scanner.getCurrentTokenEndPosition();
          if (length == 1) {
            allocation.qualification = new char[][] { this.identifierStack[0] };
          } else {
            System.arraycopy(this.identifierStack, 0, allocation.qualification = new char[length][], 0, length);
            allocation.sourceStart = (int) (this.identifierPositionStack[0] >>> 32);
          }
          allocation.memberStart = this.memberStart;
          return allocation;
        } else {
          JavadocMessageSend msg = new JavadocMessageSend(this.identifierStack[length-1], this.identifierPositionStack[length-1]);
          msg.receiver = typeRef;
          msg.tagValue = this.tagValue;
          msg.sourceEnd = this.scanner.getCurrentTokenEndPosition();
          return msg;
        }
      } else {
        JavadocArgumentExpression[] expressions = new JavadocArgumentExpression[arguments.size()];
        arguments.toArray(expressions);
        if (isConstructor) {
          JavadocAllocationExpression allocation = new JavadocAllocationExpression(this.identifierPositionStack[length-1]);
          allocation.arguments = expressions;
          allocation.type = typeRef;
          allocation.tagValue = this.tagValue;
          allocation.sourceEnd = this.scanner.getCurrentTokenEndPosition();
          if (length == 1) {
            allocation.qualification = new char[][] { this.identifierStack[0] };
          } else {
            System.arraycopy(this.identifierStack, 0, allocation.qualification = new char[length][], 0, length);
            allocation.sourceStart = (int) (this.identifierPositionStack[0] >>> 32);
          }
          allocation.memberStart = this.memberStart;
          return allocation;
        } else {
          JavadocMessageSend msg = new JavadocMessageSend(this.identifierStack[length-1], this.identifierPositionStack[length-1], expressions);
          msg.receiver = typeRef;
          msg.tagValue = this.tagValue;
          msg.sourceEnd = this.scanner.getCurrentTokenEndPosition();
          return msg;
        }
      }
    }
    catch (ClassCastException ex) {
      throw new InvalidInputException();
    }
  }
View Full Code Here

  final int USING_UNDERSCORE = 1;
  final int INVALID_POSITION = 2;
  switch(consumeDigits0(radix, USING_UNDERSCORE, INVALID_POSITION, expectingDigitFirst)) {
    case USING_UNDERSCORE :
      if (this.sourceLevel < ClassFileConstants.JDK1_7) {
        throw new InvalidInputException(UNDERSCORES_IN_LITERALS_NOT_BELOW_17);
      }
      break;
    case INVALID_POSITION :
      if (this.sourceLevel < ClassFileConstants.JDK1_7) {
        throw new InvalidInputException(UNDERSCORES_IN_LITERALS_NOT_BELOW_17);
      }
      throw new InvalidInputException(INVALID_UNDERSCORE);
  }
}
View Full Code Here

      return TokenNameERROR;
    }
    boolean isJavaIdStart;
    if (c >= HIGH_SURROGATE_MIN_VALUE && c <= HIGH_SURROGATE_MAX_VALUE) {
      if (this.complianceLevel < ClassFileConstants.JDK1_5) {
        throw new InvalidInputException(INVALID_UNICODE_ESCAPE);
      }
      // Unicode 4 detection
      char low = (char) getNextCharWithBoundChecks();
      if (low < LOW_SURROGATE_MIN_VALUE || low > LOW_SURROGATE_MAX_VALUE) {
        // illegal low surrogate
        throw new InvalidInputException(INVALID_LOW_SURROGATE);
      }
      isJavaIdStart = ScannerHelper.isJavaIdentifierStart(this.complianceLevel, c, low);
    } else if (c >= LOW_SURROGATE_MIN_VALUE && c <= LOW_SURROGATE_MAX_VALUE) {
      if (this.complianceLevel < ClassFileConstants.JDK1_5) {
        throw new InvalidInputException(INVALID_UNICODE_ESCAPE);
      }
      throw new InvalidInputException(INVALID_HIGH_SURROGATE);
    } else {
      // optimized case already checked
      isJavaIdStart = ScannerHelper.isJavaIdentifierStart(this.complianceLevel, c);
    }
    if (isJavaIdStart)
View Full Code Here

          return TokenNameCOLON;
        case '\'' :
          {
            int test;
            if ((test = getNextChar('\n', '\r')) == 0) {
              throw new InvalidInputException(INVALID_CHARACTER_CONSTANT);
            }
            if (test > 0) {
              // relocate if finding another quote fairly close: thus unicode '/u000D' will be fully consumed
              for (int lookAhead = 0; lookAhead < 3; lookAhead++) {
                if (this.currentPosition + lookAhead == this.eofPosition)
                  break;
                if (this.source[this.currentPosition + lookAhead] == '\n')
                  break;
                if (this.source[this.currentPosition + lookAhead] == '\'') {
                  this.currentPosition += lookAhead + 1;
                  break;
                }
              }
              throw new InvalidInputException(INVALID_CHARACTER_CONSTANT);
            }
          }
          if (getNextChar('\'')) {
            // relocate if finding another quote fairly close: thus unicode '/u000D' will be fully consumed
            for (int lookAhead = 0; lookAhead < 3; lookAhead++) {
              if (this.currentPosition + lookAhead == this.eofPosition)
                break;
              if (this.source[this.currentPosition + lookAhead] == '\n')
                break;
              if (this.source[this.currentPosition + lookAhead] == '\'') {
                this.currentPosition += lookAhead + 1;
                break;
              }
            }
            throw new InvalidInputException(INVALID_CHARACTER_CONSTANT);
          }
          if (getNextChar('\\')) {
            if (this.unicodeAsBackSlash) {
              // consume next character
              this.unicodeAsBackSlash = false;
              if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\') && (this.source[this.currentPosition] == 'u')) {
                getNextUnicodeChar();
              } else {
                if (this.withoutUnicodePtr != 0) {
                  unicodeStore();
                }
              }
            } else {
              this.currentCharacter = this.source[this.currentPosition++];
            }
            scanEscapeCharacter();
          } else { // consume next character
            this.unicodeAsBackSlash = false;
            checkIfUnicode = false;
            try {
              checkIfUnicode = ((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
              && (this.source[this.currentPosition] == 'u');
            } catch(IndexOutOfBoundsException e) {
              this.currentPosition--;
              throw new InvalidInputException(INVALID_CHARACTER_CONSTANT);
            }
            if (checkIfUnicode) {
              getNextUnicodeChar();
            } else {
              if (this.withoutUnicodePtr != 0) {
                unicodeStore();
              }
            }
          }
          if (getNextChar('\''))
            return TokenNameCharacterLiteral;
          // relocate if finding another quote fairly close: thus unicode '/u000D' will be fully consumed
          for (int lookAhead = 0; lookAhead < 20; lookAhead++) {
            if (this.currentPosition + lookAhead == this.eofPosition)
              break;
            if (this.source[this.currentPosition + lookAhead] == '\n')
              break;
            if (this.source[this.currentPosition + lookAhead] == '\'') {
              this.currentPosition += lookAhead + 1;
              break;
            }
          }
          throw new InvalidInputException(INVALID_CHARACTER_CONSTANT);
        case '"' :
          try {
            // consume next character
            this.unicodeAsBackSlash = false;
            boolean isUnicode = false;
            if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
              && (this.source[this.currentPosition] == 'u')) {
              getNextUnicodeChar();
              isUnicode = true;
            } else {
              if (this.withoutUnicodePtr != 0) {
                unicodeStore();
              }
            }

            while (this.currentCharacter != '"') {
              if (this.currentPosition >= this.eofPosition) {
                throw new InvalidInputException(UNTERMINATED_STRING);
              }
              /**** \r and \n are not valid in string literals ****/
              if ((this.currentCharacter == '\n') || (this.currentCharacter == '\r')) {
                // relocate if finding another quote fairly close: thus unicode '/u000D' will be fully consumed
                if (isUnicode) {
                  int start = this.currentPosition;
                  for (int lookAhead = 0; lookAhead < 50; lookAhead++) {
                    if (this.currentPosition >= this.eofPosition) {
                      this.currentPosition = start;
                      break;
                    }
                    if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\') && (this.source[this.currentPosition] == 'u')) {
                      isUnicode = true;
                      getNextUnicodeChar();
                    } else {
                      isUnicode = false;
                    }
                    if (!isUnicode && this.currentCharacter == '\n') {
                      this.currentPosition--; // set current position on new line character
                      break;
                    }
                    if (this.currentCharacter == '\"') {
                      throw new InvalidInputException(INVALID_CHAR_IN_STRING);
                    }
                  }
                } else {
                  this.currentPosition--; // set current position on new line character
                }
                throw new InvalidInputException(INVALID_CHAR_IN_STRING);
              }
              if (this.currentCharacter == '\\') {
                if (this.unicodeAsBackSlash) {
                  this.withoutUnicodePtr--;
                  // consume next character
                  this.unicodeAsBackSlash = false;
                  if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\') && (this.source[this.currentPosition] == 'u')) {
                    getNextUnicodeChar();
                    isUnicode = true;
                    this.withoutUnicodePtr--;
                  } else {
                    isUnicode = false;
                  }
                } else {
                  if (this.withoutUnicodePtr == 0) {
                    unicodeInitializeBuffer(this.currentPosition - this.startPosition);
                  }
                  this.withoutUnicodePtr --;
                  this.currentCharacter = this.source[this.currentPosition++];
                }
                // we need to compute the escape character in a separate buffer
                scanEscapeCharacter();
                if (this.withoutUnicodePtr != 0) {
                  unicodeStore();
                }
              }
              // consume next character
              this.unicodeAsBackSlash = false;
              if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
                && (this.source[this.currentPosition] == 'u')) {
                getNextUnicodeChar();
                isUnicode = true;
              } else {
                isUnicode = false;
                if (this.withoutUnicodePtr != 0) {
                  unicodeStore();
                }
              }

            }
          } catch (IndexOutOfBoundsException e) {
            this.currentPosition--;
            throw new InvalidInputException(UNTERMINATED_STRING);
          } catch (InvalidInputException e) {
            if (e.getMessage().equals(INVALID_ESCAPE)) {
              // relocate if finding another quote fairly close: thus unicode '/u000D' will be fully consumed
              for (int lookAhead = 0; lookAhead < 50; lookAhead++) {
                if (this.currentPosition + lookAhead == this.eofPosition)
                  break;
                if (this.source[this.currentPosition + lookAhead] == '\n')
                  break;
                if (this.source[this.currentPosition + lookAhead] == '\"') {
                  this.currentPosition += lookAhead + 1;
                  break;
                }
              }

            }
            throw e; // rethrow
          }
          return TokenNameStringLiteral;
        case '/' :
          if (!this.skipComments) {
            int test = getNextChar('/', '*');
            if (test == 0) { //line comment
              this.lastCommentLinePosition = this.currentPosition;
              try { //get the next char
                if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
                    && (this.source[this.currentPosition] == 'u')) {
                  getNextUnicodeChar();
                }

                //handle the \\u case manually into comment
                if (this.currentCharacter == '\\') {
                  if (this.source[this.currentPosition] == '\\')
                    this.currentPosition++;
                } //jump over the \\
                boolean isUnicode = false;
                while (this.currentCharacter != '\r' && this.currentCharacter != '\n') {
                  if (this.currentPosition >= this.eofPosition) {
                    this.lastCommentLinePosition = this.currentPosition;
                    this.currentPosition ++;
                    // this avoids duplicating the code in the catch(IndexOutOfBoundsException e)
                    throw new IndexOutOfBoundsException();
                  }
                  this.lastCommentLinePosition = this.currentPosition;
                  //get the next char
                  isUnicode = false;
                  if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
                      && (this.source[this.currentPosition] == 'u')) {
                    getNextUnicodeChar();
                    isUnicode = true;
                  }
                  //handle the \\u case manually into comment
                  if (this.currentCharacter == '\\') {
                    if (this.source[this.currentPosition] == '\\')
                      this.currentPosition++;
                  } //jump over the \\
                }
                /*
                 * We need to completely consume the line break
                 */
                if (this.currentCharacter == '\r'
                    && this.eofPosition > this.currentPosition) {
                  if (this.source[this.currentPosition] == '\n') {
                    this.currentPosition++;
                    this.currentCharacter = '\n';
                  } else if ((this.source[this.currentPosition] == '\\')
                    && (this.source[this.currentPosition + 1] == 'u')) {
                    getNextUnicodeChar();
                    isUnicode = true;
                  }
                }
                recordComment(TokenNameCOMMENT_LINE);
                if (this.taskTags != null) checkTaskTag(this.startPosition, this.currentPosition);
                if ((this.currentCharacter == '\r') || (this.currentCharacter == '\n')) {
                  if (this.checkNonExternalizedStringLiterals &&
                      this.lastPosition < this.currentPosition) {
                    parseTags();
                  }
                  if (this.recordLineSeparator) {
                    if (isUnicode) {
                      pushUnicodeLineSeparator();
                    } else {
                      pushLineSeparator();
                    }
                  }
                }
                if (this.tokenizeComments) {
                  return TokenNameCOMMENT_LINE;
                }
              } catch (IndexOutOfBoundsException e) {
                this.currentPosition--;
                recordComment(TokenNameCOMMENT_LINE);
                if (this.taskTags != null) checkTaskTag(this.startPosition, this.currentPosition);
                if (this.checkNonExternalizedStringLiterals &&
                    this.lastPosition < this.currentPosition) {
                  parseTags();
                }
                if (this.tokenizeComments) {
                  return TokenNameCOMMENT_LINE;
                } else {
                  this.currentPosition++;
                }
              }
              break;
            }
            if (test > 0) { //traditional and javadoc comment
              try { //get the next char
                boolean isJavadoc = false, star = false;
                boolean isUnicode = false;
                int previous;
                // consume next character
                this.unicodeAsBackSlash = false;
                if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
                  && (this.source[this.currentPosition] == 'u')) {
                  getNextUnicodeChar();
                  isUnicode = true;
                } else {
                  isUnicode = false;
                  if (this.withoutUnicodePtr != 0) {
                    unicodeStore();
                  }
                }

                if (this.currentCharacter == '*') {
                  isJavadoc = true;
                  star = true;
                }
                if ((this.currentCharacter == '\r') || (this.currentCharacter == '\n')) {
                  if (this.recordLineSeparator) {
                    if (isUnicode) {
                      pushUnicodeLineSeparator();
                    } else {
                      pushLineSeparator();
                    }
                  }
                }
                isUnicode = false;
                previous = this.currentPosition;
                if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
                  && (this.source[this.currentPosition] == 'u')) {
                  //-------------unicode traitement ------------
                  getNextUnicodeChar();
                  isUnicode = true;
                } else {
                  isUnicode = false;
                }
                //handle the \\u case manually into comment
                if (this.currentCharacter == '\\') {
                  if (this.source[this.currentPosition] == '\\')
                    this.currentPosition++; //jump over the \\
                }
                // empty comment is not a javadoc /**/
                if (this.currentCharacter == '/') {
                  isJavadoc = false;
                }
                //loop until end of comment */
                int firstTag = 0;
                while ((this.currentCharacter != '/') || (!star)) {
                  if (this.currentPosition >= this.eofPosition) {
                    throw new InvalidInputException(UNTERMINATED_COMMENT);
                  }
                  if ((this.currentCharacter == '\r') || (this.currentCharacter == '\n')) {
                    if (this.recordLineSeparator) {
                      if (isUnicode) {
                        pushUnicodeLineSeparator();
                      } else {
                        pushLineSeparator();
                      }
                    }
                  }
                  switch (this.currentCharacter) {
                    case '*':
                      star = true;
                      break;
                    case '@':
                      if (firstTag == 0 && this.isFirstTag()) {
                        firstTag = previous;
                      }
                      //$FALL-THROUGH$ default case to set star to false
                    default:
                      star = false;
                  }
                  //get next char
                  previous = this.currentPosition;
                  if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
                    && (this.source[this.currentPosition] == 'u')) {
                    //-------------unicode traitement ------------
                    getNextUnicodeChar();
                    isUnicode = true;
                  } else {
                    isUnicode = false;
                  }
                  //handle the \\u case manually into comment
                  if (this.currentCharacter == '\\') {
                    if (this.source[this.currentPosition] == '\\')
                      this.currentPosition++;
                  } //jump over the \\
                }
                int token = isJavadoc ? TokenNameCOMMENT_JAVADOC : TokenNameCOMMENT_BLOCK;
                recordComment(token);
                this.commentTagStarts[this.commentPtr] = firstTag;
                if (this.taskTags != null) checkTaskTag(this.startPosition, this.currentPosition);
                if (this.tokenizeComments) {
                  /*
                  if (isJavadoc)
                    return TokenNameCOMMENT_JAVADOC;
                  return TokenNameCOMMENT_BLOCK;
                  */
                  return token;
                }
              } catch (IndexOutOfBoundsException e) {
                this.currentPosition--;
                throw new InvalidInputException(UNTERMINATED_COMMENT);
              }
              break;
            }
          }
          if (getNextChar('='))
            return TokenNameDIVIDE_EQUAL;
          return TokenNameDIVIDE;
        case '\u001a' :
          if (atEnd())
            return TokenNameEOF;
          //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 :
          char c = this.currentCharacter;
          if (c < ScannerHelper.MAX_OBVIOUS) {
            if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[c] & ScannerHelper.C_IDENT_START) != 0) {
              return scanIdentifierOrKeyword();
            } else if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[c] & ScannerHelper.C_DIGIT) != 0) {
                return scanNumber(false);
            } else {
              return TokenNameERROR;
            }
          }
          boolean isJavaIdStart;
          if (c >= HIGH_SURROGATE_MIN_VALUE && c <= HIGH_SURROGATE_MAX_VALUE) {
            if (this.complianceLevel < ClassFileConstants.JDK1_5) {
              throw new InvalidInputException(INVALID_UNICODE_ESCAPE);
            }
            // Unicode 4 detection
            char low = (char) getNextChar();
            if (low < LOW_SURROGATE_MIN_VALUE || low > LOW_SURROGATE_MAX_VALUE) {
              // illegal low surrogate
              throw new InvalidInputException(INVALID_LOW_SURROGATE);
            }
            isJavaIdStart = ScannerHelper.isJavaIdentifierStart(this.complianceLevel, c, low);
          }
          else if (c >= LOW_SURROGATE_MIN_VALUE && c <= LOW_SURROGATE_MAX_VALUE) {
            if (this.complianceLevel < ClassFileConstants.JDK1_5) {
              throw new InvalidInputException(INVALID_UNICODE_ESCAPE);
            }
            throw new InvalidInputException(INVALID_HIGH_SURROGATE);
          } else {
            // optimized case already checked
            isJavaIdStart = ScannerHelper.isJavaIdentifierStart(this.complianceLevel, c);
          }
          if (isJavaIdStart)
View Full Code Here

  if (this.currentPosition < this.eofPosition) {
    while (this.source[this.currentPosition] == 'u') {
      this.currentPosition++;
      if (this.currentPosition >= this.eofPosition) {
        this.currentPosition--;
        throw new InvalidInputException(INVALID_UNICODE_ESCAPE);
      }
      unicodeSize++;
    }
  } else {
    this.currentPosition--;
    throw new InvalidInputException(INVALID_UNICODE_ESCAPE);
  }

  if ((this.currentPosition + 4) > this.eofPosition) {
    this.currentPosition += (this.eofPosition - this.currentPosition);
    throw new InvalidInputException(INVALID_UNICODE_ESCAPE);
  }
  if ((c1 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15
        || c1 < 0
        || (c2 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15
        || c2 < 0
        || (c3 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15
        || c3 < 0
        || (c4 = ScannerHelper.getNumericValue(this.source[this.currentPosition++])) > 15
        || c4 < 0){
    throw new InvalidInputException(INVALID_UNICODE_ESCAPE);
  }
  this.currentCharacter = (char) (((c1 * 16 + c2) * 16 + c3) * 16 + c4);
  //need the unicode buffer
  if (this.withoutUnicodePtr == 0) {
    //buffer all the entries that have been left aside....
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.compiler.InvalidInputException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.