Using OutliningNodeDefinition with non-nested nodes

SyntaxEditor for WPF Forum

Posted 14 years ago by Martin - Blaise - Statistics Netherlands
Version: 10.2.0531
Avatar
In our Blaise Language some Nodes are ended just because the next Node is started. They have no ending Token. In my OutliningNodeDefinition all Nodes are now nested. Is there a possibility in OutliningNodeDefinition to create an implicit ending of a node ?

Regards
Martin

sample, where fields and rules are children of block, but where rules is not a child of fields:
block test
   fields
      a
      b
   rules
     b
     a
endblock

Comments (5)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Martin,

There isn't a way to have us determine implicit node ends, however you can do it yourself.

If you look at our CodeOutliningRangeBased QuickStart, if you are doing like what we show in the JavascriptOutliningSource constructor, when you encounter a new node start or end that should also implicitly end another previous node, you can insert the previous node from its start offset through to the offset you are at, before starting to track the next node's ranges.


Actipro Software Support

Posted 13 years ago by Martin - Blaise - Statistics Netherlands
Avatar
This document has n't a parser, well not directly that is. Its an include file. So my idea was to implement outlining based on lexer data, rather than using parse data with ASTs from other documents.

Well, i will try your solution maybe later (needs to cache AST trees, and parsing of other document on textchanges)
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Martin,

Based on the syntax you have above, I would think you could just parse it as-is and wouldn't need ASTs from other document.


Actipro Software Support

Posted 13 years ago by Martin - Blaise - Statistics Netherlands
Avatar
:) If that would be the complete syntax yes. However the syntax is quite complex. But maybe a simple lookalike parser will do.
Posted 13 years ago by Martin - Blaise - Statistics Netherlands
Avatar
Fixed using a IParser (which doesnt parse;)) but hooks on the outlining. To keep it simple only implemented basic nested outlining (blocks can contain blocks e.g.), but for outlining purposes is that enough i think.
The latest build of this product (v24.1.2) was released 7 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.