A lot of the Neko compiler NML files reference an AST file (Abstract
Syntax Trees?), but I can't find this among the directories.  Is this
made available anywhere?

Thanks,
Lee



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Nicolas
Cannasse
Sent: 07 March 2006 11:48
To: Neko intermediate language mailing list
Subject: Re: [Neko] Compiler used for neko

> Not clear how that works! For LL(1) this requires the
> head token of the stream pattern to be unique?

For NekoML stream parsers, it works the following :
- if it's a pattern, we check the matching and increment the readed
tokens counter
- if we fail the token pattern matching, reset the counter to 0 and go
to next rule
- if it's a sub-rule (in fact a function call), then we junk the readed
tokens before entering it
- if no rule match an expression is raised
- if we catch an exception in a rule set, it is an error only if some
tokens were junked, else it just mean the rule didn't match

For more clear explanations you might have a look at the generated Neko
code by using :

/src> nekoml -n neko/Parser.nml

(that will keep the .neko generated files)

> I'm curious because Felix has a user defined grammar
> system using an standard Recursive Descent implementation.
> This is LL(inf). The problem is "Syntax Error". Its the
> only possible diagnostic you can get.

I'm not using LL(1) tips right now, although I don't see why it would
not be possible.

Nicolas

-- 
Neko : One VM to run them all
(http://nekovm.org)

--
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to