Outils pour utilisateurs

Outils du site


start

default page

This is my welcome page, almost empty. The goal is just to show that DW is running.

sample texts from dokuwiki.org

A rough diagram of the relationships between these components;

    +-----------+          +-----------+
    |           |  Input   |  Client   |
    |  Parser   |<---------|   Code    |
    |           |  String  |           |
    +-----.-----+          +-----|-----+
  Modes   |                     /|\
    +     |             Renderer |
  Input   |          Instructions|
  String \|/                     |
    +-----'-----+          +-----------+
    |           |          |           |
    |  Lexer    |--------->|  Handler  |
    |           |  Tokens  |           |
    +-----.-----+          +-----------+
          |
          |
     +----+---+
     | Modes  |-+
     +--------+ |-+
       +--------+ |
         +--------+
$handler = new MyHandler();
$lexer = new dokuwiki\Lexer\Lexer($handler, 'base', true);

Here the initial mode here is called 'base'.

addEntryPattern / addExitPattern

addEntryPattern() and addExitPattern() are used to register a pattern for entering and exiting a particular parsing mode. For example;

// arg0: regex to match - note no need to add start/end pattern delimiters
// arg1: name of mode where this entry pattern may be used
// arg2: name of mode to enter
$lexer->addEntryPattern('<file>','base','file');
 
// arg0: regex to match
// arg1: name of mode to exit
$lexer->addExitPattern('</file>','file');
start.txt · Dernière modification : de 127.0.0.1