{
    "content": [
        {
            "type": "text",
            "text": "# HTML::Mason::Lexer (perldoc)\n\n## NAME\n\nHTML::Mason::Lexer - Generates events based on component source lexing\n\n## SYNOPSIS\n\nmy $lexer = HTML::Mason::Lexer->new;\n$lexer->lex( compsource => $source, name => $compname, compiler => $compiler );\n\n## DESCRIPTION\n\nThe Lexer works in tandem with the Compiler to turn Mason component source into something else,\ngenerally Perl code.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS**\n- **SUBCLASSING**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "HTML::Mason::Lexer",
        "section": "",
        "mode": "perldoc",
        "summary": "HTML::Mason::Lexer - Generates events based on component source lexing",
        "synopsis": "my $lexer = HTML::Mason::Lexer->new;\n$lexer->lex( compsource => $source, name => $compname, compiler => $compiler );",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "SUBCLASSING",
                "lines": 10,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "HTML::Mason::Lexer - Generates events based on component source lexing\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "my $lexer = HTML::Mason::Lexer->new;\n\n$lexer->lex( compsource => $source, name => $compname, compiler => $compiler );\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The Lexer works in tandem with the Compiler to turn Mason component source into something else,\ngenerally Perl code.\n\nAs the lexer finds component elements, like a tag or block, it calls the appropriate event\nmethods in the compiler object it was given.\n\nIt has only a few public methods.\n\nYou can replace this lexer with one of your own simply by telling the Compiler to use a\ndifferent lexer class. Your lexer class simply needs to call the appropriate methods in the\nComponent Class's API as it scans the source.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "The lexer has very few public methods.\n\nnew This method creates a new Lexer object. This methods takes no parameters.\n\nlex ( compsource => ..., name => ..., compiler => ... )\nThis method tells the lexer to start scanning the given component source. All of these\nparameters are required. The \"name\" parameter will be used in any error messages generated\nduring lexing. The \"compiler\" object must be an object that implements the Mason Component\nAPI.\n\nlinenumber\nThe current line number that the lexer has reached.\n\nname\nThe name of the component currently being lexed.\n\nthrowsyntaxerror ($error)\nThis throws an \"HTML::Mason::Exception::Syntax\" error with the given error message as well\nas additional information about the component source.\n\nThis method is used by both the Lexer and the Compiler.\n",
                "subsections": []
            },
            "SUBCLASSING": {
                "content": "Any subclass of the lexer should declare itself to be a subclass of \"HTML::Mason::Lexer\", even\nif it plans to override all of its public methods.\n\nIf you want your subclass to work with the existing Compiler classes in Mason, you must\nimplement the methods listed above. If you plan to use a custom Compiler class that you're\nwriting, you can do whatever you want.\n\nWe recommend that any parameters you add to Lexer be read-only, because the compiler objectid\nis only computed once on creation and would not reflect any changes to Lexer parameters.\n",
                "subsections": []
            }
        }
    }
}