[augeas-devel] Inexpressible Language

Yclept Nemo orbisvicis at gmail.com
Thu Jun 26 15:59:37 UTC 2014


On Thu, Jun 26, 2014 at 2:46 AM, Raphaël Pinson <
raphael.pinson at camptocamp.com> wrote:

> Hello,
>
>
> I'm not sure if you're reporting a bug (in which case it would help to
> file it on the bugtracker [0]) or asking for help. I'll suppose the latter.
>
> Here is a lens that parses your example. I suppose there must still be an
> issue (which is linked to the restrictions I had to put in the comment
> regexp —no "[" allowed as first character— but your example doesn't expose
> it then:
>

Hi,

You're right - there are additional restrictions which I failed to
demonstrate in the unit test, though I expressed them in the lenses (which
compared from you examples had other shortcomings, ie not resetting the
counter).

let comments="
[A_COMMENT:   ] <-- this is a comment
[NOT_A_COMMENT: 5 : 6 ][A_COMMENT:  ] <--- only the last [] is a comment
"

Since this is my first lens (just started using Augeas) I was seeking
confirmation that this particular grammar is very difficult to express in
Augeas, and if so hoping to prompt further development by some suggestions.
I had just opened a github issue (#138, [1]) after posting this thread,
with alternative solutions in addition to the original proposal of greedy
operators.

For the record, I believe this is a common problem parsers face,
(dangling-else, [2]), something parsing expression grammars [3] do not
suffer, which can be solved, among other strategies, by "maximal munch"
(greedy) [4].



[1] https://github.com/hercules-team/augeas/issues/138

[2] http://en.wikipedia.org/wiki/Ambiguous_grammar#Dangling_else
[3]
http://stackoverflow.com/questions/1044600/difference-between-an-ll-and-recursive-descent-parser
[4] http://en.wikipedia.org/wiki/Maximal_munch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20140626/73343dfa/attachment.htm>


More information about the augeas-devel mailing list