raster@14180
|
1 |
/*
|
raster@14180
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
raster@14180
|
3 |
*
|
raster@14180
|
4 |
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
raster@14180
|
5 |
*
|
raster@14180
|
6 |
* The contents of this file are subject to the terms of either the GNU
|
raster@14180
|
7 |
* General Public License Version 2 only ("GPL") or the Common
|
raster@14180
|
8 |
* Development and Distribution License("CDDL") (collectively, the
|
raster@14180
|
9 |
* "License"). You may not use this file except in compliance with the
|
raster@14180
|
10 |
* License. You can obtain a copy of the License at
|
raster@14180
|
11 |
* http://www.netbeans.org/cddl-gplv2.html
|
raster@14180
|
12 |
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
|
raster@14180
|
13 |
* specific language governing permissions and limitations under the
|
raster@14180
|
14 |
* License. When distributing the software, include this License Header
|
raster@14180
|
15 |
* Notice in each file and include the License file at
|
raster@14180
|
16 |
* nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
|
raster@14180
|
17 |
* particular file as subject to the "Classpath" exception as provided
|
raster@14180
|
18 |
* by Sun in the GPL Version 2 section of the License file that
|
raster@14180
|
19 |
* accompanied this code. If applicable, add the following below the
|
raster@14180
|
20 |
* License Header, with the fields enclosed by brackets [] replaced by
|
raster@14180
|
21 |
* your own identifying information:
|
raster@14180
|
22 |
* "Portions Copyrighted [year] [name of copyright owner]"
|
raster@14180
|
23 |
*
|
raster@14180
|
24 |
* If you wish your version of this file to be governed by only the CDDL
|
raster@14180
|
25 |
* or only the GPL Version 2, indicate your decision by adding
|
raster@14180
|
26 |
* "[Contributor] elects to include this software in this distribution
|
raster@14180
|
27 |
* under the [CDDL or GPL Version 2] license." If you do not indicate a
|
raster@14180
|
28 |
* single choice of license, a recipient has the option to distribute
|
raster@14180
|
29 |
* your version of this file under either the CDDL, the GPL Version 2 or
|
raster@14180
|
30 |
* to extend the choice of license to its licensees as provided above.
|
raster@14180
|
31 |
* However, if you add GPL Version 2 code and therefore, elected the GPL
|
raster@14180
|
32 |
* Version 2 license, then the option applies only if the new code is
|
raster@14180
|
33 |
* made subject to such option by the copyright holder.
|
raster@14180
|
34 |
*
|
raster@14180
|
35 |
* Contributor(s):
|
raster@14180
|
36 |
*
|
raster@14180
|
37 |
* Portions Copyrighted 2008 Sun Microsystems, Inc.
|
raster@14180
|
38 |
*/
|
raster@14180
|
39 |
|
raster@14180
|
40 |
package org.netbeans.modules.ada.editor;
|
raster@14180
|
41 |
|
raster@14180
|
42 |
import org.netbeans.modules.ada.editor.navigator.AdaInstantRenamer;
|
raster@14180
|
43 |
import org.netbeans.api.lexer.Language;
|
raster@14485
|
44 |
import org.netbeans.modules.ada.editor.formatter.AdaFormatter;
|
raster@14485
|
45 |
import org.netbeans.modules.ada.editor.formatter.AdaKeystrokeHandler;
|
raster@14539
|
46 |
import org.netbeans.modules.ada.editor.indexer.AdaIndexer;
|
raster@14180
|
47 |
import org.netbeans.modules.ada.editor.lexer.AdaTokenId;
|
raster@14627
|
48 |
import org.netbeans.modules.ada.editor.navigator.AdaDeclarationFinder;
|
raster@14539
|
49 |
import org.netbeans.modules.ada.editor.navigator.AdaOccurrencesFinder;
|
raster@14180
|
50 |
import org.netbeans.modules.ada.editor.parser.AdaStructureScanner;
|
raster@14180
|
51 |
import org.netbeans.modules.ada.editor.parser.AdaParser;
|
raster@14523
|
52 |
import org.netbeans.modules.ada.editor.parser.AdaSemanticAnalyzer;
|
raster@15779
|
53 |
import org.netbeans.modules.csl.api.CodeCompletionHandler;
|
raster@15779
|
54 |
import org.netbeans.modules.csl.api.DeclarationFinder;
|
raster@15779
|
55 |
import org.netbeans.modules.csl.api.Formatter;
|
raster@15779
|
56 |
import org.netbeans.modules.csl.api.HintsProvider;
|
raster@15779
|
57 |
import org.netbeans.modules.csl.api.InstantRenamer;
|
raster@15779
|
58 |
import org.netbeans.modules.csl.api.KeystrokeHandler;
|
raster@15779
|
59 |
import org.netbeans.modules.csl.api.OccurrencesFinder;
|
raster@15779
|
60 |
import org.netbeans.modules.csl.api.SemanticAnalyzer;
|
raster@15779
|
61 |
import org.netbeans.modules.csl.api.StructureScanner;
|
raster@15779
|
62 |
import org.netbeans.modules.csl.spi.DefaultLanguageConfig;
|
raster@15779
|
63 |
import org.netbeans.modules.parsing.spi.Parser;
|
raster@15779
|
64 |
import org.netbeans.modules.parsing.spi.indexing.EmbeddingIndexerFactory;
|
raster@15779
|
65 |
|
raster@14180
|
66 |
|
raster@14180
|
67 |
/**
|
raster@14180
|
68 |
*
|
raster@14180
|
69 |
* @author Andrea Lucarelli
|
raster@14180
|
70 |
*/
|
raster@14180
|
71 |
public class AdaLanguage extends DefaultLanguageConfig {
|
raster@14180
|
72 |
|
raster@14180
|
73 |
public AdaLanguage() {
|
raster@14180
|
74 |
}
|
raster@14180
|
75 |
|
raster@14180
|
76 |
@Override
|
raster@14180
|
77 |
public Language getLexerLanguage() {
|
raster@14180
|
78 |
return AdaTokenId.language();
|
raster@14180
|
79 |
}
|
raster@14180
|
80 |
|
raster@14180
|
81 |
@Override
|
raster@14180
|
82 |
public String getDisplayName() {
|
raster@14180
|
83 |
return "Ada";
|
raster@14180
|
84 |
}
|
raster@14180
|
85 |
|
raster@14180
|
86 |
//
|
raster@14180
|
87 |
// Service Registrations
|
raster@14180
|
88 |
//
|
raster@14523
|
89 |
|
raster@14180
|
90 |
@Override
|
raster@14180
|
91 |
public Parser getParser() {
|
raster@14180
|
92 |
return new AdaParser();
|
raster@14180
|
93 |
}
|
raster@14180
|
94 |
|
raster@14180
|
95 |
@Override
|
raster@14180
|
96 |
public boolean hasFormatter() {
|
raster@14485
|
97 |
return true;
|
raster@14180
|
98 |
}
|
raster@14180
|
99 |
|
raster@14180
|
100 |
@Override
|
raster@14180
|
101 |
public Formatter getFormatter() {
|
raster@14485
|
102 |
return new AdaFormatter();
|
raster@14180
|
103 |
}
|
raster@14180
|
104 |
|
raster@14180
|
105 |
@Override
|
raster@14180
|
106 |
public KeystrokeHandler getKeystrokeHandler() {
|
raster@14485
|
107 |
return new AdaKeystrokeHandler();
|
raster@14180
|
108 |
}
|
raster@14180
|
109 |
|
raster@14180
|
110 |
@Override
|
raster@14180
|
111 |
public CodeCompletionHandler getCompletionHandler() {
|
raster@14180
|
112 |
return null;
|
raster@14180
|
113 |
//return new AdaCodeCompletion();
|
raster@14180
|
114 |
}
|
raster@14180
|
115 |
|
raster@14180
|
116 |
@Override
|
raster@14180
|
117 |
public SemanticAnalyzer getSemanticAnalyzer() {
|
raster@14523
|
118 |
return new AdaSemanticAnalyzer();
|
raster@14180
|
119 |
}
|
raster@14180
|
120 |
|
raster@14180
|
121 |
@Override
|
raster@14180
|
122 |
public boolean hasOccurrencesFinder() {
|
raster@14539
|
123 |
return true;
|
raster@14180
|
124 |
}
|
raster@14180
|
125 |
|
raster@14180
|
126 |
@Override
|
raster@14180
|
127 |
public OccurrencesFinder getOccurrencesFinder() {
|
raster@14539
|
128 |
return new AdaOccurrencesFinder();
|
raster@14180
|
129 |
}
|
raster@14180
|
130 |
|
raster@14180
|
131 |
@Override
|
raster@14180
|
132 |
public StructureScanner getStructureScanner() {
|
raster@14180
|
133 |
return new AdaStructureScanner();
|
raster@14180
|
134 |
}
|
raster@14180
|
135 |
|
raster@14180
|
136 |
@Override
|
raster@15779
|
137 |
public EmbeddingIndexerFactory getIndexerFactory() {
|
raster@15779
|
138 |
return new AdaIndexer.Factory();
|
raster@14180
|
139 |
}
|
raster@14180
|
140 |
|
raster@14180
|
141 |
@Override
|
raster@14180
|
142 |
public boolean hasHintsProvider() {
|
raster@14180
|
143 |
return false;
|
raster@14180
|
144 |
}
|
raster@14180
|
145 |
|
raster@14180
|
146 |
@Override
|
raster@14180
|
147 |
public HintsProvider getHintsProvider() {
|
raster@14180
|
148 |
return null;
|
raster@14180
|
149 |
//return new AdaHintsProvider();
|
raster@14180
|
150 |
}
|
raster@14180
|
151 |
|
raster@14180
|
152 |
@Override
|
raster@14180
|
153 |
public DeclarationFinder getDeclarationFinder() {
|
raster@14627
|
154 |
return new AdaDeclarationFinder();
|
raster@14180
|
155 |
}
|
raster@14180
|
156 |
|
raster@14180
|
157 |
@Override
|
raster@14180
|
158 |
public InstantRenamer getInstantRenamer() {
|
raster@14180
|
159 |
return new AdaInstantRenamer();
|
raster@14180
|
160 |
}
|
raster@14180
|
161 |
|
raster@14180
|
162 |
}
|