Posts Tagged ‘start state’

Implementing the “include” directive to support nested input files.

May 11, 2014 Leave a comment

Many programming languages and computer files have a directive, often called “include” (as well as “copy” and “import”), that causes the contents of a second file to be inserted into the original file. These included files are called copybooks or header files. They are often used to define the physical layout of program data, pieces of procedural code and/or forward declarations while promoting encapsulation and the reuse of code.

Read more…

Ignoring multiline comments with start states in compilers with Flex.

May 10, 2014 Leave a comment

In a previous article I have presented a way for ignoring multiline comments with an old fashion way.

In this article I’ll demonstrate a more elegant Flex-like way for ignoring multiline comments.

Read more…