function TextMateStyler(textView, grammar, externalGrammars) {
		this.initialize(textView);
		// Copy grammar object(s) since we will mutate them
		this.grammar = clone(grammar);
		this.externalGrammars = externalGrammars ? clone(externalGrammars) : [];
		
		this._styles = {}; /* key: {String} scopeName, value: {String[]} cssClassNames */
		this._tree = null;
		this._allGrammars = {}; /* key: {String} scopeName of grammar, value: {Object} grammar */
		this.preprocess(this.grammar);
	}
/**
	 * @name orion.editor.TextMateStyler
	 * @class A styler that knows how to apply a subset of the TextMate grammar format to style a line.
	 *
	 * <h4>Styling from a grammar:</h4>
	 * <p>Each scope name given in the grammar is converted to an array of CSS class names. For example 
	 * a region of text with scope <code>keyword.control.php</code> will be assigned the CSS classes<br />
	 * <code>keyword, keyword-control, keyword-control-php</code></p>
	 *
	 * <p>A CSS file can give rules matching any of these class names to provide generic or more specific styling.
	 * For example,</p>
	 * <p><code>.keyword { font-color: blue; }</code></p>
	 * <p>colors all keywords blue, while</p>
	 * <p><code>.keyword-control-php { font-weight: bold; }</code></p>
	 * <p>bolds only PHP control keywords.</p>
	 *
	 * <p>This is useful when using grammars that adhere to TextMate's
	 * <a href="http://manual.macromates.com/en/language_grammars.html#naming_conventions">scope name conventions</a>,
	 * as a single CSS rule can provide consistent styling to similar constructs across different languages.</p>
	 * 
	 * <h4>Top-level grammar constructs:</h4>
	 * <ul><li><code>patterns, repository</code> (with limitations, see "Other Features") are supported.</li>
	 * <li><code>scopeName, firstLineMatch, foldingStartMarker, foldingStopMarker</code> are <b>not</b> supported.</li>
	 * <li><code>fileTypes</code> is <b>not</b> supported. When using the Orion service registry, the "orion.edit.highlighter"
	 * service serves a similar purpose.</li>
	 * </ul>
	 *
	 * <h4>Regular expression constructs:</h4>
	 * <ul>
	 * <li><code>match</code> patterns are supported.</li>
	 * <li><code>begin .. end</code> patterns are supported.</li>
	 * <li>The "extended" regex forms <code>(?x)</code> and <code>(?x:...)</code> are supported, but <b>only</b> when they 
	 * apply to the entire regex pattern.</li>
	 * <li>Matching is done using native JavaScript <code>RegExp</code>s. As a result, many features of the Oniguruma regex
	 * engine used by TextMate are <b>not</b> supported.
	 * Unsupported features include:
	 *   <ul><li>Named captures</li>
	 *   <li>Setting flags inside subgroups (eg. <code>(?i:a)b</code>)</li>
	 *   <li>Lookbehind and negative lookbehind</li>
	 *   <li>Subexpression call</li>
	 *   <li>etc.</li>
	 *   </ul>
	 * </li>
	 * </ul>
	 * 
	 * <h4>Scope-assignment constructs:</h4>
	 * <ul>
	 * <li><code>captures, beginCaptures, endCaptures</code> are supported.</li>
	 * <li><code>name</code> and <code>contentName</code> are supported.</li>
	 * </ul>
	 * 
	 * <h4>Other features:</h4>
	 * <ul>
	 * <li><code>applyEndPatternLast</code> is supported.</li>
	 * <li><code>include</code> is supported, but only when it references a rule in the current grammar's <code>repository</code>.
	 * Including <code>$self</code>, <code>$base</code>, or <code>rule.from.another.grammar</code> is <b>not</b> supported.</li>
	 * </ul>
	 * 
	 * @description Creates a new TextMateStyler.
	 * @extends orion.editor.AbstractStyler
	 * @param {orion.editor.TextView} textView The <code>TextView</code> to provide styling for.
	 * @param {Object} grammar The TextMate grammar to use for styling the <code>TextView</code>, as a JavaScript object. You can
	 * produce this object by running a PList-to-JavaScript conversion tool on a TextMate <code>.tmLanguage</code> file.
	 * @param {Object[]} [externalGrammars] Additional grammar objects that will be used to resolve named rule references.
	 */
@name orion.editor.TextMateStyler
@class A styler that knows how to apply a subset of the TextMate grammar format to style a line.

Styling from a grammar:
Each scope name given in the grammar is converted to an array of CSS class names. For example
a region of text with scope keyword.control.php will be assigned the CSS classes
keyword, keyword-control, keyword-control-php

A CSS file can give rules matching any of these class names to provide generic or more specific styling.
For example,
.keyword { font-color: blue; }
colors all keywords blue, while
.keyword-control-php { font-weight: bold; }
bolds only PHP control keywords.

This is useful when using grammars that adhere to TextMate's
scope name conventions,
as a single CSS rule can provide consistent styling to similar constructs across different languages.

Top-level grammar constructs:
patterns, repository (with limitations, see "Other Features") are supported.
scopeName, firstLineMatch, foldingStartMarker, foldingStopMarker are not supported.
fileTypes is not supported. When using the Orion service registry, the "orion.edit.highlighter"
service serves a similar purpose.


Regular expression constructs:

match patterns are supported.
begin .. end patterns are supported.
The "extended" regex forms (?x) and (?x:...) are supported, but only when they
apply to the entire regex pattern.
Matching is done using native JavaScript RegExps. As a result, many features of the Oniguruma regex
engine used by TextMate are not supported.
Unsupported features include:
Named captures
Setting flags inside subgroups b)
Lookbehind and negative lookbehind
Subexpression call
etc.




Scope-assignment constructs:

captures, beginCaptures, endCaptures are supported.
name and contentName are supported.


Other features:

applyEndPatternLast is supported.
include is supported, but only when it references a rule in the current grammar's repository.
Including $self, $base, or rule.from.another.grammar is not supported.


@description Creates a new TextMateStyler.
@extends orion.editor.AbstractStyler
@param {orion.editor.TextView} textView The TextView to provide styling for.
@param {Object} grammar The TextMate grammar to use for styling the TextView, as a JavaScript object. You can
produce this object by running a PList-to-JavaScript conversion tool on a TextMate .tmLanguage file.
@param {Object[]} [externalGrammars] Additional grammar objects that will be used to resolve named rule references.
@name orion . editor . TextMateStyler @class A styler that knows how to apply a subset of the TextMate grammar format to style a line . Styling from a grammar : Each scope name given in the grammar is converted to an array of CSS class names . For example a region of text with scope keyword . control . php will be assigned the CSS classes keyword keyword - control keyword - control - php A CSS file can give rules matching any of these class names to provide generic or more specific styling . For example . keyword { font - color : blue ; } colors all keywords blue while . keyword - control - php { font - weight : bold ; } bolds only PHP control keywords . This is useful when using grammars that adhere to TextMate ' s scope name conventions as a single CSS rule can provide consistent styling to similar constructs across different languages . Top - level grammar constructs : patterns repository ( with limitations see " Other Features " ) are supported . scopeName firstLineMatch foldingStartMarker foldingStopMarker are not supported . fileTypes is not supported . When using the Orion service registry the " orion . edit . highlighter " service serves a similar purpose . Regular expression constructs : match patterns are supported . begin .. end patterns are supported . The " extended " regex forms ( ?x ) and ( ?x : ... ) are supported but only when they apply to the entire regex pattern . Matching is done using native JavaScript RegExps . As a result many features of the Oniguruma regex engine used by TextMate are not supported . Unsupported features include : Named captures Setting flags inside subgroups b ) Lookbehind and negative lookbehind Subexpression call etc . Scope - assignment constructs : captures beginCaptures endCaptures are supported . name and contentName are supported . Other features : applyEndPatternLast is supported . include is supported but only when it references a rule in the current grammar ' s repository . Including $self $base or rule . from . another . grammar is not supported . @description Creates a new TextMateStyler . @extends orion . editor . AbstractStyler @param { orion . editor . TextView } textView The TextView to provide styling for . @param { Object } grammar The TextMate grammar to use for styling the TextView as a JavaScript object . You can produce this object by running a PList - to - JavaScript conversion tool on a TextMate . tmLanguage file . @param { Object [] } [ externalGrammars ] Additional grammar objects that will be used to resolve named rule references .
function TextMateStyler(textView, grammar, externalGrammars) {
		this.initialize(textView);
		this.grammar = clone(grammar);
		this.externalGrammars = externalGrammars ? clone(externalGrammars) : [];
		this._styles = {}; 
		this._tree = null;
		this._allGrammars = {}; 
		this.preprocess(this.grammar);
	}
function TextMateStyler ( textView , grammar , externalGrammars ) { this . initialize ( textView ) ; this . grammar = clone ( grammar ) ; this . externalGrammars = externalGrammars ? clone ( externalGrammars ) : [ ] ; this . _styles = { } ; this . _tree = null ; this . _allGrammars = { } ; this . preprocess ( this . grammar ) ; }
@name orion.editor.TextMateStyler
 @class A styler that knows how to apply a subset of the TextMate grammar format to style a line.
@name orion . editor . TextMateStyler @class A styler that knows how to apply a subset of the TextMate grammar format to style a line .
// Copy grammar object(s) since we will mutate them /* key: {String} scopeName, value: {String[]} cssClassNames */ /* key: {String} scopeName of grammar, value: {Object} grammar */