Examples of resetTo()


Examples of org.eclipse.jdt.internal.compiler.parser.Scanner.resetTo()

      throw new IllegalArgumentException();
    }
    Scanner scanner = this.ast.scanner;
    char[] source = token.toCharArray();
    scanner.setSource(source);
    scanner.resetTo(0, source.length);
    scanner.tokenizeComments = false;
    scanner.tokenizeWhiteSpace = false;
    try {
      int tokenType = scanner.getNextToken();
      switch(tokenType) {
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.parser.Scanner.resetTo()

      scanner.sourceLevel = ClassFileConstants.JDK1_3;
      scanner.complianceLevel = ClassFileConstants.JDK1_5;
      char[] source = identifier.toCharArray();
      scanner.setSource(source);
      final int length = source.length;
      scanner.resetTo(0, length - 1);
      try {
        int tokenType = scanner.scanIdentifier();
        if (tokenType != TerminalTokens.TokenNameIdentifier) {
          throw new IllegalArgumentException("Invalid identifier : >" + identifier + "<")//$NON-NLS-1$//$NON-NLS-2$
        }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.parser.Scanner.resetTo()

   */
  public void setLeadingComment(String comment) {
    if (comment != null) {
      char[] source = comment.toCharArray();
      Scanner scanner = this.ast.scanner;
      scanner.resetTo(0, source.length);
      scanner.setSource(source);
      try {
        int token;
        boolean onlyOneComment = false;
        while ((token = scanner.getNextToken()) != TerminalTokens.TokenNameEOF) {
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.parser.Scanner.resetTo()

      throw new IllegalArgumentException("Token cannot be null"); //$NON-NLS-1$
    }
    Scanner scanner = this.ast.scanner;
    char[] source = token.toCharArray();
    scanner.setSource(source);
    scanner.resetTo(0, source.length);
    try {
      int tokenType = scanner.getNextToken();
      switch(tokenType) {
        case TerminalTokens.TokenNameStringLiteral:
          break;
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.parser.Scanner.resetTo()

    }

    Scanner scanner = this.ast.scanner;
    char[] source = s.toCharArray();
    scanner.setSource(source);
    scanner.resetTo(0, source.length);
    try {
      int tokenType = scanner.getNextToken();
      switch(tokenType) {
        case TerminalTokens.TokenNameStringLiteral:
          return scanner.getCurrentStringLiteral();
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.parser.Scanner.resetTo()

    int trimRightPosition = end;
    boolean first = true;
    Scanner removeBlankScanner = this.ast.scanner;
    try {
      removeBlankScanner.setSource(this.compilationUnitSource);
      removeBlankScanner.resetTo(start, end);
      while (true) {
        token = removeBlankScanner.getNextToken();
        switch (token) {
          case TerminalTokens.TokenNameCOMMENT_JAVADOC :
          case TerminalTokens.TokenNameCOMMENT_LINE :
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.parser.Scanner.resetTo()

    if (docComment == null) {
      throw new IllegalArgumentException();
    }
    char[] source = docComment.toCharArray();
    Scanner scanner = this.ast.scanner;
    scanner.resetTo(0, source.length);
    scanner.setSource(source);
    try {
      int token;
      boolean onlyOneComment = false;
      while ((token = scanner.getNextToken()) != TerminalTokens.TokenNameEOF) {
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.parser.Scanner.resetTo()

      throw new IllegalArgumentException();
    }
    Scanner scanner = this.ast.scanner;
    char[] source = value.toCharArray();
    scanner.setSource(source);
    scanner.resetTo(0, source.length);
    try {
      int tokenType = scanner.getNextToken();
      switch(tokenType) {
        case TerminalTokens.TokenNameCharacterLiteral:
          break;
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.parser.Scanner.resetTo()

   */
  public char charValue() {
    Scanner scanner = this.ast.scanner;
    char[] source = this.escapedValue.toCharArray();
    scanner.setSource(source);
    scanner.resetTo(0, source.length);
    int firstChar = scanner.getNextChar();
    int secondChar = scanner.getNextChar();

    if (firstChar == -1 || firstChar != '\'') {
      throw new IllegalArgumentException("illegal character literal");//$NON-NLS-1$
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.parser.Scanner.resetTo()

      scanner.sourceLevel = ClassFileConstants.JDK1_3;
      scanner.complianceLevel = ClassFileConstants.JDK1_5;
      char[] source = identifier.toCharArray();
      scanner.setSource(source);
      final int length = source.length;
      scanner.resetTo(0, length - 1);
      try {
        int tokenType = scanner.scanIdentifier();
        if (tokenType != TerminalTokens.TokenNameIdentifier) {
          throw new IllegalArgumentException();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.