James jSieve
  1. James jSieve
  2. JSIEVE-43

Add API for generating a Sieve script from a parse tree

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.2, 0.3, 1.0
    • Fix Version/s: 0.3
    • Component/s: Util
    • Labels:
      None

      Description

      There's currently no way to generate a Sieve script from a jSieve Node tree. This would be very helpful for cases where you need to parse a script, modify some nodes, and then generate a new script that incorporates the changes.

        Issue Links

          Activity

          Show
          Robert Burrell Donkin added a comment - http://markmail.org/message/yfogd4dn2x4rtfnb
          Hide
          Robert Burrell Donkin added a comment -

          Had a little think about design. Would like to be flexible enough to support various output pipelines: should be able to write out a Sieve script or xml.

          Implementing SieveParserVisitor seems like the best place to start. This visitor is designed to perform it's own tree recursion which suits well.

          The classic first stage of the pipeline is to turn the tree recursion into a linear series of start and end events. For flexibility, these should be node based. This will end up a rather large API with each start and end calls for each concrete node type.

          This would probably be enough to plugin custom output to strings including basic XML rendering. More stages in the pipeline would be required for more sophisticated such as XML pipelining.

          On balance should be very do-able.

          Show
          Robert Burrell Donkin added a comment - Had a little think about design. Would like to be flexible enough to support various output pipelines: should be able to write out a Sieve script or xml. Implementing SieveParserVisitor seems like the best place to start. This visitor is designed to perform it's own tree recursion which suits well. The classic first stage of the pipeline is to turn the tree recursion into a linear series of start and end events. For flexibility, these should be node based. This will end up a rather large API with each start and end calls for each concrete node type. This would probably be enough to plugin custom output to strings including basic XML rendering. More stages in the pipeline would be required for more sophisticated such as XML pipelining. On balance should be very do-able.
          Hide
          Robert Burrell Donkin added a comment -

          Started work in util module for now. Will need to review thsi decision later.

          Show
          Robert Burrell Donkin added a comment - Started work in util module for now. Will need to review thsi decision later.
          Hide
          Robert Burrell Donkin added a comment -

          Output to XML is covered by these issues

          Show
          Robert Burrell Donkin added a comment - Output to XML is covered by these issues
          Hide
          Robert Burrell Donkin added a comment -

          Complete support for XML planned for 0.4

          Show
          Robert Burrell Donkin added a comment - Complete support for XML planned for 0.4
          Hide
          Robert Burrell Donkin added a comment -

          Basic implementation completed. Maybe consider adding pretty printing later.

          Show
          Robert Burrell Donkin added a comment - Basic implementation completed. Maybe consider adding pretty printing later.

            People

            • Assignee:
              Robert Burrell Donkin
              Reporter:
              Boris Burtin
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development