<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi everyone,<br>
<br>
Actually I just started to work with Ragel and probably don't
understand right the concept.<br>
<br>
I'm trying to write parser for toy programming language. All was ok,
before I mess with recursive<br>
definitions.<br>
<br>
I want to read lisp-like expressions, e.g. ((((one)) (two)) three),
and try to write recursive definition for it.<br>
<br>
the same at gist: <a href="https://gist.github.com/893142">https://gist.github.com/893142</a><br>
<br>
<span class="Apple-style-span" style="border-collapse: separate;
color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style:
normal; font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: normal; orphans: 2; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; font-size: medium;"><span
class="Apple-style-span" style="font-family:
helvetica,arial,freesans,clean,sans-serif; font-size: 11px;
line-height: 14px; text-align: left;">
<pre style="margin: 0px; padding: 0px; font: 10pt/1.4em Monaco,monospace;"><div class="line" id="LC1" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;">%%{</div><div class="line" id="LC2" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;"> machine lisp;</div><div class="line" id="LC3" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;">
</div><div class="line" id="LC4" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;"> integer = '-'? . ('0'|[1-9][0-9]*);</div><div class="line" id="LC5" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;"> string = '"' . (any - '"') . '"';</div><div class="line" id="LC6" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;"> list = '(' . (integer|string|list)* . ')';</div><div class="line" id="LC7" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;">
</div><div class="line" id="LC8" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;"> main := list;</div><div class="line" id="LC9" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;">}%%</div><div class="line" id="LC10" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;">
</div><div class="line" id="LC11" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;">%% write data;</div><div class="line" id="LC12" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;">%% write init;</div><div class="line" id="LC13" style="margin: 0px; padding: 0px 0px 0px 1em; line-height: 1.4em;">%% write exec;</div></pre>
</span></span><br>
So I got following error:<br>
<br>
test.rl:7:32: graph lookup of "list" failed<br>
<br>
So, the question is: How to define parser for such language.<br>
<br>
Yea, sorry my bad English.<br>
</body>
</html>