954,483 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

The FLEX module

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.

QuesoTaco
Newbie Poster
12 posts since Nov 2010
Reputation Points: 10
Solved Threads: 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 .

gusano79
Posting Pro
519 posts since May 2004
Reputation Points: 182
Solved Threads: 77
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: