Mercurial > projects > dwt2
comparison org.eclipse.jface.text/src/org/eclipse/jface/text/rules/ITokenScanner.d @ 12:bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 14 Mar 2009 18:23:29 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
11:43904fec5dca | 12:bc29606a740c |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2000, 2005 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 | |
14 | |
15 module org.eclipse.jface.text.rules.ITokenScanner; | |
16 | |
17 import org.eclipse.jface.text.rules.FastPartitioner; // packageimport | |
18 import org.eclipse.jface.text.rules.Token; // packageimport | |
19 import org.eclipse.jface.text.rules.RuleBasedScanner; // packageimport | |
20 import org.eclipse.jface.text.rules.EndOfLineRule; // packageimport | |
21 import org.eclipse.jface.text.rules.WordRule; // packageimport | |
22 import org.eclipse.jface.text.rules.WhitespaceRule; // packageimport | |
23 import org.eclipse.jface.text.rules.WordPatternRule; // packageimport | |
24 import org.eclipse.jface.text.rules.IPredicateRule; // packageimport | |
25 import org.eclipse.jface.text.rules.DefaultPartitioner; // packageimport | |
26 import org.eclipse.jface.text.rules.NumberRule; // packageimport | |
27 import org.eclipse.jface.text.rules.SingleLineRule; // packageimport | |
28 import org.eclipse.jface.text.rules.PatternRule; // packageimport | |
29 import org.eclipse.jface.text.rules.RuleBasedDamagerRepairer; // packageimport | |
30 import org.eclipse.jface.text.rules.ICharacterScanner; // packageimport | |
31 import org.eclipse.jface.text.rules.IRule; // packageimport | |
32 import org.eclipse.jface.text.rules.DefaultDamagerRepairer; // packageimport | |
33 import org.eclipse.jface.text.rules.IToken; // packageimport | |
34 import org.eclipse.jface.text.rules.IPartitionTokenScanner; // packageimport | |
35 import org.eclipse.jface.text.rules.MultiLineRule; // packageimport | |
36 import org.eclipse.jface.text.rules.RuleBasedPartitioner; // packageimport | |
37 import org.eclipse.jface.text.rules.RuleBasedPartitionScanner; // packageimport | |
38 import org.eclipse.jface.text.rules.BufferedRuleBasedScanner; // packageimport | |
39 import org.eclipse.jface.text.rules.IWhitespaceDetector; // packageimport | |
40 | |
41 import java.lang.all; | |
42 import java.util.Set; | |
43 | |
44 | |
45 import org.eclipse.jface.text.IDocument; | |
46 | |
47 | |
48 /** | |
49 * A token scanner scans a range of a document and reports about the token it finds. | |
50 * A scanner has state. When asked, the scanner returns the offset and the length of the | |
51 * last found token. | |
52 * | |
53 * @see org.eclipse.jface.text.rules.IToken | |
54 * @since 2.0 | |
55 */ | |
56 public interface ITokenScanner { | |
57 | |
58 /** | |
59 * Configures the scanner by providing access to the document range that should | |
60 * be scanned. | |
61 * | |
62 * @param document the document to scan | |
63 * @param offset the offset of the document range to scan | |
64 * @param length the length of the document range to scan | |
65 */ | |
66 void setRange(IDocument document, int offset, int length); | |
67 | |
68 /** | |
69 * Returns the next token in the document. | |
70 * | |
71 * @return the next token in the document | |
72 */ | |
73 IToken nextToken(); | |
74 | |
75 /** | |
76 * Returns the offset of the last token read by this scanner. | |
77 * | |
78 * @return the offset of the last token read by this scanner | |
79 */ | |
80 int getTokenOffset(); | |
81 | |
82 /** | |
83 * Returns the length of the last token read by this scanner. | |
84 * | |
85 * @return the length of the last token read by this scanner | |
86 */ | |
87 int getTokenLength(); | |
88 } |