1 19 20 package org.netbeans.lib.lexer.batch; 21 22 import java.util.Set ; 23 import org.netbeans.api.lexer.Language; 24 import org.netbeans.lib.lexer.LexerInputOperation; 25 import org.netbeans.lib.lexer.TextLexerInputOperation; 26 import org.netbeans.api.lexer.InputAttributes; 27 import org.netbeans.api.lexer.TokenId; 28 import org.netbeans.lib.lexer.TokenHierarchyOperation; 29 30 31 37 38 public final class TextTokenList<T extends TokenId> extends BatchTokenList<T> { 39 40 private CharSequence inputText; 41 42 public TextTokenList(TokenHierarchyOperation<?,T> tokenHierarchyOperation, CharSequence inputText, 43 Language<T> language, Set <T> skipTokenIds, InputAttributes inputAttributes) { 44 super(tokenHierarchyOperation, language, skipTokenIds, inputAttributes); 45 this.inputText = inputText; 46 } 47 48 public char childTokenCharAt(int rawOffset, int index) { 49 return inputText.charAt(rawOffset + index); } 51 52 protected LexerInputOperation<T> createLexerInputOperation() { 53 return new TextLexerInputOperation<T>(this, inputText); 54 } 55 56 } 57 | Popular Tags |