shirmung/OOP — comment on commit a8f5b8a14e6b962f03d8a82fc27da3771290669e
File:  line 0
By dave-filion:

I agree a meeting might be in order. Good call on implementing a
dictionary. On the dave_experiment branch (which is where Im trying to do a
bunch of crazy stuff), I'm working on doing something like this, creating
a preliminary visitor that passes over the node before actual processing
begins, and creates a map (dictionary) of Identifier->Type of all
variables. However, the issue I hadn't considered is return types being fed
as arguments after being evaluated (i.e. m( g() );).We'll need to know the
return type of g, and have that as the argument type of m.

Another big thing we need is the whole static/virtual mess that we talked
about with grimm. This will lead to slightly different vtable formation.

System.out is pretty much done, I have the code locally which I'll post
soon.

Arrays are technically implemented, but I don't have a lot of faith in them.

On Wed, Nov 30, 2011 at 11:05 AM, shirmung <
reply@reply.github.com
> wrote:

> Can we schedule a meeting on this?
>
> Shirmung
>
> On Wed, Nov 30, 2011 at 10:55 AM, howardjing <
> reply@reply.github.com
> > wrote:
>
> > PLEASE READ THIS CAREFULLY AND DISCUSS KTHX:
> >
> > I added a dictionary in ImplementationVisitor to keep track of the name
> > and class of every variable declared. I did the implementation before
> > really thinking it through--as a result it is too naive and will have to
> be
> > drastically changed or completely removed.
> >
> > Shortcomings:
> >
> > - (REALLY MAJOR) It doesn't handle visitCallExpressions, which is
> > going to be really important
> > - (ALSO REALLY MAJOR) Since it is a dictionary, repeats are not
> > allowed, meaning IT DOESN'T KEEP TRACK OF SCOPE
> >
> > I added the dictionary thinking that it would help with method
> > overloading--but from what I can tell, there are several cases to worry
> > about.
> >
> > Base Cases:
> > Case 1)
> > y.foo(100)
> > Here 100 is an IntegerLiteral, so we can immediately pick the
> > correct overloaded method to use
> > Case 2)
> > y.foo( asdf )
> > We get the class of asdf from the dictionary in
> > ImplementationVisitor, and can then pick the correct overloaded method to
> > use
> >
> > More Complicated:
> > Case 3)
> > y.foo( x.help(me, aaugh) )
> > First let type = x.help(me, aaugh)
> > Recursively evaluate y.foo(type)
> >
> > By the way, how should we decide which overloaded method to use? For
> > example if the method foo(grandparent x) exists, but we pass a variable
> of
> > type child as the argument, we will have to go up child's hierarchy tree
> > until we find the correct ancestor of child to use in our method.
> >
> > WHAT WE WILL NEED:
> > Information on the return type of every method of every relevant
> > object.
> > The class hierarchy of every relevant object.
> >
> > Also, method chaining will probably have to be updated in order to do
> > handle overloaded methods, but I think this is a separate issue.
> >
> > Am I totally misunderstanding the problem?? LETS DISCUSS!!!
> >
> > PS: Here are important things that still need to be done
> > 1) import statements
> > 2) arrays
> > 3) System.out
> >
> > ---
> > Reply to this email directly or view it on GitHub:
> >
> >
> https://github.com/shirmung/OOP/commit/a8f5b8a14e6b962f03d8a82fc27da3771290669e#commitcomment-758058
> >
>
> ---
> Reply to this email directly or view it on GitHub:
>
> https://github.com/shirmung/OOP/commit/a8f5b8a14e6b962f03d8a82fc27da3771290669e#commitcomment-758099
>