129
|
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
|
131
|
14
|
151
|
15 module dwtx.jface.text.rules.IPartitionTokenScanner;
|
|
16
|
131
|
17 import dwtx.jface.text.rules.FastPartitioner; // packageimport
|
|
18 import dwtx.jface.text.rules.ITokenScanner; // packageimport
|
|
19 import dwtx.jface.text.rules.Token; // packageimport
|
|
20 import dwtx.jface.text.rules.RuleBasedScanner; // packageimport
|
|
21 import dwtx.jface.text.rules.EndOfLineRule; // packageimport
|
|
22 import dwtx.jface.text.rules.WordRule; // packageimport
|
|
23 import dwtx.jface.text.rules.WhitespaceRule; // packageimport
|
|
24 import dwtx.jface.text.rules.WordPatternRule; // packageimport
|
|
25 import dwtx.jface.text.rules.IPredicateRule; // packageimport
|
|
26 import dwtx.jface.text.rules.DefaultPartitioner; // packageimport
|
|
27 import dwtx.jface.text.rules.NumberRule; // packageimport
|
|
28 import dwtx.jface.text.rules.SingleLineRule; // packageimport
|
|
29 import dwtx.jface.text.rules.PatternRule; // packageimport
|
|
30 import dwtx.jface.text.rules.IWordDetector; // packageimport
|
|
31 import dwtx.jface.text.rules.RuleBasedDamagerRepairer; // packageimport
|
|
32 import dwtx.jface.text.rules.ICharacterScanner; // packageimport
|
|
33 import dwtx.jface.text.rules.IRule; // packageimport
|
|
34 import dwtx.jface.text.rules.DefaultDamagerRepairer; // packageimport
|
|
35 import dwtx.jface.text.rules.IToken; // packageimport
|
|
36 import dwtx.jface.text.rules.MultiLineRule; // packageimport
|
|
37 import dwtx.jface.text.rules.RuleBasedPartitioner; // packageimport
|
|
38 import dwtx.jface.text.rules.RuleBasedPartitionScanner; // packageimport
|
|
39 import dwtx.jface.text.rules.BufferedRuleBasedScanner; // packageimport
|
|
40 import dwtx.jface.text.rules.IWhitespaceDetector; // packageimport
|
|
41
|
129
|
42 import dwt.dwthelper.utils;
|
|
43
|
|
44
|
|
45 import dwtx.jface.text.IDocument;
|
|
46
|
|
47
|
|
48 /**
|
|
49 * A partition token scanner returns tokens that represent partitions. For that reason,
|
|
50 * a partition token scanner is vulnerable in respect to the document offset it starts
|
|
51 * scanning. In a simple case, a partition token scanner must always start at a partition
|
|
52 * boundary. A partition token scanner can also start in the middle of a partition,
|
|
53 * if it knows the type of the partition.
|
|
54 *
|
|
55 * @since 2.0
|
|
56 */
|
|
57 public interface IPartitionTokenScanner : ITokenScanner {
|
|
58
|
|
59 /**
|
|
60 * Configures the scanner by providing access to the document range that should be scanned.
|
|
61 * The range may no only contain complete partitions but starts at the beginning of a line in the
|
|
62 * middle of a partition of the given content type. This requires that a partition delimiter can not
|
|
63 * contain a line delimiter.
|
|
64 *
|
|
65 * @param document the document to scan
|
|
66 * @param offset the offset of the document range to scan
|
|
67 * @param length the length of the document range to scan
|
|
68 * @param contentType the content type at the given offset
|
|
69 * @param partitionOffset the offset at which the partition of the given offset starts
|
|
70 */
|
|
71 void setPartialRange(IDocument document, int offset, int length, String contentType, int partitionOffset);
|
|
72 }
|