Re: [ceylon-dev] Java to Ceylon Converter - variables

23 views
Skip to first unread message

Tako Schotanus

unread,
May 26, 2015, 5:56:41 AM5/26/15
to ceylon-dev
I would definitely try to detect if a value is variable or not.
Normally you'd do this with a separate pass over the AST where you look for all the assignment statements and things like ++ and -- and then mark the value it refers to as variable. That way when you do the final pass that generates the code you will know if you need to generate a "variable" annotation or not.

At the same time I'd suggest to just get things working in the beginning and handle details like that later.


-Tako

On Tue, May 26, 2015 at 11:30 AM, Rohit Mohan <rohitm...@gmail.com> wrote:
Hi

I'll be working on a Java to Ceylon converter as a GSoC project for this year.

I am currently using Antlr to generate an AST and then parsing it and producing the Ceylon code. 

What I wanted to know was how to handle variables? Because in Ceylon any value has to be specified as a variable if it has to be assigned more than once. So should I make everything a variable? Or check if the value changes and then make it a variable?


Regards

Rohit Mohan

--
You received this message because you are subscribed to the Google Groups "ceylon-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-dev+...@googlegroups.com.
To post to this group, send email to ceylo...@googlegroups.com.
Visit this group at http://groups.google.com/group/ceylon-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-dev/2d34cd4e-39bf-4e25-987d-81187428f513%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages