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 -f representation. no compression, no problem.
  • -CF β€” do not compress tables; use -F representation. also no compression, different rep. iykyk.
  • -Cm, --meta-ecs β€” construct meta-equivalence classes. meta. so meta. πŸ¦‹
  • -Cr, --read β€” use read() 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 to lex.backup. receipts!! 🧾
  • -p, --perf-report β€” write performance report to stderr. she's telling you how she did. 🌟
  • -s, --nodefault β€” suppress default rule to ECHO unmatched 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 to stdout. 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 on stdout instead of lex.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. A and a? same thing to her. 😌
  • -l, --lex-compat β€” maximal compatibility with original lex. honoring her ancestors. 🫢
  • -X, --posix-compat β€” maximal compatibility with POSIX lex. 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 in yylineno. 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] β€” #define macro defn (default defn is '1'). classic define moment.
  • -L, --noline β€” suppress #line directives 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 β€” include yylloc support. locations?? we have locations now. πŸ“
  • --stdinit β€” initialize yyin/yyout to stdin/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