class tag {
//ts is the current token stream
//this is a variant of partial evaluation
var $args;
function __construct( &$ts) {
while( not_class($arg = next($ts)) ) {
$this->args[] = $arg;
}
}
//evaluate the
function run( &$context) { ... }
}
//example usage
$ts = array("tag","php","design patterns");
$op = current($ts);
$prog = new $op();
$prog->run( new context() );