-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathp3.php
More file actions
31 lines (23 loc) · 662 Bytes
/
p3.php
File metadata and controls
31 lines (23 loc) · 662 Bytes
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
<?php
use SyntaxAnalyzer\Analyzer;
require_once __DIR__ . '/testhelpers.php';
$words = [
['type' => 'white', 'value' => ''],
['type' => 'key', 'value' => 'CREATE'],
['type' => 'white', 'value' => ''],
['type' => 'key', 'value' => 'CREATE']
];
$rule = [
'matches' => [
['type' => 'white', 'n' => [0, PHP_INT_MAX], 'name' => 'white1'],
['r' => '/CREATE/', 'type' => 'key', 'n' => [1, 1], 'name' => 'key_create'],
],
'n' => [1, PHP_INT_MAX],
];
$g = new Analyzer(null);
$g->setWords($words);
$i = 0;
$r = $g->matchNum($rule, $rs, $i, $rule['n'][0], $rule['n'][1]);
var_dump('rs', $i, $r, $rs);
//$g->showLog();
//