|
NAMEHTML::Mason::Lexer - Generates events based on component source lexingSYNOPSISmy $lexer = HTML::Mason::Lexer->new; $lexer->lex( comp_source => $source, name => $comp_name, compiler => $compiler ); DESCRIPTIONThe Lexer works in tandem with the Compiler to turn Mason component source into something else, generally Perl code.As the lexer finds component elements, like a tag or block, it calls the appropriate event methods in the compiler object it was given. It has only a few public methods. You can replace this lexer with one of your own simply by telling the Compiler to use a different lexer class. Your lexer class simply needs to call the appropriate methods in the Component Class's API as it scans the source. METHODSThe lexer has very few public methods.
SUBCLASSINGAny subclass of the lexer should declare itself to be a subclass of "HTML::Mason::Lexer", even if it plans to override all of its public methods.If you want your subclass to work with the existing Compiler classes in Mason, you must implement the methods listed above. If you plan to use a custom Compiler class that you're writing, you can do whatever you want. We recommend that any parameters you add to Lexer be read-only, because the compiler object_id is only computed once on creation and would not reflect any changes to Lexer parameters.
Visit the GSP FreeBSD Man Page Interface. |