//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_=$373; this.style_=$374; this.define_=$435; this.section_=$437; this.read=$438; this.readLine=$438Line; this.splitSub=$439; this.parseField=$436; this.findTable=$366; this.nextSection=$369; this.readGraphic=$370; this.nextValue=$367; this.makeCsv=$371; this.defineCsv=$368; this.loadGraphic=$372; 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 $366(name) { var tbl; tbl=this.topTable; while(tbl) { if(tbl.name==name)return tbl tbl=tbl.next; } return null; } function $367() { if(this.pos >=this.tokens.length)return''; this.pos=this.pos+1; return this.tokens[this.pos-1]; } function $368(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 $369() { 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 $370() { while(this.read()) { this.gra=null; 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 $371(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 $384(p) { var text; var sub; var n; text=p.nextValue(); sub=p.splitSub(text); n=sub.length; p.c.fixed=false; p.c.height=0; p.c.width=0; 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 $382_list(p) { var text; p.c.np=p.nextValue(); for(i=0; i