Origin Property Class
- Nov 01, 2012
- 1 Comment
After meeting with Caitlin, Dennis, and Kyle, it seems that we are good to go on starting to implement the AST Origin Property to the AST nodes. The various classes and tricks that everyone has pointed out have been incredibly helpful in getting started.
I began by creating an OriginProperty class, this is like (ManagementLevel) and is currently being created on every node because I threw the property into the AbstractNode class. OriginProperty has four enumerations: SYSTEM, GENERATED, COPIED, and REMIXED. This isn't quite what Kyle and I worked on this summer, but I think it is a good start. Each enumeration has three boolean values: isGenerated, isCopied, and isRemixed.
- SYSTEM (false, false, false) because it is not generated by the code, copied, or remixed. This is going to be the default for all nodes until something is changed.
- GENERATED = (true, false, false) because it is created by the user.
- COPIED = (true, true, false) because it is code that the user has generated and copied using the clipboard this may eventually become slightly redundant, but we will see.
- REMIXED = (false, true, true) since it was not generated by the particular user doing the remix, but copied into from a different world.
So right now, the AST node can be examined from the xml file and it displays every node as having the originProperty SYSTEM. I found Clipboard.java, which is what copying is used for, I implemented a line of code in there that shows a node to be copied out of the clipboard and that also shows up in the AST node. With this second part, it does not change any of the nodes inside the node that was copied (say a doTogether was copied, it does not change the values of the statements inside the doTogether).
Talking with Dennis showed me some tricks to using Eclipse that will be incredibly helpful. I had forgotten the correct short-cut keys and what things do exactly. Also, he recommended that I create a crawler to do what I am currently doing in bits and pieces. This means that I would crawl through the AST and slam all of the node originProperties to be the default and then change appropriately, so I will spend the next week trying to build a crawler. I am going to try and talk with Aaron because he seems to have lots of experience with building crawlers.
Comments
kyle said:
<p>Every node being set to SYSTEM is wrong. This means you should probably add another value: UNKNOWN and set that as the default.</p> <p> </p>
Log In or Sign Up to leave a comment.