Examples of resetTo()


Examples of org.aspectj.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.aspectj.org.eclipse.jdt.internal.compiler.parser.Scanner.resetTo()

    }
    Scanner scanner = this.ast.scanner;
    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

Examples of org.aspectj.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.aspectj.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.aspectj.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.aspectj.org.eclipse.jdt.internal.compiler.parser.Scanner.resetTo()

   */
  public char charValue() {
    Scanner scanner = this.ast.scanner;
    char[] source = 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.aspectj.org.eclipse.jdt.internal.compiler.parser.Scanner.resetTo()

    int trimRightPosition = expression.sourceEnd;
    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.core.compiler.IScanner.resetTo()

    }
   
    public ISourceRange findTokenOfType(ICompilationUnit theCU, int tokenType, int offset, int length) throws JavaModelException {
        IScanner scanner = ToolFactory.createScanner(false, false, false, false);
        scanner.setSource(theCU.getSource().toCharArray());
        scanner.resetTo(offset, offset + length);
        int token;
        try {
            while ((token = scanner.getNextToken()) != ITerminalSymbols.TokenNameEOF) {
                if (token == tokenType) {
                    return new SourceRange(scanner.getCurrentTokenStartPosition(),
View Full Code Here

Examples of org.eclipse.jdt.core.compiler.IScanner.resetTo()

    }
   
    public void scanTokens(ICompilationUnit theCU, int offset, int length, FoundToken callback) throws JavaModelException {
        IScanner scanner = ToolFactory.createScanner(false, false, false, false);
        scanner.setSource(theCU.getSource().toCharArray());
        scanner.resetTo(offset, offset + length);
        int token;
        try {
            while ((token = scanner.getNextToken()) != ITerminalSymbols.TokenNameEOF) {
                callback.found(token, scanner.getCurrentTokenStartPosition(), scanner.getCurrentTokenEndPosition() + 1 - scanner.getCurrentTokenStartPosition());
            }
View Full Code Here

Examples of org.eclipse.jdt.core.compiler.IScanner.resetTo()

        }
      }

      final int shift = range.getOffset();
      IScanner scanner = ctx.getScanner();
      scanner.resetTo(shift, shift + range.getLength());

      int start = shift;
      while (true) {

        int token = scanner.getNextToken();
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.