Code archives/Algorithms/The Ambiguity Engine.

This code has been declared by its author to be Public Domain code.

Download source code

The Ambiguity Engine. by AntonyWells2004
This engine parses text, and builds up scope and object maps.

You can very easily define your own scope entry points with nScop("Type") for example.
It'll work on any type of source code. It's just the front end, but you can use it to convert code from one language to another, optimization..anything that relies on knowing the structrual relationship of parsed text.

Some functions are not present, because they are not so free.
Big plans for this(mark 2 obviously) once bmax is out for us window users(Aka the damned.)
-

Here's some example output, after running the actual bb source code through it. (It produces two text files)
--
--Scope Name:
--Obj Maps:35
--[ nswi("print","printf") 
--[ --[ const max_lines =5000 
--[ ;-[] 
--[ const scope_main=1,scope_function =2,scope_class=3 
--[ main.scope=new scope 
--[ ;-define seperators 
--[ nsep("*"):nsep("(") 
--[ nsep(")"):nsep("/") 
--[ nsep(","):nsep("'") 
--[ nsep(":"):nsep("*") 
--[ nsep("-"):nsep("(") 
--[ nsep(")"):nsep("+") 
--[ nsep("<"):nsep("[") 
--[ nsep("]"):nsep(chr(34)) 
--[ nsep(">"):nsep("\") 
--[ nsep(" "):nsep("->") 
--[ nsep("="):nres("function") 
--[ nres("if") 
--[ fscop.scop=nscop( "function") 
--[ cscop.scop=nscop( "class") 
--[ tscop.scop=nscop("type") 
--[ ;test.code=loadcode("helloworld.vnx") 
--[ test.code=loadcode("vcom.bb") 
--[ code_tocpp(test) 
--[ code_toconsoleapp(test,"simpletest.txt") 
--[ debug_code(test,"debugprisim.txt") 
--[ ;objmap("function(test,nope  )") 
--[ ;lm.map=genmap("if a->2 then b=(5*6)+2",map) 
--[ waitkey 
--[ end 
--[ ;--c++ back end. 
--[ global l_file,l_life 
--[ ;-[ simple example prisim operation. a simple text compression algo] 
--[ const move_up=1,move_down=2 
/\/\
----Scope Name:sep
----Obj Maps:3
----[ type sep 
----[ field dat$ 
----[ end type 
/\/\/\/\
----Scope Name:scope
----Obj Maps:6
----[ type scope 
----[ field scopetype ;in most cases we can blindly assume 
----[ field m.map[ max_lines],mc 
----[ field sub.scope[2555],sc 
----[ field name$ 
----[ end type 
/\/\/\/\
----Scope Name:chunk
----Obj Maps:6
----[ type chunk 
----[ field real$,issep 
----[ field map$,entry 
----[ field c_name$,amb ;ambiguity flag. nice.. 
----[ field ext$ ;extra dat field, for code operations. 
----[ end type 
/\/\/\/\
----Scope Name:map
----Obj Maps:4
----[ type map 
----[ field c.chunk[2555],cc 
----[ field dat$ 
----[ end type 
/\/\/\/\
----Scope Name:code
----Obj Maps:4
----[ type code 
----[ field m.map[ max_lines],mc 
----[ field file$ 
----[ end type 
/\/\/\/\
----Scope Name:nsep
----Obj Maps:4
----[ function nsep(c$) 
----[ s.sep=new sep 
----[ s\dat=c 
----[ end function 
/\/\/\/\
----Scope Name:genmap
----Obj Maps:2
----[ function genmap(real$,map$) 
----[ end function 
/\/\/\/\
----Scope Name:loadcode.code
----Obj Maps:16
----[ function loadcode.code( file$) 
----[ fo=readfile(file) 
----[ if not fo return 
----[ out.code=new code 
----[ while not eof(fo) 
----[ dat$=readline( fo) 
----[ if len(dat)>2 
----[ m.map=objmap(dat) 
----[ out\m[out\mc]=m 
----[ out\mc=out\mc+1 
----[ endif 
----[ wend 
----[ print "loaded >"+out\mc+" lines of raw code" 
----[ closefile fo 
----[ return out 
----[ end function 
/\/\/\/\
----Scope Name:code_toconsoleapp
----Obj Maps:9
----[ function code_toconsoleapp(in.code,file$) 
----[ fo=writefile(file) 
----[ l_life=fo 
----[ if not fo return 
----[ write_consoleheaderc() 
----[ write_codec(in) 
----[ write_consolefooterc() 
----[ closefile fo 
----[ end function 
/\/\/\/\
----Scope Name:write_codec
----Obj Maps:9
----[ function write_codec(in.code) 
----[ for j=0 to in\mc-1 
----[ out$="" 
----[ for k=0 to in\m[j]\cc-1 
----[ out=out+in\m[j]\c[k]\c_name 
----[ next 
----[ writeline l_life,out 
----[ next 
----[ end function 
/\/\/\/\
----Scope Name:write_consoleheaderc
----Obj Maps:4
----[ function write_consoleheaderc() 
----[ writeline l_life,"#include <stdio.h>" 
----[ writeline l_life,"int main(){" 
----[ end function 
/\/\/\/\
----Scope Name:write_consolefooterc
----Obj Maps:4
----[ function write_consolefooterc() 
----[ writeline l_life,"    return 0; /* program termination. */" 
----[ writeline l_life,"}" 
----[ end function 
/\/\/\/\
----Scope Name:code_towindowapp
----Obj Maps:2
----[ function code_towindowapp(in.code) 
----[ end function 
/\/\/\/\
----Scope Name:code_tocpp
----Obj Maps:53
----[ function code_tocpp( in.code) 
----[ for j=0 to in\mc-1 
----[ m.map=in\m[j] 
----[ amb=false 
----[ amb_m$="" 
----[ if m=null runtimeerror "Bleep"
----[ for k=0 to m\cc-1 
----[ c.chunk=m\c[k] 
----[ map$=c\map 
----[ if c\issep 
----[ ;-raw data enclapsulators 
----[ if amb 
----[ select map 
----[ case chr(34) 
----[ if map=amb_m 
----[ amb=false 
----[ amb_m="" 
----[ endif 
----[ end select 
----[ else 
----[ select map 
----[ case chr(34) 
----[ amb=true 
----[ amb_m$=map 
----[ over_amb=true 
----[ end select 
----[ endif 
----[ c\c_name=map 
----[ else 
----[ c\c_name=map 
----[ if isres( map) 
----[  
----[ else 
----[ c\c_name=switch(map) 
----[ endif 
----[  
----[ endif 
----[ if amb 
----[ if over_amb 
----[ over_amb=0 
----[ else 
----[ c\c_name=map 
----[ c\amb=true 
----[ endif 
----[ endif 
----[ next 
----[ next 
----[ ;-- scope set up. 
----[ main.scope=new scope 
----[ main\scopetype=scope_main 
----[ feedscope(main,in) 
----[ debug_scope(main,"scope_debug.txt") 
----[ end function 
/\/\/\/\
----Scope Name:feedscope
----Obj Maps:51
----[ function feedscope(base.scope,c.code,from=0,endat$="") 
----[ print "scope from >"+from 
----[ for j=from to c\mc-1 
----[ .redo 
----[ if j=>c\mc exit 
----[ m.map=c\m[j] 
----[ print "obj line" 
----[ for k=0 to m\cc-1 
----[ a.chunk=m\c[k] 
----[ n.chunk=nobj(m,k) 
----[ p.chunk=nobj(m,k) 
----[ if isscop(a\map) and j<>from and a\amb=false;can't scope into thyself. 
----[ ns.scope=new scope 
----[ base\sub[base\sc]=ns 
----[ base\sc=base\sc+1 
----[ if  n<>null 
----[ print "scope called >"+n\map 
----[ ns\name=n\map 
----[ else 
----[ print "warning -? nameless scope" 
----[ ns\name="none specified" 
----[ endif 
----[ j=feedscope( ns,c,j,a\map) 
----[ goto redo 
----[ else 
----[ ;-determine if exit point. 
----[ select a\map 
----[ case "end" 
----[ if n<>null 
----[ select n\map 
----[ case endat 
----[ exitscope=true 
----[ exit ;no need to parse on. anything else is excess. 
----[ end select 
----[ endif 
----[ end select 
----[ ;--- 
----[ endif 
----[ next 
----[ base\m[base\mc]=m 
----[ base\mc=base\mc+1 
----[ if exitscope return j+1 
----[ next 
----[ if from>0 
----[ stop 
----[ print "compile error" 
----[ print endat+" without end "+endat 
----[ endif 
----[ print "scope out" 
----[ return j 
----[ end function 
/\/\/\/\
----Scope Name:debug_scope
----Obj Maps:26
----[ function debug_scope(base.scope,file$,debugsubs=true,usefile=0,pad$="--") 
----[ if not usefile 
----[ fo=writefile( file) 
----[ if not fo return 
----[ else 
----[ fo=usefile 
----[ endif 
----[ writeline fo,pad+"scope name:"+base\name 
----[ writeline fo,pad+"obj maps:"+base\mc 
----[ for j=0 to base\mc-1 
----[ out$="" 
----[ for k=0 to base\m[j]\cc-1 
----[ out=out+base\m[j]\c[k]\map 
----[ next 
----[ writeline fo,pad+"["+out 
----[ next 
----[ writeline fo,string("/\",len(pad)) 
----[ if debugsubs 
----[ for j=0 to base\sc-1 
----[ debug_scope( base\sub[j],file,true,fo,pad+"--") 
----[ next 
----[ endif 
----[ if not usefile 
----[ closefile fo 
----[ endif 
----[ end function 
/\/\/\/\
----Scope Name:nobj.chunk
----Obj Maps:7
----[ function nobj.chunk( m.map,from=0) 
----[ from=from+1 
----[ if from=>m\cc return 
----[ for j=from to m\cc-1 
----[ if not m\c[j]\issep return m\c[j] 
----[ next 
----[ end function 
/\/\/\/\
----Scope Name:poibj.chunk
----Obj Maps:7
----[ function poibj.chunk( m.map,from=0) 
----[ from=from-1 
----[ if from<0 return 
----[ for j=from to 0 step -1 
----[ if not m\c[j]\issep return m\c[j] 
----[ next 
----[ end function 
/\/\/\/\
----Scope Name:switch
----Obj Maps:3
----[ type switch 
----[ field from$,go$ 
----[ end type 
/\/\/\/\
----Scope Name:nswi
----Obj Maps:5
----[ function nswi(from$,go$) 
----[ s.switch=new switch 
----[ s\from=from 
----[ s\go=go 
----[ end function 
/\/\/\/\
----Scope Name:switch$
----Obj Maps:6
----[ function switch$(dat$) 
----[ for s.switch=each switch 
----[ if dat=s\from return s\go 
----[ next 
----[ return dat 
----[ end function 
/\/\/\/\
----Scope Name:debug_code
----Obj Maps:22
----[ function debug_code( in.code,file$) 
----[ fo=writefile(file) 
----[ if not fo return 
----[ for j=0 to in\mc-1 
----[ out$="" 
----[ for k=0 to in\m[j]\cc-1 
----[ out=out+"  "+string(in\m[j]\c[k]\amb,len(in\m[j]\c[k]\c_name))+"  " 
----[ next 
----[ writeline fo,out 
----[ out$="" 
----[ for k=0 to in\m[j]\cc-1 
----[ out=out+"_/"+in\m[j]\c[k]\c_name+"\_" 
----[ next 
----[ writeline fo,out 
----[ out="" 
----[ for k=0 to in\m[j]\cc-1 
----[ out=out+" \"+string("_",len(in\m[j]\c[k]\c_name))+"/ " 
----[ next 
----[ writeline fo,out 
----[ next 
----[ closefile fo 
----[ end function 
/\/\/\/\
----Scope Name:objmap.map
----Obj Maps:29
----[ function objmap.map(dat$) 
----[ dat=lower(clean(dat)) 
----[ l=len(dat) 
----[ out="" 
----[ fs=1 
----[ m.map=new map 
----[ m\dat=dat 
----[ for j=1 to l ;examine single char seps 
----[ c$=mid( dat,j,1) 
----[ if issep(c) 
----[ if j-lj>1 
----[ obj$=lower(mid( dat,lj+1,j-lj-1)) 
----[ nc.chunk =new chunk 
----[ nc\map=obj 
----[ m\c[m\cc]=nc 
----[ m\cc=m\cc+1 
----[ endif 
----[ lj=j 
----[  
----[ nc.chunk =new chunk 
----[ nc\map=c 
----[ nc\issep=true 
----[ m\c[m\cc]=nc 
----[ m\cc=m\cc+1 
----[ else 
----[ endif 
----[ next 
----[ return m 
----[ end function 
/\/\/\/\
----Scope Name:issep
----Obj Maps:5
----[ function issep(v$) 
----[ for s.sep=each sep 
----[ if v=s\dat return true 
----[ next 
----[ end function 
/\/\/\/\
----Scope Name:compresscode
----Obj Maps:31
----[ function compresscode(in.code,out$) 
----[ ;-compression phase 
----[ fo=writefile( out) 
----[ if not fo return 
----[ local cache$[25000],cc ;temp string buffer. 
----[ for j=0 to in\mc-1 
----[ m.map=in\m[j] 
----[ for k=0 to m\cc-1 
----[ dat$=m\c[k]\map 
----[ linkto=-1 
----[ for a=0 to cc-1 
----[ if cache[a]=dat 
----[ linkto=a 
----[ exit 
----[ endif 
----[ next 
----[ if linkto=-1 
----[ cache[cc]=dat 
----[ cc=cc+1 
----[ endif 
----[ if linkto>-1 
----[ writebyte fo,1 
----[ writeint fo,linkto 
----[ else 
----[ writebyte fo,0 
----[ writestring fo,dat 
----[ endif 
----[ next 
----[ next 
----[ closefile fo 
----[ end function 
/\/\/\/\
----Scope Name:clean$
----Obj Maps:4
----[ function clean$(dat$) 
----[ out$=dat 
----[ return " "+trim(out)+" " 
----[ end function 
/\/\/\/\
----Scope Name:res
----Obj Maps:3
----[ type res 
----[ field dat$ 
----[ end type 
/\/\/\/\
----Scope Name:scop
----Obj Maps:4
----[ type scop ;scope indentifier only. 
----[ field dat$ 
----[ field movemode 
----[ end type 
/\/\/\/\
----Scope Name:nscop.scop
----Obj Maps:5
----[ function nscop.scop(txt$) 
----[ s.scop=new scop 
----[ s\dat=txt 
----[ return s 
----[ end function 
/\/\/\/\
----Scope Name:scopmove
----Obj Maps:3
----[ function scopmove(n.scop,move) 
----[ n\movemode=move 
----[ end function 
/\/\/\/\
----Scope Name:isscop
----Obj Maps:6
----[ function isscop(txt$) 
----[ for s.scop=each scop 
----[ if s\dat=txt return true 
----[ next 
----[ return false 
----[ end function 
/\/\/\/\
----Scope Name:nres
----Obj Maps:4
----[ function nres(txt$) 
----[ n.res=new res 
----[ n\dat=lower(txt) 
----[ end function 
/\/\/\/\
----Scope Name:isres
----Obj Maps:5
----[ function isres(txt$) 
----[ for n.res= each res 
----[ if n\dat=txt return true 
----[ next 
----[ end function 
/\/\/\/\


It also produces a symbolic-ish map of the text file parsed.

 \_/  \__/  \_/  \_/  \_/  \_/  \___/  \_/  \______/  \_/  \_/  \_/  \_/ 
  0    0000    0    0    11111    0    0    0    111111    0    0    0  
_/ \__/nswi\__/(\__/"\__/print\__/"\__/,\__/"\__/printf\__/"\__/)\__/ \_
 \_/  \____/  \_/  \_/  \_____/  \_/  \_/  \_/  \______/  \_/  \_/  \_/ 
  0    0    0    0    000000    0    0  
_/ \__/;\__/-\__/[\__/consts\__/]\__/ \_
 \_/  \_/  \_/  \_/  \______/  \_/  \_/ 
  0    00000    0    000000000    0    0    0000    0  
_/ \__/const\__/ \__/max_lines\__/ \__/=\__/5000\__/ \_
 \_/  \_____/  \_/  \_________/  \_/  \_/  \____/  \_/ 
  0    0    0    0    0    0  
_/ \__/;\__/-\__/[\__/]\__/ \_
 \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0    000    0  
_/ \__/type\__/ \__/sep\__/ \_
 \_/  \____/  \_/  \___/  \_/ 
  0    00000    0    0000    0  
_/ \__/field\__/ \__/dat$\__/ \_
 \_/  \_____/  \_/  \____/  \_/ 
  0    000    0    0000    0  
_/ \__/end\__/ \__/type\__/ \_
 \_/  \___/  \_/  \____/  \_/ 
  0    0000    0    00000    0  
_/ \__/type\__/ \__/scope\__/ \_
 \_/  \____/  \_/  \_____/  \_/ 
  0    00000    0    000000000    0    000    0    0000    0    00000    0    00    0    000    0    0000000    0    000000    0  
_/ \__/field\__/ \__/scopetype\__/ \__/;in\__/ \__/most\__/ \__/cases\__/ \__/we\__/ \__/can\__/ \__/blindly\__/ \__/assume\__/ \_
 \_/  \_____/  \_/  \_________/  \_/  \___/  \_/  \____/  \_/  \_____/  \_/  \__/  \_/  \___/  \_/  \_______/  \_/  \______/  \_/ 
  0    00000    0    00000    0    0    000000000    0    0    00    0  
_/ \__/field\__/ \__/m.map\__/[\__/ \__/max_lines\__/]\__/,\__/mc\__/ \_
 \_/  \_____/  \_/  \_____/  \_/  \_/  \_________/  \_/  \_/  \__/  \_/ 
  0    00000    0    000000000    0    0000    0    0    00    0  
_/ \__/field\__/ \__/sub.scope\__/[\__/2555\__/]\__/,\__/sc\__/ \_
 \_/  \_____/  \_/  \_________/  \_/  \____/  \_/  \_/  \__/  \_/ 
  0    00000    0    00000    0  
_/ \__/field\__/ \__/name$\__/ \_
 \_/  \_____/  \_/  \_____/  \_/ 
  0    000    0    0000    0  
_/ \__/end\__/ \__/type\__/ \_
 \_/  \___/  \_/  \____/  \_/ 
  0    00000    0    0000000000    0    0    0    00000000000000    0    0    0    0    00000000000    0    0    0  
_/ \__/const\__/ \__/scope_main\__/=\__/1\__/,\__/scope_function\__/ \__/=\__/2\__/,\__/scope_class\__/=\__/3\__/ \_
 \_/  \_____/  \_/  \__________/  \_/  \_/  \_/  \______________/  \_/  \_/  \_/  \_/  \___________/  \_/  \_/  \_/ 
  0    0000    0    00000    0  
_/ \__/type\__/ \__/chunk\__/ \_
 \_/  \____/  \_/  \_____/  \_/ 
  0    00000    0    00000    0    00000    0  
_/ \__/field\__/ \__/real$\__/,\__/issep\__/ \_
 \_/  \_____/  \_/  \_____/  \_/  \_____/  \_/ 
  0    00000    0    0000    0    00000    0  
_/ \__/field\__/ \__/map$\__/,\__/entry\__/ \_
 \_/  \_____/  \_/  \____/  \_/  \_____/  \_/ 
  0    00000    0    0000000    0    000    0    0000000000    0    00000    0    000000    0  
_/ \__/field\__/ \__/c_name$\__/,\__/amb\__/ \__/;ambiguity\__/ \__/flag.\__/ \__/nice..\__/ \_
 \_/  \_____/  \_/  \_______/  \_/  \___/  \_/  \__________/  \_/  \_____/  \_/  \______/  \_/ 
  0    00000    0    0000    0    000000    0    000    0    00000    0    0    000    0    0000    0    00000000000    0  
_/ \__/field\__/ \__/ext$\__/ \__/;extra\__/ \__/dat\__/ \__/field\__/,\__/ \__/for\__/ \__/code\__/ \__/operations.\__/ \_
 \_/  \_____/  \_/  \____/  \_/  \______/  \_/  \___/  \_/  \_____/  \_/  \_/  \___/  \_/  \____/  \_/  \___________/  \_/ 
  0    000    0    0000    0  
_/ \__/end\__/ \__/type\__/ \_
 \_/  \___/  \_/  \____/  \_/ 
  0    0000    0    000    0  
_/ \__/type\__/ \__/map\__/ \_
 \_/  \____/  \_/  \___/  \_/ 
  0    00000    0    0000000    0    0000    0    0    00    0  
_/ \__/field\__/ \__/c.chunk\__/[\__/2555\__/]\__/,\__/cc\__/ \_
 \_/  \_____/  \_/  \_______/  \_/  \____/  \_/  \_/  \__/  \_/ 
  0    00000    0    0000    0  
_/ \__/field\__/ \__/dat$\__/ \_
 \_/  \_____/  \_/  \____/  \_/ 
  0    000    0    0000    0  
_/ \__/end\__/ \__/type\__/ \_
 \_/  \___/  \_/  \____/  \_/ 
  0    0000    0    0000    0  
_/ \__/type\__/ \__/code\__/ \_
 \_/  \____/  \_/  \____/  \_/ 
  0    00000    0    00000    0    0    000000000    0    0    00    0  
_/ \__/field\__/ \__/m.map\__/[\__/ \__/max_lines\__/]\__/,\__/mc\__/ \_
 \_/  \_____/  \_/  \_____/  \_/  \_/  \_________/  \_/  \_/  \__/  \_/ 
  0    00000    0    00000    0  
_/ \__/field\__/ \__/file$\__/ \_
 \_/  \_____/  \_/  \_____/  \_/ 
  0    000    0    0000    0  
_/ \__/end\__/ \__/type\__/ \_
 \_/  \___/  \_/  \____/  \_/ 
  0    0000000000    0    000    0    00000    0  
_/ \__/main.scope\__/=\__/new\__/ \__/scope\__/ \_
 \_/  \__________/  \_/  \___/  \_/  \_____/  \_/ 
  0    0    0    000000    0    0000000000    0  
_/ \__/;\__/-\__/define\__/ \__/seperators\__/ \_
 \_/  \_/  \_/  \______/  \_/  \__________/  \_/ 
  0    0000    0    0    1    0    0    0    0000    0    0    1    0    0    0  
_/ \__/nsep\__/(\__/"\__/*\__/"\__/)\__/:\__/nsep\__/(\__/"\__/(\__/"\__/)\__/ \_
 \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0    0    1    0    0    0    0000    0    0    1    0    0    0  
_/ \__/nsep\__/(\__/"\__/)\__/"\__/)\__/:\__/nsep\__/(\__/"\__//\__/"\__/)\__/ \_
 \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0    0    1    0    0    0    0000    0    0    1    0    0    0  
_/ \__/nsep\__/(\__/"\__/,\__/"\__/)\__/:\__/nsep\__/(\__/"\__/'\__/"\__/)\__/ \_
 \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0    0    1    0    0    0    0000    0    0    1    0    0    0  
_/ \__/nsep\__/(\__/"\__/:\__/"\__/)\__/:\__/nsep\__/(\__/"\__/*\__/"\__/)\__/ \_
 \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0    0    1    0    0    0    0000    0    0    1    0    0    0  
_/ \__/nsep\__/(\__/"\__/-\__/"\__/)\__/:\__/nsep\__/(\__/"\__/(\__/"\__/)\__/ \_
 \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0    0    1    0    0    0    0000    0    0    1    0    0    0  
_/ \__/nsep\__/(\__/"\__/)\__/"\__/)\__/:\__/nsep\__/(\__/"\__/+\__/"\__/)\__/ \_
 \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0    0    1    0    0    0    0000    0    0    1    0    0    0  
_/ \__/nsep\__/(\__/"\__/<\__/"\__/)\__/:\__/nsep\__/(\__/"\__/[\__/"\__/)\__/ \_
 \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0    0    1    0    0    0    0000    0    000    0    00    0    0    0  
_/ \__/nsep\__/(\__/"\__/]\__/"\__/)\__/:\__/nsep\__/(\__/chr\__/(\__/34\__/)\__/)\__/ \_
 \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/  \____/  \_/  \___/  \_/  \__/  \_/  \_/  \_/ 
  0    0000    0    0    1    0    0    0    0000    0    0    1    0    0    0  
_/ \__/nsep\__/(\__/"\__/>\__/"\__/)\__/:\__/nsep\__/(\__/"\__/\\__/"\__/)\__/ \_
 \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0    0    1    0    0    0    0000    0    0    1    1    0    0    0  
_/ \__/nsep\__/(\__/"\__/ \__/"\__/)\__/:\__/nsep\__/(\__/"\__/-\__/>\__/"\__/)\__/ \_
 \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0    0    1    0    0    0    0000    0    0    11111111    0    0    0  
_/ \__/nsep\__/(\__/"\__/=\__/"\__/)\__/:\__/nres\__/(\__/"\__/function\__/"\__/)\__/ \_
 \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/  \____/  \_/  \_/  \________/  \_/  \_/  \_/ 
  0    0000    0    0    11    0    0    0  
_/ \__/nres\__/(\__/"\__/if\__/"\__/)\__/ \_
 \_/  \____/  \_/  \_/  \__/  \_/  \_/  \_/ 
  0    0000000000    0    00000    0    0    0    11111111    0    0    0  
_/ \__/fscop.scop\__/=\__/nscop\__/(\__/ \__/"\__/function\__/"\__/)\__/ \_
 \_/  \__________/  \_/  \_____/  \_/  \_/  \_/  \________/  \_/  \_/  \_/ 
  0    0000000000    0    00000    0    0    0    11111    0    0    0  
_/ \__/cscop.scop\__/=\__/nscop\__/(\__/ \__/"\__/class\__/"\__/)\__/ \_
 \_/  \__________/  \_/  \_____/  \_/  \_/  \_/  \_____/  \_/  \_/  \_/ 
  0    0000000000    0    00000    0    0    1111    0    0    0  
_/ \__/tscop.scop\__/=\__/nscop\__/(\__/"\__/type\__/"\__/)\__/ \_
 \_/  \__________/  \_/  \_____/  \_/  \_/  \____/  \_/  \_/  \_/ 
  0    0000000000    0    00000000    0    0    11111111111111    0    0    0  
_/ \__/;test.code\__/=\__/loadcode\__/(\__/"\__/helloworld.vnx\__/"\__/)\__/ \_
 \_/  \__________/  \_/  \________/  \_/  \_/  \______________/  \_/  \_/  \_/ 
  0    000000000    0    00000000    0    0    1111111    0    0    0  
_/ \__/test.code\__/=\__/loadcode\__/(\__/"\__/vcom.bb\__/"\__/)\__/ \_
 \_/  \_________/  \_/  \________/  \_/  \_/  \_______/  \_/  \_/  \_/ 
  0    0000000000    0    0000    0    0  
_/ \__/code_tocpp\__/(\__/test\__/)\__/ \_
 \_/  \__________/  \_/  \____/  \_/  \_/ 
  0    00000000000000000    0    0000    0    0    11111111111111    0    0    0  
_/ \__/code_toconsoleapp\__/(\__/test\__/,\__/"\__/simpletest.txt\__/"\__/)\__/ \_
 \_/  \_________________/  \_/  \____/  \_/  \_/  \______________/  \_/  \_/  \_/ 
  0    0000000000    0    0000    0    0    111111111111111    0    0    0  
_/ \__/debug_code\__/(\__/test\__/,\__/"\__/debugprisim.txt\__/"\__/)\__/ \_
 \_/  \__________/  \_/  \____/  \_/  \_/  \_______________/  \_/  \_/  \_/ 
  0    0000000    0    0    11111111    1    1111    1    1111    1    1    1    0    0    0  
_/ \__/;objmap\__/(\__/"\__/function\__/(\__/test\__/,\__/nope\__/ \__/ \__/)\__/"\__/)\__/ \_
 \_/  \_______/  \_/  \_/  \________/  \_/  \____/  \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000000    0    000000    0    0    11    1    1    1    1    1    1    1111    1    1    1    1    1    1    1    1    1    1    0    0    000    0    0  
_/ \__/;lm.map\__/=\__/genmap\__/(\__/"\__/if\__/ \__/a\__/-\__/>\__/2\__/ \__/then\__/ \__/b\__/=\__/(\__/5\__/*\__/6\__/)\__/+\__/2\__/"\__/,\__/map\__/)\__/ \_
 \_/  \_______/  \_/  \______/  \_/  \_/  \__/  \_/  \_/  \_/  \_/  \_/  \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \___/  \_/  \_/ 
  0    0000000    0  
_/ \__/waitkey\__/ \_
 \_/  \_______/  \_/ 
  0    000    0  
_/ \__/end\__/ \_
 \_/  \___/  \_/ 
  0    00000000    0    0000    0    00    0    0  
_/ \__/function\__/ \__/nsep\__/(\__/c$\__/)\__/ \_
 \_/  \________/  \_/  \____/  \_/  \__/  \_/  \_/ 
  0    00000    0    000    0    000    0  
_/ \__/s.sep\__/=\__/new\__/ \__/sep\__/ \_
 \_/  \_____/  \_/  \___/  \_/  \___/  \_/ 
  0    0    0    000    0    0    0  
_/ \__/s\__/\\__/dat\__/=\__/c\__/ \_
 \_/  \_/  \_/  \___/  \_/  \_/  \_/ 
  0    000    0    00000000    0  
_/ \__/end\__/ \__/function\__/ \_
 \_/  \___/  \_/  \________/  \_/ 
  0    00000000    0    000000    0    00000    0    0000    0    0  
_/ \__/function\__/ \__/genmap\__/(\__/real$\__/,\__/map$\__/)\__/ \_
 \_/  \________/  \_/  \______/  \_/  \_____/  \_/  \____/  \_/  \_/ 
  0    000    0    00000000    0  
_/ \__/end\__/ \__/function\__/ \_
 \_/  \___/  \_/  \________/  \_/ 
  0    00000000    0    0000000000000    0    0    00000    0    0  
_/ \__/function\__/ \__/loadcode.code\__/(\__/ \__/file$\__/)\__/ \_
 \_/  \________/  \_/  \_____________/  \_/  \_/  \_____/  \_/  \_/ 
  0    00    0    00000000    0    0000    0    0  
_/ \__/fo\__/=\__/readfile\__/(\__/file\__/)\__/ \_
 \_/  \__/  \_/  \________/  \_/  \____/  \_/  \_/ 
  0    00    0    000    0    00    0    000000    0  
_/ \__/if\__/ \__/not\__/ \__/fo\__/ \__/return\__/ \_
 \_/  \__/  \_/  \___/  \_/  \__/  \_/  \______/  \_/ 
  0    00000000    0    000    0    0000    0  
_/ \__/out.code\__/=\__/new\__/ \__/code\__/ \_
 \_/  \________/  \_/  \___/  \_/  \____/  \_/ 
  0    00000    0    000    0    000    0    00    0    0  
_/ \__/while\__/ \__/not\__/ \__/eof\__/(\__/fo\__/)\__/ \_
 \_/  \_____/  \_/  \___/  \_/  \___/  \_/  \__/  \_/  \_/ 
  0    0000    0    00000000    0    0    00    0    0  
_/ \__/dat$\__/=\__/readline\__/(\__/ \__/fo\__/)\__/ \_
 \_/  \____/  \_/  \________/  \_/  \_/  \__/  \_/  \_/ 
  0    00    0    000    0    000    0    0    0    0  
_/ \__/if\__/ \__/len\__/(\__/dat\__/)\__/>\__/2\__/ \_
 \_/  \__/  \_/  \___/  \_/  \___/  \_/  \_/  \_/  \_/ 
  0    00000    0    000000    0    000    0    0  
_/ \__/m.map\__/=\__/objmap\__/(\__/dat\__/)\__/ \_
 \_/  \_____/  \_/  \______/  \_/  \___/  \_/  \_/ 
  0    000    0    0    0    000    0    00    0    0    0    0  
_/ \__/out\__/\\__/m\__/[\__/out\__/\\__/mc\__/]\__/=\__/m\__/ \_
 \_/  \___/  \_/  \_/  \_/  \___/  \_/  \__/  \_/  \_/  \_/  \_/ 
  0    000    0    00    0    000    0    00    0    0    0  
_/ \__/out\__/\\__/mc\__/=\__/out\__/\\__/mc\__/+\__/1\__/ \_
 \_/  \___/  \_/  \__/  \_/  \___/  \_/  \__/  \_/  \_/  \_/ 
  0    00000    0  
_/ \__/endif\__/ \_
 \_/  \_____/  \_/ 
  0    0000    0  
_/ \__/wend\__/ \_
 \_/  \____/  \_/ 
  0    000000    0    0    111111    1    1    0    0    000    0    00    0    0    1    11111    1    11    1    111    1    1111    0    0  
_/ \__/printf\__/ \__/"\__/loaded\__/ \__/>\__/"\__/+\__/out\__/\\__/mc\__/+\__/"\__/ \__/lines\__/ \__/of\__/ \__/raw\__/ \__/code\__/"\__/ \_
 \_/  \______/  \_/  \_/  \______/  \_/  \_/  \_/  \_/  \___/  \_/  \__/  \_/  \_/  \_/  \_____/  \_/  \__/  \_/  \___/  \_/  \____/  \_/  \_/ 
  0    000000000    0    00    0  
_/ \__/closefile\__/ \__/fo\__/ \_
 \_/  \_________/  \_/  \__/  \_/ 
  0    000000    0    000    0  
_/ \__/return\__/ \__/out\__/ \_
 \_/  \______/  \_/  \___/  \_/ 
  0    000    0    00000000    0  
_/ \__/end\__/ \__/function\__/ \_
 \_/  \___/  \_/  \________/  \_/ 
  0    0    0    0    0    0    0    0    0000    0    0000    0  
_/ \__/;\__/-\__/-\__/c\__/+\__/+\__/ \__/back\__/ \__/end.\__/ \_
 \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \____/  \_/  \____/  \_/ 
  0    000000    0    000000    0    000000    0  
_/ \__/global\__/ \__/l_file\__/,\__/l_life\__/ \_
 \_/  \______/  \_/  \______/  \_/  \______/  \_/ 
  0    00000000    0    00000000000000000    0    0000000    0    00000    0    0  
_/ \__/function\__/ \__/code_toconsoleapp\__/(\__/in.code\__/,\__/file$\__/)\__/ \_
 \_/  \________/  \_/  \_________________/  \_/  \_______/  \_/  \_____/  \_/  \_/ 
  0    00    0    000000000    0    0000    0    0  
_/ \__/fo\__/=\__/writefile\__/(\__/file\__/)\__/ \_
 \_/  \__/  \_/  \_________/  \_/  \____/  \_/  \_/ 
  0    000000    0    00    0  
_/ \__/l_life\__/=\__/fo\__/ \_
 \_/  \______/  \_/  \__/  \_/ 
  0    00    0    000    0    00    0    000000    0  
_/ \__/if\__/ \__/not\__/ \__/fo\__/ \__/return\__/ \_
 \_/  \__/  \_/  \___/  \_/  \__/  \_/  \______/  \_/ 
  0    00000000000000000000    0    0    0  
_/ \__/write_consoleheaderc\__/(\__/)\__/ \_
 \_/  \____________________/  \_/  \_/  \_/ 
  0    00000000000    0    00    0    0  
_/ \__/write_codec\__/(\__/in\__/)\__/ \_
 \_/  \___________/  \_/  \__/  \_/  \_/ 
  0    00000000000000000000    0    0    0  
_/ \__/write_consolefooterc\__/(\__/)\__/ \_
 \_/  \____________________/  \_/  \_/  \_/ 
  0    000000000    0    00    0  
_/ \__/closefile\__/ \__/fo\__/ \_
 \_/  \_________/  \_/  \__/  \_/ 
  0    000    0    00000000    0  
_/ \__/end\__/ \__/function\__/ \_
 \_/  \___/  \_/  \________/  \_/ 
  0    00000000    0    00000000000    0    0000000    0    0  
_/ \__/function\__/ \__/write_codec\__/(\__/in.code\__/)\__/ \_
 \_/  \________/  \_/  \___________/  \_/  \_______/  \_/  \_/ 
  0    000    0    0    0    0    0    00    0    00    0    00    0    0    0  
_/ \__/for\__/ \__/j\__/=\__/0\__/ \__/to\__/ \__/in\__/\\__/mc\__/-\__/1\__/ \_
 \_/  \___/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \__/  \_/  \__/  \_/  \_/  \_/ 
  0    0000    0    0    0    0  
_/ \__/out$\__/=\__/"\__/"\__/ \_
 \_/  \____/  \_/  \_/  \_/  \_/ 
  0    000    0    0    0    0    0    00    0    00    0    0    0    0    0    0    00    0    0    0  
_/ \__/for\__/ \__/k\__/=\__/0\__/ \__/to\__/ \__/in\__/\\__/m\__/[\__/j\__/]\__/\\__/cc\__/-\__/1\__/ \_
 \_/  \___/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \__/  \_/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \_/  \_/ 
  0    000    0    000    0    00    0    0    0    0    0    0    0    0    0    0    0    000000    0  
_/ \__/out\__/=\__/out\__/+\__/in\__/\\__/m\__/[\__/j\__/]\__/\\__/c\__/[\__/k\__/]\__/\\__/c_name\__/ \_
 \_/  \___/  \_/  \___/  \_/  \__/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \______/  \_/ 
  0    0000    0  
_/ \__/next\__/ \_
 \_/  \____/  \_/ 
  0    000000000    0    000000    0    000    0  
_/ \__/writeline\__/ \__/l_life\__/,\__/out\__/ \_
 \_/  \_________/  \_/  \______/  \_/  \___/  \_/ 
  0    0000    0  
_/ \__/next\__/ \_
 \_/  \____/  \_/ 
  0    000    0    00000000    0  
_/ \__/end\__/ \__/function\__/ \_
 \_/  \___/  \_/  \________/  \_/ 
  0    00000000    0    00000000000000000000    0    0    0  
_/ \__/function\__/ \__/write_consoleheaderc\__/(\__/)\__/ \_
 \_/  \________/  \_/  \____________________/  \_/  \_/  \_/ 
  0    000000000    0    000000    0    0    11111111    1    1    1111111    1    0    0  
_/ \__/writeline\__/ \__/l_life\__/,\__/"\__/#include\__/ \__/<\__/stdio.h\__/>\__/"\__/ \_
 \_/  \_________/  \_/  \______/  \_/  \_/  \________/  \_/  \_/  \_______/  \_/  \_/  \_/ 
  0    000000000    0    000000    0    0    111    1    1111    1    1    1    0    0  
_/ \__/writeline\__/ \__/l_life\__/,\__/"\__/int\__/ \__/main\__/(\__/)\__/{\__/"\__/ \_
 \_/  \_________/  \_/  \______/  \_/  \_/  \___/  \_/  \____/  \_/  \_/  \_/  \_/  \_/ 
  0    000    0    00000000    0  
_/ \__/end\__/ \__/function\__/ \_
 \_/  \___/  \_/  \________/  \_/ 
  0    00000000    0    00000000000000000000    0    0    0  
_/ \__/function\__/ \__/write_consolefooterc\__/(\__/)\__/ \_
 \_/  \________/  \_/  \____________________/  \_/  \_/  \_/ 
  0    000000000    0    000000    0    0    1    1    1    1    111111    1    11    1    1    1    1    1111111    1    111111111111    1    1    1    0    0  
_/ \__/writeline\__/ \__/l_life\__/,\__/"\__/ \__/ \__/ \__/ \__/return\__/ \__/0;\__/ \__//\__/*\__/ \__/program\__/ \__/termination.\__/ \__/*\__//\__/"\__/ \_
 \_/  \_________/  \_/  \______/  \_/  \_/  \_/  \_/  \_/  \_/  \______/  \_/  \__/  \_/  \_/  \_/  \_/  \_______/  \_/  \____________/  \_/  \_/  \_/  \_/  \_/ 
  0    000000000    0    000000    0    0    1    0    0  
_/ \__/writeline\__/ \__/l_life\__/,\__/"\__/}\__/"\__/ \_
 \_/  \_________/  \_/  \______/  \_/  \_/  \_/  \_/  \_/ 
  0    000    0    00000000    0  
_/ \__/end\__/ \__/function\__/ \_
 \_/  \___/  \_/  \________/  \_/ 
  0    00000000    0    0000000000000000    0    0000000    0    0  
_/ \__/function\__/ \__/code_towindowapp\__/(\__/in.code\__/)\__/ \_
 \_/  \________/  \_/  \________________/  \_/  \_______/  \_/  \_/ 
  0    000    0    00000000    0  
_/ \__/end\__/ \__/function\__/ \_
 \_/  \___/  \_/  \________/  \_/ 
  0    00000000    0    0000000000    0    0    0000000    0    0  
_/ \__/function\__/ \__/code_tocpp\__/(\__/ \__/in.code\__/)\__/ \_
 \_/  \________/  \_/  \__________/  \_/  \_/  \_______/  \_/  \_/ 
  0    000    0    0    0    0    0    00    0    00    0    00    0    0    0  
_/ \__/for\__/ \__/j\__/=\__/0\__/ \__/to\__/ \__/in\__/\\__/mc\__/-\__/1\__/ \_
 \_/  \___/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \__/  \_/  \__/  \_/  \_/  \_/ 
  0    00000    0    00    0    0    0    0    0    0  
_/ \__/m.map\__/=\__/in\__/\\__/m\__/[\__/j\__/]\__/ \_
 \_/  \_____/  \_/  \__/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    000    0    00000    0  
_/ \__/amb\__/=\__/false\__/ \_
 \_/  \___/  \_/  \_____/  \_/ 
  0    000000    0    0    0    0  
_/ \__/amb_m$\__/=\__/"\__/"\__/ \_
 \_/  \______/  \_/  \_/  \_/  \_/ 
  0    00    0    0    0    0000    0    000000000000    0    0    1111    1    1111    0    0  
_/ \__/if\__/ \__/m\__/=\__/null\__/ \__/runtimeerror\__/ \__/"\__/\__/ \__/!\__/"\__/ \_
 \_/  \__/  \_/  \_/  \_/  \____/  \_/  \____________/  \_/  \_/  \____/  \_/  \____/  \_/  \_/ 
  0    000    0    0    0    0    0    00    0    0    0    00    0    0    0  
_/ \__/for\__/ \__/k\__/=\__/0\__/ \__/to\__/ \__/m\__/\\__/cc\__/-\__/1\__/ \_
 \_/  \___/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \_/  \_/  \__/  \_/  \_/  \_/ 
  0    0000000    0    0    0    0    0    0    0    0  
_/ \__/c.chunk\__/=\__/m\__/\\__/c\__/[\__/k\__/]\__/ \_
 \_/  \_______/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0    0    0    000    0  
_/ \__/map$\__/=\__/c\__/\\__/map\__/ \_
 \_/  \____/  \_/  \_/  \_/  \___/  \_/ 
  0    00    0    0    0    00000    0  
_/ \__/if\__/ \__/c\__/\\__/issep\__/ \_
 \_/  \__/  \_/  \_/  \_/  \_____/  \_/ 
  0    0    0    000    0    0000    0    00000000000000    0  
_/ \__/;\__/-\__/raw\__/ \__/data\__/ \__/enclapsulators\__/ \_
 \_/  \_/  \_/  \___/  \_/  \____/  \_/  \______________/  \_/ 
  0    00    0    000    0  
_/ \__/if\__/ \__/amb\__/ \_
 \_/  \__/  \_/  \___/  \_/ 
  0    000000    0    000    0  
_/ \__/select\__/ \__/map\__/ \_
 \_/  \______/  \_/  \___/  \_/ 
  0    0000    0    000    0    00    0    0  
_/ \__/case\__/ \__/chr\__/(\__/34\__/)\__/ \_
 \_/  \____/  \_/  \___/  \_/  \__/  \_/  \_/ 
  0    00    0    000    0    00000    0  
_/ \__/if\__/ \__/map\__/=\__/amb_m\__/ \_
 \_/  \__/  \_/  \___/  \_/  \_____/  \_/ 
  0    000    0    00000    0  
_/ \__/amb\__/=\__/false\__/ \_
 \_/  \___/  \_/  \_____/  \_/ 
  0    00000    0    0    0    0  
_/ \__/amb_m\__/=\__/"\__/"\__/ \_
 \_/  \_____/  \_/  \_/  \_/  \_/ 
  0    00000    0  
_/ \__/endif\__/ \_
 \_/  \_____/  \_/ 
  0    000    0    000000    0  
_/ \__/end\__/ \__/select\__/ \_
 \_/  \___/  \_/  \______/  \_/ 
  0    0000    0  
_/ \__/else\__/ \_
 \_/  \____/  \_/ 
  0    000000    0    000    0  
_/ \__/select\__/ \__/map\__/ \_
 \_/  \______/  \_/  \___/  \_/ 
  0    0000    0    000    0    00    0    0  
_/ \__/case\__/ \__/chr\__/(\__/34\__/)\__/ \_
 \_/  \____/  \_/  \___/  \_/  \__/  \_/  \_/ 
  0    000    0    0000    0  
_/ \__/amb\__/=\__/true\__/ \_
 \_/  \___/  \_/  \____/  \_/ 
  0    000000    0    000    0  
_/ \__/amb_m$\__/=\__/map\__/ \_
 \_/  \______/  \_/  \___/  \_/ 
  0    00000000    0    0000    0  
_/ \__/over_amb\__/=\__/true\__/ \_
 \_/  \________/  \_/  \____/  \_/ 
  0    000    0    000000    0  
_/ \__/end\__/ \__/select\__/ \_
 \_/  \___/  \_/  \______/  \_/ 
  0    00000    0  
_/ \__/endif\__/ \_
 \_/  \_____/  \_/ 
  0    0    0    000000    0    000    0  
_/ \__/c\__/\\__/c_name\__/=\__/map\__/ \_
 \_/  \_/  \_/  \______/  \_/  \___/  \_/ 
  0    0000    0  
_/ \__/else\__/ \_
 \_/  \____/  \_/ 
  0    0    0    000000    0    000    0  
_/ \__/c\__/\\__/c_name\__/=\__/map\__/ \_
 \_/  \_/  \_/  \______/  \_/  \___/  \_/ 
  0    00    0    00000    0    0    000    0    0  
_/ \__/if\__/ \__/isres\__/(\__/ \__/map\__/)\__/ \_
 \_/  \__/  \_/  \_____/  \_/  \_/  \___/  \_/  \_/ 
  0    0  
_/ \__/ \_
 \_/  \_/ 
  0    0000    0  
_/ \__/else\__/ \_
 \_/  \____/  \_/ 
  0    0    0    000000    0    000000    0    000    0    0  
_/ \__/c\__/\\__/c_name\__/=\__/switch\__/(\__/map\__/)\__/ \_
 \_/  \_/  \_/  \______/  \_/  \______/  \_/  \___/  \_/  \_/ 
  0    00000    0  
_/ \__/endif\__/ \_
 \_/  \_____/  \_/ 
  0    0  
_/ \__/ \_
 \_/  \_/ 
  0    00000    0  
_/ \__/endif\__/ \_
 \_/  \_____/  \_/ 
  0    00    0    000    0  
_/ \__/if\__/ \__/amb\__/ \_
 \_/  \__/  \_/  \___/  \_/ 
  0    00    0    00000000    0  
_/ \__/if\__/ \__/over_amb\__/ \_
 \_/  \__/  \_/  \________/  \_/ 
  0    00000000    0    0    0  
_/ \__/over_amb\__/=\__/0\__/ \_
 \_/  \________/  \_/  \_/  \_/ 
  0    0000    0  
_/ \__/else\__/ \_
 \_/  \____/  \_/ 
  0    0    0    000000    0    000    0  
_/ \__/c\__/\\__/c_name\__/=\__/map\__/ \_
 \_/  \_/  \_/  \______/  \_/  \___/  \_/ 
  0    0    0    000    0    0000    0  
_/ \__/c\__/\\__/amb\__/=\__/true\__/ \_
 \_/  \_/  \_/  \___/  \_/  \____/  \_/ 
  0    00000    0  
_/ \__/endif\__/ \_
 \_/  \_____/  \_/ 
  0    00000    0  
_/ \__/endif\__/ \_
 \_/  \_____/  \_/ 
  0    0000    0  
_/ \__/next\__/ \_
 \_/  \____/  \_/ 
  0    0000    0  
_/ \__/next\__/ \_
 \_/  \____/  \_/ 
  0    0    0    0    0    00000    0    000    0    000    0  
_/ \__/;\__/-\__/-\__/ \__/scope\__/ \__/set\__/ \__/up.\__/ \_
 \_/  \_/  \_/  \_/  \_/  \_____/  \_/  \___/  \_/  \___/  \_/ 
  0    0000000000    0    000    0    00000    0  
_/ \__/main.scope\__/=\__/new\__/ \__/scope\__/ \_
 \_/  \__________/  \_/  \___/  \_/  \_____/  \_/ 
  0    0000    0    000000000    0    0000000000    0  
_/ \__/main\__/\\__/scopetype\__/=\__/scope_main\__/ \_
 \_/  \____/  \_/  \_________/  \_/  \__________/  \_/ 
  0    000000000    0    0000    0    00    0    0  
_/ \__/feedscope\__/(\__/main\__/,\__/in\__/)\__/ \_
 \_/  \_________/  \_/  \____/  \_/  \__/  \_/  \_/ 
  0    00000000000    0    0000    0    0    111111111111111    0    0    0  
_/ \__/debug_scope\__/(\__/main\__/,\__/"\__/scope_debug.txt\__/"\__/)\__/ \_
 \_/  \___________/  \_/  \____/  \_/  \_/  \_______________/  \_/  \_/  \_/ 
  0    000    0    00000000    0  
_/ \__/end\__/ \__/function\__/ \_
 \_/  \___/  \_/  \________/  \_/ 
  0    00000000    0    000000000    0    0000000000    0    000000    0    0000    0    0    0    000000    0    0    0    0    0  
_/ \__/function\__/ \__/feedscope\__/(\__/base.scope\__/,\__/c.code\__/,\__/from\__/=\__/0\__/,\__/endat$\__/=\__/"\__/"\__/)\__/ \_
 \_/  \________/  \_/  \_________/  \_/  \__________/  \_/  \______/  \_/  \____/  \_/  \_/  \_/  \______/  \_/  \_/  \_/  \_/  \_/ 
  0    000000    0    0    11111    1    1111    1    1    0    0    0000    0  
_/ \__/printf\__/ \__/"\__/scope\__/ \__/from\__/ \__/>\__/"\__/+\__/from\__/ \_
 \_/  \______/  \_/  \_/  \_____/  \_/  \____/  \_/  \_/  \_/  \_/  \____/  \_/ 
  0    000    0    0    0    0000    0    00    0    0    0    00    0    0    0  
_/ \__/for\__/ \__/j\__/=\__/from\__/ \__/to\__/ \__/c\__/\\__/mc\__/-\__/1\__/ \_
 \_/  \___/  \_/  \_/  \_/  \____/  \_/  \__/  \_/  \_/  \_/  \__/  \_/  \_/  \_/ 
  0    00000    0  
_/ \__/.redo\__/ \_
 \_/  \_____/  \_/ 
  0    00    0    0    0    0    0    0    00    0    0000    0  
_/ \__/if\__/ \__/j\__/=\__/>\__/c\__/\\__/mc\__/ \__/exit\__/ \_
 \_/  \__/  \_/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \____/  \_/ 
  0    00000    0    0    0    0    0    0    0    0  
_/ \__/m.map\__/=\__/c\__/\\__/m\__/[\__/j\__/]\__/ \_
 \_/  \_____/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    000000    0    0    111    1    1111    0    0  
_/ \__/printf\__/ \__/"\__/obj\__/ \__/line\__/"\__/ \_
 \_/  \______/  \_/  \_/  \___/  \_/  \____/  \_/  \_/ 
  0    000    0    0    0    0    0    00    0    0    0    00    0    0    0  
_/ \__/for\__/ \__/k\__/=\__/0\__/ \__/to\__/ \__/m\__/\\__/cc\__/-\__/1\__/ \_
 \_/  \___/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \_/  \_/  \__/  \_/  \_/  \_/ 
  0    0000000    0    0    0    0    0    0    0    0  
_/ \__/a.chunk\__/=\__/m\__/\\__/c\__/[\__/k\__/]\__/ \_
 \_/  \_______/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000000    0    0000    0    0    0    0    0    0  
_/ \__/n.chunk\__/=\__/nobj\__/(\__/m\__/,\__/k\__/)\__/ \_
 \_/  \_______/  \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000000    0    0000    0    0    0    0    0    0  
_/ \__/p.chunk\__/=\__/nobj\__/(\__/m\__/,\__/k\__/)\__/ \_
 \_/  \_______/  \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    00    0    000000    0    0    0    000    0    0    000    0    0    0    0    0000    0    000    0    0    0    000    0    000000000    0    0    0    00000    0    0000    0    00000000    0  
_/ \__/if\__/ \__/isscop\__/(\__/a\__/\\__/map\__/)\__/ \__/and\__/ \__/j\__/<\__/>\__/from\__/ \__/and\__/ \__/a\__/\\__/amb\__/=\__/false;can\__/'\__/t\__/ \__/scope\__/ \__/into\__/ \__/thyself.\__/ \_
 \_/  \__/  \_/  \______/  \_/  \_/  \_/  \___/  \_/  \_/  \___/  \_/  \_/  \_/  \_/  \____/  \_/  \___/  \_/  \_/  \_/  \___/  \_/  \_________/  \_/  \_/  \_/  \_____/  \_/  \____/  \_/  \________/  \_/ 
  0    00000000    0    000    0    00000    0  
_/ \__/ns.scope\__/=\__/new\__/ \__/scope\__/ \_
 \_/  \________/  \_/  \___/  \_/  \_____/  \_/ 
  0    0000    0    000    0    0000    0    00    0    0    00    0  
_/ \__/base\__/\\__/sub\__/[\__/base\__/\\__/sc\__/]\__/=\__/ns\__/ \_
 \_/  \____/  \_/  \___/  \_/  \____/  \_/  \__/  \_/  \_/  \__/  \_/ 
  0    0000    0    00    0    0000    0    00    0    0    0  
_/ \__/base\__/\\__/sc\__/=\__/base\__/\\__/sc\__/+\__/1\__/ \_
 \_/  \____/  \_/  \__/  \_/  \____/  \_/  \__/  \_/  \_/  \_/ 
  0    00    0    0    0    0    0    0000    0  
_/ \__/if\__/ \__/ \__/n\__/<\__/>\__/null\__/ \_
 \_/  \__/  \_/  \_/  \_/  \_/  \_/  \____/  \_/ 
  0    000000    0    0    11111    1    111111    1    1    0    0    0    0    000    0  
_/ \__/printf\__/ \__/"\__/scope\__/ \__/called\__/ \__/>\__/"\__/+\__/n\__/\\__/map\__/ \_
 \_/  \______/  \_/  \_/  \_____/  \_/  \______/  \_/  \_/  \_/  \_/  \_/  \_/  \___/  \_/ 
  0    00    0    0000    0    0    0    000    0  
_/ \__/ns\__/\\__/name\__/=\__/n\__/\\__/map\__/ \_
 \_/  \__/  \_/  \____/  \_/  \_/  \_/  \___/  \_/ 
  0    0000    0  
_/ \__/else\__/ \_
 \_/  \____/  \_/ 
  0    000000    0    0    1111111    1    1    1    1    11111111    1    11111    0    0  
_/ \__/printf\__/ \__/"\__/warning\__/ \__/-\__/?\__/ \__/nameless\__/ \__/scope\__/"\__/ \_
 \_/  \______/  \_/  \_/  \_______/  \_/  \_/  \_/  \_/  \________/  \_/  \_____/  \_/  \_/ 
  0    00    0    0000    0    0    1111    1    111111111    0    0  
_/ \__/ns\__/\\__/name\__/=\__/"\__/none\__/ \__/specified\__/"\__/ \_
 \_/  \__/  \_/  \____/  \_/  \_/  \____/  \_/  \_________/  \_/  \_/ 
  0    00000    0  
_/ \__/endif\__/ \_
 \_/  \_____/  \_/ 
  0    0    0    000000000    0    0    00    0    0    0    0    0    0    0    000    0    0  
_/ \__/j\__/=\__/feedscope\__/(\__/ \__/ns\__/,\__/c\__/,\__/j\__/,\__/a\__/\\__/map\__/)\__/ \_
 \_/  \_/  \_/  \_________/  \_/  \_/  \__/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \___/  \_/  \_/ 
  0    0000    0    0000    0  
_/ \__/goto\__/ \__/redo\__/ \_
 \_/  \____/  \_/  \____/  \_/ 
  0    0000    0  
_/ \__/else\__/ \_
 \_/  \____/  \_/ 
  0    0    0    000000000    0    00    0    0000    0    000000    0  
_/ \__/;\__/-\__/determine\__/ \__/if\__/ \__/exit\__/ \__/point.\__/ \_
 \_/  \_/  \_/  \_________/  \_/  \__/  \_/  \____/  \_/  \______/  \_/ 
  0    000000    0    0    0    000    0  
_/ \__/select\__/ \__/a\__/\\__/map\__/ \_
 \_/  \______/  \_/  \_/  \_/  \___/  \_/ 
  0    0000    0    0    111    0    0  
_/ \__/case\__/ \__/"\__/end\__/"\__/ \_
 \_/  \____/  \_/  \_/  \___/  \_/  \_/ 
  0    00    0    0    0    0    0000    0  
_/ \__/if\__/ \__/n\__/<\__/>\__/null\__/ \_
 \_/  \__/  \_/  \_/  \_/  \_/  \____/  \_/ 
  0    000000    0    0    0    000    0  
_/ \__/select\__/ \__/n\__/\\__/map\__/ \_
 \_/  \______/  \_/  \_/  \_/  \___/  \_/ 
  0    0000    0    00000    0  
_/ \__/case\__/ \__/endat\__/ \_
 \_/  \____/  \_/  \_____/  \_/ 
  0    000000000    0    0000    0  
_/ \__/exitscope\__/=\__/true\__/ \_
 \_/  \_________/  \_/  \____/  \_/ 
  0    0000    0    000    0    0000    0    00    0    00000    0    000    0    00000000    0    0000    0    00    0    0000000    0  
_/ \__/exit\__/ \__/;no\__/ \__/need\__/ \__/to\__/ \__/parse\__/ \__/on.\__/ \__/anything\__/ \__/else\__/ \__/is\__/ \__/excess.\__/ \_
 \_/  \____/  \_/  \___/  \_/  \____/  \_/  \__/  \_/  \_____/  \_/  \___/  \_/  \________/  \_/  \____/  \_/  \__/  \_/  \_______/  \_/ 
  0    000    0    000000    0  
_/ \__/end\__/ \__/select\__/ \_
 \_/  \___/  \_/  \______/  \_/ 
  0    00000    0  
_/ \__/endif\__/ \_
 \_/  \_____/  \_/ 
  0    000    0    000000    0  
_/ \__/end\__/ \__/select\__/ \_
 \_/  \___/  \_/  \______/  \_/ 
  0    0    0    0    0    0  
_/ \__/;\__/-\__/-\__/-\__/ \_
 \_/  \_/  \_/  \_/  \_/  \_/ 
  0    00000    0  
_/ \__/endif\__/ \_
 \_/  \_____/  \_/ 
  0    0000    0  
_/ \__/next\__/ \_
 \_/  \____/  \_/ 
  0    0000    0    0    0    0000    0    00    0    0    0    0  
_/ \__/base\__/\\__/m\__/[\__/base\__/\\__/mc\__/]\__/=\__/m\__/ \_
 \_/  \____/  \_/  \_/  \_/  \____/  \_/  \__/  \_/  \_/  \_/  \_/ 
  0    0000    0    00    0    0000    0    00    0    0    0  
_/ \__/base\__/\\__/mc\__/=\__/base\__/\\__/mc\__/+\__/1\__/ \_
 \_/  \____/  \_/  \__/  \_/  \____/  \_/  \__/  \_/  \_/  \_/ 
  0    00    0    000000000    0    000000    0    0    0    0    0  
_/ \__/if\__/ \__/exitscope\__/ \__/return\__/ \__/j\__/+\__/1\__/ \_
 \_/  \__/  \_/  \_________/  \_/  \______/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0  
_/ \__/next\__/ \_
 \_/  \____/  \_/ 
  0    00    0    0000    0    0    0  
_/ \__/if\__/ \__/from\__/>\__/0\__/ \_
 \_/  \__/  \_/  \____/  \_/  \_/  \_/ 
  0    0000    0  
_/ \__/stop\__/ \_
 \_/  \____/  \_/ 
  0    000000    0    0    1111111    1    11111    0    0  
_/ \__/printf\__/ \__/"\__/compile\__/ \__/error\__/"\__/ \_
 \_/  \______/  \_/  \_/  \_______/  \_/  \_____/  \_/  \_/ 
  0    000000    0    00000    0    0    1    1111111    1    111    1    0    0    00000    0  
_/ \__/printf\__/ \__/endat\__/+\__/"\__/ \__/without\__/ \__/end\__/ \__/"\__/+\__/endat\__/ \_
 \_/  \______/  \_/  \_____/  \_/  \_/  \_/  \_______/  \_/  \___/  \_/  \_/  \_/  \_____/  \_/ 
  0    00000    0  
_/ \__/endif\__/ \_
 \_/  \_____/  \_/ 
  0    000000    0    0    11111    1    111    0    0  
_/ \__/printf\__/ \__/"\__/scope\__/ \__/out\__/"\__/ \_
 \_/  \______/  \_/  \_/  \_____/  \_/  \___/  \_/  \_/ 
  0    000000    0    0    0  
_/ \__/return\__/ \__/j\__/ \_
 \_/  \______/  \_/  \_/  \_/ 
  0    000    0    00000000    0  
_/ \__/end\__/ \__/function\__/ \_
 \_/  \___/  \_/  \________/  \_/ 
  0    00000000    0    00000000000    0    0000000000    0    00000    0    000000000    0    0000    0    0000000    0    0    0    0000    0    0    1    1    0    0    0  
_/ \__/function\__/ \__/debug_scope\__/(\__/base.scope\__/,\__/file$\__/,\__/debugsubs\__/=\__/true\__/,\__/usefile\__/=\__/0\__/,\__/pad$\__/=\__/"\__/-\__/-\__/"\__/)\__/ \_
 \_/  \________/  \_/  \___________/  \_/  \__________/  \_/  \_____/  \_/  \_________/  \_/  \____/  \_/  \_______/  \_/  \_/  \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    00    0    000    0    0000000    0  
_/ \__/if\__/ \__/not\__/ \__/usefile\__/ \_
 \_/  \__/  \_/  \___/  \_/  \_______/  \_/ 
  0    00    0    000000000    0    0    0000    0    0  
_/ \__/fo\__/=\__/writefile\__/(\__/ \__/file\__/)\__/ \_
 \_/  \__/  \_/  \_________/  \_/  \_/  \____/  \_/  \_/ 
  0    00    0    000    0    00    0    000000    0  
_/ \__/if\__/ \__/not\__/ \__/fo\__/ \__/return\__/ \_
 \_/  \__/  \_/  \___/  \_/  \__/  \_/  \______/  \_/ 
  0    0000    0  
_/ \__/else\__/ \_
 \_/  \____/  \_/ 
  0    00    0    0000000    0  
_/ \__/fo\__/=\__/usefile\__/ \_
 \_/  \__/  \_/  \_______/  \_/ 
  0    00000    0  
_/ \__/endif\__/ \_
 \_/  \_____/  \_/ 
  0    000000000    0    00    0    000    0    0    11111    1    1111    1    0    0    0000    0    0000    0  
_/ \__/writeline\__/ \__/fo\__/,\__/pad\__/+\__/"\__/scope\__/ \__/name\__/:\__/"\__/+\__/base\__/\\__/name\__/ \_
 \_/  \_________/  \_/  \__/  \_/  \___/  \_/  \_/  \_____/  \_/  \____/  \_/  \_/  \_/  \____/  \_/  \____/  \_/ 
  0    000000000    0    00    0    000    0    0    111    1    1111    1    0    0    0000    0    00    0  
_/ \__/writeline\__/ \__/fo\__/,\__/pad\__/+\__/"\__/obj\__/ \__/maps\__/:\__/"\__/+\__/base\__/\\__/mc\__/ \_
 \_/  \_________/  \_/  \__/  \_/  \___/  \_/  \_/  \___/  \_/  \____/  \_/  \_/  \_/  \____/  \_/  \__/  \_/ 
  0    000    0    0    0    0    0    00    0    0000    0    00    0    0    0  
_/ \__/for\__/ \__/j\__/=\__/0\__/ \__/to\__/ \__/base\__/\\__/mc\__/-\__/1\__/ \_
 \_/  \___/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \____/  \_/  \__/  \_/  \_/  \_/ 
  0    0000    0    0    0    0  
_/ \__/out$\__/=\__/"\__/"\__/ \_
 \_/  \____/  \_/  \_/  \_/  \_/ 
  0    000    0    0    0    0    0    00    0    0000    0    0    0    0    0    0    00    0    0    0  
_/ \__/for\__/ \__/k\__/=\__/0\__/ \__/to\__/ \__/base\__/\\__/m\__/[\__/j\__/]\__/\\__/cc\__/-\__/1\__/ \_
 \_/  \___/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \_/  \_/ 
  0    000    0    000    0    0000    0    0    0    0    0    0    0    0    0    0    0    000    0  
_/ \__/out\__/=\__/out\__/+\__/base\__/\\__/m\__/[\__/j\__/]\__/\\__/c\__/[\__/k\__/]\__/\\__/map\__/ \_
 \_/  \___/  \_/  \___/  \_/  \____/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \___/  \_/ 
  0    0000    0  
_/ \__/next\__/ \_
 \_/  \____/  \_/ 
  0    000000000    0    00    0    000    0    0    1    0    0    000    0  
_/ \__/writeline\__/ \__/fo\__/,\__/pad\__/+\__/"\__/[\__/"\__/+\__/out\__/ \_
 \_/  \_________/  \_/  \__/  \_/  \___/  \_/  \_/  \_/  \_/  \_/  \___/  \_/ 
  0    0000    0  
_/ \__/next\__/ \_
 \_/  \____/  \_/ 
  0    000000000    0    00    0    000000    0    0    1    1    0    0    000    0    000    0    0    0  
_/ \__/writeline\__/ \__/fo\__/,\__/string\__/(\__/"\__//\__/\\__/"\__/,\__/len\__/(\__/pad\__/)\__/)\__/ \_
 \_/  \_________/  \_/  \__/  \_/  \______/  \_/  \_/  \_/  \_/  \_/  \_/  \___/  \_/  \___/  \_/  \_/  \_/ 
  0    00    0    000000000    0  
_/ \__/if\__/ \__/debugsubs\__/ \_
 \_/  \__/  \_/  \_________/  \_/ 
  0    000    0    0    0    0    0    00    0    0000    0    00    0    0    0  
_/ \__/for\__/ \__/j\__/=\__/0\__/ \__/to\__/ \__/base\__/\\__/sc\__/-\__/1\__/ \_
 \_/  \___/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \____/  \_/  \__/  \_/  \_/  \_/ 
  0    00000000000    0    0    0000    0    000    0    0    0    0    0000    0    0000    0    00    0    000    0    0    1    1    0    0    0  
_/ \__/debug_scope\__/(\__/ \__/base\__/\\__/sub\__/[\__/j\__/]\__/,\__/file\__/,\__/true\__/,\__/fo\__/,\__/pad\__/+\__/"\__/-\__/-\__/"\__/)\__/ \_
 \_/  \___________/  \_/  \_/  \____/  \_/  \___/  \_/  \_/  \_/  \_/  \____/  \_/  \____/  \_/  \__/  \_/  \___/  \_/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0  
_/ \__/next\__/ \_
 \_/  \____/  \_/ 
  0    00000    0  
_/ \__/endif\__/ \_
 \_/  \_____/  \_/ 
  0    00    0    000    0    0000000    0  
_/ \__/if\__/ \__/not\__/ \__/usefile\__/ \_
 \_/  \__/  \_/  \___/  \_/  \_______/  \_/ 
  0    000000000    0    00    0  
_/ \__/closefile\__/ \__/fo\__/ \_
 \_/  \_________/  \_/  \__/  \_/ 
  0    00000    0  
_/ \__/endif\__/ \_
 \_/  \_____/  \_/ 
  0    000    0    00000000    0  
_/ \__/end\__/ \__/function\__/ \_
 \_/  \___/  \_/  \________/  \_/ 
  0    00000000    0    0000000000    0    0    00000    0    0000    0    0    0    0  
_/ \__/function\__/ \__/nobj.chunk\__/(\__/ \__/m.map\__/,\__/from\__/=\__/0\__/)\__/ \_
 \_/  \________/  \_/  \__________/  \_/  \_/  \_____/  \_/  \____/  \_/  \_/  \_/  \_/ 
  0    0000    0    0000    0    0    0  
_/ \__/from\__/=\__/from\__/+\__/1\__/ \_
 \_/  \____/  \_/  \____/  \_/  \_/  \_/ 
  0    00    0    0000    0    0    0    0    00    0    000000    0  
_/ \__/if\__/ \__/from\__/=\__/>\__/m\__/\\__/cc\__/ \__/return\__/ \_
 \_/  \__/  \_/  \____/  \_/  \_/  \_/  \_/  \__/  \_/  \______/  \_/ 
  0    000    0    0    0    0000    0    00    0    0    0    00    0    0    0  
_/ \__/for\__/ \__/j\__/=\__/from\__/ \__/to\__/ \__/m\__/\\__/cc\__/-\__/1\__/ \_
 \_/  \___/  \_/  \_/  \_/  \____/  \_/  \__/  \_/  \_/  \_/  \__/  \_/  \_/  \_/ 
  0    00    0    000    0    0    0    0    0    0    0    0    00000    0    000000    0    0    0    0    0    0    0    0  
_/ \__/if\__/ \__/not\__/ \__/m\__/\\__/c\__/[\__/j\__/]\__/\\__/issep\__/ \__/return\__/ \__/m\__/\\__/c\__/[\__/j\__/]\__/ \_
 \_/  \__/  \_/  \___/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_____/  \_/  \______/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0  
_/ \__/next\__/ \_
 \_/  \____/  \_/ 
  0    000    0    00000000    0  
_/ \__/end\__/ \__/function\__/ \_
 \_/  \___/  \_/  \________/  \_/ 
  0    00000000    0    00000000000    0    0    00000    0    0000    0    0    0    0  
_/ \__/function\__/ \__/poibj.chunk\__/(\__/ \__/m.map\__/,\__/from\__/=\__/0\__/)\__/ \_
 \_/  \________/  \_/  \___________/  \_/  \_/  \_____/  \_/  \____/  \_/  \_/  \_/  \_/ 
  0    0000    0    0000    0    0    0  
_/ \__/from\__/=\__/from\__/-\__/1\__/ \_
 \_/  \____/  \_/  \____/  \_/  \_/  \_/ 
  0    00    0    0000    0    0    0    000000    0  
_/ \__/if\__/ \__/from\__/<\__/0\__/ \__/return\__/ \_
 \_/  \__/  \_/  \____/  \_/  \_/  \_/  \______/  \_/ 
  0    000    0    0    0    0000    0    00    0    0    0    0000    0    0    0    0  
_/ \__/for\__/ \__/j\__/=\__/from\__/ \__/to\__/ \__/0\__/ \__/step\__/ \__/-\__/1\__/ \_
 \_/  \___/  \_/  \_/  \_/  \____/  \_/  \__/  \_/  \_/  \_/  \____/  \_/  \_/  \_/  \_/ 
  0    00    0    000    0    0    0    0    0    0    0    0    00000    0    000000    0    0    0    0    0    0    0    0  
_/ \__/if\__/ \__/not\__/ \__/m\__/\\__/c\__/[\__/j\__/]\__/\\__/issep\__/ \__/return\__/ \__/m\__/\\__/c\__/[\__/j\__/]\__/ \_
 \_/  \__/  \_/  \___/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_____/  \_/  \______/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0  
_/ \__/next\__/ \_
 \_/  \____/  \_/ 
  0    000    0    00000000    0  
_/ \__/end\__/ \__/function\__/ \_
 \_/  \___/  \_/  \________/  \_/ 
  0    0000    0    000000    0  
_/ \__/type\__/ \__/switch\__/ \_
 \_/  \____/  \_/  \______/  \_/ 
  0    00000    0    00000    0    000    0  
_/ \__/field\__/ \__/from$\__/,\__/go$\__/ \_
 \_/  \_____/  \_/  \_____/  \_/  \___/  \_/ 
  0    000    0    0000    0  
_/ \__/end\__/ \__/type\__/ \_
 \_/  \___/  \_/  \____/  \_/ 
  0    00000000    0    0000    0    00000    0    000    0    0  
_/ \__/function\__/ \__/nswi\__/(\__/from$\__/,\__/go$\__/)\__/ \_
 \_/  \________/  \_/  \____/  \_/  \_____/  \_/  \___/  \_/  \_/ 
  0    00000000    0    000    0    000000    0  
_/ \__/s.switch\__/=\__/new\__/ \__/switch\__/ \_
 \_/  \________/  \_/  \___/  \_/  \______/  \_/ 
  0    0    0    0000    0    0000    0  
_/ \__/s\__/\\__/from\__/=\__/from\__/ \_
 \_/  \_/  \_/  \____/  \_/  \____/  \_/ 
  0    0    0    00    0    00    0  
_/ \__/s\__/\\__/go\__/=\__/go\__/ \_
 \_/  \_/  \_/  \__/  \_/  \__/  \_/ 
  0    000    0    00000000    0  
_/ \__/end\__/ \__/function\__/ \_
 \_/  \___/  \_/  \________/  \_/ 
  0    00000000    0    0000000    0    0000    0    0  
_/ \__/function\__/ \__/switch$\__/(\__/dat$\__/)\__/ \_
 \_/  \________/  \_/  \_______/  \_/  \____/  \_/  \_/ 
  0    000    0    00000000    0    0000    0    000000    0  
_/ \__/for\__/ \__/s.switch\__/=\__/each\__/ \__/switch\__/ \_
 \_/  \___/  \_/  \________/  \_/  \____/  \_/  \______/  \_/ 
  0    00    0    000    0    0    0    0000    0    000000    0    0    0    00    0  
_/ \__/if\__/ \__/dat\__/=\__/s\__/\\__/from\__/ \__/return\__/ \__/s\__/\\__/go\__/ \_
 \_/  \__/  \_/  \___/  \_/  \_/  \_/  \____/  \_/  \______/  \_/  \_/  \_/  \__/  \_/ 
  0    0000    0  
_/ \__/next\__/ \_
 \_/  \____/  \_/ 
  0    000000    0    000    0  
_/ \__/return\__/ \__/dat\__/ \_
 \_/  \______/  \_/  \___/  \_/ 
  0    000    0    00000000    0  
_/ \__/end\__/ \__/function\__/ \_
 \_/  \___/  \_/  \________/  \_/ 
  0    00000000    0    0000000000    0    0    0000000    0    00000    0    0  
_/ \__/function\__/ \__/debug_code\__/(\__/ \__/in.code\__/,\__/file$\__/)\__/ \_
 \_/  \________/  \_/  \__________/  \_/  \_/  \_______/  \_/  \_____/  \_/  \_/ 
  0    00    0    000000000    0    0000    0    0  
_/ \__/fo\__/=\__/writefile\__/(\__/file\__/)\__/ \_
 \_/  \__/  \_/  \_________/  \_/  \____/  \_/  \_/ 
  0    00    0    000    0    00    0    000000    0  
_/ \__/if\__/ \__/not\__/ \__/fo\__/ \__/return\__/ \_
 \_/  \__/  \_/  \___/  \_/  \__/  \_/  \______/  \_/ 
  0    000    0    0    0    0    0    00    0    00    0    00    0    0    0  
_/ \__/for\__/ \__/j\__/=\__/0\__/ \__/to\__/ \__/in\__/\\__/mc\__/-\__/1\__/ \_
 \_/  \___/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \__/  \_/  \__/  \_/  \_/  \_/ 
  0    0000    0    0    0    0  
_/ \__/out$\__/=\__/"\__/"\__/ \_
 \_/  \____/  \_/  \_/  \_/  \_/ 
  0    000    0    0    0    0    0    00    0    00    0    0    0    0    0    0    00    0    0    0  
_/ \__/for\__/ \__/k\__/=\__/0\__/ \__/to\__/ \__/in\__/\\__/m\__/[\__/j\__/]\__/\\__/cc\__/-\__/1\__/ \_
 \_/  \___/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \__/  \_/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \_/  \_/ 
  0    000    0    000    0    0    1    1    0    0    000000    0    00    0    0    0    0    0    0    0    0    0    0    0    000    0    000    0    00    0    0    0    0    0    0    0    0    0    0    0    000000    0    0    0    0    1    1    0    0  
_/ \__/out\__/=\__/out\__/+\__/"\__/ \__/ \__/"\__/+\__/string\__/(\__/in\__/\\__/m\__/[\__/j\__/]\__/\\__/c\__/[\__/k\__/]\__/\\__/amb\__/,\__/len\__/(\__/in\__/\\__/m\__/[\__/j\__/]\__/\\__/c\__/[\__/k\__/]\__/\\__/c_name\__/)\__/)\__/+\__/"\__/ \__/ \__/"\__/ \_
 \_/  \___/  \_/  \___/  \_/  \_/  \_/  \_/  \_/  \_/  \______/  \_/  \__/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \___/  \_/  \___/  \_/  \__/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \______/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0  
_/ \__/next\__/ \_
 \_/  \____/  \_/ 
  0    000000000    0    00    0    000    0  
_/ \__/writeline\__/ \__/fo\__/,\__/out\__/ \_
 \_/  \_________/  \_/  \__/  \_/  \___/  \_/ 
  0    0000    0    0    0    0  
_/ \__/out$\__/=\__/"\__/"\__/ \_
 \_/  \____/  \_/  \_/  \_/  \_/ 
  0    000    0    0    0    0    0    00    0    00    0    0    0    0    0    0    00    0    0    0  
_/ \__/for\__/ \__/k\__/=\__/0\__/ \__/to\__/ \__/in\__/\\__/m\__/[\__/j\__/]\__/\\__/cc\__/-\__/1\__/ \_
 \_/  \___/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \__/  \_/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \_/  \_/ 
  0    000    0    000    0    0    1    1    0    0    00    0    0    0    0    0    0    0    0    0    0    0    000000    0    0    1    1    0    0  
_/ \__/out\__/=\__/out\__/+\__/"\__/_\__//\__/"\__/+\__/in\__/\\__/m\__/[\__/j\__/]\__/\\__/c\__/[\__/k\__/]\__/\\__/c_name\__/+\__/"\__/\\__/_\__/"\__/ \_
 \_/  \___/  \_/  \___/  \_/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \______/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0  
_/ \__/next\__/ \_
 \_/  \____/  \_/ 
  0    000000000    0    00    0    000    0  
_/ \__/writeline\__/ \__/fo\__/,\__/out\__/ \_
 \_/  \_________/  \_/  \__/  \_/  \___/  \_/ 
  0    000    0    0    0    0  
_/ \__/out\__/=\__/"\__/"\__/ \_
 \_/  \___/  \_/  \_/  \_/  \_/ 
  0    000    0    0    0    0    0    00    0    00    0    0    0    0    0    0    00    0    0    0  
_/ \__/for\__/ \__/k\__/=\__/0\__/ \__/to\__/ \__/in\__/\\__/m\__/[\__/j\__/]\__/\\__/cc\__/-\__/1\__/ \_
 \_/  \___/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \__/  \_/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \_/  \_/ 
  0    000    0    000    0    0    1    1    0    0    000000    0    0    1    0    0    000    0    00    0    0    0    0    0    0    0    0    0    0    0    000000    0    0    0    0    1    1    0    0  
_/ \__/out\__/=\__/out\__/+\__/"\__/ \__/\\__/"\__/+\__/string\__/(\__/"\__/_\__/"\__/,\__/len\__/(\__/in\__/\\__/m\__/[\__/j\__/]\__/\\__/c\__/[\__/k\__/]\__/\\__/c_name\__/)\__/)\__/+\__/"\__//\__/ \__/"\__/ \_
 \_/  \___/  \_/  \___/  \_/  \_/  \_/  \_/  \_/  \_/  \______/  \_/  \_/  \_/  \_/  \_/  \___/  \_/  \__/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \______/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    0000    0  
_/ \__/next\__/ \_
 \_/  \____/  \_/ 
  0    000000000    0    00    0    000    0  
_/ \__/writeline\__/ \__/fo\__/,\__/out\__/ \_
 \_/  \_________/  \_/  \__/  \_/  \___/  \_/ 
  0    0000    0  
_/ \__/next\__/ \_
 \_/  \____/  \_/ 
  0    000000000    0    00    0  
_/ \__/closefile\__/ \__/fo\__/ \_
 \_/  \_________/  \_/  \__/  \_/ 
  0    000    0    00000000    0  
_/ \__/end\__/ \__/function\__/ \_
 \_/  \___/  \_/  \________/  \_/ 
  0    00000000    0    0000000000    0    0000    0    0  
_/ \__/function\__/ \__/objmap.map\__/(\__/dat$\__/)\__/ \_
 \_/  \________/  \_/  \__________/  \_/  \____/  \_/  \_/ 
  0    000    0    00000    0    00000    0    000    0    0    0  
_/ \__/dat\__/=\__/lower\__/(\__/clean\__/(\__/dat\__/)\__/)\__/ \_
 \_/  \___/  \_/  \_____/  \_/  \_____/  \_/  \___/  \_/  \_/  \_/ 
  0    0    0    000    0    000    0    0  
_/ \__/l\__/=\__/len\__/(\__/dat\__/)\__/ \_
 \_/  \_/  \_/  \___/  \_/  \___/  \_/  \_/ 
  0    000    0    0    0    0  
_/ \__/out\__/=\__/"\__/"\__/ \_
 \_/  \___/  \_/  \_/  \_/  \_/ 
  0    00    0    0    0  
_/ \__/fs\__/=\__/1\__/ \_
 \_/  \__/  \_/  \_/  \_/ 
  0    00000    0    000    0    000    0  
_/ \__/m.map\__/=\__/new\__/ \__/map\__/ \_
 \_/  \_____/  \_/  \___/  \_/  \___/  \_/ 
  0    0    0    000    0    000    0  
_/ \__/m\__/\\__/dat\__/=\__/dat\__/ \_
 \_/  \_/  \_/  \___/  \_/  \___/  \_/ 
  0    000    0    0    0    0    0    00    0    0    0    00000000    0    000000    0    0000    0    0000    0  
_/ \__/for\__/ \__/j\__/=\__/1\__/ \__/to\__/ \__/l\__/ \__/;examine\__/ \__/single\__/ \__/char\__/ \__/seps\__/ \_
 \_/  \___/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \_/  \_/  \________/  \_/  \______/  \_/  \____/  \_/  \____/  \_/ 
  0    00    0    000    0    0    000    0    0    0    0    0    0  
_/ \__/c$\__/=\__/mid\__/(\__/ \__/dat\__/,\__/j\__/,\__/1\__/)\__/ \_
 \_/  \__/  \_/  \___/  \_/  \_/  \___/  \_/  \_/  \_/  \_/  \_/  \_/ 
  0    00    0    00000    0    0    0    0  
_/ \__/if\__/ \__/issep\__/(\__/c\__/)\__/ \_
 \_/  \__/  \_/  \_____/  \_/  \_/  \_/  \_/ 
  0    00    0    0    0    00    0    0    0  
_/ \__/if\__/ \__/j\__/-\__/lj\__/>\__/1\__/ \_
 \_/  \__/  \_/  \_/  \_/  \__/  \_/  \_/  \_/ 
  0    0000    0    00000    0    000    0    0    000    0    00    0    0    0    0    0    00    0    0    0    0    0  
_/ \__/obj$\__/=\__/lower\__/(\__/mid\__/(\__/ \__/dat\__/,\__/lj\__/+\__/1\__/,\__/j\__/-\__/lj\__/-\__/1\__/)\__/)\__/ \_
 \_/  \____/  \_/  \_____/  \_/  \___/  \_/  \_/  \___/  \_/  \__/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \_/  \_/  \_/  \_/ 
  0    00000000    0    0    000    0    00000    0  
_/ \__/nc.chunk\__/ \__/=\__/new\__/ \__/chunk\__/ \_
 \_/  \________/  \_/  \_/  \___/  \_/  \_____/  \_/ 
  0    00    0    000    0    000    0  
_/ \__/nc\__/\\__/map\__/=\__/obj\__/ \_
 \_/  \__/  \_/  \___/  \_/  \___/  \_/ 
  0    0    0    0    0    0    0    00    0    0    00    0  
_/ \__/m\__/\\__/c\__/[\__/m\__/\\__/cc\__/]\__/=\__/nc\__/ \_
 \_/  \_/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \_/  \__/  \_/ 
  0    0    0    00    0    0    0    00    0    0    0  
_/ \__/m\__/\\__/cc\__/=\__/m\__/\\__/cc\__/+\__/1\__/ \_
 \_/  \_/  \_/  \__/  \_/  \_/  \_/  \__/  \_/  \_/  \_/ 
  0    00000    0  
_/ \__/endif\__/ \_
 \_/  \_____/  \_/ 
  0    00    0    0    0  
_/ \__/lj\__/=\__/j\__/ \_
 \_/  \__/  \_/  \_/  \_/ 
  0    0  
_/ \__/ \_
 \_/  \_/ 
  0    00000000    0    0    000    0    00000    0  
_/ \__/nc.chunk\__/ \__/=\__/new\__/ \__/chunk\__/ \_
 \_/  \________/  \_/  \_/  \___/  \_/  \_____/  \_/ 
  0    00    0    000    0    0    0  
_/ \__/nc\__/\\__/map\__/=\__/c\__/ \_
 \_/  \__/  \_/  \___/  \_/  \_/  \_/ 
  0    00    0    00000    0    0000    0  
_/ \__/nc\__/\\__/issep\__/=\__/true\__/ \_
 \_/  \__/  \_/  \_____/  \_/  \____/  \_/ 
  0    0    0    0    0    0    0    00    0    0    00    0  
_/ \__/m\__/\\__/c\__/[\__/m\__/\\__/cc\__/]\__/=\__/nc\__/ \_
 \_/  \_/  \_/  \_/  \_/  \_/  \_/  \__/  \_/  \_/  \__/  \_/ 
  0    0    0    00    0    0    0    00    0    0    0  
_/ \__/m\__/\\__/cc\__/=\__/m\__/\\__/cc\__/+\__/1\__/ \_
 \_/  \_/  \_/  \__/  \_/  \_/  \_/  \__/  \_/  \_/  \_/ 
  0    0000    0  
_/ \__/else\__/ \_
 \_/  \____/  \_/ 
  0    00000    0  
nSwi("print","printf")

;-[Consts]
Const Max_Lines =5000

;-[]
Type Sep
	Field dat$
End Type

Type scope
	Field scopeType ;In most cases we can blindly assume
	Field m.map[ Max_Lines],mc
	Field sub.scope[2555],sc
	Field name$
End Type
Const Scope_Main=1,Scope_Function =2,Scope_Class=3

Type chunk
	Field real$,isSep
	Field map$,entry
    Field C_Name$,amb ;ambiguity flag. Nice..
	Field ext$ ;Extra dat field, for code operations.
End Type

Type map
	Field c.chunk[2555],cc
	Field dat$
End Type
Type code
	Field m.map[ Max_Lines],mc
	Field file$
End Type



Main.scope=New scope


;-define seperators
nSep("*"):nSep("(")
nSep(")"):nSep("/")
nSep(","):nSep("'")
nSep(":"):nSep("*")
nSep("-"):nSep("(")
nSep(")"):nSep("+")
nSep("<"):nSep("[")
nSep("]"):nSep(Chr(34))
nSep(">"):nSep("\")
nSep(" "):nSep("->")
nsep("="):nRes("function")
nRes("if")
fScop.scop=nScop( "function")
cScop.scop=nScop( "class")
tScop.scop=nScop("type")


;test.code=loadCode("helloworld.vnx")
test.code=loadCode("vCom.bb")
code_toCpp(test)

code_toConsoleApp(test,"SimpleTest.txt")
debug_code(test,"DebugPrisim.txt")

;objMap("function(test,nope  )")
;lM.map=genMap("if a->2 then b=(5*6)+2",map)


WaitKey

End
Function nSep(c$)
	s.sep=New sep
	s\dat=c
End Function

Function genMap(real$,map$)
	
End Function

Function loadCode.code( file$)
	fo=ReadFile(file)
	If Not fo Return
	out.code=New code
	While Not Eof(fo)
		dat$=ReadLine( fo)
		If Len(dat)>2
			m.map=objMap(dat)
			out\m[out\mc]=m
			out\mc=out\mc+1
		EndIf
	Wend
	Print "Loaded >"+out\mc+" Lines of raw code"
	CloseFile fo
	Return out
End Function

;--C++ Back end.

Global l_file,l_life
Function code_toConsoleAPP(in.code,file$)
	fo=WriteFile(file)
	l_life=fo
	If Not fo Return
	write_ConsoleHeaderC()
	write_codeC(in)
	write_consoleFooterC()
	CloseFile fo
End Function

Function write_codeC(in.code)
	For j=0 To in\mc-1
		out$=""
		For k=0 To in\m[j]\cc-1
			out=out+in\m[j]\c[k]\c_name
		Next
		WriteLine l_life,out
	Next
End Function

Function write_ConsoleHeaderC()
	WriteLine l_life,"#include <stdio.h>"
	WriteLine l_life,"int main(){"
End Function

Function write_consoleFooterC()
	WriteLine l_Life,"    return 0; /* Program termination. */"
	WriteLine l_life,"}"
End Function


Function code_toWindowApp(in.code)

End Function

Function code_toCPP( in.code)
	For j=0 To in\mc-1
		m.map=in\m[j]
		amb=False
		amb_m$=""
	        For k=0 To m\cc-1

			c.chunk=m\c[k]
			map$=c\map
			If c\isSep
				;-raw data enclapsulators
				If amb
					Select map
						Case Chr(34)
							If map=amb_m
								amb=False
								amb_m=""
							EndIf
					End Select
				Else
					Select map
						Case Chr(34)
							amb=True
							amb_m$=map
							over_amb=True
					End Select
				EndIf
				c\c_name=map
			Else
				c\c_name=map
				If isRes( map)
					
				Else
					c\c_name=switch(map)
				EndIf
			
			EndIf
			If amb
				If over_amb
					over_amb=0
				Else
					c\c_name=map
					c\amb=True
				EndIf
			EndIf
		Next
	Next
	;-- Scope Set up.
	main.scope=New scope
	main\scopeType=scope_main
	feedScope(main,in)
	debug_scope(main,"Scope_Debug.txt")
End Function

Function feedScope(base.scope,c.code,from=0,endAt$="")
Print "Scope From >"+from
	For j=from To c\mc-1
		.redo
		If j=>c\mc Exit
		m.map=c\m[j]
		Print "Obj Line"
		
		For k=0 To m\cc-1
			a.chunk=m\c[k]
			n.chunk=nObj(m,k) 
			p.chunk=nObj(m,k)
			If isScop(a\map) And j<>from And a\amb=False;Can't scope into thyself.
				ns.scope=New scope
				base\sub[base\sc]=ns
				base\sc=base\sc+1
				If  n<>Null
					Print "Scope Called >"+n\map
					ns\name=n\map
				Else
					Print "Warning -? Nameless Scope"
					ns\name="None specified"
				EndIf
				j=feedScope( ns,c,j,a\map)
				Goto redo
			Else
				;-determine if exit point.
				Select a\map
					Case "end"
						If n<>Null
						Select n\map
								Case endAt
									exitScope=True
									Exit ;no need to parse on. anything else is excess.
						End Select
						EndIf
				End Select
				;---
			EndIf
		Next
		base\m[base\mc]=m
		base\mc=base\mc+1
		If exitScope Return j+1
	Next
	If from>0
		Stop
		Print "Compile Error"
		Print endAt+" Without end "+endAt
	EndIf
	Print "Scope Out"
	Return j
End Function

Function debug_scope(base.scope,file$,debugSubs=True,useFile=0,pad$="--")
	If Not useFile
		 fo=WriteFile( file)
    	If Not fo Return
	Else
		 fo=useFile
	EndIf
	WriteLine fo,pad+"Scope Name:"+base\name
	WriteLine fo,pad+"Obj Maps:"+base\mc
	For j=0 To base\mc-1
		out$=""
		For k=0 To base\m[j]\cc-1
			out=out+base\m[j]\c[k]\map
		Next
		WriteLine fo,pad+"["+out
	Next
	WriteLine fo,String("/\",Len(pad))
	 If debugSubs
	 	For j=0 To base\sc-1
	 		debug_scope( base\sub[j],file,True,fo,pad+"--")
		Next
	 EndIf
	 If Not useFile
	 	CloseFile fo
	 EndIf
End Function


Function nObj.chunk( m.map,from=0)
	from=from+1
	If from=>m\cc Return 
	For j=from To m\cc-1
		If Not m\c[j]\isSep Return m\c[j]
	Next
End Function

Function pOIbj.chunk( m.map,from=0)
	from=from-1
	If from<0 Return 
	For j=from To 0 Step -1
		If Not m\c[j]\isSep Return m\c[j]
	Next
End Function



Type switch
	Field from$,go$
End Type

Function nswi(from$,go$)
	s.switch=New switch
	s\from=from
	s\go=go
End Function

Function switch$(dat$)
	For s.switch=Each switch
		If dat=s\from Return s\go
	Next
	Return dat
End Function


Function debug_code( in.code,file$)
	fo=WriteFile(file)
	If Not fo Return
	For j=0 To in\mc-1
		out$=""
		For k=0 To in\m[j]\cc-1
			out=out+"  "+String(in\m[j]\c[k]\amb,Len(in\m[j]\c[k]\c_name))+"  "
		Next
		
		
		WriteLine fo,out
		
		out$=""
		For k=0 To in\m[j]\cc-1
			out=out+"_/"+in\m[j]\c[k]\c_name+"\_"
		Next
		WriteLine fo,out
		out=""
		For k=0 To in\m[j]\cc-1
			out=out+" \"+String("_",Len(in\m[j]\c[k]\c_name))+"/ "
		Next
		WriteLine fo,out
	Next
	CloseFile fo
End Function



Function objMap.map(dat$)
	Dat=Lower(clean(dat))
	l=Len(dat)
	out=""
	fs=1
	m.map=New map
	m\dat=dat
	For j=1 To l ;examine single char seps
		c$=Mid( dat,j,1)
		If isSep(c)
			If j-lj>1
				obj$=Lower(Mid( dat,lj+1,j-lj-1))
				nc.chunk =New chunk
				nc\map=obj
				m\c[m\cc]=nc
				m\cc=m\cc+1
			EndIf
			lj=j
			
				nc.chunk =New chunk
				nc\map=c
				nc\isSep=True
				m\c[m\cc]=nc
				m\cc=m\cc+1
		
		Else
		
		EndIf
	Next
	Return m
End Function

Function isSep(v$)
For s.sep=Each sep
	If v=s\dat Return True
Next
End Function

;-[ Simple Example prisim operation. A simple text compression algo]

Function CompressCode(in.code,out$)
;-compression phase
fo=WriteFile( out)
If Not fo Return
Local cache$[25000],cc ;temp string buffer.
	For j=0 To in\mc-1
		m.map=in\m[j]
		For k=0 To m\cc-1
			dat$=m\c[k]\map
				linkTo=-1
		
		
			For a=0 To cc-1
				If cache[a]=dat
					linkTo=a
					Exit
				EndIf
			Next
				If linkTo=-1
					cache[cc]=dat
					cc=cc+1
				EndIf
	
			If linkTo>-1
				WriteByte fo,1
	    		WriteInt fo,linkTo
			Else
				WriteByte fo,0
				WriteString fo,dat
			EndIf
		Next
	Next
	CloseFile fo
End Function


Function clean$(dat$)
	out$=dat
	Return " "+Trim(out)+" "
End Function

Type res
	Field dat$
End Type
Type scop ;scope indentifier only.
	Field dat$
	Field moveMode
End Type

Const move_Up=1,move_Down=2


Function nScop.scop(txt$)
	s.scop=New scop
	s\dat=txt
	Return s
End Function
Function scopMove(n.scop,move)
    n\moveMode=move
End Function

Function isScop(txt$)
	For s.scop=Each scop
		If s\dat=txt Return True
	Next
	Return False
End Function

Function nRes(txt$)
	n.res=New res
	n\dat=Lower(txt)
End Function

Function isRes(txt$)
	For n.res= Each res
	   If n\dat=txt Return True
	Next
End Function

Comments

Rook Zimbabwe2006
interesting output... makes my eyes water


Code Archives Forum