aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/Parsing/ParserMode/ModeInterface.php
blob: 7cca0385f4682c24b25a793098ad5bf990b161bf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php

namespace dokuwiki\Parsing\ParserMode;

/**
 * Defines a mode (syntax component) in the Parser
 */
interface ModeInterface
{
    /**
     * returns a number used to determine in which order modes are added
     *
     * @return int;
     */
    public function getSort();

    /**
     * Called before any calls to connectTo
     *
     * @return void
     */
    public function preConnect();

    /**
     * Connects the mode
     *
     * @param string $mode
     * @return void
     */
    public function connectTo($mode);

    /**
     * Called after all calls to connectTo
     *
     * @return void
     */
    public function postConnect();

    /**
     * Check if given mode is accepted inside this mode
     *
     * @param string $mode
     * @return bool
     */
    public function accepts($mode);
}