{
    "content": [
        {
            "type": "text",
            "text": "# lex(1) (man)\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  `lex {{analyzer.l}}`\n- Specify the output file:\n  `lex -t {{analyzer.l}} > {{analyzer.c}}`\n- Compile a C file generated by Lex:\n  `c99 {{path/to/lex.yy.c}} -o {{executable}}`\n\n*Source: tldr-pages*\n\n---\n\n**Summary:** flex - the fast lexical analyser generator\n\n**Synopsis:** flex [OPTIONS] [FILE]...\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| — | --align | — | trade off larger tables for better memory alignment |\n| — | --ecs | — | construct equivalence classes |\n| -f | — | — |  |\n| -F | — | — |  |\n| — | --meta-ecs | — | construct meta-equivalence classes |\n| — | --read | — | use read() instead of stdio for scanner input |\n| -f | --full | — | generate fast, large scanner. Same as -Cfr |\n| -F | --fast | — | use alternate table representation. Same as -CFr |\n| — | --meta-ecs | — |  |\n| -d | --debug | — | enable debug mode in scanner |\n| -b | --backup | — | write backing-up information to lex.backup |\n| -p | --perf-report | — | write performance report to stderr |\n| -s | --nodefault | — | suppress default rule to ECHO unmatched text |\n| -T | --trace | — | flex should run in trace mode |\n| -w | --nowarn | — | do not generate warnings |\n| -v | --verbose | — | write summary of scanner statistics to stdout --hex use hexadecimal numbers instead of octal in debug outputs |\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (2 lines) — 18 subsections\n  - Table Compression: (1 lines)\n  - -Ca --align (2 lines)\n  - -Ce --ecs (2 lines)\n  - -Cf -f (1 lines)\n  - -CF -F (1 lines)\n  - -Cm --meta-ecs (2 lines)\n  - -Cr --read (2 lines)\n  - -f --full (2 lines)\n  - -F --fast (2 lines)\n  - -Cem --ecs --meta-ecs (1 lines)\n  - Debugging: (1 lines)\n  - -d --debug (2 lines)\n  - -b --backup (2 lines)\n  - -p --perf-report (2 lines)\n  - -s --nodefault (2 lines)\n  - -T --trace (2 lines)\n  - -w --nowarn (2 lines)\n  - -v --verbose (4 lines)\n- **FILES** (1 lines) — 27 subsections\n  - -o --outfile (2 lines)\n  - -S --skel (2 lines)\n  - -t --stdout (13 lines)\n  - Scanner behavior: (1 lines)\n  - -7 --7bit (2 lines)\n  - -8 --8bit (2 lines)\n  - -B --batch (2 lines)\n  - -i --case-insensitive (2 lines)\n  - -l --lex-compat (2 lines)\n  - -X --posix-compat (2 lines)\n  - -I --interactive (2 lines)\n  - --yylineno (2 lines)\n  - Generated code: (3 lines)\n  - -Dmacro (2 lines)\n  - -L --noline (2 lines)\n  - -P --prefix (2 lines)\n  - -R --reentrant (2 lines)\n  - --bison-bridge (2 lines)\n  - --bison-locations (2 lines)\n  - --stdinit (2 lines)\n  - --nounistd (2 lines)\n  - --noFUNCTION (2 lines)\n  - Miscellaneous: (1 lines)\n  - -c (1 lines)\n  - -n (2 lines)\n  - -h --help (2 lines)\n  - -V --version (2 lines)\n- **SEE ALSO** (10 lines)\n\n## Full Content\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#### Table Compression:\n\n#### -Ca --align\n\ntrade off larger tables for better memory alignment\n\n#### -Ce --ecs\n\nconstruct equivalence classes\n\n#### -Cf -f\n\n#### -CF -F\n\n#### -Cm --meta-ecs\n\nconstruct meta-equivalence classes\n\n#### -Cr --read\n\nuse read() instead of stdio for scanner input\n\n#### -f --full\n\ngenerate fast, large scanner. Same as -Cfr\n\n#### -F --fast\n\nuse alternate table representation. Same as -CFr\n\n#### -Cem --ecs --meta-ecs\n\n#### Debugging:\n\n#### -d --debug\n\nenable debug mode in scanner\n\n#### -b --backup\n\nwrite backing-up information to lex.backup\n\n#### -p --perf-report\n\nwrite performance report to stderr\n\n#### -s --nodefault\n\nsuppress default rule to ECHO unmatched text\n\n#### -T --trace\n\nflex should run in trace mode\n\n#### -w --nowarn\n\ndo not generate warnings\n\n#### -v --verbose\n\nwrite summary of scanner statistics to stdout\n\n--hex  use hexadecimal numbers instead of octal in debug outputs\n\n### FILES\n\n#### -o --outfile\n\nspecify output filename\n\n#### -S --skel\n\nspecify skeleton file\n\n#### -t --stdout\n\nwrite 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\n#### Scanner behavior:\n\n#### -7 --7bit\n\ngenerate 7-bit scanner\n\n#### -8 --8bit\n\ngenerate 8-bit scanner\n\n#### -B --batch\n\ngenerate batch scanner (opposite of -I)\n\n#### -i --case-insensitive\n\nignore case in patterns\n\n#### -l --lex-compat\n\nmaximal compatibility with original lex\n\n#### -X --posix-compat\n\nmaximal compatibility with POSIX lex\n\n#### -I --interactive\n\ngenerate interactive scanner (opposite of -B)\n\n#### --yylineno\n\ntrack line count in yylineno\n\n#### Generated code:\n\n-+,  --c++\ngenerate C++ scanner class\n\n#### -Dmacro\n\n#define macro defn  (default defn is '1')\n\n#### -L --noline\n\nsuppress #line directives in scanner\n\n#### -P --prefix\n\nuse STRING as prefix instead of \"yy\"\n\n#### -R --reentrant\n\ngenerate a reentrant C scanner\n\n#### --bison-bridge\n\nscanner for bison pure parser.\n\n#### --bison-locations\n\ninclude yylloc support.\n\n#### --stdinit\n\ninitialize yyin/yyout to stdin/stdout\n\n#### --nounistd\n\ndo not include <unistd.h>\n\n#### --noFUNCTION\n\ndo not generate a particular FUNCTION\n\n#### Miscellaneous:\n\n#### -c\n\n#### -n\n\n-?\n\n#### -h --help\n\nproduce this help message\n\n#### -V --version\n\nreport flex version\n\n### SEE ALSO\n\nThe 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)\n\n"
        }
    ],
    "structuredContent": {
        "command": "lex",
        "section": "1",
        "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": "lex {{analyzer.l}}"
            },
            {
                "description": "Specify the output file",
                "command": "lex -t {{analyzer.l}} > {{analyzer.c}}"
            },
            {
                "description": "Compile a C file generated by Lex",
                "command": "c99 {{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": []
            }
        ]
    }
}