0

I am studying viruses and trying to figure out how the FLEX module works for C++. I have taken classes before on regular languages, context free, etc. Is FLEX dealing with regular languages or regular expressions, and also what is the difference exactly? Could you give an example of how a flex program works and or point me to a link that does? How it integrates with C++? I am trying to use it to scan for particular code in viruses as a parser.

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by gusano79
0

Is FLEX dealing with regular languages or regular expressions, and also what is the difference exactly?

A regular language is, by one of many definitions, a formal language that can be described by a regular expression. Regular expressions are a convenient way to describe a regular language without having to specify all of the sequences that are in the language. This is convenient when the language is infinite.

Flex generates code that checks an input stream to see if it matches any one of a list of regular expressions.

Could you give an example of how a flex program works and or point me to a link that does? How it integrates with C++?

The Flex manual is a good place to start; it has some simple examples near the start.

Flex generates a C source file with the scanner definition and assorted support code. This should work with a C++ program as is, but there is also experimental support for generating a C++ scanner.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.