Skip to content

Commit c935b6b

Browse files
committed
Use c-def-arrays package, include ragel 6.9
- Use c-def-arrays package - Include ragel 6.9 Windows executable - Build `packet_actions.cpp` automatically using Paver task
1 parent 5bf2200 commit c935b6b

File tree

9 files changed

+415
-24
lines changed

9 files changed

+415
-24
lines changed

COPYING

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Embedded-friendly transport layer, inspired by ZeroMQ
2+
Copyright (C) 2013-2015 Christian Fobel
3+
4+
This program is free software; you can redistribute it and/or modify
5+
it under the terms of the GNU General Public License as published by
6+
the Free Software Foundation; either version 2 of the License, or
7+
(at your option) any later version.
8+
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU General Public License for more details.
13+
14+
You should have received a copy of the GNU General Public License
15+
along with this program; if not, see <http://www.gnu.org/licenses/>.

SConstruct

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
env = Environment(CPPPATH=Dir('#/nadamq/src').abspath, CCFLAGS=['-std=c++0x'])
1+
import c_array_defs
2+
3+
env = Environment(CPPPATH=[Dir('#/nadamq/src').abspath] +
4+
c_array_defs.get_includes(), CCFLAGS=['-std=c++0x'])
25

36
SConscript('nadamq/src/SConscript', variant_dir='build', exports={'env': env})

nadamq/src/Packet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ using namespace std;
1414
#include <stdlib.h>
1515
#include "crc_common.h"
1616
#ifdef AVR
17-
#include "Array.h"
17+
#include "CArrayDefs.h"
1818
#endif // #ifdef AVR
1919

2020

nadamq/src/SConscript

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,24 @@
1+
import platform
2+
13
Import('env')
24

5+
if platform.system() == 'Windows':
6+
ragel = r'nadamq\tools\ragel-6.9\ragel.exe'
7+
else:
8+
ragel = 'ragel'
9+
310
socket_fsm_src = Command('packet_socket_fsm_actions.cpp',
411
'packet_socket_fsm_actions.rl',
5-
'ragel -G2 -o $TARGET $SOURCE')
6-
#socket_fsm_dot = Command('packet_socket_fsm.dot', 'packet_socket_fsm_actions.rl',
7-
#'ragel -V -p -o $TARGET $SOURCE')
8-
#socket_fsm_pdf = Command('packet_socket_fsm.pdf', socket_fsm_dot,
9-
#'dot -Tpdf -o $TARGET $SOURCE')
12+
'%s -G2 -o $TARGET $SOURCE' % ragel)
1013

1114
Depends(socket_fsm_src, 'packet_socket_fsm.rl')
12-
#Depends(socket_fsm_dot, 'packet_socket_fsm.rl')
13-
#Depends(socket_fsm_pdf, 'packet_socket_fsm.rl')
1415

1516
packet_actions_src = Command('packet_actions.cpp', 'packet_actions.rl',
1617
'ragel -G2 -o $TARGET $SOURCE')
17-
#packet_dot = Command('packet_actions.dot', 'packet_actions.rl',
18-
#'ragel -V -o $TARGET $SOURCE')
19-
#packet_pdf = Command('packet_actions.pdf', packet_dot,
20-
#'dot -Tpdf -o $TARGET $SOURCE')
2118

2219
Depends(packet_actions_src, 'packet.rl')
2320
#Depends(packet_dot, 'packet.rl')
2421
#Depends(packet_pdf, 'packet.rl')
2522

2623
crc_objs = env.Object(['crc_common.cpp'])
2724
packet_actions = env.Object([packet_actions_src])
28-
#CPPDEFINES=['VERBOSE_STATES'])
29-
# env.Program(['tests/test_packet_parser.cpp', packet_actions, crc_objs],
30-
# CCFLAGS=['-g', '-O0'])
31-
# env.Program(['tests/test_packet_socket.cpp', socket_fsm_src, packet_actions,
32-
# crc_objs], CCFLAGS=['-g', '-O0'])
33-
# env.Program(['tests/test_circular_buffer.cpp'], CCFLAGS=['-g', '-O0'])
34-
# env.Program(['tests/test_deque.cpp'], CCFLAGS=['-g', '-O0'])
35-
# env.Program(['tests/test_buffer_allocator.cpp'], CCFLAGS=['-g', '-O0'])
36-
# env.Program(['tests/test_packet_stream.cpp', packet_actions, crc_objs],
37-
# CCFLAGS=['-g', '-O0'])
38-
# env.Program(['tests/test_packet_writer.cpp', crc_objs], CCFLAGS=['-g', '-O0'])

nadamq/tools/ragel-6.9/AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See CREDITS.

nadamq/tools/ragel-6.9/COPYING

Lines changed: 340 additions & 0 deletions
Large diffs are not rendered by default.

nadamq/tools/ragel-6.9/CREDITS

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Ragel State Machine Compiler -- CREDITS
2+
=======================================
3+
4+
5+
* Ragel was designed and written by Adrian Thurston <[email protected]>.
6+
7+
* Many others have helped out along the way. Feedback, Packaging, and Fixes
8+
provided by:
9+
10+
Bob Tennent, Robert Lemmen, Tobias Jahn, Cris Bailiff, Buddy Betts,
11+
Scott Dixon, Steven Handerson, Michael Somos, Bob Paddock, Istvan Buki,
12+
David Drai, Matthias Rahlf, Zinx Verituse, Markus W. Weissmann,
13+
Marc Liyanage, Erich Ocean, Alan West, Steven Kibbler, Laurent Boulard,
14+
Jon Oberheide, David Helder, Lexington Luthor, Jason Jobe, Colin Fleming,
15+
Carlos Antunes, Steve Horne, Matt Mower, Josef Goettgens, Zed Shaw,
16+
Marcus Rueckert, Jeremy Hinegardner, Aaron Campbell, Josh Purinton,
17+
Judson Lester, Barry Arthur, Tim Potter, Ryan Phelps, David Waite,
18+
Kenny MacDermid, MenTaLguY, Manoj Rajagopalan, Tim Chklovski,
19+
Mikkel Fahnøe Jørgensen, Andrei Polushin, Evan Phoenix, David Balmain,
20+
Ross Thomas, Mitchell Foral, John D. Mitchell, Diego 'Flameeyes' Pettenò,
21+
Jose Quinteiro, William Morgan, _why, Iñaki Baz Castillo, Attila Sztupák,
22+
Graham Miller, Ismael Luceno, Josh Stern, Denis Naumov, Arbor Networks,
23+
Victor Hugo Borja, Daniel Tang, Justine Tunney, Johannes Pfau, ygrek
24+
25+
* Ragel 6 Code generators contributed by:
26+
27+
- Objective-C: Erich Ocean
28+
- D: Alan West
29+
- Java: Colin Fleming
30+
- Ruby: Victor Hugo Borja
31+
- C#: Daniel Tang
32+
- Go: Justine Tunney
33+
- D2: Johannes Pfau
34+
- OCaml: ygrek

nadamq/tools/ragel-6.9/ragel.exe

18.3 MB
Binary file not shown.

pavement.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
url='https://github.com/cfobel/nadamq',
4141
license='GPL',
4242
packages=['nadamq', ],
43+
install_requires=['c-array-defs'],
4344
# Install data listed in `MANIFEST.in`
4445
include_package_data=True,
4546
ext_modules=extensions)
@@ -61,6 +62,17 @@ def build_arduino_library():
6162

6263

6364
@task
65+
def build_packet_actions():
66+
sh('scons')
67+
68+
69+
@task
70+
def clean_packet_actions():
71+
sh('scons -c')
72+
73+
74+
@task
75+
@needs(['build_packet_actions'])
6476
def copy_packet_actions():
6577
path('build/packet_actions.cpp').copy('nadamq/src')
6678

0 commit comments

Comments
 (0)