Home | History | Annotate | Download | only in Specifications
      1 /*
      2 	Copyright (c) 2011 Google Inc. All rights reserved.
      3 	Use of this source code is governed by a BSD-style license that can be
      4 	found in the LICENSE file.
      5 
      6 	gyp.xclangspec
      7 	GYP language specification for Xcode 3
      8 
      9 	There is not much documentation available regarding the format
     10 	of .xclangspec files. As a starting point, see for instance the
     11 	outdated documentation at:
     12 	http://maxao.free.fr/xcode-plugin-interface/specifications.html
     13 	and the files in:
     14 	/Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/Resources/
     15 
     16 	Place this file in directory:
     17 	~/Library/Application Support/Developer/Shared/Xcode/Specifications/
     18 */
     19 
     20 (
     21 
     22     {
     23         Identifier = "xcode.lang.gyp.keyword";
     24         Syntax = {
     25             Words = (
     26                 "and",
     27                 "or",
     28                 "<!",
     29                 "<",
     30              );
     31             Type = "xcode.syntax.keyword";
     32         };
     33     },
     34 
     35     {
     36         Identifier = "xcode.lang.gyp.target.declarator";
     37         Syntax = {
     38         	Words = (
     39         		"'target_name'",
     40         	);
     41             Type = "xcode.syntax.identifier.type";
     42         };
     43     },
     44 
     45 	{
     46 		Identifier = "xcode.lang.gyp.string.singlequote";
     47 		Syntax = {
     48 			IncludeRules = (
     49 				"xcode.lang.string",
     50 				"xcode.lang.gyp.keyword",
     51 				"xcode.lang.number",
     52 			);
     53 			Start = "'";
     54 			End = "'";
     55 		};
     56 	},
     57 
     58 	{
     59 		Identifier = "xcode.lang.gyp.comma";
     60 		Syntax = {
     61 			Words = ( ",", );
     62 
     63 		};
     64 	},
     65 
     66 	{
     67 		Identifier = "xcode.lang.gyp";
     68 		Description = "GYP Coloring";
     69 		BasedOn = "xcode.lang.simpleColoring";
     70 		IncludeInMenu = YES;
     71 		Name = "GYP";
     72 		Syntax = {
     73 			Tokenizer = "xcode.lang.gyp.lexer.toplevel";
     74 			IncludeRules = (
     75 				"xcode.lang.gyp.dictionary",
     76 			);
     77 			Type = "xcode.syntax.plain";
     78 		};
     79 	},
     80 
     81 	// The following rule returns tokens to the other rules
     82 	{
     83 		Identifier = "xcode.lang.gyp.lexer";
     84 		Syntax = {
     85 			IncludeRules = (
     86 				"xcode.lang.gyp.comment",
     87 				"xcode.lang.string",
     88 				'xcode.lang.gyp.targetname.declarator',
     89 				"xcode.lang.gyp.string.singlequote",
     90 				"xcode.lang.number",
     91 				"xcode.lang.gyp.comma",
     92 			);
     93 		};
     94 	},
     95 
     96 	{
     97 		Identifier = "xcode.lang.gyp.lexer.toplevel";
     98 		Syntax = {
     99 			IncludeRules = (
    100 				"xcode.lang.gyp.comment",
    101 			);
    102 		};
    103 	},
    104 
    105 	{
    106         Identifier = "xcode.lang.gyp.assignment";
    107         Syntax = {
    108             Tokenizer = "xcode.lang.gyp.lexer";
    109             Rules = (
    110             	"xcode.lang.gyp.assignment.lhs",
    111             	":",
    112                 "xcode.lang.gyp.assignment.rhs",
    113             );
    114         };
    115 
    116     },
    117 
    118     {
    119         Identifier = "xcode.lang.gyp.target.declaration";
    120         Syntax = {
    121             Tokenizer = "xcode.lang.gyp.lexer";
    122             Rules = (
    123                 "xcode.lang.gyp.target.declarator",
    124                 ":",
    125                 "xcode.lang.gyp.target.name",
    126             );
    127         };
    128    },
    129 
    130    {
    131         Identifier = "xcode.lang.gyp.target.name";
    132         Syntax = {
    133             Tokenizer = "xcode.lang.gyp.lexer";
    134             Rules = (
    135                 "xcode.lang.gyp.string.singlequote",
    136             );
    137         	Type = "xcode.syntax.definition.function";
    138         };
    139     },
    140 
    141 	{
    142         Identifier = "xcode.lang.gyp.assignment.lhs";
    143         Syntax = {
    144             Tokenizer = "xcode.lang.gyp.lexer";
    145             Rules = (
    146             	"xcode.lang.gyp.string.singlequote",
    147             );
    148          	Type = "xcode.syntax.identifier.type";
    149         };
    150     },
    151 
    152     {
    153         Identifier = "xcode.lang.gyp.assignment.rhs";
    154         Syntax = {
    155         	Tokenizer = "xcode.lang.gyp.lexer";
    156             Rules = (
    157             	"xcode.lang.gyp.string.singlequote?",
    158                 "xcode.lang.gyp.array?",
    159 				"xcode.lang.gyp.dictionary?",
    160 				"xcode.lang.number?",
    161             );
    162         };
    163     },
    164 
    165 	{
    166 		Identifier = "xcode.lang.gyp.dictionary";
    167 		Syntax = {
    168 			Tokenizer = "xcode.lang.gyp.lexer";
    169 			Start = "{";
    170 			End = "}";
    171 			Foldable = YES;
    172 			Recursive = YES;
    173 			IncludeRules = (
    174 				"xcode.lang.gyp.target.declaration",
    175 				"xcode.lang.gyp.assignment",
    176 			);
    177 		};
    178 	},
    179 
    180 	{
    181 		Identifier = "xcode.lang.gyp.array";
    182 		Syntax = {
    183 			Tokenizer = "xcode.lang.gyp.lexer";
    184 			Start = "[";
    185 			End = "]";
    186 			Foldable = YES;
    187 			Recursive = YES;
    188 			IncludeRules = (
    189 				"xcode.lang.gyp.array",
    190 				"xcode.lang.gyp.dictionary",
    191 				"xcode.lang.gyp.string.singlequote",
    192 			);
    193 		};
    194 	},
    195 
    196     {
    197         Identifier = "xcode.lang.gyp.todo.mark";
    198         Syntax = {
    199             StartChars = "T";
    200             Match = (
    201                 "^\(TODO\(.*\):[ \t]+.*\)$",       // include "TODO: " in the markers list
    202             );
    203             // This is the order of captures. All of the match strings above need the same order.
    204             CaptureTypes = (
    205                 "xcode.syntax.mark"
    206             );
    207             Type = "xcode.syntax.comment";
    208         };
    209     },
    210 
    211 	{
    212 		Identifier = "xcode.lang.gyp.comment";
    213 		BasedOn = "xcode.lang.comment"; // for text macros
    214 		Syntax = {
    215 			Start = "#";
    216 			End = "\n";
    217 			IncludeRules = (
    218 				"xcode.lang.url",
    219 				"xcode.lang.url.mail",
    220 				"xcode.lang.comment.mark",
    221 				"xcode.lang.gyp.todo.mark",
    222 			);
    223 			Type = "xcode.syntax.comment";
    224 		};
    225 	},
    226 )
    227