#ifndef __NASAL_BUILTINFUNC_H__ #define __NASAL_BUILTINFUNC_H__ int append(std::list >& local_scope) { int vector_addr=-1,elements_addr=-1; for(std::list >::iterator i=local_scope.begin();i!=local_scope.end();++i) { if(i->find("vector")!=i->end()) vector_addr=(*i)["vector"]; if(i->find("elements")!=i->end()) elements_addr=(*i)["elements"]; } if(vector_addr<0 || elements_addr<0) return -1; if(nasal_gc.get_scalar(vector_addr).get_type()!=scalar_vector) { std::cout<<">> [Runtime] append gets a value that is not a vector."< >& local_scope) { int vector_addr=-1,size_addr=-1; for(std::list >::iterator i=local_scope.begin();i!=local_scope.end();++i) { if(i->find("vector")!=i->end()) vector_addr=(*i)["vector"]; if(i->find("__size")!=i->end()) size_addr=(*i)["__size"]; } if(vector_addr<0 || size_addr<0) return -1; int vector_size=-1; int aim_size=-1; if(nasal_gc.get_scalar(vector_addr).get_type()!=scalar_vector) { std::cout<<">> [Runtime] setsize gets a variable that is not a vector."<> [Runtime] __size is not a numerable string."<> [Runtime] __size must be a number or numerable string."<> [Runtime] __size must be greater than 0."<aim_size) for(int i=aim_size;i >& local_scope) { int vector_addr=-1,start=-1,length=-1,type=-1; int begin_iter=0,len_iter=0; for(std::list >::iterator i=local_scope.begin();i!=local_scope.end();++i) { if(i->find("vector")!=i->end()) vector_addr=(*i)["vector"]; if(i->find("start")!=i->end()) start=(*i)["start"]; if(i->find("length")!=i->end()) length=(*i)["length"]; } if(vector_addr<0 || start<0 || length<0) return -1; if(nasal_gc.get_scalar(vector_addr).get_type()!=scalar_vector) { std::cout<<">> subvec gets a value that is not a vector."<> [Runtime] \'start\' is not a number or numerable string."<> [Runtime] \'start\' is not a numerable string."<> [Runtime] \'length\' is not a nil type,number or numerable string."<> [Runtime] \'length\' is not a numerable string."<> [Runtime] subvec out of memory boundary."<> [Runtime] subvec out of memory boundary."< >& local_scope) { int vector_addr=-1; for(std::list >::iterator i=local_scope.begin();i!=local_scope.end();++i) if(i->find("dyn")!=i->end()) vector_addr=(*i)["dyn"]; if(vector_addr<0) return -1; for(int i=0;i >& local_scope) { int data=-1; for(std::list >::iterator i=local_scope.begin();i!=local_scope.end();++i) if(i->find("thing")!=i->end()) data=(*i)["thing"]; if(data<0) return -1; print_scalar_type(nasal_gc.get_scalar(data).get_type()); std::cout< >& local_scope,int func_type) { int data=-1; double num=0; int type=-1; for(std::list >::iterator i=local_scope.begin();i!=local_scope.end();++i) if(i->find("x")!=i->end()) data=(*i)["x"]; if(data<0) return -1; type=nasal_gc.get_scalar(data).get_type(); if(type!=scalar_number && type!=scalar_string) { std::cout<<">> [Runtime] x must be a number or numerable string."<> [Runtime] x is not a numerable string."< >& local_scope) { int data=-1; double num=0; int type=-1; for(std::list >::iterator i=local_scope.begin();i!=local_scope.end();++i) if(i->find("x")!=i->end()) data=(*i)["x"]; if(data<0) return -1; type=nasal_gc.get_scalar(data).get_type(); if(type!=scalar_number && type!=scalar_string) { std::cout<<">> [Runtime] x must be a number or numerable string."<> [Runtime] x is not a numerable string."<