Mercurial > projects > dwt-addons
diff dwtx/jface/text/rules/IRule.d @ 129:eb30df5ca28b
Added JFace Text sources
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 23 Aug 2008 19:10:48 +0200 |
parents | |
children | c4fb132a086c |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwtx/jface/text/rules/IRule.d Sat Aug 23 19:10:48 2008 +0200 @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2000, 2006 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * Port to the D programming language: + * Frank Benoit <benoit@tionex.de> + *******************************************************************************/ +module dwtx.jface.text.rules.IRule; + +import dwt.dwthelper.utils; + + +/** + * Defines the interface for a rule used in the + * scanning of text for the purpose of document + * partitioning or text styling. + * + * @see ICharacterScanner + */ +public interface IRule { + + /** + * Evaluates the rule by examining the characters available from + * the provided character scanner. The token returned by this rule + * returns <code>true</code> when calling <code>isUndefined</code>, + * if the text that the rule investigated does not match the rule's requirements + * + * @param scanner the character scanner to be used by this rule + * @return the token computed by the rule + */ + IToken evaluate(ICharacterScanner scanner); +}