![]() ![]() ![]() file.l) is added as input to a lexical analyzer, which is converted into a stream of tokens as output, A C program(.c file). The Lexical analysis phase attempts to convert strings to tokens.In technical terms lex converts regular expression specifications into C implementation of a corresponding finite state machine, the C program is later compiled and executed to produce a lexical analyzer. In this article, The lexical analysis phase is of primary interest to us. The third layer is the code generator phase, here the syntax tree is converted to the generated code. The second layer is the syntax analysis phase, here the tokens are converted into a syntax tree, using the yacc tool. The first layer is the lexical analysis phase, where a tool called lex is used to convert the given string into tokens. When a source code is entered ,it goes through three layers of logical treatment. Ī Compilation process is a long and complicated procedure. These utilities greatly simplified compiler writing. Prior to the year 1975 designing a compiler was a tedious ordeal which is when Lesk and Johnson published their work on lex and yacc. Lex accomplishes this task using regular expressions. While in the Lexical Analysis Phase it is required that tokens be recognized. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |