Eugene Chernyshov a écrit :
> Hi.
>>> THis is not very simple. The Neko compiler is not written in C, it's
>>> written in NekoML which is an highlevel language that can compiles to
>>> Neko. If you want to get these methods, you'll have to build a .n
>>> containing a part of the compiler, then load it from your C library and
>>> call its method.
>>>
>>> See neko/src/neko/Console.nml which does just that (read,eval,print
>>> loop).
>>>     
> Can I use parse_string from Parser.nml (i.e. neko/Parser.parse_string or
> neko/Xml.parse_string) for parsing Neko source-lines?

You'll get back an Neko AST, which needs to be compiled into Bytecode
instructions, then written into a .n , either on disk or in memory.
Console.nml does just that :

- read some lines until one ends with "!"
- parse
- compile
- write bytecode in memory (string)
- use the load module API (Reflex in NML) to load the module from memory

Best,
Nicolas



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

Reply via email to