What negation is doing in MethodInvocation node? And what negation is doing in the VariableAccessorNode? What type cast is doing in VariableAccessorNode? Why does variable accessor has array? Is't not accessor_s_. Accessor. Only one. Accessor only knows only name of the variable it's accessing and the target of access. During parsing PJVariableAccessorNode is created as part of identifierWithAccessors, primary and selector grammars.
As for me this is madness. Yes, I made some mess to when I created InfixOperation instead of all the additive expressions, multiplicative expressions, etc... But to do it right now you just have to define a new node and create it for a related grammar instead of infix expression node. I think that right now PetitJava is a bigger mess than it was Надіслано з iPhone _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Hi Yuriy, So, let's talk this through. If a variable is being type cast as something else, how would you model it? A wrapping node that holds the cast? I chose to inline it with the accessor itself as being simpler.
When a variable access is being negated, you would also wrap the accessor with a PJNegationNode, maybe? And, as for the arrayIndexes, if the accessor is an accessor to a point in the array of objects, well, how do you model that?
How would you want the models for this java expression: !super.(OtherType)booleanArray[1][8] The nodes work for my purposes as-is - I can trace the flow of data through the program, which is my main intent. That said, I have no objection to it being modeled better/different, but I do want it modeled at least this well and with at least this much detail.
What is it that you want? Do you want to go back to the way it was? or do you have a specific destination in mind? -Chris On Fri, Jun 28, 2013 at 7:39 AM, Yuriy Tymchuk <[hidden email]> wrote: What negation is doing in MethodInvocation node? And what negation is doing in the VariableAccessorNode? What type cast is doing in VariableAccessorNode? Why does variable accessor has array? Is't not accessor_s_. Accessor. Only one. Accessor only knows only name of the variable it's accessing and the target of access. During parsing PJVariableAccessorNode is created as part of identifierWithAccessors, primary and selector grammars. _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
To be short IMHO it should be as close to http://docs.oracle.com/javase/specs/jls/se7/html/index.html as possible. Надіслано з iPhone
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
So, you'd like to have a PJArrayVariableAccessorNode and PJArrayVariableDeclarationNode as well to support http://docs.oracle.com/javase/specs/jls/se7/html/jls-10.html#jls-10.4 and http://docs.oracle.com/javase/specs/jls/se7/html/jls-10.html#jls-10.2 ? how granular do you want the AST? Or am I not understanding what you are asking? I am having a hard time trying to understand how to translate that web-site into a Node design. -Chris On Fri, Jun 28, 2013 at 8:56 AM, Yuriy Tymchuk <[hidden email]> wrote:
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Yes, I want it that way, very granular. First of all a shortcut methods can be created so instead of getting an identifier from the method and getting its name, a method node can can have a 'name' method that will get the name directly. Personally I will convert this AST to other one greatly simplified. But if someone wants to parse a Java code he should get a result that is similar to what Java compiler is working with in a first place. Plus it's easier to maintain wrappers than to introduce a negation for each node etc... Надіслано з iPhone
_______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Free forum by Nabble | Edit this page |