Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
i have a 4 part assignment that is to write
[1:lexical analyzer][2:parser][3:symbol table][4:simulator]
these have to be built using modules? my lex will read in a .txt file that contains int i;
int n = 4 ;
float sum ;
for ( i = 0 ; i < n ; i = i + 1 )
sum = sum + 1 ;
i can read this from a .txt file to the screen; but i am pretty sure that inorder to move to the next step, i need to tokenize each character. that is the first problem. i can use whitespace as my delimeter. once the file is tokenized i need to pass it as a module to a state machine for parsing.
i am stuck. if i could get help with the creation of the tokens i would be off to a better start.