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

Max Lapshin max.lapshin@REDACTED
Mon May 16 23:19:29 CEST 2016


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160517/a142ab2b/attachment.htm>


More information about the erlang-questions mailing list