Professional Documents
Culture Documents
Cod Lab Assignment
Cod Lab Assignment
1. Analyzetheobjectcode
2. DownloadandanalyzetheFlextool
3. WriteaC/C++/JavaprogramtotokenizethesimpleHelloWorldprogramofClanguage.First
of all, define the token for this program. The original program should necessarily include few
comments. Display the tokens by removing all the comments, i.e., the comments should be
ignored for tokenization. No predefined function for tokenization is allowed. Assume the
s i t u a t i o n s , w i t h a n d w i t h o u t s p a c e b e t w e e n t h e t o k e n s i n t h e p r o g r a m .
SampleI/PinPython
SampleLexicaloutput
print(3+x*2)#comment
(keyword,"print")
(delim,"(")
(int,3)
(punct,"+")
(id,"x")
(punct,"*")
(int,2)
(delim,")")