<?xml version="1.0" encoding="UTF-8"?>

<!--

############
### CONTENTS
# @1 == Metadata
# @2 == Styles
# @3 == Regex Definitions
# @4 == Error Contexts
# @5 == Parts that make Declerations
# @6 == Declerations
# @7 == Parts that make blocks
# @8 == Blocks
# @9 == Comments
# @10 == Strings
# @11 == Constants
# @12 == Keywords
# @13 == CDATA
# @14 == Context Groups

-->

<language id="as" _name="Actionscript" version="2.0" _section="Sources">


	<!--
		@1 == Metadata
	-->


    <metadata>
        <property name="mimetypes">text/actionscript</property>
        <property name="globs">*.as</property>
        <property name="line-comment-start">//</property>
        <property name="block-comment-start">/*</property>
		<property name="block-comment-end">*/</property>
    </metadata>


    <!--
    	@2 == Styles
    -->


    <styles>
        <style id="comment" 		_name="Comment" 					map-to="def:comment"/>
        <style id="error" 			_name="Error" 						map-to="def:error"/>
        <style id="string" 			_name="String" 						map-to="def:string"/>
        <style id="null-value" 		_name="Null Value" 					map-to="def:special-constant"/>
        <style id="boolean" 		_name="Boolean value" 				map-to="def:boolean"/>
        <style id="keyword" 		_name="Keyword" 					map-to="def:keyword"/>
		<style id="other" 			_name="Other"	 					map-to="def:others"/>
        <style id="type"			_name="Data Type" 					map-to="def:type"/>
        <style id="function" 		_name="Function" 					map-to="def:function"/>
        <style id="properties" 		_name="Properties" 					map-to="def:statement"/>
        <style id="constructors" 	_name="Constructors" 				map-to="def:type"/>
		<style id="future-words" 	_name="Future Reserved Keywords" 	map-to="def:error"/>
		<style id="preprocessor" 	_name="preprocessor" 				map-to="def:preprocessor"/>
		<style id="operators" 		_name="operators" 					map-to="def:operators"/>
	</styles>

	<default-regex-options 			dupnames="true" 		extended="true"/>

	<definitions>

		<!--

			@3 == Regex Definitions

		-->


		<define-regex id="packagePath">
			\w+(\.\w+)*
			#[a-zA-Z_](\.?[a-zA-Z0-9]+)*
		</define-regex>

		<define-regex id="importPath">
			\%{packagePath};?
		</define-regex>

		<define-regex id="classStatement">
			\s(class)\s+\w+
			(
				(?&lt;extends&gt;			\sextends\s+)
				(?&lt;path1&gt;		   	 \%{packagePath})
			)?

			(
				(?&lt;implements&gt;	\simplements\s+)
				(?&lt;path2&gt;		   	 \%{packagePath})
			)?
		</define-regex>

		<define-regex id="functionStatement">
			\s(function)(\sset\s|\sget\s|\s+)\w+\s*
		</define-regex>


		<!--

			@4 == Error Contexts

		-->



        <context id="closeCommentOutside" 		style-ref="error">
			<start>
				\*/
			</start>
		</context>

		<context id="badComment" 				style-ref="error">
			<start>
				^\s*/([^(/|*)]|$)
			</start>
		</context>


		<context id="errorImportStatement" 		style-ref="error">
			<match>
				^\s*(import)\s.*$
			</match>
		</context>

		<context id="matchbadParams" 			style-ref="error">
			<start>
				,\s*(,|:)		|   # two commas or comma and colon in procession
				\w+\s+\.  		| 	# a dot without a preceding comma
				,\s*\)			| 	# comma followed by nothing followed by end bracket
				:\s*\) 	 		|  	# a colon followed by some or none spaces and an end bracket
				:\s*\w*\s*: 	|	# two colons without comma in between
				\s*\w+:?$ 		|	# end of the line after a param
				\s*\w+:\w+\s*\. |	# a paramater with a dot in the type
				\w+\s+\w+ 			# one or more letters followed by one or more spaces followed by one or more letters
			</start>
		</context>

		<context id="badParams" 				style-ref="error">
			<start>
				\(
				(
					(\s*\w+\s*:\s*\w+\s*,)*
					(
						\s*\w+:\s*(,|\)) |
						\s*\w*\s*:\s*\) |
						\s*\w+\s*(\)|,) |
						(\.\.\.)\s*\w+\s*[^\)] |
						\s*\.(?!(\.\.\s*\w+\s*\)))


					)
				) 	|
				\((\s*\w+\s*:\s*\w+\s*,)+\s*\)	|
				\(\s*: |
				\(\s*, |
				\(\s*\w+\s*(:\s*)?,
			</start>
		</context>

		<context id="badStatementInBrackets" 	style-ref="error" 	once-only="true">
			<start>
				#\([^\)]*[,:][^\)]*\) |
				\.\s*\(
			</start>
		</context>

		<context id="badBraces" 				style-ref="error" 	once-only="true" >
			<start>\S+</start>
			<end>{</end>
		</context>


		<context id="badStartBracket"  			style-ref="error" 	once-only="true" 	end-parent="true">
			<start>\S+</start>
			<end>\(</end>
		</context>

		<context id="badDecleration" 			style-ref="error">
			<start>
				(public|private)
			</start>
		</context>

		<context id="badVarTypeInFunction"		style-ref="error" 	once-only="true" >
			<start>
				\)\s*
				(
					[^\s*:] |
					:\s*\w+\*
				)
			</start>
		</context>

		<context id="badVarType"		style-ref="error" 	once-only="true" >
			<start>
				:\s+ |
				:\*\w+ |
				:\w+\*
			</start>
		</context>

		<context id="badVarInitialisationStep1" style-ref="error">
			<start>
				\s*=\s*\(	|
				\s*=\s*;?$
			</start>
		</context>

		<context id="badVarInitialisation" 		style-ref="error">
			<match>
				\w+\s+(\w+\s*)+[^$]*$ |
				\w+\s*\(\s*\w*\s*\)(\s+[^\+]+)+ |
				\w+\s*\((\s*\w*)*$ |

			</match>
		</context>


		<!--

			@5 == Parts that make Declerations

		-->

		<context id="initialiseClass">
			<include>
				<context id="badInitialiseClass" once-only="true" style-ref="error">
					<start>\s*=\s*(new)\s+( \( | ;?\s*$)</start>
				</context>
				<context id="goodInitialiseClass" once-only="true" end-parent="true">
					<start>\s*=\s*(new)\s</start>
					<end>\s*;\s*</end>
					<include>
						<context sub-pattern="1" style-ref="keyword" where="start"/>
						<context id="badFunctionExecution" style-ref="error">
							<match>
								\s*\w+\s*\((\s*\w*)*$	|
								\s*\w+\s+\w[^$]*$	|
								\s*[a-zA-Z0-9]+\s*\) 	|
								\s*\w+\s*\(\s*\w*\s*\)(\s+\S+)+;$ |
								\s*\w+\s*\(\s*\w+\s+(\w+\s*)+[^$]$
							</match>
						</context>
						<context ref="functionExecution" />
						<context ref="dataTypes"/>
					</include>
				</context>
			</include>
		</context>

		<context id="insideVariableDeclaration">
			<include>
				<context ref="badVarType"/>
				<context id="functionVarType" end-parent="true" once-only="true">
					<start>:</start>
					<end>\s*;\s*</end>
					<include>
						<context ref="insideGoodDeclaration"/>
					</include>
				</context>
			</include>
		</context>

		<context id="insideConstDeclaration">
			<include>
				<context ref="badVarType"/>
				<context id="constVarType" end-parent="true" once-only="true">
					<start>:</start>
					<include>
						<context ref="insideGoodDeclaration"/>
					</include>
				</context>
			</include>
		</context>

		<context id="insideNamespaceDeclaration">
			<include>
				<context id="badNameSpaceInitialisation" style-ref="error">
					<start>\s*=\s*\w+</start>
				</context>
				<context id="namespaceInitialisation" end-parent="true" >
					<start>\s*=\s*</start>
					<end>\s*;\s*</end>
					<include>
						<context ref="string-double"/>
					</include>
				</context>
			</include>
		</context>

		<context id="insideGoodDeclaration">
			<include>
				<context ref="dataTypes"/>
				<context ref="initialiseClass"/>
				<context ref="badVarInitialisationStep1"/>
				<context id="varInitialisation" end-parent="true" >
					<start>\s*=\s*</start>
					<end>\s*;\s*</end>
					<include>
						<context ref="functionExecution"/>
						<context ref="accessArrayChild"/>
						<context ref="badVarInitialisation"/>
						<context ref="common"/>
					</include>
				</context>
			</include>
		</context>
		<context id="importStatement">
			<start>^\s*(import)\s+(\%{importPath})(\.\*\;)?\s*</start>
			<end>$</end>
			<include>
				<context sub-pattern="1" style-ref="keyword" where="start"/>
				<context sub-pattern="2" style-ref="preprocessor" where="start"/>
				<context id="extraImport" style-ref="error">
					<match>\S</match>
				</context>
			</include>
		</context>

		<context id="badFunctionName" style-ref="error">
			<start>\s*\S+\s*\(</start>
		</context>

		<context id="insideFunction">
			<include>
				<context ref="badParams"/>
				<context ref="badFunctionName"/>
				<context id="functionParams" once-only="true" end-parent="true">
					<start>\(</start>
					<include>
						<context ref="matchbadParams"/>
						<context ref="dataTypes"/>
						<context sub-pattern="0" style-ref="keyword" where="start"/>
						<context ref="badVarTypeInFunction"/>
						<context id="functionType" end-parent="true" once-only="true">
							<start>(?&lt;bracket&gt; \) )\s*</start>
							<include>
								<context sub-pattern="bracket" where="start" style-ref="keyword"/>

								<context id="badType0" style-ref="error">
									<start>\s*{</start>
								</context>

								<context id="badtype1" style-ref="error">
									<start>(?=:\s*\w+\s+\w+)</start>
								</context>

								<context id="badtype2" style-ref="error">
									<start>(?=:\s*\*\s+\w+)</start>
								</context>

								<context id="badtype3" style-ref="error">
									<start>(?=:\s*(//|$|/\*))</start>
								</context>

								<context id="goodType1" end-parent="true">
									<start>(?=:\s*\w+\s*)(?!\s+\w+)</start>
									<include>
										<context ref="dataTypes"/>
										<context ref="line-comment"/>
										<context ref="block-comment"/>
										<context id="goodFBrackets2" end-parent="true" once-only="true">
											<start>\s*{</start>
											<end>}</end>
											<include>
												<context ref="includeInGoodFunctionBrackets"/>
											</include>
										</context>
									</include>
								</context>
								<context id="goodType2" end-parent="true" >
									<start>(?=:\s*\*\s*)(?!\s+\w+)</start>
									<include>
										<context ref="dataTypes"/>
										<context ref="line-comment"/>
										<context ref="block-comment"/>
										<context id="goodFBrackets3" end-parent="true" once-only="true">
											<start>\s*{</start>
											<end>}</end>
											<include>
												<context ref="includeInGoodFunctionBrackets"/>
											</include>
										</context>
									</include>
								</context>


							</include>
						</context>

					</include>
				</context>
			</include>
		</context>

		<context id="insideConstructorFunction">
			<include>
				<context ref="badParams"/>
				<context ref="badFunctionName"/>
				<context id="cfunctionParams" once-only="true" end-parent="true">
					<start>\(</start>
					<include>
						<context ref="matchbadParams"/>
						<context sub-pattern="0" style-ref="keyword" where="start"/>
						<context id="cfunctionType" end-parent="true" once-only="true">
							<start>(?&lt;bracket&gt; \) )(?=\s*({|$|//|/*))</start>
							<include>
								<context sub-pattern="bracket" where="start" style-ref="keyword"/>
								<context ref="dataTypes"/>
								<context ref="line-comment"/>
								<context ref="block-comment"/>
								<context id="cgoodFBrackets2" end-parent="true" once-only="true">
									<start>\s*{</start>
									<end>}</end>
									<include>
										<context ref="includeInGoodFunctionBrackets"/>
									</include>
								</context>
							</include>
						</context>
					</include>
				</context>
			</include>
		</context>

		<context id="insideClass" >
			<include>
				<context ref="comments"/>
				<context ref="importStatement"/>
				<context ref="function" />
				<context ref="variableDeclaration"/>
				<context ref="specialDeclerationKeywordsInClass"/>
				<context ref="constDeclaration"/>
				<context ref="metadataTags"/>
				<context ref="namespaceDeclaration"/>
			</include>
		</context>

		<!--

			@6 == Declerations

		-->

		<context id="package">
			<start>^\s*(package)\s</start>
			<include>
				<context sub-pattern="0" style-ref="keyword" where="start"/>
				<context id="thePackageName" once-only="true" end-parent="true">
					<start>\s*(\%{packagePath})</start>
					<include>
						<context sub-pattern="0" style-ref="preprocessor" where="start"/>
						<context id="goodPBrackets" end-parent="true" once-only="true">
							<start>\s*{</start>
							<end>}</end>
							<include>
								<context ref="comments"/>
								<context ref="importStatement"/>
								<context ref="class"/>
								<context ref="specialDeclerationKeywords"/>
							</include>
						</context>
						<context ref="badBraces"/>
					</include>
				</context>
			</include>
		</context>


		<context id="class" 										once-only="true">
			<start>\%{classStatement}</start>
			<include>
				<context sub-pattern="1" style-ref="keyword" where="start"/>
				<context sub-pattern="extends" style-ref="keyword" where="start"/>
				<context sub-pattern="path1" style-ref="preprocessor" where="start"/>
				<context sub-pattern="implements" style-ref="keyword" where="start"/>
				<context sub-pattern="path2" style-ref="preprocessor" where="start"/>
				<context id="goodCBrackets" end-parent="true" once-only="true">
					<start>\s*{</start>
					<end>}</end>
					<include>
						<context ref="constructorFunction"/>
						<context ref="insideClass"/>
						
					</include>
				</context>
				<context ref="badBraces"/>
			</include>
		</context>

		<context id="classOutsidePackage">
			<start>\%{classStatement}</start>
			<include>
				<context sub-pattern="1" style-ref="keyword" where="start"/>
				<context sub-pattern="extends" style-ref="keyword" where="start"/>
				<context sub-pattern="path1" style-ref="preprocessor" where="start"/>
				<context sub-pattern="implements" style-ref="keyword" where="start"/>
				<context sub-pattern="path2" style-ref="preprocessor" where="start"/>
				<context id="goodC2Brackets" end-parent="true" once-only="true">
					<start>\s*{</start>
					<end>}</end>
					<include>
						<context ref="insideClass"/>
					</include>
				</context>
				<context ref="badBraces"/>
			</include>
		</context>

		<context id="function">
			<start>\%{functionStatement}</start>
			<include>
				<context sub-pattern="1" style-ref="keyword" where="start"/>
				<context sub-pattern="2" style-ref="keyword" where="start"/>
				<context ref="insideFunction"/>
			</include>
		</context>

		<!-- This would be a lot better if I could make sure this only matches the function whose 
		name is the same as the file it's in, but for now it matches the first function that isn't a getter or setter -->
		<context id="constructorFunction" 							once-only="true">
			<start>\s(function)\s+\w+\s*(?=\()</start>
			<include>
				<context sub-pattern="1" style-ref="keyword" where="start"/>
				<context ref="insideConstructorFunction"/>
			</include>
		</context>

		<context id="variableDeclaration" >
			<start>(\svar)\s+\w+</start>
			<include>
				<context sub-pattern="1" style-ref="keyword" where="start"/>
				<context ref="insideVariableDeclaration"/>
			</include>
		</context>

		<context id="constDeclaration" >
			<start>(\sconst)\s+\w+</start>
			<include>
				<context sub-pattern="1" style-ref="keyword" where="start"/>
				<context ref="insideConstDeclaration"/>
			</include>
		</context>

		<context id="namespaceDeclaration" >
			<start>(\snamespace)\s+\w+</start>
			<end>\s*;\s*</end>
			<include>
				<context sub-pattern="1" style-ref="keyword" where="start"/>
				<context ref="insideNamespaceDeclaration"/>
			</include>
		</context>
		<!--

			@7 == Parts that make blocks

		-->

		<context id="badEndBracket" style-ref="error">
			<start>\)\s*\w+</start>
		</context>

		<context id="accessArrayChild" >
			<start>\%{packagePath}\s*(?&lt;bracket&gt; \[ )</start>
			<end>\]</end>
			<include>
				<context sub-pattern="bracket" style-ref="keyword" where="start"/>
				<context sub-pattern="0" style-ref="keyword" where="end"/>
				<context ref="common"/>
				<context ref="functionExecution"/>
				<context ref="accessArrayChild"/>
			</include>
		</context>

		<context id="functionExecution">
			<start>\%{packagePath}\s*(?&lt;bracket&gt; \( )</start>
			<end>\)</end>
			<include>
				<context sub-pattern="bracket" style-ref="keyword" where="start"/>
				<context sub-pattern="0" style-ref="keyword" where="end"/>
				<context ref="common"/>
				<context ref="functionExecution"/>
				<context ref="accessArrayChild"/>
				<context ref="badEndBracket"/>
			</include>
		</context>

		<context id="statementInBrackets">
			<start>\(</start>
			<end>\)</end>
			<include>
				<context sub-pattern="0" style-ref="keyword" where="start"/>
				<context sub-pattern="0" style-ref="keyword" where="end"/>
				<context ref="common"/>
				<context ref="functionExecution"/>
				<context ref="accessArrayChild"/>
				<context ref="badEndBracket"/>
			</include>
		</context>

		<context id="blockBody">
			<include>
				<context id="theStartBracket" end-parent="true" once-only="true">
					<start>\s*\(</start>
					<include>
						<context sub-pattern="0" style-ref="keyword" where="start"/>
						<context ref="common"/>
						<context ref="functionExecution"/>
						<context ref="accessArrayChild"/>
						<context ref="badStatementInBrackets"/>
						<context id="afterBrackets" end-parent="true" once-only="true">
							<start>\)</start>
							<include>
								<context ref="comments"/>
								<context sub-pattern="0" style-ref="keyword" where="start"/>
								<context id="goodBraces" once-only="true" end-parent="true">
									<start>\s*{</start>
									<end>}</end>
									<include>
										<context ref="common"/>
										<context ref="generalBlock"/>
									</include>
								</context>
								<context ref="badBraces"/>
							</include>
						</context>
					</include>
				</context>
				<context ref="badStartBracket"/>
			</include>
		</context>


		<!--

			@8 == Blocks

		-->

		<context id="ifBlock">
			<start>\s*(if)(\s|(?=\())</start>
			<include>
				<context sub-pattern="0" style-ref="keyword" where="start"/>
				<context ref="blockBody"/>
			</include>
		</context>

		<context id="endParentIfBlock" end-parent="true" once-only="true">
			<start>\s*(if)(\s|(?=\())</start>
			<include>
				<context sub-pattern="0" style-ref="keyword" where="start"/>
				<context ref="blockBody"/>
			</include>
		</context>

		<context id="elseIfBlock">
			<start>\s*(else\sif)(\s|(?=\())</start>
			<include>
				<context sub-pattern="0" style-ref="keyword" where="start"/>
				<context ref="blockBody"/>
			</include>
		</context>

		<context id="tryBlock">
			<start>^\s*(try)(\s|(?=\())</start>
			<include>
				<context sub-pattern="0" style-ref="keyword" where="start"/>
				<context ref="blockBody"/>
			</include>
		</context>

		<context id="catchBlock">
			<start>\s*(catch)(\s|(?=\())</start>
			<include>
				<context sub-pattern="0" style-ref="keyword" where="start"/>
				<context ref="blockBody"/>
			</include>
		</context>


		<context id="finallyBlock">
			<start>\s*(finally)(\s|(?=\())</start>
			<include>
				<context sub-pattern="0" style-ref="keyword" where="start"/>
				<context ref="blockBody"/>
			</include>
		</context>

		<context id="elseBlock">
			<start>\s*(else)(\s|$|(?={))</start>
			<include>
				<context sub-pattern="0" style-ref="keyword" where="start"/>
				<context ref="comments"/>
				<context ref="endParentIfBlock"/>
				<context id="elseGoodBraces" once-only="true" end-parent="true">
					<start>\s*{</start>
					<end>}</end>
					<include>
						<context ref="common"/>
						<context ref="generalBlock"/>
						<context ref="loopKeywords"/>
					</include>
				</context>
				<context ref="badBraces"/>
			</include>
		</context>

		<context id="withBlock">
			<start>^\s*(with)(\s|(?=\())</start>
			<include>
				<context sub-pattern="0" style-ref="keyword" where="start"/>
				<context id="wiStartBracket" end-parent="true" once-only="true">
					<start>\s*\(</start>
					<include>
						<context sub-pattern="0" style-ref="keyword" where="start"/>
						<context ref="common"/>
						<context ref="functionExecution"/>
						<context ref="accessArrayChild"/>
						<context id="wiStartBrace" end-parent="true" once-only="true">
							<start>\)</start>
							<include>
								<context ref="comments"/>
								<context sub-pattern="0" style-ref="keyword" where="start"/>
								<context id="wiGoodBraces" once-only="true" end-parent="true">
									<start>\s*{</start>
									<end>}</end>
									<include>
										<context ref="common"/>
										<context ref="generalBlock"/>
									</include>
								</context>
								<context ref="badBraces"/>
							</include>
						</context>
					</include>
				</context>
				<context ref="badStartBracket"/>
			</include>
		</context>

		<context id="switchBlock">
			<start>^\s*(switch)(\s|(?=\())</start>
			<include>
				<context sub-pattern="0" style-ref="keyword" where="start"/>
				<context id="swStartBracket" end-parent="true" once-only="true">
					<start>\s*\(</start>
					<include>
						<context sub-pattern="0" style-ref="keyword" where="start"/>
						<context ref="common"/>
						<context ref="functionExecution"/>
						<context ref="accessArrayChild"/>
						<context id="swStartBrace" end-parent="true" once-only="true">
							<start>\)</start>
							<include>
								<context sub-pattern="0" style-ref="keyword" where="start"/>
								<context ref="comments"/>
								<context id="swGoodBraces" once-only="true" end-parent="true">
									<start>\s*{</start>
									<end>}</end>
									<include>
										<context ref="common"/>
										<context ref="generalBlock"/>
										<context id="badSwitchCase" style-ref="error">
											<start>
												(case)\s*\w+\s+\w+ |
												(case)\s*[^\s\w"] |
												(default)\s*\w+\s*:
											</start>
										</context>
										<context id="switchCase">
											<start>
												(case)\s*("?)\w+("?)\s*
											</start>
											<end>:</end>
											<include>
												<context sub-pattern="1" style-ref="keyword" where="start"/>
											</include>
										</context>
										<context id="switchDefault" once-only="true">
											<start>
												(default)\s*
											</start>
											<end>:</end>
											<include>
												<context sub-pattern="1" style-ref="keyword" where="start"/>
											</include>
										</context>
										<context id="switchKeywords" style-ref="keyword">
											<keyword>break</keyword>
										</context>
									</include>
								</context>
								<context ref="badBraces"/>
							</include>
						</context>
					</include>
				</context>
				<context ref="badStartBracket"/>
			</include>
		</context>

		<context id="forBlock">
			<start>^\s*(for)(\s|(?=\())</start>
			<include>
				<context sub-pattern="0" style-ref="keyword" where="start"/>
				<context id="forStartBracket" end-parent="true" once-only="true">
					<start>(\s*each\s*)?\s*\(</start>
					<include>
						<context sub-pattern="0" style-ref="keyword" where="start"/>
						<context ref="functionExecution"/>
						<context ref="accessArrayChild"/>
						<context id="forLoopDeclarationKeywords" style-ref="keyword">
							<match>
								\sin\s |
								var\s
							</match>
						</context>
						<context ref="common"/>
						<context id="forStartBrace" end-parent="true" once-only="true">
							<start>\)</start>
							<include>
								<context sub-pattern="0" style-ref="keyword" where="start"/>
								<context ref="comments"/>
								<context id="forGoodBraces" once-only="true" end-parent="true">
									<start>\s*{</start>
									<end>}</end>
									<include>
										<context ref="common"/>
										<context ref="generalBlock"/>
										<context ref="loopKeywords" />
									</include>
								</context>
								<context ref="badBraces"/>
							</include>
						</context>
					</include>
				</context>
				<context id="badforStartBracket" end-parent="true" once-only="true" style-ref="error">
					<start>\s*([^each])\s*\w*\s*\(</start>
				</context>
			</include>
		</context>

		<context id="whileBlock">
			<start>^\s*(while)(\s|(?=\())</start>
			<include>
				<context sub-pattern="0" style-ref="keyword" where="start"/>
				<context id="wStartBracket" end-parent="true" once-only="true">
					<start>\s*\(</start>
					<include>
						<context sub-pattern="0" style-ref="keyword" where="start"/>
						<context ref="common"/>
						<context ref="functionExecution"/>
						<context ref="accessArrayChild"/>
						<context id="wStartBrace" end-parent="true" once-only="true">
							<start>\)</start>
							<include>
								<context ref="comments"/>
								<context sub-pattern="0" style-ref="keyword" where="start"/>
								<context id="wGoodBraces" once-only="true" end-parent="true">
									<start>\s*{</start>
									<end>}</end>
									<include>
										<context ref="common"/>
										<context ref="generalBlock"/>
										<context ref="loopKeywords"/>
									</include>
								</context>
								<context ref="badBraces"/>
							</include>
						</context>
					</include>
				</context>
				<context ref="badStartBracket"/>
			</include>
		</context>

		<context id="doWhileBlock">
			<start>^\s*(do)(\s|$|(?={))</start>
			<include>
				<context sub-pattern="0" style-ref="keyword" where="start"/>
				<context ref="comments"/>
				<context id="dowGoodBraces" once-only="true" end-parent="true">
					<start>\s*{</start>
					<include>
						<context ref="common"/>
						<context ref="generalBlock"/>
						<context id="noWhilePart" end-parent="true" once-only="true">
							<start>\s*}\s*$</start>
							<end>$</end>
						</context>
						<context id="hasWhilePart" end-parent="true" once-only="true">
							<start>\s*}(\s*while\s*)(?=\()</start>
						<end>;$</end>
							<include>
								<context sub-pattern="1" style-ref="keyword" where="start"/>
								<context sub-pattern="0" style-ref="keyword" where="end"/>
								<context ref="statementInBrackets"/>
							</include>
						</context>
						<context id="notWhilePart" style-ref="error" once-only="true">
							<start>\s*}(?!(\s*while\s*\())</start>
						</context>

					</include>
				</context>
				<context ref="badBraces"/>
			</include>
		</context>

		<!--

			@9 == Comments

		-->


        <context id="line-comment" 				style-ref="comment">
            <start>//</start>
            <end>$</end>
            <include>
                <context ref="def:line-continue"/>
                <context ref="def:in-comment"/>
            </include>
        </context>

        <context id="block-comment" 			style-ref="comment">
            <start>/\*</start>
            <end>\*/</end>
            <include>
                <context ref="def:in-comment"/>
            </include>
		</context>


        <!--

        	@10 == Strings

        -->

        <context id="string-double" 			style-ref="string" 			end-at-line-end="true" >
            <start>"</start>
            <end>"</end>
            <include>
                <context ref="def:line-continue"/>
                <context ref="def:escape"/>
            </include>
        </context>

        <context id="string-single" 			style-ref="string" 			end-at-line-end="true" >
            <start>'</start>
            <end>'</end>
            <include>
                <context ref="def:line-continue"/>
                <context ref="def:escape"/>
            </include>
        </context>

        <!--

        	@11 == Constants

        -->

        <context id="null-value" 				style-ref="null-value">
			<keyword>null</keyword>
			<keyword>NaN</keyword>
			<keyword>Infinity</keyword>
			<keyword>-Infinity</keyword>
			<keyword>Undefined</keyword>
        </context>

        <context id="boolean" 					style-ref="boolean">
            <keyword>false</keyword>
            <keyword>true</keyword>
		</context>

		<!--

			@12 == keywords

		-->

		<context id="specialWordsInFunctions" 	style-ref="keyword">
			<match>
				(^|;|\()\s*
				(
					super((?=\s*\()|\.) 	|
					this\.	|
					return\s |
					trace\s*(?= \( )
				)
			</match>
		</context>


		<context id="dataTypes" 				style-ref="keyword">
			<keyword>void</keyword>
			<keyword>AbstractEvent</keyword>
			<keyword>AbstractInvoker</keyword>
			<keyword>AbstractMessage</keyword>
			<keyword>AbstractOperation</keyword>
			<keyword>AbstractService</keyword>
			<keyword>AbstractTarget</keyword>
			<keyword>Accessibility</keyword>
			<keyword>AccessibilityProperties</keyword>
			<keyword>AccessPrivileges</keyword>
			<keyword>AccessPrivilegesPrivilege</keyword>
			<keyword>Accordion</keyword>
			<keyword>AccordionHeader</keyword>
			<keyword>AccordionHeaderSkin</keyword>
			<keyword>AcknowledgeMessage</keyword>
			<keyword>ActionEffectInstance</keyword>
			<keyword>ActionScriptVersion</keyword>
			<keyword>ActivatorSkin</keyword>
			<keyword>ActivityEvent</keyword>
			<keyword>AddChild</keyword>
			<keyword>AddChildAction</keyword>
			<keyword>AddChildActionInstance</keyword>
			<keyword>Alert</keyword>
			<keyword>AMFChannel</keyword>
			<keyword>AnimateProperty</keyword>
			<keyword>AnimatePropertyInstance</keyword>
			<keyword>AntiAliasType</keyword>
			<keyword>Application</keyword>
			<keyword>ApplicationControlBar</keyword>
			<keyword>ApplicationDomain</keyword>
			<keyword>AreaChart</keyword>
			<keyword>AreaRenderer</keyword>
			<keyword>AreaSeries</keyword>
			<keyword>AreaSeriesItem</keyword>
			<keyword>AreaSeriesRenderData</keyword>
			<keyword>AreaSet</keyword>
			<keyword>ArgumentError</keyword>
			<keyword>arguments</keyword>
			<keyword>Array</keyword>
			<keyword>ArrayCollection</keyword>
			<keyword>ArrayUtil</keyword>
			<keyword>AssociationDefinition</keyword>
			<keyword>AsyncMessage</keyword>
			<keyword>AsyncRequest</keyword>
			<keyword>AsyncToken</keyword>
			<keyword>AVM1Movie</keyword>
			<keyword>AxisBase</keyword>
			<keyword>AxisLabel</keyword>
			<keyword>AxisLabelSet</keyword>
			<keyword>AxisRenderer</keyword>
			<keyword>Back</keyword>
			<keyword>BarChart</keyword>
			<keyword>BarSeries</keyword>
			<keyword>BarSeriesItem</keyword>
			<keyword>BarSeriesRenderData</keyword>
			<keyword>BarSet</keyword>
			<keyword>BaseListData</keyword>
			<keyword>BevelFilter</keyword>
			<keyword>BindingUtils</keyword>
			<keyword>Bitmap</keyword>
			<keyword>BitmapAsset</keyword>
			<keyword>BitmapData</keyword>
			<keyword>BitmapDataChannel</keyword>
			<keyword>BitmapFill</keyword>
			<keyword>BitmapFilter</keyword>
			<keyword>BitmapFilterQuality</keyword>
			<keyword>BitmapFilterType</keyword>
			<keyword>BlendMode</keyword>
			<keyword>Blur</keyword>
			<keyword>BlurFilter</keyword>
			<keyword>BlurInstance</keyword>
			<keyword>Boolean</keyword>
			<keyword>Border</keyword>
			<keyword>Bounce</keyword>
			<keyword>BoundedValue</keyword>
			<keyword>Box</keyword>
			<keyword>BoxDirection</keyword>
			<keyword>BoxItemRenderer</keyword>
			<keyword>BubbleChart</keyword>
			<keyword>BubbleSeries</keyword>
			<keyword>BubbleSeriesItem</keyword>
			<keyword>BubbleSeriesRenderData</keyword>
			<keyword>Button</keyword>
			<keyword>ButtonAsset</keyword>
			<keyword>ButtonBar</keyword>
			<keyword>ButtonBarButtonSkin</keyword>
			<keyword>ButtonLabelPlacement</keyword>
			<keyword>ButtonSkin</keyword>
			<keyword>ByteArray</keyword>
			<keyword>CalendarLayoutChangeEvent</keyword>
			<keyword>Camera</keyword>
			<keyword>CandlestickChart</keyword>
			<keyword>CandlestickItemRenderer</keyword>
			<keyword>CandlestickSeries</keyword>
			<keyword>Canvas</keyword>
			<keyword>Capabilities</keyword>
			<keyword>CapsStyle</keyword>
			<keyword>CartesianChart</keyword>
			<keyword>CartesianTransform</keyword>
			<keyword>CategoryAxis</keyword>
			<keyword>ChangeWatcher</keyword>
			<keyword>Channel</keyword>
			<keyword>ChannelError</keyword>
			<keyword>ChannelEvent</keyword>
			<keyword>ChannelFaultEvent</keyword>
			<keyword>ChannelSet</keyword>
			<keyword>ChartBase</keyword>
			<keyword>ChartElement</keyword>
			<keyword>ChartItem</keyword>
			<keyword>ChartItemEvent</keyword>
			<keyword>ChartLabel</keyword>
			<keyword>ChartState</keyword>
			<keyword>CheckBox</keyword>
			<keyword>CheckBoxIcon</keyword>
			<keyword>ChildExistenceChangedEvent</keyword>
			<keyword>CircleItemRenderer</keyword>
			<keyword>Circular</keyword>
			<keyword>Class</keyword>
			<keyword>ClassFactory</keyword>
			<keyword>ClientInputError</keyword>
			<keyword>CloseEvent</keyword>
			<keyword>CollectionEvent</keyword>
			<keyword>CollectionEventKind</keyword>
			<keyword>CollectionViewError</keyword>
			<keyword>ColorMatrixFilter</keyword>
			<keyword>ColorPicker</keyword>
			<keyword>ColorPickerEvent</keyword>
			<keyword>ColorPickerSkin</keyword>
			<keyword>ColorTransform</keyword>
			<keyword>ColorUtil</keyword>
			<keyword>ColumnChart</keyword>
			<keyword>ColumnSeries</keyword>
			<keyword>ColumnSeriesItem</keyword>
			<keyword>ColumnSeriesRenderData</keyword>
			<keyword>ColumnSet</keyword>
			<keyword>ComboBase</keyword>
			<keyword>ComboBox</keyword>
			<keyword>ComboBoxArrowSkin</keyword>
			<keyword>CommandMessage</keyword>
			<keyword>ComponentDescriptor</keyword>
			<keyword>CompositeEffect</keyword>
			<keyword>CompositeEffectInstance</keyword>
			<keyword>ConcreteDataService</keyword>
			<keyword>Conflict</keyword>
			<keyword>ConflictDetector</keyword>
			<keyword>Conflicts</keyword>
			<keyword>Consumer</keyword>
			<keyword>Container</keyword>
			<keyword>ContainerCreationPolicy</keyword>
			<keyword>ContextMenu</keyword>
			<keyword>ContextMenuBuiltInItems</keyword>
			<keyword>ContextMenuEvent</keyword>
			<keyword>ContextMenuItem</keyword>
			<keyword>ControlBar</keyword>
			<keyword>ConvolutionFilter</keyword>
			<keyword>CreditCardValidator</keyword>
			<keyword>CreditCardValidatorCardType</keyword>
			<keyword>CrossItemRenderer</keyword>
			<keyword>CSMSettings</keyword>
			<keyword>CSSStyleDeclaration</keyword>
			<keyword>Cubic</keyword>
			<keyword>CuePointEvent</keyword>
			<keyword>CuePointManager</keyword>
			<keyword>CurrencyFormatter</keyword>
			<keyword>CurrencyValidator</keyword>
			<keyword>CurrencyValidatorAlignSymbol</keyword>
			<keyword>CursorBookmark</keyword>
			<keyword>CursorError</keyword>
			<keyword>CursorEvent</keyword>
			<keyword>CursorManager</keyword>
			<keyword>CursorManagerPriority</keyword>
			<keyword>DataAssociationMessage</keyword>
			<keyword>DataConflictEvent</keyword>
			<keyword>DataConsumer</keyword>
			<keyword>DataDescription</keyword>
			<keyword>DataErrorMessage</keyword>
			<keyword>DataEvent</keyword>
			<keyword>DataGrid</keyword>
			<keyword>DataGridBase</keyword>
			<keyword>DataGridColumn</keyword>
			<keyword>DataGridColumnDropIndicator</keyword>
			<keyword>DataGridColumnResizeSkin</keyword>
			<keyword>DataGridDragProxy</keyword>
			<keyword>DataGridEvent</keyword>
			<keyword>DataGridEventReason</keyword>
			<keyword>DataGridHeaderSeparator</keyword>
			<keyword>DataGridItemRenderer</keyword>
			<keyword>DataGridListData</keyword>
			<keyword>DataGridSortArrow</keyword>
			<keyword>DataList</keyword>
			<keyword>DataListError</keyword>
			<keyword>DataService</keyword>
			<keyword>DataServiceError</keyword>
			<keyword>DataServiceFaultEvent</keyword>
			<keyword>DataStore</keyword>
			<keyword>DataTip</keyword>
			<keyword>DataTransform</keyword>
			<keyword>Date</keyword>
			<keyword>DateBase</keyword>
			<keyword>DateChooser</keyword>
			<keyword>DateChooserEvent</keyword>
			<keyword>DateChooserEventDetail</keyword>
			<keyword>DateChooserIndicator</keyword>
			<keyword>DateChooserMonthArrowSkin</keyword>
			<keyword>DateChooserYearArrowSkin</keyword>
			<keyword>DateField</keyword>
			<keyword>DateFormatter</keyword>
			<keyword>DateTimeAxis</keyword>
			<keyword>DateValidator</keyword>
			<keyword>DefaultDataDescriptor</keyword>
			<keyword>DeferredInstanceFromClass</keyword>
			<keyword>DeferredInstanceFromFunction</keyword>
			<keyword>DefinitionError</keyword>
			<keyword>DiamondItemRenderer</keyword>
			<keyword>Dictionary</keyword>
			<keyword>DirectHTTPChannel</keyword>
			<keyword>DisplacementMapFilter</keyword>
			<keyword>DisplacementMapFilterMode</keyword>
			<keyword>DisplayObject</keyword>
			<keyword>DisplayObjectContainer</keyword>
			<keyword>Dissolve</keyword>
			<keyword>DissolveInstance</keyword>
			<keyword>DividedBox</keyword>
			<keyword>DividerEvent</keyword>
			<keyword>DownloadProgressBar</keyword>
			<keyword>DragEvent</keyword>
			<keyword>DragManager</keyword>
			<keyword>DragSource</keyword>
			<keyword>DropdownEvent</keyword>
			<keyword>DropShadowFilter</keyword>
			<keyword>DualStyleObject</keyword>
			<keyword>DynamicEvent</keyword>
			<keyword>EdgeMetrics</keyword>
			<keyword>Effect</keyword>
			<keyword>EffectEvent</keyword>
			<keyword>EffectInstance</keyword>
			<keyword>EffectManager</keyword>
			<keyword>EffectTargetFilter</keyword>
			<keyword>Elastic</keyword>
			<keyword>EmailValidator</keyword>
			<keyword>EncodingError</keyword>
			<keyword>Endian</keyword>
			<keyword>EOFError</keyword>
			<keyword>Error</keyword>
			<keyword>ErrorEvent</keyword>
			<keyword>ErrorMessage</keyword>
			<keyword>EvalError</keyword>
			<keyword>Event</keyword>
			<keyword>EventDispatcher</keyword>
			<keyword>EventPhase</keyword>
			<keyword>EventPriority</keyword>
			<keyword>Exponential</keyword>
			<keyword>ExternalInterface</keyword>
			<keyword>Fade</keyword>
			<keyword>FadeInstance</keyword>
			<keyword>Fault</keyword>
			<keyword>FaultEvent</keyword>
			<keyword>FileFilter</keyword>
			<keyword>FileReference</keyword>
			<keyword>FileReferenceList</keyword>
			<keyword>FlexBitmap</keyword>
			<keyword>FlexEvent</keyword>
			<keyword>FlexMovieClip</keyword>
			<keyword>FlexPrintJob</keyword>
			<keyword>FlexPrintJobScaleType</keyword>
			<keyword>FlexShape</keyword>
			<keyword>FlexSimpleButton</keyword>
			<keyword>FlexSprite</keyword>
			<keyword>FlexTextField</keyword>
			<keyword>FocusEvent</keyword>
			<keyword>FocusManager</keyword>
			<keyword>Font</keyword>
			<keyword>FontStyle</keyword>
			<keyword>FontType</keyword>
			<keyword>Form</keyword>
			<keyword>Formatter</keyword>
			<keyword>FormHeading</keyword>
			<keyword>FormItem</keyword>
			<keyword>FormItemDirection</keyword>
			<keyword>FormItemLabel</keyword>
			<keyword>FrameLabel</keyword>
			<keyword>Function</keyword>
			<keyword>Glow</keyword>
			<keyword>GlowFilter</keyword>
			<keyword>GlowInstance</keyword>
			<keyword>GradientBase</keyword>
			<keyword>GradientBevelFilter</keyword>
			<keyword>GradientEntry</keyword>
			<keyword>GradientGlowFilter</keyword>
			<keyword>GradientType</keyword>
			<keyword>Graphics</keyword>
			<keyword>Grid</keyword>
			<keyword>GridFitType</keyword>
			<keyword>GridItem</keyword>
			<keyword>GridLines</keyword>
			<keyword>GridRow</keyword>
			<keyword>HaloBorder</keyword>
			<keyword>HaloColors</keyword>
			<keyword>HaloFocusRect</keyword>
			<keyword>HBox</keyword>
			<keyword>HDividedBox</keyword>
			<keyword>HeaderEvent</keyword>
			<keyword>HistoryManager</keyword>
			<keyword>HitData</keyword>
			<keyword>HLOCChart</keyword>
			<keyword>HLOCItemRenderer</keyword>
			<keyword>HLOCSeries</keyword>
			<keyword>HLOCSeriesBase</keyword>
			<keyword>HLOCSeriesItem</keyword>
			<keyword>HLOCSeriesRenderData</keyword>
			<keyword>HorizontalList</keyword>
			<keyword>HRule</keyword>
			<keyword>HScrollBar</keyword>
			<keyword>HSlider</keyword>
			<keyword>HTTPChannel</keyword>
			<keyword>HTTPRequestMessage</keyword>
			<keyword>HTTPService</keyword>
			<keyword>HTTPService</keyword>
			<keyword>HTTPStatusEvent</keyword>
			<keyword>IAccessPrivileges</keyword>
			<keyword>IAutomationObject</keyword>
			<keyword>IAutomationObjectContainer</keyword>
			<keyword>IAxis</keyword>
			<keyword>IBar</keyword>
			<keyword>IBitmapDrawable</keyword>
			<keyword>IChangeObject</keyword>
			<keyword>IChartElement</keyword>
			<keyword>IChildList</keyword>
			<keyword>ICollectionView</keyword>
			<keyword>IColumn</keyword>
			<keyword>IContainer</keyword>
			<keyword>ID3Info</keyword>
			<keyword>IDataInput</keyword>
			<keyword>IDataOutput</keyword>
			<keyword>IDataRenderer</keyword>
			<keyword>IDeferredInstance</keyword>
			<keyword>IDeferredInstantiationUIComponent</keyword>
			<keyword>IDropInListItemRenderer</keyword>
			<keyword>IDynamicPropertyOutput</keyword>
			<keyword>IDynamicPropertyWriter</keyword>
			<keyword>IEventDispatcher</keyword>
			<keyword>IExternalizable</keyword>
			<keyword>IFactory</keyword>
			<keyword>IFill</keyword>
			<keyword>IFlexAsset</keyword>
			<keyword>IFlexDisplayObject</keyword>
			<keyword>IFocusManager</keyword>
			<keyword>IFocusManagerComponent</keyword>
			<keyword>IFocusManagerContainer</keyword>
			<keyword>IFocusManagerGroup</keyword>
			<keyword>IHistoryManagerClient</keyword>
			<keyword>IIMESupport</keyword>
			<keyword>IInvalidating</keyword>
			<keyword>ILayoutManagerClient</keyword>
			<keyword>IList</keyword>
			<keyword>IListItemRenderer</keyword>
			<keyword>IllegalOperationError</keyword>
			<keyword>ILogger</keyword>
			<keyword>ILoggingTarget</keyword>
			<keyword>Image</keyword>
			<keyword>IManaged</keyword>
			<keyword>IME</keyword>
			<keyword>IMEConversionMode</keyword>
			<keyword>IMEEvent</keyword>
			<keyword>IMenuDataDescriptor</keyword>
			<keyword>IMenuItemRenderer</keyword>
			<keyword>IMessage</keyword>
			<keyword>IMXMLObject</keyword>
			<keyword>IMXMLSupport</keyword>
			<keyword>IndexChangedEvent</keyword>
			<keyword>InstanceCache</keyword>
			<keyword>int</keyword>
			<keyword>InteractiveObject</keyword>
			<keyword>InterpolationMethod</keyword>
			<keyword>InvalidCategoryError</keyword>
			<keyword>InvalidChannelError</keyword>
			<keyword>InvalidDestinationError</keyword>
			<keyword>InvalidFilterError</keyword>
			<keyword>InvalidSWFError</keyword>
			<keyword>IOError</keyword>
			<keyword>IOErrorEvent</keyword>
			<keyword>IOverride</keyword>
			<keyword>IPreloaderDisplay</keyword>
			<keyword>IPropertyChangeNotifier</keyword>
			<keyword>IRawChildrenContainer</keyword>
			<keyword>IRepeater</keyword>
			<keyword>IRepeaterClient</keyword>
			<keyword>IResponder</keyword>
			<keyword>Iris</keyword>
			<keyword>IrisInstance</keyword>
			<keyword>ISimpleStyleClient</keyword>
			<keyword>IStackable</keyword>
			<keyword>IStroke</keyword>
			<keyword>IStyleClient</keyword>
			<keyword>ISystemManager</keyword>
			<keyword>ItemClickEvent</keyword>
			<keyword>ItemPendingError</keyword>
			<keyword>ItemResponder</keyword>
			<keyword>IToolTip</keyword>
			<keyword>IToolTipManagerClient</keyword>
			<keyword>ITreeDataDescriptor</keyword>
			<keyword>IUIComponent</keyword>
			<keyword>IUID</keyword>
			<keyword>IViewCursor</keyword>
			<keyword>JointStyle</keyword>
			<keyword>Keyboard</keyword>
			<keyword>KeyboardEvent</keyword>
			<keyword>KeyLocation</keyword>
			<keyword>Label</keyword>
			<keyword>LayoutManager</keyword>
			<keyword>Legend</keyword>
			<keyword>LegendData</keyword>
			<keyword>LegendItem</keyword>
			<keyword>LegendMouseEvent</keyword>
			<keyword>Linear</keyword>
			<keyword>LinearAxis</keyword>
			<keyword>LinearGradient</keyword>
			<keyword>LinearGradientStroke</keyword>
			<keyword>LineChart</keyword>
			<keyword>LineFormattedTarget</keyword>
			<keyword>LineRenderer</keyword>
			<keyword>LineScaleMode</keyword>
			<keyword>LineSeries</keyword>
			<keyword>LineSeriesItem</keyword>
			<keyword>LineSeriesRenderData</keyword>
			<keyword>LineSeriesSegment</keyword>
			<keyword>LinkBar</keyword>
			<keyword>LinkButton</keyword>
			<keyword>LinkButtonSkin</keyword>
			<keyword>LinkSeparator</keyword>
			<keyword>List</keyword>
			<keyword>ListBase</keyword>
			<keyword>ListBaseSeekPending</keyword>
			<keyword>ListBaseSelectionData</keyword>
			<keyword>ListCollectionView</keyword>
			<keyword>ListData</keyword>
			<keyword>ListDropIndicator</keyword>
			<keyword>ListEvent</keyword>
			<keyword>ListEventReason</keyword>
			<keyword>ListItemDragProxy</keyword>
			<keyword>ListItemRenderer</keyword>
			<keyword>ListItemSelectEvent</keyword>
			<keyword>ListRowInfo</keyword>
			<keyword>Loader</keyword>
			<keyword>LoaderConfig</keyword>
			<keyword>LoaderContext</keyword>
			<keyword>LoaderInfo</keyword>
			<keyword>LoadEvent</keyword>
			<keyword>LocalConnection</keyword>
			<keyword>Locale</keyword>
			<keyword>Log</keyword>
			<keyword>LogAxis</keyword>
			<keyword>LogEvent</keyword>
			<keyword>LogEventLevel</keyword>
			<keyword>LogLogger</keyword>
			<keyword>MaskEffect</keyword>
			<keyword>MaskEffectInstance</keyword>
			<keyword>Math</keyword>
			<keyword>Matrix</keyword>
			<keyword>MBeanAttributeInfo</keyword>
			<keyword>MBeanFeatureInfo</keyword>
			<keyword>MBeanInfo</keyword>
			<keyword>MBeanOperationInfo</keyword>
			<keyword>MBeanParameterInfo</keyword>
			<keyword>MemoryError</keyword>
			<keyword>Menu</keyword>
			<keyword>MenuBar</keyword>
			<keyword>MenuBarBackgroundSkin</keyword>
			<keyword>MenuBarItem</keyword>
			<keyword>MenuEvent</keyword>
			<keyword>MenuItemRenderer</keyword>
			<keyword>MessageAckEvent</keyword>
			<keyword>MessageAgent</keyword>
			<keyword>MessageCacheItem</keyword>
			<keyword>MessageEvent</keyword>
			<keyword>MessageFaultEvent</keyword>
			<keyword>MessagePersister</keyword>
			<keyword>MessagePersisterEvent</keyword>
			<keyword>MessageResponder</keyword>
			<keyword>MessageSerializationError</keyword>
			<keyword>MessageStore</keyword>
			<keyword>MessageStoreEvent</keyword>
			<keyword>MessagingError</keyword>
			<keyword>Metadata</keyword>
			<keyword>MetadataEvent</keyword>
			<keyword>Microphone</keyword>
			<keyword>MiniDebugTarget</keyword>
			<keyword>MorphShape</keyword>
			<keyword>Mouse</keyword>
			<keyword>MouseEvent</keyword>
			<keyword>Move</keyword>
			<keyword>MoveEvent</keyword>
			<keyword>MoveInstance</keyword>
			<keyword>MovieClip</keyword>
			<keyword>MovieClipAsset</keyword>
			<keyword>MovieClipLoaderAsset</keyword>
			<keyword>Namespace</keyword>
			<keyword>NavBar</keyword>
			<keyword>NetConnection</keyword>
			<keyword>NetConnectionChannel</keyword>
			<keyword>NetStatusEvent</keyword>
			<keyword>NetStream</keyword>
			<keyword>NoChannelAvailableError</keyword>
			<keyword>NoDataAvailableError</keyword>
			<keyword>NoSuchChannelError</keyword>
			<keyword>Number</keyword>
			<keyword>NumberBase</keyword>
			<keyword>NumberBaseRoundType</keyword>
			<keyword>NumberFormatter</keyword>
			<keyword>NumberValidator</keyword>
			<keyword>NumericAxis</keyword>
			<keyword>NumericStepper</keyword>
			<keyword>NumericStepperDownSkin</keyword>
			<keyword>NumericStepperEvent</keyword>
			<keyword>NumericStepperUpSkin</keyword>
			<keyword>Object</keyword>
			<keyword>ObjectEncoding</keyword>
			<keyword>ObjectName</keyword>
			<keyword>ObjectProxy</keyword>
			<keyword>ObjectUtil</keyword>
			<keyword>Operation</keyword>
			<keyword>Operation</keyword>
			<keyword>Operation</keyword>
			<keyword>Operation</keyword>
			<keyword>PagedMessage</keyword>
			<keyword>Panel</keyword>
			<keyword>Parallel</keyword>
			<keyword>ParallelInstance</keyword>
			<keyword>Pause</keyword>
			<keyword>PauseInstance</keyword>
			<keyword>PhoneFormatter</keyword>
			<keyword>PhoneNumberValidator</keyword>
			<keyword>PieChart</keyword>
			<keyword>PieSeries</keyword>
			<keyword>PieSeriesItem</keyword>
			<keyword>PieSeriesRenderData</keyword>
			<keyword>PixelSnapping</keyword>
			<keyword>PlotChart</keyword>
			<keyword>PlotSeries</keyword>
			<keyword>PlotSeriesItem</keyword>
			<keyword>PlotSeriesRenderData</keyword>
			<keyword>Point</keyword>
			<keyword>PolarChart</keyword>
			<keyword>PolarTransform</keyword>
			<keyword>PollingChannel</keyword>
			<keyword>PopUpButton</keyword>
			<keyword>PopUpButtonSkin</keyword>
			<keyword>PopUpIcon</keyword>
			<keyword>PopUpManager</keyword>
			<keyword>PopUpManagerChildList</keyword>
			<keyword>PopUpMenuButton</keyword>
			<keyword>PopUpMenuIcon</keyword>
			<keyword>Preloader</keyword>
			<keyword>PrintDataGrid</keyword>
			<keyword>PrintJob</keyword>
			<keyword>PrintJobOptions</keyword>
			<keyword>PrintJobOrientation</keyword>
			<keyword>PriorityQueue</keyword>
			<keyword>Producer</keyword>
			<keyword>ProgrammaticSkin</keyword>
			<keyword>ProgressBar</keyword>
			<keyword>ProgressBarDirection</keyword>
			<keyword>ProgressBarLabelPlacement</keyword>
			<keyword>ProgressBarMode</keyword>
			<keyword>ProgressBarSkin</keyword>
			<keyword>ProgressEvent</keyword>
			<keyword>ProgressIndeterminateSkin</keyword>
			<keyword>ProgressTrackSkin</keyword>
			<keyword>PropertyChangeEvent</keyword>
			<keyword>PropertyChangeEventKind</keyword>
			<keyword>PropertyChanges</keyword>
			<keyword>Proxy</keyword>
			<keyword>QName</keyword>
			<keyword>Quadratic</keyword>
			<keyword>Quartic</keyword>
			<keyword>Quintic</keyword>
			<keyword>RadialGradient</keyword>
			<keyword>RadioButton</keyword>
			<keyword>RadioButtonGroup</keyword>
			<keyword>RadioButtonIcon</keyword>
			<keyword>RangeError</keyword>
			<keyword>Rectangle</keyword>
			<keyword>RectangularBorder</keyword>
			<keyword>RectangularDropShadow</keyword>
			<keyword>ReferenceError</keyword>
			<keyword>RegExp</keyword>
			<keyword>RegExpValidationResult</keyword>
			<keyword>RegExpValidator</keyword>
			<keyword>RemoteObject</keyword>
			<keyword>RemoteObject</keyword>
			<keyword>RemotingMessage</keyword>
			<keyword>RemoveChild</keyword>
			<keyword>RemoveChildAction</keyword>
			<keyword>RemoveChildActionInstance</keyword>
			<keyword>RenderData</keyword>
			<keyword>Repeater</keyword>
			<keyword>Resize</keyword>
			<keyword>ResizeEvent</keyword>
			<keyword>ResizeInstance</keyword>
			<keyword>ResourceBundle</keyword>
			<keyword>Responder</keyword>
			<keyword>ResultEvent</keyword>
			<keyword>RichTextEditor</keyword>
			<keyword>Rotate</keyword>
			<keyword>RotateInstance</keyword>
			<keyword>RoundedRectangle</keyword>
			<keyword>RPCMessage</keyword>
			<keyword>RSLEvent</keyword>
			<keyword>RTMPChannel</keyword>
			<keyword>Scene</keyword>
			<keyword>ScriptTimeoutError</keyword>
			<keyword>ScrollArrowSkin</keyword>
			<keyword>ScrollBar</keyword>
			<keyword>ScrollBarDirection</keyword>
			<keyword>ScrollControlBase</keyword>
			<keyword>ScrollEvent</keyword>
			<keyword>ScrollEventDetail</keyword>
			<keyword>ScrollEventDirection</keyword>
			<keyword>ScrollPolicy</keyword>
			<keyword>ScrollThumb</keyword>
			<keyword>ScrollThumbSkin</keyword>
			<keyword>ScrollTrackSkin</keyword>
			<keyword>SecureAMFChannel</keyword>
			<keyword>Security</keyword>
			<keyword>SecurityDomain</keyword>
			<keyword>SecurityError</keyword>
			<keyword>SecurityErrorEvent</keyword>
			<keyword>SecurityPanel</keyword>
			<keyword>Sequence</keyword>
			<keyword>SequencedMessage</keyword>
			<keyword>SequenceInstance</keyword>
			<keyword>Series</keyword>
			<keyword>SeriesEffect</keyword>
			<keyword>SeriesEffectInstance</keyword>
			<keyword>SeriesInterpolate</keyword>
			<keyword>SeriesInterpolateInstance</keyword>
			<keyword>SeriesSlide</keyword>
			<keyword>SeriesSlideInstance</keyword>
			<keyword>SeriesZoom</keyword>
			<keyword>SeriesZoomInstance</keyword>
			<keyword>SetEventHandler</keyword>
			<keyword>SetProperty</keyword>
			<keyword>SetPropertyAction</keyword>
			<keyword>SetPropertyActionInstance</keyword>
			<keyword>SetStyle</keyword>
			<keyword>SetStyleAction</keyword>
			<keyword>SetStyleActionInstance</keyword>
			<keyword>ShadowBoxItemRenderer</keyword>
			<keyword>ShadowLineRenderer</keyword>
			<keyword>Shape</keyword>
			<keyword>SharedObject</keyword>
			<keyword>SharedObjectFlushStatus</keyword>
			<keyword>SimpleButton</keyword>
			<keyword>SimpleXMLDecoder</keyword>
			<keyword>SimpleXMLEncoder</keyword>
			<keyword>Sine</keyword>
			<keyword>Slider</keyword>
			<keyword>SliderDataTip</keyword>
			<keyword>SliderDirection</keyword>
			<keyword>SliderEvent</keyword>
			<keyword>SliderEventClickTarget</keyword>
			<keyword>SliderHighlightSkin</keyword>
			<keyword>SliderLabel</keyword>
			<keyword>SliderThumb</keyword>
			<keyword>SliderThumbSkin</keyword>
			<keyword>SliderTrackSkin</keyword>
			<keyword>SOAPHeader</keyword>
			<keyword>SOAPMessage</keyword>
			<keyword>SocialSecurityValidator</keyword>
			<keyword>Socket</keyword>
			<keyword>SolidColor</keyword>
			<keyword>Sort</keyword>
			<keyword>SortError</keyword>
			<keyword>SortField</keyword>
			<keyword>Sound</keyword>
			<keyword>SoundAsset</keyword>
			<keyword>SoundChannel</keyword>
			<keyword>SoundEffect</keyword>
			<keyword>SoundEffectInstance</keyword>
			<keyword>SoundLoaderContext</keyword>
			<keyword>SoundMixer</keyword>
			<keyword>SoundTransform</keyword>
			<keyword>Spacer</keyword>
			<keyword>SpreadMethod</keyword>
			<keyword>Sprite</keyword>
			<keyword>SpriteAsset</keyword>
			<keyword>StackedSeries</keyword>
			<keyword>StackOverflowError</keyword>
			<keyword>Stage</keyword>
			<keyword>StageAlign</keyword>
			<keyword>StageQuality</keyword>
			<keyword>StageScaleMode</keyword>
			<keyword>State</keyword>
			<keyword>StateChangeEvent</keyword>
			<keyword>StaticText</keyword>
			<keyword>StatusEvent</keyword>
			<keyword>String</keyword>
			<keyword>StringUtil</keyword>
			<keyword>StringValidator</keyword>
			<keyword>Stroke</keyword>
			<keyword>StyleManager</keyword>
			<keyword>StyleSheet</keyword>
			<keyword>SwatchPanelSkin</keyword>
			<keyword>SwatchSkin</keyword>
			<keyword>SWFLoader</keyword>
			<keyword>SWFVersion</keyword>
			<keyword>SwitchSymbolFormatter</keyword>
			<keyword>SyncEvent</keyword>
			<keyword>SyntaxError</keyword>
			<keyword>System</keyword>
			<keyword>SystemManager</keyword>
			<keyword>TabBar</keyword>
			<keyword>TabNavigator</keyword>
			<keyword>TabSkin</keyword>
			<keyword>Text</keyword>
			<keyword>TextArea</keyword>
			<keyword>TextColorType</keyword>
			<keyword>TextDisplayMode</keyword>
			<keyword>TextEvent</keyword>
			<keyword>TextField</keyword>
			<keyword>TextFieldAsset</keyword>
			<keyword>TextFieldAutoSize</keyword>
			<keyword>TextFieldType</keyword>
			<keyword>TextFormat</keyword>
			<keyword>TextFormatAlign</keyword>
			<keyword>TextInput</keyword>
			<keyword>TextLineMetrics</keyword>
			<keyword>TextRange</keyword>
			<keyword>TextRenderer</keyword>
			<keyword>TextSnapshot</keyword>
			<keyword>Tile</keyword>
			<keyword>TileBase</keyword>
			<keyword>TileBaseDirection</keyword>
			<keyword>TileDirection</keyword>
			<keyword>TileListItemRenderer</keyword>
			<keyword>Timer</keyword>
			<keyword>TimerEvent</keyword>
			<keyword>TitleBackground</keyword>
			<keyword>TitleWindow</keyword>
			<keyword>ToggleButtonBar</keyword>
			<keyword>ToolTip</keyword>
			<keyword>ToolTipBorder</keyword>
			<keyword>ToolTipManager</keyword>
			<keyword>TraceTarget</keyword>
			<keyword>Transform</keyword>
			<keyword>Transition</keyword>
			<keyword>Tree</keyword>
			<keyword>TreeEvent</keyword>
			<keyword>TreeItemRenderer</keyword>
			<keyword>TreeListData</keyword>
			<keyword>TriangleItemRenderer</keyword>
			<keyword>Tween</keyword>
			<keyword>TweenEffect</keyword>
			<keyword>TweenEffectInstance</keyword>
			<keyword>TweenEvent</keyword>
			<keyword>TypeError</keyword>
			<keyword>UIComponent</keyword>
			<keyword>UIComponentCachePolicy</keyword>
			<keyword>UIComponentDescriptor</keyword>
			<keyword>UIDUtil</keyword>
			<keyword>uint</keyword>
			<keyword>UITextField</keyword>
			<keyword>UITextFormat</keyword>
			<keyword>UnresolvedConflictsError</keyword>
			<keyword>UnresolvedConflictsEvent</keyword>
			<keyword>UpdateCollectionMessage</keyword>
			<keyword>UpdateCollectionRange</keyword>
			<keyword>URIError</keyword>
			<keyword>URLLoader</keyword>
			<keyword>URLLoaderDataFormat</keyword>
			<keyword>URLRequest</keyword>
			<keyword>URLRequestHeader</keyword>
			<keyword>URLRequestMethod</keyword>
			<keyword>URLStream</keyword>
			<keyword>URLUtil</keyword>
			<keyword>URLVariables</keyword>
			<keyword>ValidationResult</keyword>
			<keyword>ValidationResultEvent</keyword>
			<keyword>Validator</keyword>
			<keyword>VBox</keyword>
			<keyword>VDividedBox</keyword>
			<keyword>VerifyError</keyword>
			<keyword>Video</keyword>
			<keyword>VideoDisplay</keyword>
			<keyword>VideoError</keyword>
			<keyword>VideoEvent</keyword>
			<keyword>ViewStack</keyword>
			<keyword>VRule</keyword>
			<keyword>VScrollBar</keyword>
			<keyword>VSlider</keyword>
			<keyword>WeakFunctionClosure</keyword>
			<keyword>WeakMethodClosure</keyword>
			<keyword>WebService</keyword>
			<keyword>WebService</keyword>
			<keyword>WedgeItemRenderer</keyword>
			<keyword>WipeDown</keyword>
			<keyword>WipeDownInstance</keyword>
			<keyword>WipeLeft</keyword>
			<keyword>WipeLeftInstance</keyword>
			<keyword>WipeRight</keyword>
			<keyword>WipeRightInstance</keyword>
			<keyword>WipeUp</keyword>
			<keyword>WipeUpInstance</keyword>
			<keyword>WSDLError</keyword>
			<keyword>XML</keyword>
			<keyword>XMLDocument</keyword>
			<keyword>XMLList</keyword>
			<keyword>XMLListCollection</keyword>
			<keyword>XMLNode</keyword>
			<keyword>XMLNodeType</keyword>
			<keyword>XMLUtil</keyword>
			<keyword>ZipCodeFormatter</keyword>
			<keyword>ZipCodeValidatorDomainType</keyword>
			<keyword>Zoom</keyword>
			<keyword>ZoomInstance</keyword>
		</context>

		<context id="loopKeywords" style-ref="keyword">
			<keyword>break</keyword>
			<keyword>continue</keyword>
		</context>

		<context id="specialDeclerationKeywords" style-ref="preprocessor">
			<keyword>dynamic</keyword>
			<keyword>final</keyword>
			<keyword>public</keyword>
			<keyword>private</keyword>
			<keyword>protected</keyword>
			<keyword>static</keyword>
		</context>

		<context id="specialDeclerationKeywordsInClass" style-ref="preprocessor">
			<keyword>final</keyword>
			<keyword>override</keyword>
			<keyword>public</keyword>
			<keyword>private</keyword>
			<keyword>protected</keyword>
			<keyword>static</keyword>
		</context>

		<context id="specialDeclerationKeywordsOutsidePackage" style-ref="preprocessor">
			<keyword>internal</keyword>
		</context>

		<context id="metadataTags" style-ref="other">
			<prefix>\[\s*</prefix>
			<suffix>\s*\]</suffix>
			<keyword>ArrayElementType</keyword>
			<keyword>Bindable</keyword>
			<keyword>DefaultProperty</keyword>
			<keyword>Deprecated</keyword>
			<keyword>Effect</keyword>
			<keyword>Embed</keyword>
			<keyword>Event</keyword>
			<keyword>Exclude</keyword>
			<keyword>ExcludeClass</keyword>
			<keyword>IconFile</keyword>
			<keyword>Inspectable</keyword>
			<keyword>InstanceType</keyword>
			<keyword>NonCommittingChangeEvent</keyword>
			<keyword>RemoteClass</keyword>
			<keyword>Style</keyword>
			<keyword>Transient</keyword>
		</context>

		<context id="operators" style-ref="other">
			<match>
				=		|
				\+		|
				\-\-		|
				/		|
				\+\+		|
				\%		|
				\*		|
				\-		|
				\+=		|

				%=		|
				\*=		|
				\-=		|
				==		|
				&amp;		|
				&lt;&lt;		|
				~		|
				\|		|
				&gt;&gt;		|
				&gt;&gt;&gt;		|
				\^		|
				&amp;=		|
				&lt;&lt;=		|
				\|=		|
				&gt;&gt;=		|
				&gt;&gt;&gt;=		|
				\^=		|
				==		|
				&gt;		|
				&gt;=		|
				\!=		|
				&lt;		|
				&lt;=		|
				===		|
				\!==		|
				&amp;&amp;		|
				\!		|
				\|\|
			</match>
		</context>




		<!--

			@13 == CDATA

		-->


		<context id="Cdata" 					extend-parent="false">
			<start>&lt;!\[CDATA\[</start>
			<end>\]\]&gt;</end>
			<include>
                <context sub-pattern="0" where="start" style-ref="preprocessor"/>
				<context sub-pattern="0" where="end" style-ref="preprocessor"/>
				<context ref="insideClass"/>
            </include>
		</context>


		<!--

			@14 == Context Groups

		-->


		<context id="common">
            <include>
				<context ref="comments"/>
            	<context ref="string-double"/>
            	<context ref="string-single"/>
        		<context ref="def:float"/>
        		<context ref="def:decimal"/>
        		<context ref="def:octal"/>
        		<context ref="def:hexadecimal"/>
            	<context ref="string-double"/>
            	<context ref="string-single"/>
            	<context ref="null-value"/>
				<context ref="boolean"/>
				<context ref="dataTypes"/>
				<context ref="operators"/>

            </include>
		</context>

		<context id="comments">
			<include>
				<context ref="line-comment"/>
            	<context ref="block-comment" />
				<context ref="closeCommentOutside"/>
				<context ref="badComment"/>
			</include>
		</context>

		<context id="includeInGoodFunctionBrackets">
			<include>
				<context ref="comments"/>
				<context ref="errorImportStatement" style-ref="error"/>
				<context ref="specialWordsInFunctions"/>
				<context ref="common"/>
				<context ref="generalBlock"/>
				<context ref="badDecleration"/>

			</include>
		</context>

		<context id="generalBlock">
			<include>
				<context ref="elseIfBlock"/>
				<context ref="ifBlock"/>
				<context ref="forBlock"/>
				<context ref="whileBlock"/>
				<context ref="doWhileBlock"/>
				<context ref="elseBlock"/>
				<context ref="withBlock"/>
				<context ref="tryBlock"/>
				<context ref="catchBlock"/>
				<context ref="finallyBlock"/>
				<context ref="switchBlock"/>
				<context ref="variableDeclaration"/>
				<context ref="functionExecution"/>
				<context ref="badStatementInBrackets"/>
				<context ref="statementInBrackets"/>
				<context ref="accessArrayChild"/>
			</include>
		</context>

		<context id="as">
			<include>
				<context ref="package"/>
				<context ref="comments"/>
				<context ref="badDecleration"/>
				<context ref="importStatement"/>
				<context ref="classOutsidePackage"/>
				<context ref="specialDeclerationKeywordsOutsidePackage"/>

            </include>
		</context>

	</definitions>
</language>
