Trying to keep my unique parse tree

57 views
Skip to first unread message

senechaux

unread,
Nov 24, 2017, 4:12:43 PM11/24/17
to TiddlyWikiDev
I have a custom language with its own syntax and parse tree that I currently enter in unique tiddlers containing one or more language statements

A TW5 wikirule parses the tiddler and returns (w/ added formatting) the TW5 wiki parse tree for rendering.  The parser aborts on the first (syntax, etc.) error and the rule adjusts the TW5 parse tree accordingly.  Note, the language's unique parse tree is also produced. Ideally, this is the one/only parsing/validation that I want to execute so I want to "keep" the custom language's parse tree.

The appropriately tagged, validated tiddlers created this way are later processed by a macro but I want to avoid re-parsing to acquire the unique parse trees.

I really like the wikirule I developed but I'm unaware of a convenient way to store my unique parse tree.

Assuming the data store is the tiddler's (preferably hidden) "field" with a value of a "stringified" tree, known alternatives include:
* injecting an "action-setfield" into the rule's TW5 parse tree. Early attempts don't show promise.
* using a custom widget to wrap the "statements". Not as friendly as a wikirule and will have to move parser and do-away with the rule.
* custom content type?

Another thought was to use the TW5 tree to hold the language's tree as a wiki comment. Although I'm not afraid of more work, I thought I would confer with the group before I went down a resolution path.

Any recommendations?

Jeremy Ruston

unread,
Nov 24, 2017, 5:10:31 PM11/24/17
to tiddly...@googlegroups.com
Hi Senechaux

I’m not sure that I fully understand your use case, but it sounds like you should keep your parse rule but have it generate an invocation of a custom widget, and pass the data to it via attributes. 

Best wishes

Jeremy

--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/7c961455-e18f-412b-bd71-6c9861d3bebb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

senechaux

unread,
Nov 24, 2017, 6:31:54 PM11/24/17
to TiddlyWikiDev
Hi Jeremy,

Sorry I failed at the use-case description.  Imagine an interpreted language where one or more statements can exist within a number of tiddlers.  I want the parsing to occur only when the statement(s) are saved in a tiddler -- leaving only the parse tree for later.  

I will try the use of a widget as you suggest.  Assuming the tiddler field is best to store the tree, is it possible to hide the field?

Thank your for your interest!
Reply all
Reply to author
Forward
Message has been deleted
0 new messages