[erlang-questions] leex question about context dependent parsing.

Serge Aleynikov serge@REDACTED
Mon May 16 23:43:53 CEST 2016


Max,

Take a look at the following project https://github.com/saleyn/erlcfg. Its
syntax is very similar to yours and it's got the corresponding lexer/parser
grammars there that you could use as the starting point.

Regards,

Serge

On Mon, May 16, 2016 at 5:19 PM, Max Lapshin <max.lapshin@REDACTED> wrote:

> Hi.  I'm trying to build a leex + yacc parser for our Flussonic config
> syntax and have met problem.
>
> I want to split following text:
>
>
> stream s {
> url rtsp://10.1.2.3/h264?user=admin&password=  rtp=udp;
> }
>
> into following stream of lexems:
>
> {stream, 1},
> {string, 1, "s"},
> {'{', 1},
> {url, 2},
> {string, 2, "rtsp://10.1.2.3/h264?user=admin&password="},
> {string, 2, "rtp"},
> {eq, 2},
> {string, 2, "udp"},
> {';', 2},
> {'}', 3}
>
> At least I think that I want it.
>
> Problem with my approach is that it requires syntax dependent lexical
> analysis and leex doesn't allow to do it.  If I consider  "=" a split
> symbol, then first string after keyword url will be splitted. If I consider
> it a part of string, then it will not split  key=value part of url
> specification.
>
> Maybe I'm doing it wrong?
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160516/4ea64abe/attachment.htm>


More information about the erlang-questions mailing list