Tcl Library Source Code

View Ticket
Login
2017-08-31
21:56 • Ticket [eb8c1e69ba] Add "prune" mode status still Open with 4 other changes artifact: 92353d5363 user: aku
2017-08-29
08:47 • Ticket [eb8c1e69ba]: 3 changes artifact: 4475966d61 user: anonymous
2017-08-28
19:14 • Ticket [eb8c1e69ba]: 5 changes artifact: 0d706c7680 user: aku
2017-08-22
08:36 • New ticket [eb8c1e69ba]. artifact: 15c3a80c52 user: anonymous

Ticket UUID: eb8c1e69ba76594f03b296d4dcf9ffc52b4f2521
Title: Add "prune" mode
Type: RFE Version:
Submitter: anonymous Created on: 2017-08-22 08:36:04
Subsystem: pt (parsetools) Assigned To: aku
Priority: 3 Low Severity: Minor
Status: Open Last Modified: 2017-08-31 21:56:54
Resolution: None Closed By: nobody
    Closed on:
Description:
In addition to "value", "void" and "leaf", I'd like to have "prune": if a non terminal is empty or contains a single non terminal, then it is removed from the resulting AST, only the right side is kept (if non empty).
User Comments: aku added on 2017-08-31 21:56:54:
Ok. So this is about eliminating symbol chains.

Do you have a patch implementing this feature ?
(preferably with tests ?)

This looks to be quite a lot of work to be done from meta grammar to interpreter and the various coded engines. Especially for something which can be implemented as a post-parse tree-transformation.

anonymous added on 2017-08-29 08:47:50:
The functionality comes from waxeye:
https://waxeye.org/manual.html#_pruning_non_terminals

aku added on 2017-08-28 19:14:33:
Do you have ASCII art showing how the AST looks before vs after the use of prune ?