Programmatically building DynamicSyntaxLanguage XML files?

SyntaxEditor for Windows Forms Forum

Posted 9 years ago by Amy Brown - CSMicroSystems.com LTD
Version: 4.0.0284
Avatar
Hello,

I am working with the Dynamic Syntax Language XML programmatically using the DynamicSyntaxLanguage class. So far I have ran into a couple issues I wanted to get clarification on since I am new to the SyntaxEditor control.

1. Missing BracketHighlight Property in the DynamicLexicalScope class?
The SyntaxEditor help file specifies that the DynamicLexicalScope class represents the Scope tag at run-time. It shows two possible attributes AncestorEndScopeCheckEnabled and BracketHighlight.
The problem I ran into is that the BracketHighlight attribute is not defined in the DynamicLexicalScope class. Is there some other way to get/set this property?

2. Unable to add a Explicit Pattern Tag?
The SyntaxEditor Help File shows two Child Tags (ExplicitPattern & ExplicitPatterns ) for the ExplicitPatternGroup Tag. Both tags are represented at run-time by the LexicalPattern class. How can I programmatically flag a group of patterns to save separate “ExplicitPattern” tags? Adding more than one LexicalPattern to the PatternGroup changes the XML tag to ExplicitPatterns.

Example:
LexicalPatternGroup.Add(New ActiproSoftware.SyntaxEditor.Addons.Dynamic.LexicalPattern("End Function"))
LexicalPatternGroup.Add(New ActiproSoftware.SyntaxEditor.Addons.Dynamic.LexicalPattern("End Sub"))
State.LexicalPatternGroups.Add(LexicalPatternGroup)
Saved XML Output:

<!-- States -->
 <States>
 <!-- DefaultState State -->
   <State Key="DefaultState" TokenKey="DefaultToken" Style="DefaultStyle">
     <!-- Pattern Groups -->
       <PatternGroups>
         <ExplicitPatternGroup TokenKey="Test">
           <ExplicitPatterns>
             End Function End Sub 
           </ExplicitPatterns>
         </ExplicitPatternGroup>
       </PatternGroups>
    </State>
    </States>
Desired XML Output:
<!-- States -->
<States>
 <!-- DefaultState State -->
 <State Key="DefaultState" TokenKey="DefaultToken" Style="DefaultStyle">
   <!-- Pattern Groups -->
   <PatternGroups>
     <ExplicitPatternGroup TokenKey="Test">
       <ExplicitPattern Value="End Function" />
       <ExplicitPattern Value="End Sub" />
     </ExplicitPatternGroup>
   </PatternGroups>
 </State>
</States>
Regards,
Ken Brown

Comments (2)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Ken,

All the BracketHighlight property does when read in is it sets the scope's EndLexicalPatternGroup.StartBracket property to the LexicalPatternGroup in StartLexicalPatternGroup, and sets the scope's StartLexicalPatternGroup.EndBracket property to the LexicalPatternGroup in EndLexicalPatternGroup.

For the second item, I checked our code and we'd need to update our code to output tags like that. I'll mark it down on our TODO list.


Actipro Software Support

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ken,

We've updated our code to fix the second item. This update will be in the next maintenance release.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 6 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.