8000 add boiler plate c++ code for pickle · dragoncoder047/pickle@de6a684 · GitHub
[go: up one dir, main page]

Skip to content

Commit de6a684

Browse files
add boiler plate c++ code for pickle
1 parent c19eacb commit de6a684

16 files changed

+108
-7
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "cpp/tinobsy"]
2+
path = cpp/tinobsy
3+
url = https://github.com/dragoncoder047/tinobsy

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# PICKLE
22

33
It's Python! No, it's Tcl!, Wait, what is it? It's a programming language!
4-
5-
The test arena (which I have named the "seeder" for no reason) can be found at <https://dragoncoder047.github.io/pickle/seeder/seeder.html>.

cpp/Makefile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.PHONY: test64 builtest64 valgrind64 clean test32 buildtest32 valgrind32 deps show checkleaks
2+
3+
buildtest64:
4+
g++ --std=c++11 pickle_test.cpp -g -o pickletest64
5+
6+
valgrind64: buildtest64
7+
valgrind --track-origins=yes ./pickletest64 > test/out64.txt 2> test/valgrind64.txt
8+
9+
buildtest32:
10+
g++ --std=c++11 -m32 pickle_test.cpp -g -o pickletest32
11+
12+
valgrind32: buildtest32
13+
valgrind --track-origins=yes ./pickletest32 > test/out32.txt 2> test/valgrind32.txt
14+
15+
clean:
16+
rm -f pickletest64
17+
rm -f pickletest32
18+
rm -f vgcore.*
19+
20+
test: buildtest64 valgrind64 buildtest32 valgrind32 clean
21+
22+
deps:
23+
sudo dpkg --add-architecture i386
24+
sudo apt-get update
25+
sudo apt-get install valgrind --yes
26+
sudo apt-get install gcc-multilib --yes
27+
sudo apt-get install g++-multilib --yes
28+
sudo apt-get install libgcc-s1:i386 --yes
29+
sudo apt-get install libc6-dbg:i386 --yes
30+
31+
show:
32+
cat test/out64.txt
33+
cat test/valgrind64.txt
34+
cat test/out32.txt
35+
cat test/valgrind32.txt
36+
37+
checkleaks:
38+
cat test/valgrind64.txt | grep "no leaks are possible" >/dev/null
39+
cat test/valgrind32.txt | grep "no leaks are possible" >/dev/null

cpp/pickle.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include "pickle.hpp"
2+
3+
namespace pickle {
4+
5+
6+
7+
}

cpp/pickle.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#pragma once
2+
3+
#include "tinobsy/tinobsy.hpp"
4+
5+
namespace pickle {
6+
7+
// Tokenizer
8+
class
9+
10+
11+
12+
}
13+
14+
#include "pickle.cpp"

cpp/pickle_test.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include "pickle.hpp"
2+
3+
#include <cstdio>
4+
5+
int main() {
6+
// compilation test
7+
printf("hello world\n");
8+
return 0;
9+
}

cpp/test/out32.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hello world

cpp/test/out64.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hello world

cpp/test/valgrind32.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
==11183== Memcheck, a memory error detector
2+
==11183== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
3+
==11183== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
4+
==11183== Command: ./pickletest32
5+
==11183==
6+
==11183==
7+
==11183== HEAP SUMMARY:
8+
==11183== in use at exit: 0 bytes in 0 blocks
9+
==11183== total heap usage: 2 allocs, 2 frees, 23,040 bytes allocated
10+
==11183==
11+
==11183== All heap blocks were freed -- no leaks are possible
12+
==11183==
13+
==11183== For lists of detected and suppressed errors, rerun with: -s
14+
==11183== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

cpp/test/valgrind64.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
==11158== Memcheck, a memory error detector
2+
==11158== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
3+
==11158== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
4+
==11158== Command: ./pickletest64
5+
==11158==
6+
==11158==
7+
==11158== HEAP SUMMARY:
8+
==11158== in use at exit: 0 bytes in 0 blocks
9+
==11158== total heap usage: 2 allocs, 2 frees, 76,800 bytes allocated
10+
==11158==
11+
==11158== All heap blocks were freed -- no leaks are possible
12+
==11158==
13+
==11158== For lists of detected and suppressed errors, rerun with: -s
14+
==11158== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

cpp/tinobsy

Submodule tinobsy added at e3c1441

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<html>
33

44
<head>
5-
<title>Pickle Main Page</title>
5+
<title>Pickle Javascript Main Page</title>
66
</head>
77

88
<body>
9-
<h1>Pickle Main Page</h1>
10-
<p>Go to the <a href="seeder/seeder.html">Pickle Seeder</a> to test the tokenizer.</p>
9+
<h1>Pickle Javascript Main Page</h1>
10+
<p><a href="js/test_tokenizer/test_tokenizer.html">tokenizer test</a></p>
1111
</body>
1212

1313
</html>

pickle.js renamed to js/pickle.js

File renamed without changes.
File renamed without changes.

seeder/seeder.html renamed to js/test_tokenizer/test_tokenizer.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<head>
55
<title>Pickle Seeder!</title>
6-
<link rel="stylesheet" href="seeder.css" />
6+
<link rel="stylesheet" href="test_tokenizer.css" />
77
</head>
88

99
<body>
@@ -20,6 +20,6 @@ <h1>Pickle Seeder!</h1>
2020
</body>
2121
<script src="https://cdn.jsdelivr.net/npm/ace-builds@1.10.0/src-noconflict/ace.min.js"></script>
2222
<script src="../pickle.js"></script>
23-
<script src="seeder.js"></script>
23+
<script src="test_tokenizer.js"></script>
2424

2525
</html>
File renamed without changes.

0 commit comments

Comments
 (0)
0