Hi,
I have this .langdef file:
<?xml version="1.0" encoding="utf-8"?>
<!--
Actipro Syntax Language Definition (.langdef)
For use with Actipro SyntaxEditor and related products.
http://www.actiprosoftware.com
'AGC+' language created by Agathon AG.
Copyright by Agathon AG
-->
<LanguageDefinition LanguageKey="AGCplus" LanguageDescription="AGC+" Creator="Agathon AG" Copyright="Copyright by Agathon AG" xmlns="http://schemas.actiprosoftware.com/langdef/1.0">
<!-- Classification types -->
<LanguageDefinition.ClassificationTypes>
<ClassificationType Key="Comment" DefaultStyle="#FF008000" />
<ClassificationType Key="curKeyword" />
<ClassificationType Key="currCommand" />
<ClassificationType Key="Delimiter" />
<ClassificationType Key="Identifier" />
<ClassificationType Key="Keyword" DefaultStyle="#FF0000FF" />
<ClassificationType Key="Number" />
<ClassificationType Key="Operator" />
<ClassificationType Key="Simulation" DefaultStyle="#FF8000FF" />
<ClassificationType Key="String" DefaultStyle="#FF851111" />
</LanguageDefinition.ClassificationTypes>
<!-- Lexer -->
<LanguageDefinition.Lexer>
<DynamicLexer>
<!-- Default state -->
<State Id="1" Key="Default">
<State.ChildStates>
<StateRef Key="PrimaryString" />
<StateRef Key="Simulation" />
<StateRef Key="MultiLineComment" />
</State.ChildStates>
<RegexPatternGroup TokenId="2" TokenKey="Whitespace" Pattern="{LineTerminatorWhitespace}+" />
<ExplicitPatternGroup TokenId="3" TokenKey="CommandEnd" ClassificationTypeKey="Delimiter" Pattern=";" />
<ExplicitPatternGroup TokenId="4" TokenKey="OpenParenthesis" ClassificationTypeKey="Delimiter" Pattern="(" />
<ExplicitPatternGroup TokenId="5" TokenKey="CloseParenthesis" ClassificationTypeKey="Delimiter" Pattern=")" />
<ExplicitPatternGroup TokenId="1" TokenKey="Keyword" ClassificationTypeKey="Keyword" LookAheadPattern="{NonWord}|\z" CaseSensitivity="AutoCorrect">
<ExplicitPatterns><![CDATA[
###IP COMMANDS###
]]></ExplicitPatterns>
</ExplicitPatternGroup>
<RegexPatternGroup TokenId="6" TokenKey="Identifier" ClassificationTypeKey="Identifier" Pattern="(_ | {Alpha})({Word})*" />
<ExplicitPatternGroup TokenId="7" TokenKey="Operator" ClassificationTypeKey="Operator">
<ExplicitPatterns><![CDATA[
* + - / <= <> < = >= >
]]></ExplicitPatterns>
</ExplicitPatternGroup>
<RegexPatternGroup TokenId="8" TokenKey="RealNumber" ClassificationTypeKey="Number" Pattern="{Digit}* \. {Digit}+" LookAheadPattern="{NonWord}|\z" />
<RegexPatternGroup TokenId="9" TokenKey="IntegerNumber" ClassificationTypeKey="Number" Pattern="{Digit}+" LookAheadPattern="{NonWord}|\z" />
</State>
<!-- Simulation state -->
<State Id="2" Key="Simulation" DefaultClassificationTypeKey="Simulation">
<State.Scopes>
<Scope>
<Scope.StartPatternGroup>
<ExplicitPatternGroup Pattern="[" />
</Scope.StartPatternGroup>
<Scope.EndPatternGroup>
<ExplicitPatternGroup Pattern="]" />
</Scope.EndPatternGroup>
</Scope>
</State.Scopes>
<State.ChildStates>
<StateRef Key="MultiLineComment" />
<StateRef Key="PrimaryString" />
<StateRef Key="Simulation" />
</State.ChildStates>
<ExplicitPatternGroup TokenId="1" TokenKey="Keyword" ClassificationTypeKey="Keyword" Pattern="###XXX IP COMMANDS###" LookAheadPattern="{NonWord}|\z" CaseSensitivity="AutoCorrect" />
</State>
<!-- PrimaryString state -->
<State Id="3" Key="PrimaryString" DefaultTokenId="10" DefaultTokenKey="PrimaryStringText" DefaultClassificationTypeKey="String">
<State.Scopes>
<Scope>
<Scope.StartPatternGroup>
<ExplicitPatternGroup TokenId="11" TokenKey="PrimaryStringStartDelimiter" Pattern=""" />
</Scope.StartPatternGroup>
<Scope.EndPatternGroup>
<ExplicitPatternGroup TokenId="12" TokenKey="PrimaryStringEndDelimiter" Pattern=""" />
</Scope.EndPatternGroup>
</Scope>
</State.Scopes>
<State.ChildStates>
<StateRef Key="MultiLineComment" />
</State.ChildStates>
<RegexPatternGroup TokenId="13" TokenKey="PrimaryStringLineTerminator" Pattern="\n" />
<RegexPatternGroup TokenId="10" TokenKey="PrimaryStringText" Pattern="[^\"\n]+" />
</State>
<!-- MultiLineComment state -->
<State Id="4" Key="MultiLineComment" DefaultClassificationTypeKey="Comment">
<State.Scopes>
<Scope>
<Scope.StartPatternGroup>
<ExplicitPatternGroup Pattern="(*" />
</Scope.StartPatternGroup>
<Scope.EndPatternGroup>
<ExplicitPatternGroup Pattern="*)" />
</Scope.EndPatternGroup>
</Scope>
</State.Scopes>
<State.ChildStates>
<StateRef Key="MultiLineComment" />
</State.ChildStates>
</State>
</DynamicLexer>
</LanguageDefinition.Lexer>
</LanguageDefinition>
What do i have to do to add a new State which marks me a single line starting with % and endig wit newline (\n)?
I tried it with this:
<State Id="5" Key="EmbeddedIso" DefaultClassificationTypeKey="Simulation">
<State.Scopes>
<Scope>
<Scope.StartPatternGroup>
<ExplicitPatternGroup Pattern="%" />
</Scope.StartPatternGroup>
<Scope.EndPatternGroup>
<ExplicitPatternGroup Pattern="\n" />
</Scope.EndPatternGroup>
</Scope>
</State.Scopes>
<State.ChildStates>
<StateRef Key="MultiLineComment" />
<StateRef Key="PrimaryString" />
<StateRef Key="EmbeddedIso" />
</State.ChildStates>
</State>
and several variations. But im stuck now for two days :(
Thanks for any advice.
[Modified 7 years ago]