{
    "content": [
        {
            "type": "text",
            "text": "# flex (man)\n\n## NAME\n\nflex - the fast lexical analyser generator\n\n## SYNOPSIS\n\nflex [OPTIONS] [FILE]...\n\n## DESCRIPTION\n\nGenerates programs that perform pattern-matching on text.\n\n## TLDR\n\n> Lexical analyzer generator.\n\n- Generate an analyzer from a Lex file, storing it to the file `lex.yy.c`:\n  `flex {{analyzer.l}}`\n- Write analyzer to `stdout`:\n  `flex {{-t|--stdout}} {{analyzer.l}}`\n- Specify the output file:\n  `flex {{analyzer.l}} {{-o|--outfile}} {{analyzer.c}}`\n- Generate a batch scanner instead of an interactive scanner:\n  `flex {{-B|--batch}} {{analyzer.l}}`\n- Compile a C file generated by Lex:\n  `cc {{path/to/lex.yy.c}} -o {{executable}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (18 subsections)\n- **FILES** (27 subsections)\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "flex",
        "section": "",
        "mode": "man",
        "summary": "flex - the fast lexical analyser generator",
        "synopsis": "flex [OPTIONS] [FILE]...",
        "tldr_summary": "Lexical analyzer generator.",
        "tldr_examples": [
            {
                "description": "Generate an analyzer from a Lex file, storing it to the file `lex.yy.c`",
                "command": "flex {{analyzer.l}}"
            },
            {
                "description": "Write analyzer to `stdout`",
                "command": "flex {{-t|--stdout}} {{analyzer.l}}"
            },
            {
                "description": "Specify the output file",
                "command": "flex {{analyzer.l}} {{-o|--outfile}} {{analyzer.c}}"
            },
            {
                "description": "Generate a batch scanner instead of an interactive scanner",
                "command": "flex {{-B|--batch}} {{analyzer.l}}"
            },
            {
                "description": "Compile a C file generated by Lex",
                "command": "cc {{path/to/lex.yy.c}} -o {{executable}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "",
                "long": "--align",
                "arg": null,
                "description": "trade off larger tables for better memory alignment"
            },
            {
                "flag": "",
                "long": "--ecs",
                "arg": null,
                "description": "construct equivalence classes"
            },
            {
                "flag": "-f",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-F",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--meta-ecs",
                "arg": null,
                "description": "construct meta-equivalence classes"
            },
            {
                "flag": "",
                "long": "--read",
                "arg": null,
                "description": "use read() instead of stdio for scanner input"
            },
            {
                "flag": "-f",
                "long": "--full",
                "arg": null,
                "description": "generate fast, large scanner. Same as -Cfr"
            },
            {
                "flag": "-F",
                "long": "--fast",
                "arg": null,
                "description": "use alternate table representation. Same as -CFr"
            },
            {
                "flag": "",
                "long": "--meta-ecs",
                "arg": null,
                "description": ""
            },
            {
                "flag": "-d",
                "long": "--debug",
                "arg": null,
                "description": "enable debug mode in scanner"
            },
            {
                "flag": "-b",
                "long": "--backup",
                "arg": null,
                "description": "write backing-up information to lex.backup"
            },
            {
                "flag": "-p",
                "long": "--perf-report",
                "arg": null,
                "description": "write performance report to stderr"
            },
            {
                "flag": "-s",
                "long": "--nodefault",
                "arg": null,
                "description": "suppress default rule to ECHO unmatched text"
            },
            {
                "flag": "-T",
                "long": "--trace",
                "arg": null,
                "description": "flex should run in trace mode"
            },
            {
                "flag": "-w",
                "long": "--nowarn",
                "arg": null,
                "description": "do not generate warnings"
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "write summary of scanner statistics to stdout --hex use hexadecimal numbers instead of octal in debug outputs"
            }
        ],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 2,
                "subsections": [
                    {
                        "name": "Table Compression:",
                        "lines": 1
                    },
                    {
                        "name": "-Ca --align",
                        "lines": 2,
                        "long": "--align"
                    },
                    {
                        "name": "-Ce --ecs",
                        "lines": 2,
                        "long": "--ecs"
                    },
                    {
                        "name": "-Cf -f",
                        "lines": 1,
                        "flag": "-f"
                    },
                    {
                        "name": "-CF -F",
                        "lines": 1,
                        "flag": "-F"
                    },
                    {
                        "name": "-Cm --meta-ecs",
                        "lines": 2,
                        "long": "--meta-ecs"
                    },
                    {
                        "name": "-Cr --read",
                        "lines": 2,
                        "long": "--read"
                    },
                    {
                        "name": "-f --full",
                        "lines": 2,
                        "flag": "-f",
                        "long": "--full"
                    },
                    {
                        "name": "-F --fast",
                        "lines": 2,
                        "flag": "-F",
                        "long": "--fast"
                    },
                    {
                        "name": "-Cem --ecs --meta-ecs",
                        "lines": 1,
                        "long": "--meta-ecs"
                    },
                    {
                        "name": "Debugging:",
                        "lines": 1
                    },
                    {
                        "name": "-d --debug",
                        "lines": 2,
                        "flag": "-d",
                        "long": "--debug"
                    },
                    {
                        "name": "-b --backup",
                        "lines": 2,
                        "flag": "-b",
                        "long": "--backup"
                    },
                    {
                        "name": "-p --perf-report",
                        "lines": 2,
                        "flag": "-p",
                        "long": "--perf-report"
                    },
                    {
                        "name": "-s --nodefault",
                        "lines": 2,
                        "flag": "-s",
                        "long": "--nodefault"
                    },
                    {
                        "name": "-T --trace",
                        "lines": 2,
                        "flag": "-T",
                        "long": "--trace"
                    },
                    {
                        "name": "-w --nowarn",
                        "lines": 2,
                        "flag": "-w",
                        "long": "--nowarn"
                    },
                    {
                        "name": "-v --verbose",
                        "lines": 4,
                        "flag": "-v",
                        "long": "--verbose"
                    }
                ]
            },
            {
                "name": "FILES",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-o --outfile",
                        "lines": 2,
                        "flag": "-o",
                        "long": "--outfile"
                    },
                    {
                        "name": "-S --skel",
                        "lines": 2,
                        "flag": "-S",
                        "long": "--skel"
                    },
                    {
                        "name": "-t --stdout",
                        "lines": 13,
                        "flag": "-t",
                        "long": "--stdout"
                    },
                    {
                        "name": "Scanner behavior:",
                        "lines": 1
                    },
                    {
                        "name": "-7 --7bit",
                        "lines": 2,
                        "flag": "-7",
                        "long": "--7bit"
                    },
                    {
                        "name": "-8 --8bit",
                        "lines": 2,
                        "flag": "-8",
                        "long": "--8bit"
                    },
                    {
                        "name": "-B --batch",
                        "lines": 2,
                        "flag": "-B",
                        "long": "--batch"
                    },
                    {
                        "name": "-i --case-insensitive",
                        "lines": 2,
                        "flag": "-i",
                        "long": "--case-insensitive"
                    },
                    {
                        "name": "-l --lex-compat",
                        "lines": 2,
                        "flag": "-l",
                        "long": "--lex-compat"
                    },
                    {
                        "name": "-X --posix-compat",
                        "lines": 2,
                        "flag": "-X",
                        "long": "--posix-compat"
                    },
                    {
                        "name": "-I --interactive",
                        "lines": 2,
                        "flag": "-I",
                        "long": "--interactive"
                    },
                    {
                        "name": "--yylineno",
                        "lines": 2,
                        "long": "--yylineno"
                    },
                    {
                        "name": "Generated code:",
                        "lines": 3
                    },
                    {
                        "name": "-Dmacro",
                        "lines": 2
                    },
                    {
                        "name": "-L --noline",
                        "lines": 2,
                        "flag": "-L",
                        "long": "--noline"
                    },
                    {
                        "name": "-P --prefix",
                        "lines": 2,
                        "flag": "-P",
                        "long": "--prefix"
                    },
                    {
                        "name": "-R --reentrant",
                        "lines": 2,
                        "flag": "-R",
                        "long": "--reentrant"
                    },
                    {
                        "name": "--bison-bridge",
                        "lines": 2,
                        "long": "--bison-bridge"
                    },
                    {
                        "name": "--bison-locations",
                        "lines": 2,
                        "long": "--bison-locations"
                    },
                    {
                        "name": "--stdinit",
                        "lines": 2,
                        "long": "--stdinit"
                    },
                    {
                        "name": "--nounistd",
                        "lines": 2,
                        "long": "--nounistd"
                    },
                    {
                        "name": "--noFUNCTION",
                        "lines": 2,
                        "long": "--noFUNCTION"
                    },
                    {
                        "name": "Miscellaneous:",
                        "lines": 1
                    },
                    {
                        "name": "-c",
                        "lines": 1,
                        "flag": "-c"
                    },
                    {
                        "name": "-n",
                        "lines": 2,
                        "flag": "-n"
                    },
                    {
                        "name": "-h --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-V --version",
                        "lines": 2,
                        "flag": "-V",
                        "long": "--version"
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 10,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "flex - the fast lexical analyser generator\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "flex [OPTIONS] [FILE]...\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Generates programs that perform pattern-matching on text.\n",
                "subsections": [
                    {
                        "name": "Table Compression:",
                        "content": ""
                    },
                    {
                        "name": "-Ca --align",
                        "content": "trade off larger tables for better memory alignment\n",
                        "long": "--align"
                    },
                    {
                        "name": "-Ce --ecs",
                        "content": "construct equivalence classes\n",
                        "long": "--ecs"
                    },
                    {
                        "name": "-Cf -f",
                        "content": "",
                        "flag": "-f"
                    },
                    {
                        "name": "-CF -F",
                        "content": "",
                        "flag": "-F"
                    },
                    {
                        "name": "-Cm --meta-ecs",
                        "content": "construct meta-equivalence classes\n",
                        "long": "--meta-ecs"
                    },
                    {
                        "name": "-Cr --read",
                        "content": "use read() instead of stdio for scanner input\n",
                        "long": "--read"
                    },
                    {
                        "name": "-f --full",
                        "content": "generate fast, large scanner. Same as -Cfr\n",
                        "flag": "-f",
                        "long": "--full"
                    },
                    {
                        "name": "-F --fast",
                        "content": "use alternate table representation. Same as -CFr\n",
                        "flag": "-F",
                        "long": "--fast"
                    },
                    {
                        "name": "-Cem --ecs --meta-ecs",
                        "content": "",
                        "long": "--meta-ecs"
                    },
                    {
                        "name": "Debugging:",
                        "content": ""
                    },
                    {
                        "name": "-d --debug",
                        "content": "enable debug mode in scanner\n",
                        "flag": "-d",
                        "long": "--debug"
                    },
                    {
                        "name": "-b --backup",
                        "content": "write backing-up information to lex.backup\n",
                        "flag": "-b",
                        "long": "--backup"
                    },
                    {
                        "name": "-p --perf-report",
                        "content": "write performance report to stderr\n",
                        "flag": "-p",
                        "long": "--perf-report"
                    },
                    {
                        "name": "-s --nodefault",
                        "content": "suppress default rule to ECHO unmatched text\n",
                        "flag": "-s",
                        "long": "--nodefault"
                    },
                    {
                        "name": "-T --trace",
                        "content": "flex should run in trace mode\n",
                        "flag": "-T",
                        "long": "--trace"
                    },
                    {
                        "name": "-w --nowarn",
                        "content": "do not generate warnings\n",
                        "flag": "-w",
                        "long": "--nowarn"
                    },
                    {
                        "name": "-v --verbose",
                        "content": "write summary of scanner statistics to stdout\n\n--hex  use hexadecimal numbers instead of octal in debug outputs\n",
                        "flag": "-v",
                        "long": "--verbose"
                    }
                ]
            },
            "FILES": {
                "content": "",
                "subsections": [
                    {
                        "name": "-o --outfile",
                        "content": "specify output filename\n",
                        "flag": "-o",
                        "long": "--outfile"
                    },
                    {
                        "name": "-S --skel",
                        "content": "specify skeleton file\n",
                        "flag": "-S",
                        "long": "--skel"
                    },
                    {
                        "name": "-t --stdout",
                        "content": "write scanner on stdout instead of lex.yy.c\n\n--yyclass=NAME\nname of C++ class\n\n--header-file=FILE\ncreate a C header file in addition to the scanner\n\n--tables-file[=FILE] write tables to FILE\n\n--backup-file=FILE\nwrite backing-up information to FILE\n",
                        "flag": "-t",
                        "long": "--stdout"
                    },
                    {
                        "name": "Scanner behavior:",
                        "content": ""
                    },
                    {
                        "name": "-7 --7bit",
                        "content": "generate 7-bit scanner\n",
                        "flag": "-7",
                        "long": "--7bit"
                    },
                    {
                        "name": "-8 --8bit",
                        "content": "generate 8-bit scanner\n",
                        "flag": "-8",
                        "long": "--8bit"
                    },
                    {
                        "name": "-B --batch",
                        "content": "generate batch scanner (opposite of -I)\n",
                        "flag": "-B",
                        "long": "--batch"
                    },
                    {
                        "name": "-i --case-insensitive",
                        "content": "ignore case in patterns\n",
                        "flag": "-i",
                        "long": "--case-insensitive"
                    },
                    {
                        "name": "-l --lex-compat",
                        "content": "maximal compatibility with original lex\n",
                        "flag": "-l",
                        "long": "--lex-compat"
                    },
                    {
                        "name": "-X --posix-compat",
                        "content": "maximal compatibility with POSIX lex\n",
                        "flag": "-X",
                        "long": "--posix-compat"
                    },
                    {
                        "name": "-I --interactive",
                        "content": "generate interactive scanner (opposite of -B)\n",
                        "flag": "-I",
                        "long": "--interactive"
                    },
                    {
                        "name": "--yylineno",
                        "content": "track line count in yylineno\n",
                        "long": "--yylineno"
                    },
                    {
                        "name": "Generated code:",
                        "content": "-+,  --c++\ngenerate C++ scanner class\n"
                    },
                    {
                        "name": "-Dmacro",
                        "content": "#define macro defn  (default defn is '1')\n"
                    },
                    {
                        "name": "-L --noline",
                        "content": "suppress #line directives in scanner\n",
                        "flag": "-L",
                        "long": "--noline"
                    },
                    {
                        "name": "-P --prefix",
                        "content": "use STRING as prefix instead of \"yy\"\n",
                        "flag": "-P",
                        "long": "--prefix"
                    },
                    {
                        "name": "-R --reentrant",
                        "content": "generate a reentrant C scanner\n",
                        "flag": "-R",
                        "long": "--reentrant"
                    },
                    {
                        "name": "--bison-bridge",
                        "content": "scanner for bison pure parser.\n",
                        "long": "--bison-bridge"
                    },
                    {
                        "name": "--bison-locations",
                        "content": "include yylloc support.\n",
                        "long": "--bison-locations"
                    },
                    {
                        "name": "--stdinit",
                        "content": "initialize yyin/yyout to stdin/stdout\n",
                        "long": "--stdinit"
                    },
                    {
                        "name": "--nounistd",
                        "content": "do not include <unistd.h>\n",
                        "long": "--nounistd"
                    },
                    {
                        "name": "--noFUNCTION",
                        "content": "do not generate a particular FUNCTION\n",
                        "long": "--noFUNCTION"
                    },
                    {
                        "name": "Miscellaneous:",
                        "content": ""
                    },
                    {
                        "name": "-c",
                        "content": "",
                        "flag": "-c"
                    },
                    {
                        "name": "-n",
                        "content": "-?\n",
                        "flag": "-n"
                    },
                    {
                        "name": "-h --help",
                        "content": "produce this help message\n",
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-V --version",
                        "content": "report flex version\n",
                        "flag": "-V",
                        "long": "--version"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "The full documentation for flex is maintained as a Texinfo manual.  If the info and flex pro‐\ngrams are properly installed at your site, the command\n\ninfo flex\n\nshould give you access to the complete manual.\n\n\n\nThe Flex Project                             March 2022                                      FLEX(1)",
                "subsections": []
            }
        }
    }
}