Skip to main content
summaryrefslogtreecommitdiffstats
blob: c795e51b17a53a553a7f7e465afed0b531a6c6cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*******************************************************************************
* Copyright (c) 2007 IBM Corporation.
* 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:
*    Robert Fuhrer (rfuhrer@watson.ibm.com) - initial API and implementation
*******************************************************************************/

package org.eclipse.imp.services;

import org.eclipse.imp.language.ILanguageService;

/**
 * Describes certain syntactic properties of the language used in support of certain editor features, such
 * as toggling comments, fence matching, and so on.
 * @author rfuhrer@watson.ibm.com
 */
public interface ILanguageSyntaxProperties extends ILanguageService {
    /**
     * if null, the language has no single-line comment syntax
     * @return
     */
    public String getSingleLineCommentPrefix();

    /**
     * @return the character sequence that starts a block comment, if the language has syntax for that, else null
     */
    public String getBlockCommentStart();

    /**
     * @return the character sequence for a line in the middle of a block comment, if the language has syntax
     * for that, else null
     */
    public String getBlockCommentContinuation();

    /**
     * @return the character sequence that ends a block comment, if the language has syntax for that, else null
     */
    public String getBlockCommentEnd();

    /**
     * If -1, there is no comment column
     */
//  public int getSingleLineCommentColumn();

    /**
     * If -1, there is no continuation column
     */
//  public int getLineContinuationColumn();

    /**
     * @return an array of arrays each containing a balanced pair
     * of fence Strings, e.g.:
     *    [ [ "[" "]" ] ["(" ")" ] [ "{" "}" ] [ "/." "./" ]
     */
    public String[][] getFences();

    /**
     * @return the set of characters that are legal in an identifier in this language
     */
    public String getIdentifierConstituentChars();

    /**
     * @param ident an identifier
     * @return the ordered set of character offsets to the individual components (e.g. words) of an identifier.
     * May be null.
     */
    public int[] getIdentifierComponents(String ident);
}

Back to the top