Babble

Posted by s on Sept. 7, 2008, 9:59 a.m.

in.txtint main(int argc,char *argv[]){

//Older version, rewrote it to be nicer

std::ofstream fw("out.txt")

std::ifstream fr("in.txt",std::ios::ate);int flen=fr.tellg();fr.seekg(0,std::ios::beg)

char *data=new char[flen]

v=0;while(fr.good()) data[v++]=fr.get()

data[v-1]=0

int para=0,brac=0,quot=0

v=0;while(data[++v]!=0):

. if((data[v]==''||data[v]=='")&&data[v-1]!='\) quot=!quot

. if quot==0:

. . brac+=(data[v]=='{)-(data[v]=='})

. . para+=(data[v]=='()-(data[v]=='))

. if(data[v]=='\n&&brac==0&&para==0&&data[v-1]!=';) fw<<";"

. fw<<data[v]

fw.close();fr.close()

system("start out.txt")

return 0;}

out.txt

int main(int argc,char *argv[]){

std::ofstream fw(`s);

std::ifstream fr(`s,std::ios::ate);int flen=fr.tellg();fr.seekg(0,std::ios::beg);

char *data=new char[flen];

v=0;while(fr.good()) data[v++]=fr.get();

data[v-1]=0;

int para=0,brac=0,quot=0;

v=0;while((data[++v]!=0)){

if((data[v]==((char)039)||data[v]==((char)034))&&data[v-1]!=((char)092)) quot=!quot;

if(quot==0){

brac+=(data[v]==((char)123))-(data[v]==((char)125));

para+=(data[v]==((char)040))-(data[v]==((char)041));}

if(data[v]==((char)092)n&&brac==0&&para==0&&data[v-1]!=((char)059)) fw<<`s;

fw<<data[v];}

fw.close();fr.close();

system(`s);

return 0;}

out.txtin.txt;start out.txt

Soon enough, syntax will be mine

mwhahahaaaaaaaa

Ya, I should probably write about thoughtful zombies instead of resyntaxers

Comments

frenchcon1 16 years, 3 months ago

Probably.

s 16 years, 3 months ago

What if I…put it in parser friendly format?

int main ( int argc , char * argv [ ] ) {

std::ofstream fw ( "" ) ;

std::ifstream fr ( "" , std::ios::ate ) ; int flen = fr.tellg ( ) ; fr.seekg ( 0 , std::ios::beg ) ;

char * data = new char [ flen ] ;

v = 0 ; while ( ( fr.good ( ) ) ) data [ v ++ ] = fr.get ( ) ;

data [ v - 1 ] = 0 ;

int para = 0 , brac = 0 , quot = 0 ;

v = 0 ; while ( ( data [ ++ v ] != 0 ) ) {

if ( ( data [ v ] == ( ( char ) 039 ) || data [ v ] == ( ( char ) 034 ) ) && data [ v - 1 ] != ( ( char ) 092 ) ) quot =! quot ;

if ( quot == 0 ) {

brac += ( data [ v ] == ( ( char ) 123 ) ) - ( data [ v ] == ( ( char ) 125 ) ) ;

para += ( data [ v ] == ( ( char ) 040 ) ) - ( data [ v ] == ( ( char ) 041 ) ) ; }

if ( data [ v ] == ( ( char ) 092 ) n && brac == 0 && para == 0 && data [ v - 1 ] != ( ( char ) 059 ) ) fw << "" ;

fw << data [ v ] ; }

fw.close ( ) ; fr.close ( ) ;

system ( "" ) ;

return 0 ; }

out.txtin.txt;start out.txt

int main(int argc,char *argv[]){

std::ofstream fw("")

std::ifstream fr("",std::ios::ate);int flen=fr.tellg();fr.seekg(0,std::ios::beg)

char *data=new char[flen]

v=0;while(fr.good()):data[v++]=fr.get()

data[v-1]=0

int para=0,brac=0,quot=0

v=0;while(data[++v]!=0):

. if((data[v]==''||data[v]=='")&&data[v-1]!='\) quot=!quot

. if quot==0:

. . brac+=(data[v]=='{)-(data[v]=='})

. . para+=(data[v]=='()-(data[v]=='))

. if(data[v]=='\n&&brac==0&&para==0&&data[v-1]!=';) fw<<""

. fw<<data[v]

fw.close();fr.close()

system("")

return 0;}

I decided to be destructive and work on the input data before transfering/converting it to the code data

Also, the greatness of space based tokenization has allowed for !! to be complete

PY 16 years, 3 months ago

resyntaxers just take somebody elses hard work and make it prettier.

Resyntaxers are thieves!!