docs: function execute(stmts,context){
  	var stmt;
  	var exprs;
  	var ignoreNest=0;
  	var isActive=true;
  	var blkStack=[];
  	var blkState=0; // 0:executing, 1:if-executing, 2:, if-finding, 3: if-ending, (4:ignore)
  	var mode=context.mode;
  
  	if(mode=='cond'){
  		executeExpr=executeExpr_withLog_;
  	}else{
  		executeExpr=executeExpr_;
  	}
  
  	for(var i=0;i<stmts.length;i++){
  		stmt=stmts[i];
  		if(mode=='stmt'){
  			console.log(JSON.stringify(stmt));
  		}
  		exprs=(stmt.exprs)?stmt.exprs:null;
  		switch(stmt.type){
  		case 'text':
  			if(isActive){
  				var key;
  				if(stmt.value!='//'){
  					context.buf+=stmt.value.replace(textRegex,function(match){
  						key=match.substring(8,match.length-1);
  						return context.params[key] || key;
  					});
  					context.buf+="\n";
  				}
  			}
  			break;
  		case 'define':
  			if(isActive){
  				context.params[exprs[0]]=executeExpr(exprs[1],context);
  			}
  			break;
  		case 'include':{
  			var oldcurdir=context.curdir;
  			var filepath=mpath.join(context.curdir,exprs[0]);
  			context.curdir=mpath.dirname(filepath);
  			var doc=readFileSync_(filepath);
  			if(doc!=null){
  				compile(doc, context);
  				if(!context.includes){
  					context.includes={};
  				}
  				context.includes[exprs[0]]=true;
  			}else{
  				console.log("error: invalid include file "+exprs[0]);
  			}
  			context.curdir=oldcurdir;
  			break;}
  		case 'include_once':{
  			if(context.includes&&(context.includes[exprs[0]])){
  				// ignore
  			}else{
  				var oldcurdir=context.curdir;
  				var filepath=mpath.join(context.curdir,exprs[0]);
  				context.curdir=mpath.dirname(filepath);
  
  				var doc=readFileSync_(filepath);
  				if(doc!=null){
  					compile(doc, context);
  					if(!context.includes){
  						context.includes={};
  					}
  					context.includes[exprs[0]]=true;
  				}else{
  					console.log("error: invalid include file "+exprs[0]);
  				}
  
  				context.curdir=oldcurdir;
  			}
  			break;}
  		case 'include_code':{
  			var oldcurdir=context.curdir;
  			var filepath=mpath.join(context.curdir,exprs[0]);
  			context.curdir=mpath.dirname(filepath);
  			var doc=readFileCodeSync_(filepath);
  			if(doc!=null){
  				compile(doc, context);
  				if(!context.includes){
  					context.includes={};
  				}
  				context.includes[exprs[0]]=true;
  			}else{
  				console.log("error: invalid include file "+exprs[0]);
  			}
  			context.curdir=oldcurdir;
  			break;}
  		case 'include_code_once':{
  			if(context.includes&&(context.includes[exprs[0]])){
  				// ignore
  			}else{
  				var oldcurdir=context.curdir;
  				var filepath=mpath.join(context.curdir,exprs[0]);
  				context.curdir=mpath.dirname(filepath);
  				var doc=readFileCodeSync_(filepath);
  				if(doc!=null){
  					compile(doc, context);
  					if(!context.includes){
  						context.includes={};
  					}
  					context.includes[exprs[0]]=true;
  				}else{
  					console.log("error: invalid include file "+exprs[0]);
  				}
  				context.curdir=oldcurdir;
  			}
  			break;}
  		case 'if':
  			if(isActive){
  				//assert(blkState==0)
  				if(mode=='cond'){
  					console.log("stmt:"+executeExpr(exprs,context)+'<='+JSON.stringify(stmt));
  				}
  				if(executeExpr(exprs,context)){
  					blkState=1; //if-executing
  				}else{
  					blkState=2; //if-finding
  				}
  				if(blkState==1){ //if-executing
  					blkStack.push(blkState);
  					blkState=0;
  				}else{
  					isActive=false;
  					ignoreNest++;
  				}
  			}else{
  				ignoreNest++;
  			}
  			break;
  		case 'elseif':
  		case 'elif':
  		case 'else':
  			if(isActive){
  				blkState=blkStack.pop();
  			}else{
  				ignoreNest--;
  				if(ignoreNest==0){
  					isActive=true;
  				}
  			}
  			if(isActive){
  				switch(blkState){
  				case 1: //if-executing
  					blkState=3;//if-ending
  					break;
  				case 2: //if-finding
  					if((mode=='cond')&&((stmt.type=='elseif')||(stmt.type=='elif'))){
  						console.log('stmt:'+executeExpr(exprs,context)+'<='+JSON.stringify(stmt));
  					}
  					if((stmt.type=='else')||(executeExpr(exprs,context))){
  						blkState=1; //if-executing
  					}else{
  						//nothing to do
  					}
  					break;
  				case 3://if-ending
  					// nothing to do
  					break;
  				}
  				if(blkState==1){ //if-executing
  					blkStack.push(blkState);
  					blkState=0;
  				}else{
  					//blkState=4; //ignore
  					isActive=false;
  					ignoreNest++;
  				}
  			}else{
  				ignoreNest++;
  			}
  			break;
  		case 'endif':
  			if(isActive){
  				blkState=blkStack.pop();
  			}else{
  				ignoreNest--;
  				if(ignoreNest==0){
  					isActive=true;
  				}
  			}
  			if(isActive){
  				blkState=0;
  			}
  			break;
  		default:
  			break;
  		}
  	}
  }