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 module dwtx.jface.text.rules.IToken;
|
|
14
|
131
|
15 import dwtx.jface.text.rules.FastPartitioner; // packageimport
|
|
16 import dwtx.jface.text.rules.ITokenScanner; // packageimport
|
|
17 import dwtx.jface.text.rules.Token; // packageimport
|
|
18 import dwtx.jface.text.rules.RuleBasedScanner; // packageimport
|
|
19 import dwtx.jface.text.rules.EndOfLineRule; // packageimport
|
|
20 import dwtx.jface.text.rules.WordRule; // packageimport
|
|
21 import dwtx.jface.text.rules.WhitespaceRule; // packageimport
|
|
22 import dwtx.jface.text.rules.WordPatternRule; // packageimport
|
|
23 import dwtx.jface.text.rules.IPredicateRule; // packageimport
|
|
24 import dwtx.jface.text.rules.DefaultPartitioner; // packageimport
|
|
25 import dwtx.jface.text.rules.NumberRule; // packageimport
|
|
26 import dwtx.jface.text.rules.SingleLineRule; // packageimport
|
|
27 import dwtx.jface.text.rules.PatternRule; // packageimport
|
|
28 import dwtx.jface.text.rules.RuleBasedDamagerRepairer; // packageimport
|
|
29 import dwtx.jface.text.rules.ICharacterScanner; // packageimport
|
|
30 import dwtx.jface.text.rules.IRule; // packageimport
|
|
31 import dwtx.jface.text.rules.DefaultDamagerRepairer; // packageimport
|
|
32 import dwtx.jface.text.rules.IPartitionTokenScanner; // packageimport
|
|
33 import dwtx.jface.text.rules.MultiLineRule; // packageimport
|
|
34 import dwtx.jface.text.rules.RuleBasedPartitioner; // packageimport
|
|
35 import dwtx.jface.text.rules.RuleBasedPartitionScanner; // packageimport
|
|
36 import dwtx.jface.text.rules.BufferedRuleBasedScanner; // packageimport
|
|
37 import dwtx.jface.text.rules.IWhitespaceDetector; // packageimport
|
|
38
|
|
39
|
129
|
40 import dwt.dwthelper.utils;
|
|
41
|
|
42
|
|
43 /**
|
|
44 * A token to be returned by a rule.
|
|
45 */
|
|
46 public interface IToken {
|
|
47
|
|
48 /**
|
|
49 * Return whether this token is undefined.
|
|
50 *
|
|
51 * @return <code>true</code>if this token is undefined
|
|
52 */
|
|
53 bool isUndefined();
|
|
54
|
|
55 /**
|
|
56 * Return whether this token represents a whitespace.
|
|
57 *
|
|
58 * @return <code>true</code>if this token represents a whitespace
|
|
59 */
|
|
60 bool isWhitespace();
|
|
61
|
|
62 /**
|
|
63 * Return whether this token represents End Of File.
|
|
64 *
|
|
65 * @return <code>true</code>if this token represents EOF
|
|
66 */
|
|
67 bool isEOF();
|
|
68
|
|
69 /**
|
|
70 * Return whether this token is neither undefined, nor whitespace, nor EOF.
|
|
71 *
|
|
72 * @return <code>true</code>if this token is not undefined, not a whitespace, and not EOF
|
|
73 */
|
|
74 bool isOther();
|
|
75
|
|
76 /**
|
|
77 * Return a data attached to this token. The semantics of this data kept undefined by this interface.
|
|
78 *
|
|
79 * @return the data attached to this token.
|
|
80 */
|
|
81 Object getData();
|
|
82 }
|