//ICMap, Copyright 2006, clifford L. Collins, Collins Software, all rights reserved, http://collinssoftware.com, not for distribution or resale, use License is required: icparse function isTrue(value) { var test; test=value.toLowerCase(); if(test=='true')return true; if(test=='t')return true; if(test=='yes')return true; if(test=='y')return true; return false; } function ic$parser(fd) { this.fd=fd; this.topTable=null; this.curTable=null; this.line=0; this.image=''; this.c=new ic$copy(); this.copy=new Array(0); this.copy[0]=-1; this.sectionName=''; this.csvRecord=''; this.csv=new ic$csv(); this.cg2_=$332; this.style_=$333; this.define_=$383; this.section_=$385; this.read=$386; this.readLine=$386Line; this.splitSub=$387; this.parseField=$384; this.findTable=$325; this.nextSection=$328; this.readGraphic=$329; this.nextValue=$326; this.makeCsv=$330; this.defineCsv=$327; this.loadGraphic=$331; while(this.read()) { switch(this.type) { case'*cg2': this.cg2_(); break; case'*style': this.style_(); break; case'*define': this.define_(); break; case'*section': this.section_(); return; break; case'*end-of-file': return; break; } } } function $325(name) { var tbl; tbl=this.topTable; while(tbl) { if(tbl.name==name)return tbl tbl=tbl.next; } return null; } function $326() { if(this.pos >=this.tokens.length)return''; this.pos=this.pos+1; return this.tokens[this.pos-1]; } function $327(otable) { var nc; var ofld; var itable; this.copy=new Array(0); nc=0; this.copy[0]=-1; if(!otable)return; ofld=otable.topField; itable=this.findTable(this.sectionName); if(! itable)return; while(ofld) { nc=nc+1; this.copy[nc-1]=itable.indexOf(ofld.name); ofld=ofld.next; } } function $328() { this.sectionName=''; while(true) { switch(this.type) { case'*section': this.sectionName=trim(this.tokens[1].toLowerCase()); return true; case'*define': this.define_(); break; } if(! this.read())return false; } } function $329() { while(this.read()) { switch(this.type) { case'*section': this.sectionName=this.tokens[1].toLowerCase(); return null; case'*define': this.define_(); break; default: if(this.loadGraphic(this.type))return this.gra; } } return null; } function $330(tbl) { this.csv.clear(); for(i=0; i =0)&&(j 0)p.c.xmin=parseFloat(sub[0]); if(n >1)p.c.ymin=parseFloat(sub[1]); if(n >2)p.c.xmax=parseFloat(sub[2]); if(n >3)p.c.ymax=parseFloat(sub[3]); } function $340(p) { var text; var sub; var n; text=p.nextValue(); sub=p.splitSub(text); n=sub.length; if(n >0)p.c.fixed=isTrue(sub[0]); if(n >1)p.c.height=parseInt(sub[1]); if(n >2)p.c.width=parseInt(sub[2]); } function $338_list(p) { var text; p.c.np=p.nextValue(); for(i=0; i