I have a small programming project, called YAY, which I work on occasionally. The objective of YAY is to be a type-safe and easy to use parser-generator-and-compiler. The parser-generator is the easy part. The compiler portion is more difficult. Specifically, I am adding namespace processing so that the parsers specified are able to generate general graphs, and not just trees. In theory, YAY should be able to parse simple “languages” like XML and HTML, including URLs and XML namespaces, with no post-processing.
Programming languages, like Java, should require macro definitions to become full compilers. Unfortunately, macro definitions have not been added to YAY yet.
Today I have discovered π (PI), which is very much like YAY. This is good news because I do not particularly enjoy building YAY, I only like using it. If π (PI) can replace YAY, then I can have someone else do the hard work, while I play at a higher abstraction level. π (PI) looks interesting because it seems to have avoided YAYs intermediate parse tree representation, and seems to go directly to macro (re)writing.
But, I am suspicious whether it works.
Now, I could be wrong, but YAY is complicated for a reason: It must allow identical language constructs inside different contexts to mean different things. For example
A: for (Object o : MyList){
for (Object p : MyOtherList){
if (something) continue A;
}//for
}//for
In this case the continue A; refers to scope that is ‘far’ from itself, and the same sequence of bytes can also refer to a different exit point of another loop later in the program. I am also thinking that exception handing scope can be more complicated.
It is not obvious how π (PI) achieves this non-local syntax specification.
In any case, language specification is one of my favorite subjects. I am compelled to review the π (PI) implementation despite it being in a pre-alpha state.