Add a model 'Backtrack' Element impl, which reads ahead.
Motivation:
Create a parser for MANIFEST.MF files, which extracts the version of specific bundle dependencies.
The protected region support could be used to protected the MANIFEST contents but replace the version of specific bundles (fill in regions/generated regions). This would be helpful for release engineering/packaging of tycho projects.
With the re-design of v2.0.0 and the new architecture of the region parser, it is now possible to extend the functionality of the parser without changing it's implementation. Compared to v1.x of xtext-protected-regions, the loc of the parser could be reduced by 86% from 677 lines to just 91 lines (including comments)!
The key to change parser behavior are so called Elements, which are part of the parser model (-> describing the structure of the parser input). Adding new Elements enhance the parser how input is parsed.
Currently there are the following Elemens:
Str: fixed string
GreedyStr: last occurrence of a string in a contiguous char sequence
RegEx: regular expression
None: nothing (literals are treated as blocks consisting of just a start string - the end string is a None)
Some: given a set of elements the one is searched which occurs first
Seq: the concatenation of a given sequence of elements
Dynamic: a placeholder for another element (= delegate). useful to model 'semantic' cycles (like recursive structures) in a tree
Add a model 'Backtrack' Element impl, which reads ahead.
Motivation: Create a parser for MANIFEST.MF files, which extracts the version of specific bundle dependencies. The protected region support could be used to protected the MANIFEST contents but replace the version of specific bundles (fill in regions/generated regions). This would be helpful for release engineering/packaging of tycho projects.
With the re-design of v2.0.0 and the new architecture of the region parser, it is now possible to extend the functionality of the parser without changing it's implementation. Compared to v1.x of xtext-protected-regions, the loc of the parser could be reduced by 86% from 677 lines to just 91 lines (including comments)!
The key to change parser behavior are so called Elements, which are part of the parser model (-> describing the structure of the parser input). Adding new Elements enhance the parser how input is parsed.
Currently there are the following Elemens: