comparison org.eclipse.jface.text/src/org/eclipse/jface/text/rules/MultiLineRule.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 module org.eclipse.jface.text.rules.MultiLineRule;
14
15 import org.eclipse.jface.text.rules.FastPartitioner; // packageimport
16 import org.eclipse.jface.text.rules.ITokenScanner; // packageimport
17 import org.eclipse.jface.text.rules.Token; // packageimport
18 import org.eclipse.jface.text.rules.RuleBasedScanner; // packageimport
19 import org.eclipse.jface.text.rules.EndOfLineRule; // packageimport
20 import org.eclipse.jface.text.rules.WordRule; // packageimport
21 import org.eclipse.jface.text.rules.WhitespaceRule; // packageimport
22 import org.eclipse.jface.text.rules.WordPatternRule; // packageimport
23 import org.eclipse.jface.text.rules.IPredicateRule; // packageimport
24 import org.eclipse.jface.text.rules.DefaultPartitioner; // packageimport
25 import org.eclipse.jface.text.rules.NumberRule; // packageimport
26 import org.eclipse.jface.text.rules.SingleLineRule; // packageimport
27 import org.eclipse.jface.text.rules.PatternRule; // packageimport
28 import org.eclipse.jface.text.rules.RuleBasedDamagerRepairer; // packageimport
29 import org.eclipse.jface.text.rules.ICharacterScanner; // packageimport
30 import org.eclipse.jface.text.rules.IRule; // packageimport
31 import org.eclipse.jface.text.rules.DefaultDamagerRepairer; // packageimport
32 import org.eclipse.jface.text.rules.IToken; // packageimport
33 import org.eclipse.jface.text.rules.IPartitionTokenScanner; // packageimport
34 import org.eclipse.jface.text.rules.RuleBasedPartitioner; // packageimport
35 import org.eclipse.jface.text.rules.RuleBasedPartitionScanner; // packageimport
36 import org.eclipse.jface.text.rules.BufferedRuleBasedScanner; // packageimport
37 import org.eclipse.jface.text.rules.IWhitespaceDetector; // packageimport
38
39
40 import java.lang.all;
41
42
43 /**
44 * A rule for detecting patterns which begin with a given
45 * sequence and may end with a given sequence thereby spanning
46 * multiple lines.
47 */
48 public class MultiLineRule : PatternRule {
49
50 /**
51 * Creates a rule for the given starting and ending sequence
52 * which, if detected, will return the specified token.
53 *
54 * @param startSequence the pattern's start sequence
55 * @param endSequence the pattern's end sequence
56 * @param token the token to be returned on success
57 */
58 public this(String startSequence, String endSequence, IToken token) {
59 this(startSequence, endSequence, token, cast(wchar) 0);
60 }
61
62 /**
63 * Creates a rule for the given starting and ending sequence
64 * which, if detected, will return the specific token.
65 * Any character which follows the given escape character will be ignored.
66 *
67 * @param startSequence the pattern's start sequence
68 * @param endSequence the pattern's end sequence
69 * @param token the token to be returned on success
70 * @param escapeCharacter the escape character
71 */
72 public this(String startSequence, String endSequence, IToken token, char escapeCharacter) {
73 this(startSequence, endSequence, token, escapeCharacter, false);
74 }
75
76 /**
77 * Creates a rule for the given starting and ending sequence
78 * which, if detected, will return the specific token. Any character that follows the
79 * given escape character will be ignored. <code>breakOnEOF</code> indicates whether
80 * EOF is equivalent to detecting the <code>endSequence</code>.
81 *
82 * @param startSequence the pattern's start sequence
83 * @param endSequence the pattern's end sequence
84 * @param token the token to be returned on success
85 * @param escapeCharacter the escape character
86 * @param breaksOnEOF indicates whether the end of the file terminates this rule successfully
87 * @since 2.1
88 */
89 public this(String startSequence, String endSequence, IToken token, char escapeCharacter, bool breaksOnEOF) {
90 super(startSequence, endSequence, token, escapeCharacter, false, breaksOnEOF);
91 }
92 }