[big update] json array works
This commit is contained in:
parent
1600bb44a0
commit
6996441429
|
@ -96,14 +96,14 @@ int main(int argc, char* argv[]){
|
|||
linkDots(&array, 0, 1, STRING_T, 0); // q0 --s0--> q1
|
||||
linkDots(&array, 1, 2, AUTOMATE_T, 0); // q1 --a0--> q2
|
||||
linkDots(&array, 2, 1, STRING_T, 2); // q2 --s2--> q1
|
||||
linkDots(&array, 1, 3, AUTOMATE_T, 0); // q1 --a0--> q3
|
||||
linkDots(&array, 1, 3, STRING_T, 1); // q1 --s1--> q3
|
||||
|
||||
char str[40] = {0};
|
||||
strcpy(str, "[null, \"abc\", \"def\"]\0");
|
||||
strcpy(str, "[null, \"abc\", \"def\", false, true, 12, -1.2, .54, -.3, 5.]\0");
|
||||
clock_t start, stop;
|
||||
unsigned int browsed = 0;
|
||||
start = clock(); browsed = browse(&array, str, 0); stop = clock();
|
||||
debug(array);
|
||||
|
||||
printf("browse '%s' : %d/%d\n", str, browsed, (int) strlen(str));
|
||||
printf(" (*) final_state: %d/%d\n", array.dCurrent, array.dFinal);
|
||||
|
|
82
src/test
82
src/test
|
@ -1,82 +0,0 @@
|
|||
>>> [browsing number]
|
||||
> q0 --l0--> q1 ?
|
||||
< yes
|
||||
> q1 --a0--> q2 ?
|
||||
>>> [browsing positive]
|
||||
> q0 --a0--> q1 ?
|
||||
>>> [browsing digit]
|
||||
> q0 --r0--> q0 ?
|
||||
< yes
|
||||
> q1 --r0--> q0 ?
|
||||
< yes
|
||||
> q2 --r0--> q0 ?
|
||||
< yes
|
||||
> q3 --r0--> q0 ?
|
||||
< yes
|
||||
>>> [done digit = 0/0]
|
||||
automate leads us (positive) from state 0 to 1
|
||||
< yes
|
||||
> q1 --s0--> q2 ?
|
||||
> q1 --s0--> q3 ?
|
||||
< not
|
||||
* back to q0:1
|
||||
> q0 --s0--> q2 ?
|
||||
> q0 --a0--> q3 ?
|
||||
>>> [browsing digit]
|
||||
> q0 --r0--> q0 ?
|
||||
< yes
|
||||
> q1 --r0--> q0 ?
|
||||
< yes
|
||||
> q2 --r0--> q0 ?
|
||||
< yes
|
||||
> q3 --r0--> q0 ?
|
||||
< yes
|
||||
>>> [done digit = 0/0]
|
||||
automate leads us (positive) from state 0 to 3
|
||||
< yes
|
||||
< not
|
||||
* back to q0:3
|
||||
>>> [done positive = 0/3]
|
||||
< not
|
||||
* back to q0:1
|
||||
> q0 --a0--> q2 ?
|
||||
>>> [browsing positive]
|
||||
> q0 --a0--> q1 ?
|
||||
>>> [browsing digit]
|
||||
> q0 --r0--> q0 ?
|
||||
< not
|
||||
* back to q0:1
|
||||
>>> [done digit = 0/0]
|
||||
automate leads us (positive) from state 0 to 1
|
||||
< yes
|
||||
> q1 --s0--> q2 ?
|
||||
> q1 --s0--> q3 ?
|
||||
< not
|
||||
* back to q0:1
|
||||
> q0 --s0--> q2 ?
|
||||
> q0 --a0--> q3 ?
|
||||
>>> [browsing digit]
|
||||
> q0 --r0--> q0 ?
|
||||
< not
|
||||
* back to q0:1
|
||||
>>> [done digit = 0/0]
|
||||
automate leads us (positive) from state 0 to 3
|
||||
< yes
|
||||
< not
|
||||
* back to q0:3
|
||||
>>> [done positive = 0/3]
|
||||
< not
|
||||
* back to q0:2
|
||||
>>> [done number = 0/2]
|
||||
browse '+1234' : 0/5
|
||||
(*) final_state: 0/2
|
||||
(*) in 20 steps
|
||||
(*) in 0.000 seconds
|
||||
|
||||
line/0: '<?php'
|
||||
line/1: 'require_once 'blabla.php';'
|
||||
line/1: 'echo "blabla";'
|
||||
line/0: ''
|
||||
line/1: 'function sadsad(){'
|
||||
line/2: '$var = 12;'
|
||||
line/1: '}'
|
Loading…
Reference in New Issue