Last time I spent a weekend hacking was a few years ago, in a tent. Back then, I converted a diff algorithm from C to Java, and put a friendly diff/merge API on top of it. This weekend is even better, because it is almost three days of no interruption, and no time was wasted traveling to and from a tent.
And, serendipitously: Finding The Coding Zone: Your Perfect Trifecta?
This weekend I am working on the next version of YAY, a parser specification language. This next version will be able to generate general parse graphs, as opposed to parse trees. This is good for the declarative aspect of some languages.
General parse graphs are generated from parse trees using some namespace as a reference to connect nodes of that tree. Essentially, any node can be given a name, and that name can be used by other nodes to refer to it.
The namespace is not flat, but rather can be transformed by the nodes to reflect the varying contexts represented by the parse tree. As you can imagine “this” in one part of the tree refers to a very different object then “this” in another part of the tree. Namespace transformations are used to portray changes in scope
I must also mention that the namespaces are limited to the context of the source code. This means namespaces can not be used to refer to objects that exist only in the runtime. I hope that this will not be too limiting: Classes, methods, and properties are all realized in the source code, so can be “named”. Futhermore, with a little trickery, prototypical instances can also be named; by assuming they occupy some part of the original source code: eg “this”.
Each node has access to namespace of local nodes to help derive it’s own namespace. The geeky conclusion is that the namespace dependencies must go though a dependency analysis so all nodes are calculated in the correct order. Yay! Dependency analysis!