~ubuntu-branches/ubuntu/quantal/netbeans/quantal

« back to all changes in this revision

Viewing changes to languages/engine/src/org/netbeans/modules/languages/resources/NBS.nbs

  • Committer: Bazaar Package Importer
  • Author(s): Marek Slama
  • Date: 2008-01-29 14:11:22 UTC
  • Revision ID: james.westby@ubuntu.com-20080129141122-fnzjbo11ntghxfu7
Tags: upstream-6.0.1
ImportĀ upstreamĀ versionĀ 6.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 
2
#
 
3
# Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
 
4
#
 
5
# The contents of this file are subject to the terms of either the GNU
 
6
# General Public License Version 2 only ("GPL") or the Common
 
7
# Development and Distribution License("CDDL") (collectively, the
 
8
# "License"). You may not use this file except in compliance with the
 
9
# License. You can obtain a copy of the License at
 
10
# http://www.netbeans.org/cddl-gplv2.html
 
11
# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
 
12
# specific language governing permissions and limitations under the
 
13
# License.  When distributing the software, include this License Header
 
14
# Notice in each file and include the License file at
 
15
# nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
 
16
# particular file as subject to the "Classpath" exception as provided
 
17
# by Sun in the GPL Version 2 section of the License file that
 
18
# accompanied this code. If applicable, add the following below the
 
19
# License Header, with the fields enclosed by brackets [] replaced by
 
20
# your own identifying information:
 
21
# "Portions Copyrighted [year] [name of copyright owner]"
 
22
#
 
23
# Contributor(s):
 
24
#
 
25
# The Original Software is NetBeans. The Initial Developer of the Original
 
26
# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
 
27
# Microsystems, Inc. All Rights Reserved.
 
28
#
 
29
# If you wish your version of this file to be governed by only the CDDL
 
30
# or only the GPL Version 2, indicate your decision by adding
 
31
# "[Contributor] elects to include this software in this distribution
 
32
# under the [CDDL or GPL Version 2] license." If you do not indicate a
 
33
# single choice of license, a recipient has the option to distribute
 
34
# your version of this file under either the CDDL, the GPL Version 2 or
 
35
# to extend the choice of license to its licensees as provided above.
 
36
# However, if you add GPL Version 2 code and therefore, elected the GPL
 
37
# Version 2 license, then the option applies only if the new code is
 
38
# made subject to such option by the copyright holder.
 
39
 
 
40
########### Syntax Coloring ##################################################################
 
41
 
 
42
TOKEN:keyword:(
 
43
    "ACTION" |
 
44
    "AST" |
 
45
    "BRACE" |
 
46
    "BUNDLE" |
 
47
    "COLOR" | 
 
48
    "COMMENT_LINE" |
 
49
    "COMPLETE" |  
 
50
    "COMPLETION" | 
 
51
    "FOLD" | 
 
52
    "FORMAT" |
 
53
    "HYPERLINK" | 
 
54
    "IMPORT" | 
 
55
    "INDENT" | 
 
56
    "MARK" | 
 
57
    "NAVIGATOR" | 
 
58
    "PARSE" | 
 
59
    "PROPERTIES" | 
 
60
    "REFORMAT" |
 
61
    "SELECTION" |
 
62
    "SEMANTIC_CONTEXT" |
 
63
    "SEMANTIC_DECLARATION" |
 
64
    "SEMANTIC_USAGE" |
 
65
    "SKIP" | 
 
66
    "STORE" | 
 
67
    "TOKEN" | 
 
68
    "TOOLTIP"
 
69
)
 
70
TOKEN:identifier: ( ["a"-"z" "A"-"Z"] ["a"-"z" "A"-"Z" "0"-"9" "_"]* )
 
71
TOKEN:operator: ( 
 
72
    ":" | "*" | "?" | "+" | "-" | "[" | "]" | "<" | ">" |
 
73
    "^" | "|" | "{" | "}" | "(" | ")" | "," | "=" | ";" | 
 
74
    "." | "$"
 
75
)
 
76
TOKEN:string:( 
 
77
    "\"" 
 
78
        (  
 
79
            [^ "\"" "\\" "\r" "\n"] | 
 
80
            ("\\" ["r" "n" "t" "\\" "\'" "\""]) |
 
81
            ("\\" "u" ["0"-"9" "a"-"f" "A"-"F"] ["0"-"9" "a"-"f" "A"-"F"] ["0"-"9" "a"-"f" "A"-"F"] ["0"-"9" "a"-"f" "A"-"F"])
 
82
        )* 
 
83
    "\""
 
84
)
 
85
TOKEN:string:( 
 
86
    "\'" 
 
87
        (  
 
88
            [^ "\'" "\\" "\r" "\n"] | 
 
89
            ("\\" ["r" "n" "t" "\\" "\'" "\""]) |
 
90
            ("\\" "u" ["0"-"9" "a"-"f" "A"-"F"] ["0"-"9" "a"-"f" "A"-"F"] ["0"-"9" "a"-"f" "A"-"F"] ["0"-"9" "a"-"f" "A"-"F"])
 
91
        )* 
 
92
    "\'"
 
93
)
 
94
TOKEN:comment: ( "#" [^"\n" "\r"]* ["\n" "\r"]+ )
 
95
TOKEN:comment: ( "/#" - "#/")
 
96
TOKEN:whitespace:( ["\n" "\r" " " "\t"]+ )
 
97
 
 
98
SKIP:comment
 
99
SKIP:whitespace
 
100
 
 
101
S = token S;
 
102
S = tokenState S;
 
103
S = grammarRule S;
 
104
S = command S;
 
105
S = ;
 
106
                    
 
107
token = "TOKEN" ":" tokenName ":" token2;
 
108
tokenName = <identifier>;
 
109
token2 = regularExpression token3;
 
110
token2 = properties;
 
111
token3 = ":" state;
 
112
token3 = ;
 
113
tokenState = state tokenState1;
 
114
state = "<" <identifier> ">";
 
115
tokenState1 = "{" tokenGroup;
 
116
tokenState1 = ":" token;
 
117
tokenGroup = tokensInGroup "}";
 
118
tokensInGroup = token tokensInGroup;
 
119
tokensInGroup = ;
 
120
                  
 
121
regularExpression = "(" regularExpression1 ")";                    
 
122
regularExpression1 = reChoice regularExpression2;
 
123
regularExpression2 = "|" reChoice regularExpression2;
 
124
regularExpression2 = ;
 
125
reChoice = rePart reChoice1;
 
126
reChoice1 = rePart reChoice1;
 
127
reChoice1 = ;
 
128
rePart = <string> [ <identifier, "i"> ] rePartOperatorOrMinus;
 
129
rePart = "." rePartOperator;
 
130
rePart = reClass rePartOperator;
 
131
rePart = "(" regularExpression1 ")" rePartOperator;
 
132
rePartOperator = ;
 
133
rePartOperator = "+";
 
134
rePartOperator = "?";
 
135
rePartOperator = "*";
 
136
rePartOperatorOrMinus = "-" <string>;
 
137
rePartOperatorOrMinus = rePartOperator;
 
138
reClass = "[" reInClassNegation reInClass "]";
 
139
reInClassNegation = "^";
 
140
reInClassNegation = ;
 
141
reInClass = <string> reInClassMinus reInClass1;
 
142
reInClass1 = <string> reInClassMinus reInClass1;
 
143
reInClass1 = ;
 
144
reInClassMinus = "-" <string>;
 
145
reInClassMinus = ;
 
146
                    
 
147
grammarRule = grammarRuleNT "=" grRightSide ";";
 
148
grammarRuleNT = <identifier>;
 
149
grRightSide = grChoice grRightSide1;
 
150
grRightSide1 = "|" grChoice grRightSide1;
 
151
grRightSide1 = ;
 
152
grChoice = grPart grChoice;
 
153
grChoice = ;
 
154
grPart = ntRef grOperator;
 
155
ntRef = <identifier>;
 
156
grPart = tokenDef grOperator;
 
157
grPart = <string> grOperator;
 
158
grPart = "[" grRightSide "]";
 
159
grPart = "(" grRightSide ")" grOperator;
 
160
grOperator = "+";
 
161
grOperator = "*";
 
162
grOperator = "?";
 
163
grOperator = ;
 
164
tokenDef = "<" tokenDefName tokenDef1 ">";
 
165
tokenDefName = <identifier>;
 
166
tokenDef1 = "," <string>;
 
167
tokenDef1 = ;
 
168
                    
 
169
command = <keyword> command0;
 
170
command0 = ":" selector [":" value];
 
171
command0 = value;
 
172
value = class | <string> | properties | regularExpression;
 
173
class = <identifier> class1;
 
174
class1 = "." <identifier> class1;
 
175
class1 = ;
 
176
properties = "{" properties1 "}";
 
177
properties1 = property properties1;
 
178
properties1 = ;
 
179
property = <identifier> ":" propertyValue ";";
 
180
propertyValue = <string>;
 
181
propertyValue = class;
 
182
propertyValue = regularExpression;
 
183
selector = selectorPart ("," selectorPart)*;                    
 
184
selectorPart = selectorIdentifier selectorPart1;
 
185
selectorPart1 = "." selectorIdentifier selectorPart1;
 
186
selectorPart1 = ;
 
187
selectorIdentifier = <identifier>;
 
188
 
 
189
 
 
190
 
 
191
AST {
 
192
    removeSimple:"!selector,tokenName,tokenDefName,grammarRuleNT,ntRef,selectorIdentifier";
 
193
}
 
194
 
 
195
NAVIGATOR:token: {
 
196
    display_name: "<html><b><font color=000099>TOKEN</font></b>: $tokenName$</html>";
 
197
}
 
198
 
 
199
NAVIGATOR:command: {
 
200
    display_name: "<html><b><font color=000099>$keyword$</font></b>: $command0.selector$</html>";
 
201
}
 
202
 
 
203
COMPLETION:keyword,identifier,operator,comment,string,whitespace: {
 
204
    text1: org.netbeans.modules.languages.ext.NBS.completion;
 
205
}
 
206
 
 
207
COMPLETION:tokenName: {
 
208
    text1: "identifier";
 
209
    text2: "comment";
 
210
    text3: "keyword";
 
211
    text4: "string";
 
212
    text5: "number";
 
213
    text6: "operator";
 
214
    text7: "whitespace";
 
215
}
 
216
 
 
217
COMPLETION:regularExpression: {
 
218
    text1: "'";
 
219
    description1:"<b>'</b> character or string";
 
220
    text2: "\"";
 
221
    description2:"<b>\"</b> character or string";
 
222
    text3: "?";
 
223
    description3:"<b>?</b> repeat once or not at all";
 
224
    text4: "+";
 
225
    description4:"<b>+</b> repeat once or more time";
 
226
    text5: "*";
 
227
    description5:"<b>*</b> repeat zero or more time";
 
228
    text6: "|";
 
229
    description6:"<b>|</b> or";
 
230
    text7: "(";
 
231
    description7:"<b>(</b> subexpression";
 
232
    text8: "[";
 
233
    description8:"<b>[</b> set of characters ['a'-z' '_']";
 
234
    text9: "[^";
 
235
    description9:"<b>[^</b> any character expect [^'\\n']";
 
236
}
 
237
 
 
238
MARK:ERROR: {
 
239
    type:"Error";
 
240
    message:"LBL_SYNTAX_ERROR";
 
241
}
 
242
 
 
243
MARK:error: {
 
244
    type:"Error";
 
245
    message:"LBL_UNEXPECTED_CHARACTER";
 
246
}
 
247
 
 
248
SEMANTIC_DECLARATION:grammarRuleNT: {
 
249
    name:"$$";
 
250
    type:"variable";
 
251
}
 
252
 
 
253
SEMANTIC_DECLARATION:tokenName: {
 
254
    name:"$$";
 
255
    type:"variable";
 
256
}
 
257
 
 
258
SEMANTIC_DECLARATION:command0.selector: {
 
259
    name:"$$";
 
260
    type:"variable";
 
261
    condition: org.netbeans.modules.languages.ext.NBS.tokenComand;
 
262
}
 
263
 
 
264
SEMANTIC_USAGE:selectorIdentifier: {
 
265
    name:"$$";
 
266
    type:"variable";
 
267
    condition: org.netbeans.modules.languages.ext.NBS.notTokenComand;
 
268
    declaration_precedes_usage:"false";
 
269
}
 
270
 
 
271
SEMANTIC_USAGE:ntRef: {
 
272
    name:"$$";
 
273
    type:"variable";
 
274
    declaration_precedes_usage:"false";
 
275
}
 
276
SEMANTIC_USAGE:tokenDefName: {
 
277
    name:"$$";
 
278
    type:"variable";
 
279
    declaration_precedes_usage:"false";
 
280
}
 
281
 
 
282
BUNDLE "org.netbeans.modules.languages.resources.Bundle"