All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.netbeans.modules.languages.resources.NBS.nbs Maven / Gradle / Ivy

The newest version!
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

########### Syntax Coloring ##################################################################

TOKEN:keyword:("TOKEN")
TOKEN:identifier: ( ["a"-"z" "A"-"Z"] ["a"-"z" "A"-"Z" "0"-"9" "_"]* )
TOKEN:operator: ( 
    ":" | "*" | "?" | "+" | "-" | "[" | "]" | "<" | ">" |
    "^" | "|" | "{" | "}" | "(" | ")" | "," | "=" | ";" | 
    "." | "$"
)
TOKEN:string:( 
    "\"" 
        (  
            [^ "\"" "\\" "\r" "\n"] | 
            ("\\" ["r" "n" "t" "\\" "\'" "\""]) |
            ("\\" "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"])
        )* 
    "\""
)
TOKEN:string:( 
    "\'" 
        (  
            [^ "\'" "\\" "\r" "\n"] | 
            ("\\" ["r" "n" "t" "\\" "\'" "\""]) |
            ("\\" "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"])
        )* 
    "\'"
)
TOKEN:number:( ['0'-'9']+ )
TOKEN:comment: ( "#" [^"\n" "\r"]* ["\n" "\r"]+ )
TOKEN:comment: ( "/#" - "#/")
TOKEN:whitespace:( ["\n" "\r" " " "\t"]+ )

SKIP:comment
SKIP:whitespace

S = token S;
S = tokenState S;
S = grammarRule S;
S = command S;
S = ;
                    
token = "TOKEN" ":" tokenName ":" token2;
tokenName = ;
token2 = regularExpression token3;
token2 = properties;
token3 = ":" state;
token3 = ;
tokenState = state tokenState1;
state = "<"  ">";
tokenState1 = "{" tokenGroup;
tokenState1 = ":" token;
tokenGroup = tokensInGroup "}";
tokensInGroup = token tokensInGroup;
tokensInGroup = ;
                  
regularExpression = "(" regularExpression1 ")";                    
regularExpression1 = reChoice regularExpression2;
regularExpression2 = "|" reChoice regularExpression2;
regularExpression2 = ;
reChoice = rePart reChoice1;
reChoice1 = rePart reChoice1;
reChoice1 = ;
rePart =  [  ] rePartOperatorOrMinus;
rePart = "." rePartOperator;
rePart = reClass rePartOperator;
rePart = "(" regularExpression1 ")" rePartOperator;
rePartOperator = ;
rePartOperator = "+";
rePartOperator = "?";
rePartOperator = "*";
rePartOperatorOrMinus = "-" ;
rePartOperatorOrMinus = rePartOperator;
reClass = "[" reInClassNegation reInClass "]";
reInClassNegation = "^";
reInClassNegation = ;
reInClass =  reInClassMinus reInClass1;
reInClass1 =  reInClassMinus reInClass1;
reInClass1 = ;
reInClassMinus = "-" ;
reInClassMinus = ;
                    
grammarRule = grammarRuleNT "=" grRightSide ";";
grammarRuleNT = ;
grRightSide = grChoice grRightSide1;
grRightSide1 = "|" grChoice grRightSide1;
grRightSide1 = ;
grChoice = lookahead grPart grChoice1;
grChoice = ;
grChoice1 = grPart grChoice1;
grChoice1 = ;
grPart = ntRef grOperator;
ntRef = ;
grPart = tokenDef grOperator;
grPart =  grOperator;
grPart = "[" grRightSide "]";
grPart = "(" grRightSide ")" grOperator;
grOperator = "+";
grOperator = "*";
grOperator = "?";
grOperator = ;
tokenDef = "<" tokenDefName tokenDef1 ">";
tokenDefName = ;
tokenDef1 = "," ;
tokenDef1 = ;
lookahead = "{" grRightSide "}";
lookahead = "{"  "}";
lookahead = ;
                    
command = commandName command0;
commandName = ;
command0 = ":" selector [":" value];
command0 = value;
value = class |  | properties | regularExpression;
class =  class1;
class1 = "."  class1;
class1 = ;
properties = "{" properties1 "}";
properties1 = property properties1;
properties1 = ;
property =  ":" propertyValue ";";
propertyValue = ;
propertyValue = class;
propertyValue = regularExpression;
selector = selectorPart ("," selectorPart)*;                    
selectorPart = selectorIdentifier selectorPart1;
selectorPart1 = "." selectorIdentifier selectorPart1;
selectorPart1 = ;
selectorIdentifier = ;



AST {
    removeSimple:"!selector,tokenName,tokenDefName,grammarRuleNT,ntRef,selectorIdentifier";
}

COLOR:commandName: {
    color_name: "keyword";
    default_coloring: "keyword";
    foreground_color:"blue";
}
COLOR:tokenDef: {
    color_name: "token";
    default_coloring: "variable";
    foreground_color:"0x228B22";
}
NAVIGATOR:token: {
    display_name: "TOKEN: $tokenName$";
}

NAVIGATOR:command: {
    display_name: "$keyword$: $command0.selector$";
}

COMPLETION:keyword,identifier,operator,comment,string,whitespace: {
    text1: org.netbeans.modules.languages.ext.NBS.completion;
}

COMPLETION:tokenName: {
    text1: "identifier";
    text2: "comment";
    text3: "keyword";
    text4: "string";
    text5: "number";
    text6: "operator";
    text7: "whitespace";
}

COMPLETION:regularExpression: {
    text1: "'";
    description1:"' character or string";
    text2: "\"";
    description2:"\" character or string";
    text3: "?";
    description3:"? repeat once or not at all";
    text4: "+";
    description4:"+ repeat once or more time";
    text5: "*";
    description5:"* repeat zero or more time";
    text6: "|";
    description6:"| or";
    text7: "(";
    description7:"( subexpression";
    text8: "[";
    description8:"[ set of characters ['a'-z' '_']";
    text9: "[^";
    description9:"[^ any character expect [^'\\n']";
}

MARK:ERROR: {
    type:"Error";
    message:"LBL_SYNTAX_ERROR";
}

MARK:error: {
    type:"Error";
    message:"LBL_UNEXPECTED_CHARACTER";
}

SEMANTIC_DECLARATION:grammarRuleNT: {
    name:"$$";
    type:"variable";
}

SEMANTIC_DECLARATION:tokenName: {
    name:"$$";
    type:"variable";
}

SEMANTIC_DECLARATION:command0.selector: {
    name:"$$";
    type:"variable";
    condition: org.netbeans.modules.languages.ext.NBS.tokenComand;
}

SEMANTIC_USAGE:selectorIdentifier: {
    name:"$$";
    type:"variable";
    condition: org.netbeans.modules.languages.ext.NBS.notTokenComand;
    declaration_precedes_usage:"false";
}

SEMANTIC_USAGE:ntRef: {
    name:"$$";
    type:"variable";
    declaration_precedes_usage:"false";
}
SEMANTIC_USAGE:tokenDefName: {
    name:"$$";
    type:"variable";
    declaration_precedes_usage:"false";
}

BUNDLE "org.netbeans.modules.languages.resources.Bundle"




© 2015 - 2025 Weber Informatics LLC | Privacy Policy