junkyard.liorean.net mode : text/plain encoding: utf-8 format : flowed width : 80 -------------------------------------------------------------------------------- the Junkyard -- -- -- -- ---- -- -------- Something going on : ParrotESE @ 2004-12-01 03:20 UTC+1 Today I saw the start of my ParrotESE project for real. I've got a good idea for how the AST should look, and started getting on the road of writing the actual lexer/parser/treebuilder. Yes, that's one script. It was easier that way, considering how both ECMA-262 (ECMAScript) and ECMA-357 (ECMAScript for XML) make the lexer dependant on the parser. I don't know about the modularity of it, though. I'm currently relying somewhat on closures, and that means it's hard to extend the functionality without getting your hands dirty. Anyway, here's the runup of it: The whole structure of the compiler is written so as to take advantage of Parrot's closures. This means that the current Mozilla SpiderMonkey targetting version will be large and clunky, since it essentially has to replace the closures functionality with something similar to it during this development phase. Also, as I'm entirely new to this, I'm probably making every mistake in the book. The structure as it looks today will be a task powered one. That is, a main loop will execute the current task, and replace the current task with it's return value until current task is null. That's the simple bit. Tasks will delegate to actions or continuations. Continuations aren't really continuations, but they act as to emulate them. Or at least, that's the plan. They will either return a task or perform an action. Actions are what they sound like - they will be building nodes, scanning tokens, throwing SyntaxError exceptions etc. Hopefully this system will be easily turned into a working continuation based system later on. -------------------------------------------------------------------------------- // 2004, David "liorean" Andersson CMS: Manual