FLEX(1)
π FLEX(1) β the flex manual page, bestie edition π
okay so you're looking at flex(1), the programming-section manual page, and honestly? she's an icon. let's get into it. β¨
πΈ NAME πΈ
flex β the fast lexical analyser generator. that's it, that's the whole vibe. lexical analyser generator π¦
π SYNOPSIS π
flex [OPTIONS] [FILE]...
like. you give her options, you give her files, she does her thing. periodt. π
β¨ DESCRIPTION β¨
flex generates programs that perform pattern-matching on text. no cap. that's literally the entire job description. π
π Table Compression π
this is where you decide how big and how cute the tables are gonna be. it's giving "choose your fighter".
-Ca,--alignβ trade off larger tables for better memory alignment. bigger tables, but they line up pretty. π-Ce,--ecsβ construct equivalence classes. yes bestie, classes. for equivalence. β¨-Cfβ do not compress tables; use-frepresentation. no compression, no problem.-CFβ do not compress tables; use-Frepresentation. also no compression, different rep. iykyk.-Cm,--meta-ecsβ construct meta-equivalence classes. meta. so meta. π¦-Cr,--readβ useread()instead of stdio for scanner input. raw input energy, lowkey.-f,--fullβ generate fast, large scanner. Same as-Cfr. fast AND large, she contains multitudes. π₯-F,--fastβ use alternate table representation. Same as-CFr. alternate. mysterious. iconic.-Cemβ default compression (same as--ecs --meta-ecs). the default, so she's already slaying without you asking. π
π Debugging π
when things are weird and you need to know why. not me spiraling over a scanner bug π
-d,--debugβ enable debug mode in scanner. turn the lights on bestie π‘-b,--backupβ write backing-up information tolex.backup. receipts!! π§Ύ-p,--perf-reportβ write performance report tostderr. she's telling you how she did. π-s,--nodefaultβ suppress default rule toECHOunmatched text. unmatched text gets NO screen time. π-T,--traceβ flex should run in trace mode. following her every move, respectfully. π-w,--nowarnβ do not generate warnings. no thoughts, no warnings, just vibes. π-v,--verboseβ write summary of scanner statistics tostdout. stats!! we love stats!! π--hexβ use hexadecimal numbers instead of octal in debug outputs. hex girl era. π’
πΈ FILES πΈ
(and also, apparently, a bunch of output-ish options. the manpage said FILES, so FILES it is. i don't make the rules. π«Ά)
-o,--outfile=FILEβ specify output filename. tell her where to put it. π-S,--skel=FILEβ specify skeleton file. spooky. structural. slay. πβ¨-t,--stdoutβ write scanner onstdoutinstead oflex.yy.c. to the terminal, to the people. π’--yyclass=NAMEβ name of C++ class. name her, bestie. π--header-file=FILEβ create a C header file in addition to the scanner. plus one header, as a treat. π--tables-file[=FILE]β write tables to FILE. tables but make it a file.--backup-file=FILEβ write backing-up information to FILE. backup lore goes here. π§Ύ
π Scanner behavior π
how she acts. her personality, if you will. main character energy fr fr.
-7,--7bitβ generate 7-bit scanner. seven bits, tiny queen. π§-8,--8bitβ generate 8-bit scanner. eight bits, bigger queen. π-B,--batchβ generate batch scanner (opposite of-I). batch mode, no chit-chat.-i,--case-insensitiveβ ignore case in patterns.Aanda? same thing to her. π-l,--lex-compatβ maximal compatibility with originallex. honoring her ancestors. π«Ά-X,--posix-compatβ maximal compatibility with POSIXlex. posix said so, so it's law. π-I,--interactiveβ generate interactive scanner (opposite of-B). she wants to talk to you. π¬--yylinenoβ track line count inyylineno. keeping count. always. π’
π¦ Generated code π¦
the stuff she spits out. her art. her legacy.
-+,--c++β generate C++ scanner class. c plus plus, extra plus, extra slay. π₯-Dmacro[=defn]β#definemacro defn (default defn is'1'). classic define moment.-L,--nolineβ suppress#linedirectives in scanner. no line directives, no problem. π«-P,--prefix=STRINGβ use STRING as prefix instead of"yy". rebranding! you get to pick the name. β¨-R,--reentrantβ generate a reentrant C scanner. she can be called again. and again. and again. π--bison-bridgeβ scanner for bison pure parser. bridging the gap, literally. π--bison-locationsβ includeyyllocsupport. locations?? we have locations now. π--stdinitβ initializeyyin/yyouttostdin/stdout. she starts where the streams are.--nounistdβ do not include<unistd.h>. leave that header at home. π--noFUNCTIONβ do not generate a particular FUNCTION. no FUNCTION for you. π
π Miscellaneous π
the lil extras. the sprinkles on top. π
-cβ do-nothing POSIX option. literally does nothing. iconic for that honestly. π-nβ do-nothing POSIX option. also nothing. two nothing queens. π―-?β (yes, that's an option. just-?. she's mysterious like that.)-h,--helpβ produce this help message. help is here!! π-V,--versionβ report flex version. what version is she? find out. π
π SEE ALSO π
The full documentation for flex is maintained as a Texinfo manual. If the info and flex programs are properly installed at your site, the command
info flex
should give you access to the complete manual. like, the complete complete manual. the director's cut. π¬
that's the whole page, bestie π written by The Flex Project, dated April 2024, and now go forth and generate a lexical analyser, you absolute legend π¦β¨π
π¦ where this page comes from
- ubuntu noble: flex 2.6.4-8.2build1 Β· FLEX
- ubuntu questing: flex 2.6.4-8.2build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms