1
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
# Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
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]"
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.
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.
40
########### Syntax Coloring ##################################################################
63
"SEMANTIC_DECLARATION" |
70
TOKEN:identifier: ( ["a"-"z" "A"-"Z"] ["a"-"z" "A"-"Z" "0"-"9" "_"]* )
72
":" | "*" | "?" | "+" | "-" | "[" | "]" | "<" | ">" |
73
"^" | "|" | "{" | "}" | "(" | ")" | "," | "=" | ";" |
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"])
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"])
94
TOKEN:comment: ( "#" [^"\n" "\r"]* ["\n" "\r"]+ )
95
TOKEN:comment: ( "/#" - "#/")
96
TOKEN:whitespace:( ["\n" "\r" " " "\t"]+ )
107
token = "TOKEN" ":" tokenName ":" token2;
108
tokenName = <identifier>;
109
token2 = regularExpression token3;
113
tokenState = state tokenState1;
114
state = "<" <identifier> ">";
115
tokenState1 = "{" tokenGroup;
116
tokenState1 = ":" token;
117
tokenGroup = tokensInGroup "}";
118
tokensInGroup = token tokensInGroup;
121
regularExpression = "(" regularExpression1 ")";
122
regularExpression1 = reChoice regularExpression2;
123
regularExpression2 = "|" reChoice regularExpression2;
124
regularExpression2 = ;
125
reChoice = rePart reChoice1;
126
reChoice1 = rePart reChoice1;
128
rePart = <string> [ <identifier, "i"> ] rePartOperatorOrMinus;
129
rePart = "." rePartOperator;
130
rePart = reClass rePartOperator;
131
rePart = "(" regularExpression1 ")" 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;
144
reInClassMinus = "-" <string>;
147
grammarRule = grammarRuleNT "=" grRightSide ";";
148
grammarRuleNT = <identifier>;
149
grRightSide = grChoice grRightSide1;
150
grRightSide1 = "|" grChoice grRightSide1;
152
grChoice = grPart grChoice;
154
grPart = ntRef grOperator;
155
ntRef = <identifier>;
156
grPart = tokenDef grOperator;
157
grPart = <string> grOperator;
158
grPart = "[" grRightSide "]";
159
grPart = "(" grRightSide ")" grOperator;
164
tokenDef = "<" tokenDefName tokenDef1 ">";
165
tokenDefName = <identifier>;
166
tokenDef1 = "," <string>;
169
command = <keyword> command0;
170
command0 = ":" selector [":" value];
172
value = class | <string> | properties | regularExpression;
173
class = <identifier> class1;
174
class1 = "." <identifier> class1;
176
properties = "{" properties1 "}";
177
properties1 = property 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;
187
selectorIdentifier = <identifier>;
192
removeSimple:"!selector,tokenName,tokenDefName,grammarRuleNT,ntRef,selectorIdentifier";
196
display_name: "<html><b><font color=000099>TOKEN</font></b>: $tokenName$</html>";
200
display_name: "<html><b><font color=000099>$keyword$</font></b>: $command0.selector$</html>";
203
COMPLETION:keyword,identifier,operator,comment,string,whitespace: {
204
text1: org.netbeans.modules.languages.ext.NBS.completion;
207
COMPLETION:tokenName: {
217
COMPLETION:regularExpression: {
219
description1:"<b>'</b> character or string";
221
description2:"<b>\"</b> character or string";
223
description3:"<b>?</b> repeat once or not at all";
225
description4:"<b>+</b> repeat once or more time";
227
description5:"<b>*</b> repeat zero or more time";
229
description6:"<b>|</b> or";
231
description7:"<b>(</b> subexpression";
233
description8:"<b>[</b> set of characters ['a'-z' '_']";
235
description9:"<b>[^</b> any character expect [^'\\n']";
240
message:"LBL_SYNTAX_ERROR";
245
message:"LBL_UNEXPECTED_CHARACTER";
248
SEMANTIC_DECLARATION:grammarRuleNT: {
253
SEMANTIC_DECLARATION:tokenName: {
258
SEMANTIC_DECLARATION:command0.selector: {
261
condition: org.netbeans.modules.languages.ext.NBS.tokenComand;
264
SEMANTIC_USAGE:selectorIdentifier: {
267
condition: org.netbeans.modules.languages.ext.NBS.notTokenComand;
268
declaration_precedes_usage:"false";
271
SEMANTIC_USAGE:ntRef: {
274
declaration_precedes_usage:"false";
276
SEMANTIC_USAGE:tokenDefName: {
279
declaration_precedes_usage:"false";
282
BUNDLE "org.netbeans.modules.languages.resources.Bundle"