Hello.

It seems that the problem of your grammar is using repetition of
not predicate (!(...))+, which doesn't consume any character if succeed.
I think that rewrite of your grammar as the followings would be fine
(note that period (.), which indicates any character, is added).

label <-  (STRINGMARK ANYCHAR STRINGMARK) ;
void:   STRINGMARK <- "'";
void:   ANYCHAR <- (! ( (STRINGMARK ' ') / (STRINGMARK OROPERATOR)  / EOL ) .)+;
void:   EOL             <- "\n\r" / "\n" / "\r" ;

2010/7/11 Fredrik Karlsson <dargo...@gmail.com>:
> Dear list,
>
> I need to construct at grammar where anything (the entire UTF-8 space)
> in single quotes are accepted up to a quote char followed by either
>
> * a |-char
> * whitespace
> * EOF or EOL
>
> So, ''''''''''''''''''''''''''''''''''a|`´´´´´'{}' would be just one
> string, but '''''''''''''''''''''''''''''''''a'|'`´´´´´'{}' would be
> two strings (the | is used as a separator)
>
> What I got is this:
> ...
> label <-  (STRINGMARK ANYCHAR STRINGMARK) ;
> void:   STRINGMARK <- "'";
> void:   ANYCHAR <- (! ( (STRINGMARK ' ') / (STRINGMARK OROPERATOR)  / EOL ) 
> )+;
> void:   EOL             <- "\n\r" / "\n" / "\r" ;
> ...
>
> But this seems to create an infinite loop (?). Any ideas on how to do this?
>
> I would very much appreciate all the help I gould get on this.
>
> /Fredrik
>
>
>
> --
> "Life is like a trumpet - if you don't put anything into it, you don't
> get anything out of it."
>
> _______________________________________________
> PEG mailing list
> PEG@lists.csail.mit.edu
> https://lists.csail.mit.edu/mailman/listinfo/peg
>



-- 
Kota Mizushima
e-mail: mizuk...@gmail.com,
mizus...@ialab.cs.tsukuba.ac.jp

_______________________________________________
PEG mailing list
PEG@lists.csail.mit.edu
https://lists.csail.mit.edu/mailman/listinfo/peg

Reply via email to