| Rev | Author | # | Line |
|---|---|---|---|
| 1 | AristotlePagaltzis | 1 | An [Acronym] for __f__ast __lex__ical analyzer generator. |
| 2 | |||
| 3 | [Flex] is used to generate [C] programs that perform pattern matching on text. It produces a single __lex.yy.c__ file which defines a single __yylex()__ function, which can compiled and linked with __libfl__ to produce an executable that analyzes its input for occurrences of regular expresÂsions. Whenever it finds one, it executes the correspondÂing C code. | ||
| 4 | |||
| 5 | It is usually used in conjunction with [Bison]. The [Flex] code then passes the tokens it finds to the yacc(1) style parser generated by [Bison]. | ||
| 6 | |||
| 7 | As a completely spurious example this is what the rules file could look like: | ||
| 8 | |||
| 9 | %{ | ||
| 10 | #include <string.h> | ||
| 11 | %} | ||
| 12 | |||
| 13 | MATCHBOB "bob"|"BOB" | ||
| 14 | |||
| 4 | KarlBriscoe | 15 | %% |
| 16 | /* pattern action */ | ||
| 17 | |||
| 18 | {MATCHBOB} {printf("bob has been found!);} | ||
| 19 | |||
| 20 | %% | ||
| 1 | AristotlePagaltzis | 21 | |
| 22 | /*user supplied functions */ | ||
| 5 | StuartYeates | 23 | |
| 24 | See also: flex(1) lex(1) bison(1) yacc(1) |
lib/plugin/WlugLicense.php (In template 'html'):99: Warning: Invalid argument supplied for foreach()
lib/plugin/WlugLicense.php (In template 'html'):111: Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument