Package at.bestsolution.efxclipse.text.jface.rules

Examples of at.bestsolution.efxclipse.text.jface.rules.IToken


        TextAttribute lastAttribute = null;
       
        scanner.setRange(document, r.getOffset(), r.getLength());
       
        while( true ) {
          IToken token= scanner.nextToken();
          if (token.isEOF())
            break;
         
          TextAttribute attribute = getTokenTextAttribute(token);
          if (lastAttribute != null && lastAttribute.equals(attribute)) {
            length += scanner.getTokenLength();
View Full Code Here


          c= scanner.read();
        } while (c != ICharacterScanner.EOF && fDetector.isWordPart((char) c));
        scanner.unread();

        for (int i= 0, n= fMatchers.size(); i < n; i++) {
          IToken token= ((WordMatcher) fMatchers.get(i)).evaluate(scanner, fBuffer);
          if (!token.isUndefined())
            return token;
        }

        if (fDefaultToken.isUndefined())
          unreadBuffer(scanner);
View Full Code Here

     * @param scanner the scanner
     * @param word the word
     * @return the token or <code>null</code> if none is associated by this matcher
     */
    public IToken evaluate(ICharacterScanner scanner, CharacterBuffer word) {
      IToken token= (IToken) fWords.get(word);
      if (token != null)
        return token;
      return Token.UNDEFINED;
    }
View Full Code Here

          switch (fState) {
          case SINGLE_LINE_COMMENT:
          case CHARACTER:
          case STRING:
            if (fTokenLength > 0) {
              IToken token= fTokens[fState];

               // emulate JavaPartitionScanner
              if (fEmulate) {
                fTokenLength++;
                fLast= NONE;
View Full Code Here

    } else {
      fTokenLength -= getLastLength(fLast);
      fLast= last;
      fPrefixLength= prefixLength;
      IToken token= fTokens[state];
      fState= newState;
      return token;
    }
  }
View Full Code Here

   */
  protected List<WordMatcher> createMatchers() {
    List<WordMatcher> list= super.createMatchers();

    // Add word rule for keywords.
    final IToken token= getToken(ResourceProvider.JAVADOC_KEYWORD);
    WordMatcher matcher= new WordMatcher() {
      public IToken evaluate(ICharacterScanner scanner, CombinedWordRule.CharacterBuffer word) {
        int length= word.length();
        if (length > 1 && word.charAt(0) == '@') {
          int i= 0;
View Full Code Here

    /*
     * @see PatternRule#evaluate(ICharacterScanner)
     */
    public IToken evaluate(ICharacterScanner scanner) {
      IToken result= super.evaluate(scanner);
      if (result == fToken)
        return evaluateToken();
      return result;
    }
View Full Code Here

TOP

Related Classes of at.bestsolution.efxclipse.text.jface.rules.IToken

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.