hi guy`s ,
can someone tell me where can i find the scanner and parser source codes ?!!
scanner (take a character and convert it to tokens)
parser (take the tokens and convert it to parse tree)
hi guy`s ,
can someone tell me where can i find the scanner and parser source codes ?!!
scanner (take a character and convert it to tokens)
parser (take the tokens and convert it to parse tree)
You'll find it all in the header described in this post. Instead of using disk, you'll need to subsitute scanner and parser.
Quzah.
Hope is the first step on the road to disappointment.
no that`s not what i mean !
i mean like this : http://www.mattababy.org/~belmonte/T.../CCC/scanner.c
but i need a full scanner.c that recognize if/else/while/void/int/return that`s enough ..
and i couldn`t find the parser !! can someone help me to find it source code ?
> can someone help me to find it source code ?
I looked underneath my chair - nothing.
Have you considered actually trying to do the work yourself rather than merely competing with your class-mates to see who has the best google skills.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
GNU Bison and Flex. Probably more than you need*. Good luck.
Heh, magic scanner/parser. Which reminds me...
Attachment 7010
* And probably more than he can handle, too.
Last edited by jafet; 11-17-2006 at 06:57 AM.
Code:#include <stdio.h> void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){ puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9 /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i] ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][ t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}
i want to learn and read the code , this things have no related with what you talking about Salem ..
and about the way i am a medical student not a computer science student ??!!!
quite interesting.Originally Posted by Meshal
Why do medical student need a parser which parses a code
ssharish2005
Yeah, like we haven't heard the "But I need one to compare with the one I've written" before.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
i am interesting in computers espescially in programming and i like to learn C and be a prof. on it , and i want to know how scanner / parser be programmed !!
So start with the basics and work your way up like everyone else.
Sure, you might find a scanner which does what you want, but how would you know whether it was "good C" to learn from?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.