129
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2000, 2006 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.IRule;
|
|
14
|
|
15 import dwt.dwthelper.utils;
|
|
16
|
|
17
|
|
18 /**
|
|
19 * Defines the interface for a rule used in the
|
|
20 * scanning of text for the purpose of document
|
|
21 * partitioning or text styling.
|
|
22 *
|
|
23 * @see ICharacterScanner
|
|
24 */
|
|
25 public interface IRule {
|
|
26
|
|
27 /**
|
|
28 * Evaluates the rule by examining the characters available from
|
|
29 * the provided character scanner. The token returned by this rule
|
|
30 * returns <code>true</code> when calling <code>isUndefined</code>,
|
|
31 * if the text that the rule investigated does not match the rule's requirements
|
|
32 *
|
|
33 * @param scanner the character scanner to be used by this rule
|
|
34 * @return the token computed by the rule
|
|
35 */
|
|
36 IToken evaluate(ICharacterScanner scanner);
|
|
37 }
|