views:

144

answers:

2

lex and yacc are supposed to be used together.

Which ones is the scanner and which one is the parser?

Which one creates a scanner and which one creates a parser?

+2  A: 

Lex (flex) is the lexical scanner. Yacc (bison) is the LALR parser generator.

Nic Strong
So lex scans, and yacc creates a parser (it is not a parser itself.)
Phenom
Correct. Lex generates tokens that are consumed by the parser generated from the yacc grammer.
Nic Strong
+1  A: 

You will find that Wikipedia has excellent answers on all of these software tools and will explain them clearly and concisely. It's often the best place to start when you want a clear answer to a standard question. Here is http://en.wikipedia.org/wiki/Lex%5F%28software)

In computer science, lex is a program that generates lexical analyzers ("scanners" or "lexers").[1] Lex is commonly used with the yacc parser generator.

And there is a lot more

peter.murray.rust