Hi Kyle, 2010/5/20 Kyle <[email protected]>: > This is probably a silly question -- but why did you all choose to create your > own bnf/parser instead of just replacing the backend in the existing compiler?
My no means a silly question, but an obvious one and iirc, Wouter even asked for a 'C backend' as a universal target and not a new tool. I had a look ad the pcode output and learned that it is currently output too late since vars are already resolved. A subsequent look at the compiler source learned that I would need quite some support from you to change this, while your time seems scarce these days. So I decided to follow the path started by William, creating a new parser with antrl. This was a nice and informative experience and my own 'little language' interpreter is code complete after only 2 days of work :). So William, thanks for pointing this path to me! Generating code from the AST is pretty straight-forward for most cases, but some combinations of features are not. This is mostly related to the location where the (definition, initialisation) code can be put. And to variable passing, where the C method of passing on stack is quite different from the JAL method (which becomes apparent if you use a function with volatile parameters in a compound expression). As expected, arrays almost doubles the possible combinations. An advantage of the current aproach is that it allows the use of variables that are 'extern' to jal, like IO registers from the C device file. And inline C is useful too ;) Why elaborate on this? Since compatibility is important and sharing the frontend would be a major advantage from that point of view. And if we think it is feasable to adapt the frontend to support this and are committed to add C as a target, I'd prefere to take this path. I haven't pushed this though, since I don't want to put any (more) pressure on you. You did a great job on creating the compiler and still do on maintaining it. I appreciate this and hope you continue to do so. Joep -- You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
