I know you can extract this with lots of work from the documentation, but did anyone actually write a real parser (ideally lex/yacc resp. flex/bison) for Natural? I know this CoCoLab thing, but I need it for a 4.x version and cannot rely on a closed-source external library here.
No, any other tool will NOT do, we have to create software that rewrites Natural programs, therefore, I need a real parser.
Actually, the documentation doesn’t provide a lot of what you need to know how the code is interpreted in object form. For that, you need proprietary inside knowledge about what the Natural compiler does. That’s why you find ex-SAG people forming companies that attempt to do this very thing.
Since I am not sure if there is a legal or ethical way you can snag such a person, I am afraid you’re out of luck.
“interpreted in object form”? No that’s not what I need, I’ll not write an alternate interpreter for it, I just need to identify some statements in the Natural code which I can rewrite programmatically, and therefore I need to have the grammar. I just need a precise/complete language specification and this IS of course public as any Natural programmer uses it - but it’s documented in pieces, and I just hoped that perpahs someone already did this work and has it around. It can be figured out from the existing documentation (look for example at “DEFINE CLASS” (that’s right now open on my desk) in the docs - there you get such a grammar piece). But it’s a painful, time-wasting job
@Matthias - Yes I’ve read this thread already, thanks anyway
Guess I am not sure what you mean, then. By re-write Natural programs, my assumption is you want to have it generate code in another language (i.e., Java) in which case you not only have to know what the syntax is but how it’s interpreted. Perhaps that’s not your intention?
no, that’s not my intention.
I write a program (in this case in C#, but that doesn’t really matter) which reads Natural sourcecode, modifies it, and writes the modifed Natural sourcecode back. Must output valid Natural of course