Skip to content

Commit 2dcfba8

Browse files
committed
Add tutotial05
1 parent 0b52f79 commit 2dcfba8

26 files changed

+1299
-0
lines changed

tutorial05/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
cmake_minimum_required (VERSION 2.6)
2+
project (leptjson_test C)
3+
4+
if (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
5+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ansi -pedantic -Wall")
6+
endif()
7+
8+
add_library(leptjson leptjson.c)
9+
add_executable(leptjson_test test.c)
10+
target_link_libraries(leptjson_test leptjson)

tutorial05/images/makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%.png: %.dot
2+
dot $< -Tpng -o $@
3+
4+
DOTFILES = $(basename $(wildcard *.dot))
5+
all: $(addsuffix .png, $(DOTFILES))
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
digraph {
2+
rankdir=TB
3+
compound=true
4+
fontname="Inconsolata, Consolas"
5+
fontsize=10
6+
margin="0,0"
7+
ranksep=0.3
8+
nodesep=1
9+
penwidth=0.5
10+
11+
node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5, colorscheme=spectral7]
12+
edge [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
13+
14+
{
15+
node [shape=record, style=filled, margin=0.1, height=0.3]
16+
json [fillcolor=3, label="<j>[|\"|a|b|c|\"|,|[|1|,|2|]|,|3|]|\\0"]
17+
stack [fillcolor=4, label="<t> | | | | | |"]
18+
}
19+
{
20+
node [shape=plaintext, margin=0]
21+
22+
cjson [label="c->json"]
23+
ctop [label="c->top"]
24+
desc [style=solid,label="\l1. lept_parse()\l 2. lept_parse_value() \l 3. lept_parse_array()"]
25+
}
26+
27+
cjson -> json:j
28+
ctop -> stack:t
29+
json -> desc [style=invis]
30+
}
13.7 KB
Loading
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
digraph {
2+
rankdir=TB
3+
compound=true
4+
fontname="Inconsolata, Consolas"
5+
fontsize=10
6+
margin="0,0"
7+
ranksep=0.3
8+
nodesep=1
9+
penwidth=0.5
10+
11+
node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5, colorscheme=spectral7]
12+
edge [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
13+
14+
{
15+
node [shape=record, style=filled, margin=0.1, height=0.3]
16+
json [fillcolor=3, label="[|<j>\"|a|b|c|\"|,|[|1|,|2|]|,|3|]|\\0"]
17+
stack [fillcolor=4, label="<t>| | | | | |"]
18+
}
19+
{
20+
node [shape=plaintext, margin=0]
21+
22+
cjson [label="c->json"]
23+
ctop [label="c->top"]
24+
desc [style=solid,label="\l1. lept_parse()\l 2. lept_parse_value()\l 3. lept_parse_array()\l 4. lept_parse_value()\l 5. lept_parse_string()"]
25+
}
26+
{
27+
node [shape=Mrecord,style=filled]
28+
29+
e [fillcolor=5,label="{null|}"]
30+
}
31+
32+
cjson -> json:j
33+
ctop -> stack:t
34+
json -> desc [style=invis]
35+
stack -> e [style=invis]
36+
}
19.7 KB
Loading
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
digraph {
2+
rankdir=TB
3+
compound=true
4+
fontname="Inconsolata, Consolas"
5+
fontsize=10
6+
margin="0,0"
7+
ranksep=0.3
8+
nodesep=1
9+
penwidth=0.5
10+
11+
node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5, colorscheme=spectral7]
12+
edge [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
13+
14+
{
15+
node [shape=record, style=filled, margin=0.1, height=0.3]
16+
json [fillcolor=3, label="[|\"|a|b|c|<j>\"|,|[|1|,|2|]|,|3|]|\\0"]
17+
stack [fillcolor=4, label="a|b|c|<t>| | |"]
18+
}
19+
{
20+
node [shape=plaintext, margin=0]
21+
22+
cjson [label="c->json"]
23+
ctop [label="c->top"]
24+
desc [style=solid,label="\l1. lept_parse()\l 2. lept_parse_value()\l 3. lept_parse_array()\l 4. lept_parse_value()\l 5. lept_parse_string()"]
25+
}
26+
27+
{
28+
node [shape=Mrecord,style=filled]
29+
30+
e [fillcolor=5,label="{null|}"]
31+
}
32+
33+
cjson -> json:j
34+
ctop -> stack:t
35+
json -> desc [style=invis]
36+
stack -> e [style=invis]
37+
}
20.6 KB
Loading
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
digraph {
2+
rankdir=TB
3+
compound=true
4+
fontname="Inconsolata, Consolas"
5+
fontsize=10
6+
margin="0,0"
7+
ranksep=0.3
8+
nodesep=1
9+
penwidth=0.5
10+
11+
node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5, colorscheme=spectral7]
12+
edge [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
13+
14+
{
15+
node [shape=record, style=filled, margin=0.1, height=0.3]
16+
json [fillcolor=3, label="[|\"|a|b|c|<j>\"|,|[|1|,|2|]|,|3|]|\\0"]
17+
stack [fillcolor=4, label="<t> | | | | | |"]
18+
abc [fillcolor=3, label="<h>a|b|c|\\0"]
19+
}
20+
{
21+
node [shape=plaintext, margin=0]
22+
23+
cjson [label="c->json"]
24+
ctop [label="c->top"]
25+
desc [style=solid,label="\l1. lept_parse()\l 2. lept_parse_value()\l 3. lept_parse_array()\l 4. lept_parse_value()\l 5. lept_parse_string()"]
26+
}
27+
28+
{
29+
node [shape=Mrecord,style=filled]
30+
31+
s [fillcolor=6,label="{string|<s>s|len=3}"]
32+
}
33+
34+
cjson -> json:j
35+
ctop -> stack:t
36+
json -> desc [style=invis]
37+
stack -> s [style=invis]
38+
s:s -> abc:h
39+
}
24.8 KB
Loading

0 commit comments

Comments
 (0)