<?xml version="1.0" encoding="utf-8"?>
<!--

Actipro Syntax Language Definition (.langdef)
  For use with Actipro SyntaxEditor and related products.
  http://www.actiprosoftware.com

'INI File' language created by Actipro Software LLC.
  Copyright (c) 2001-2014 Actipro Software LLC.  All rights reserved.

-->
<LanguageDefinition LanguageKey="IniFile" LanguageDescription="INI File" Creator="Actipro Software LLC" Copyright="Copyright (c) 2001-2014 Actipro Software LLC.  All rights reserved." xmlns="http://schemas.actiprosoftware.com/langdef/1.0">
	<!-- Classification types -->
	<LanguageDefinition.ClassificationTypes>
		<ClassificationType Key="Label" DefaultStyle="#FF008080" />
		<ClassificationType Key="Comment" DefaultStyle="#FF008000" />
		<ClassificationType Key="Identifier" />
		<ClassificationType Key="IniFileNumber" Description="INI File Number" DefaultStyle="#FF800080" />
		<ClassificationType Key="String" DefaultStyle="#FF800000" />
	</LanguageDefinition.ClassificationTypes>
	<!-- Lexer -->
	<LanguageDefinition.Lexer>
		<DynamicLexer>
			<!-- Default state -->
			<State Key="Default">
				<State.ChildStates>
					<StateRef Key="Section" />
					<StateRef Key="PrimaryString" />
					<StateRef Key="SingleLineComment" />
				</State.ChildStates>
				<RegexPatternGroup TokenKey="Whitespace" Pattern="{Whitespace}+" />
				<RegexPatternGroup TokenKey="LineTerminator" Pattern="{LineTerminator}" />
				<ExplicitPatternGroup TokenKey="Equals" Pattern="=" />
				<ExplicitPatternGroup TokenKey="Comma" Pattern="," />
				<ExplicitPatternGroup TokenKey="SemiColon" Pattern=";" />
				<RegexPatternGroup TokenKey="Identifier" ClassificationTypeKey="Identifier" Pattern="(_ | {Alpha})({Word})*" />
				<RegexPatternGroup TokenKey="RealNumber" ClassificationTypeKey="IniFileNumber" LookAheadPattern="{NonWord}|\z">
					<RegexPattern Value="{Digit}* \. {Digit}+ ([Ee] [\+\-]? {Digit}+)?" />
					<RegexPattern Value="{Digit}+ [Ee] [\+\-]? {Digit}+" />
				</RegexPatternGroup>
				<RegexPatternGroup TokenKey="IntegerNumber" ClassificationTypeKey="IniFileNumber" Pattern="{Digit}+" LookAheadPattern="{NonWord}|\z" />
			</State>
			<!-- Section state -->
			<State Key="Section" DefaultTokenKey="SectionText" DefaultClassificationTypeKey="Label">
				<State.Scopes>
					<Scope>
						<Scope.StartPatternGroup>
							<ExplicitPatternGroup TokenKey="SectionStartDelimiter" Pattern="[" />
						</Scope.StartPatternGroup>
						<Scope.EndPatternGroup>
							<RegexPatternGroup TokenKey="SectionEndDelimiter" Pattern="[\]\n]" />
						</Scope.EndPatternGroup>
					</Scope>
				</State.Scopes>
				<RegexPatternGroup TokenKey="SectionText" Pattern="[^\]\n]+" />
			</State>
			<!-- PrimaryString state -->
			<State Key="PrimaryString" DefaultTokenKey="PrimaryStringText" DefaultClassificationTypeKey="String">
				<State.Scopes>
					<Scope>
						<Scope.StartPatternGroup>
							<ExplicitPatternGroup TokenKey="PrimaryStringStartDelimiter" Pattern="&quot;" />
						</Scope.StartPatternGroup>
						<Scope.EndPatternGroup>
							<RegexPatternGroup TokenKey="PrimaryStringEndDelimiter" Pattern="[\&quot;\n]" />
						</Scope.EndPatternGroup>
					</Scope>
				</State.Scopes>
				<ExplicitPatternGroup TokenKey="PrimaryStringEscapedDelimiter" Pattern="\&quot;" />
				<RegexPatternGroup TokenKey="PrimaryStringText" Pattern="[^\&quot;\\\n]+" />
			</State>
			<!-- SingleLineComment state -->
			<State Key="SingleLineComment" DefaultTokenKey="SingleLineCommentText" DefaultClassificationTypeKey="Comment">
				<State.Scopes>
					<Scope>
						<Scope.StartPatternGroup>
							<ExplicitPatternGroup TokenKey="SingleLineCommentStartDelimiter" Pattern=";" />
						</Scope.StartPatternGroup>
						<Scope.EndPatternGroup>
							<RegexPatternGroup TokenKey="SingleLineCommentEndDelimiter" Pattern="\n" />
						</Scope.EndPatternGroup>
					</Scope>
				</State.Scopes>
				<RegexPatternGroup TokenKey="SingleLineCommentText" Pattern="[^\n]+" />
			</State>
		</DynamicLexer>
	</LanguageDefinition.Lexer>
	<!-- Example text -->
	<LanguageDefinition.ExampleText><![CDATA[; Company employees

[Employee1]
name="Bob Johnson"
department=Accounting

[Employee2]
name="Susan Fielding"
department=Sales
]]></LanguageDefinition.ExampleText>
</LanguageDefinition>