Example #1
0
 /**
  *    Sets up the matching lexer. Starts in 'text' mode.
  *    @param SimpleSaxParser $parser    Event generator, usually $self.
  *    @return SimpleLexer               Lexer suitable for this parser.
  *    @access public
  *    @static
  */
 function &createLexer(&$parser)
 {
     $lexer =& new SimpleLexer($parser, 'text');
     $lexer->mapHandler('text', 'acceptTextToken');
     SimpleSaxParser::_addSkipping($lexer);
     foreach (SimpleSaxParser::_getParsedTags() as $tag) {
         SimpleSaxParser::_addTag($lexer, $tag);
     }
     SimpleSaxParser::_addInTagTokens($lexer);
     return $lexer;
 }