Commit graph

1099 commits

Author SHA1 Message Date
Sven M. Hallberg
0231dc141e add iterative API to LL(k) backend 2015-09-03 19:18:07 +02:00
Sven M. Hallberg
f1d6d0bc5e split h_llk_parse into start/chunk/finish internally 2015-09-03 19:15:57 +02:00
Sven M. Hallberg
2845a9391e add API and backend hooks for iterative (chunked) parsing 2015-09-03 15:03:01 +02:00
Meredith L. Patterson
e01d10f0ab Merge pull request #139 from pesco/fix-llk_zero_end
add a missing end-of-input check in the LL(k) backend
2015-08-25 14:49:15 +02:00
Sven M. Hallberg
c5f2c5aa2b add a missing end-of-input check in the LL(k) backend 2015-08-25 14:14:48 +02:00
TQ Hirsch
25b27490c3 Merge pull request #138 from uucidl/platform-timing
Platform compilation improvement (windows port)
2015-08-19 12:56:49 +02:00
Nicolas Léveillé
9557448ae6 Introduce {v,}asprintf for windows
We have now again two functions called h_platform_vasprintf and
h_platform_asprintf. On windows they are implemented in terms of vsnprint
and the like. On BSD/GNU libraries we use the supplied vasprintf and
asprintf.
2015-08-16 16:46:52 +02:00
Nicolas Léveillé
124b4c381b regex_debug.c: Stop including dlfcn.h
Since the block of code has been disabled anyway and is not very
portable, we introduce a define to control both the include
and the code.
2015-08-16 16:21:21 +02:00
Nicolas Léveillé
102b9593dc Update list of files to compile on windows 2015-08-16 16:20:53 +02:00
Nicolas Léveillé
e74e23d672 Change system_allocator to store size of blocks only for debugging
Storing the size of the blocks is now only activated when DEBUG__MEMFILL
has been defined.
2015-08-16 09:15:20 +02:00
Nicolas Léveillé
d9ae097533 Remove void pointer arithmetics in system_allocator.c
We replace instances of void* w/ char* arithmetics.

This allows system_allocator.c to be compiled with MSVC.

Also we introduce a struct to represent the size_t header.
2015-08-16 09:10:04 +02:00
Nicolas Léveillé
01333964bd Substitute spaces for tabs 2015-08-15 15:43:46 +02:00
Nicolas Léveillé
2346239887 Implement h_platform_stopwatch for Windows
We use QueryPerformanceCounter which will return realtime, not user
time.
2015-08-15 15:43:35 +02:00
Nicolas Léveillé
739f5d6d5c Split platform specific time measurement away
We now have a `stopwatch` to measure time between two moments.
2015-08-15 15:43:22 +02:00
Meredith L. Patterson
a7a5e8cfad Merge pull request #137 from uucidl/building-on-appveyor
Building on appveyor
2015-08-12 10:01:03 +02:00
Nicolas Léveillé
226cad2ab2 Don't build all of Hammer on AppVeyor just now
Since the port is not finished yet, we remove some source files
and the compilation of examples.
2015-08-09 22:46:45 +02:00
Nicolas Léveillé
c0ab06736f Deactivate compiler warnings from CL.EXE that fire in hammer
Some of them are completely spurious however some (marked FIXME(windows))
may benefit from being looked at.
2015-08-09 22:46:45 +02:00
Nicolas Léveillé
0c35525e30 Convert usages of errx to h_platform_errx
This BSD call will have to be implemented on windows. Right now
we have a stub that just exits the process.
2015-08-09 22:46:45 +02:00
Nicolas Léveillé
c8726244ae Wrap remaining __attribute__
We wrap all remaining references to __attribute__ into a macro call to
H_GCC_ATTRIBUTE, to allow compilation with MSVC CL.EXE
2015-08-09 22:46:00 +02:00
Nicolas Léveillé
6b9ba6033e Allow windows users to include hammer.h
We substitute H_GCC_ATTRIBUTE to any occurence of __attribute__ and
disable its function with non gcc, non clang compilers.

We use a H_ macro so as to not pollute users' namespaces.

On windows build without c4201 so as to allow anonymous struct. This
shows hammer is not C99 compliant but rather C11.
2015-08-09 22:46:00 +02:00
Nicolas Léveillé
e7620e3e4b windows build: Build with debug symbols 2015-08-09 22:46:00 +02:00
Nicolas Léveillé
be30820023 windows build: Add build scripts + appveyor.yml
In order to guarantee that Hammer can build on Windows, an appveyor.yml
and associated build scripts will build hammer and its examples. The idea
is that as soon as the appveyor.yml exists in the repository, pull
requests that would impede Windows portability would be immediately
detected.

The scripts expect CL.EXE to be in the path, and will produce their
results in build/

The highest level of warning is enabled on CL.EXE, minus warnings that
bring CL.EXE to a level that ressembles C99. The only notable warning
that was disabled is the one that tells you about implicit truncating
conversions.

Hammer's source code has quite a few implicit conversions say from a 64bit
unsigned integer to a integer of a lesser size (signed or otherwise)
2015-08-09 22:46:00 +02:00
TQ Hirsch
402721ddb7 Merge pull request #136 from abiggerhammer/master
Fix #133
2015-08-03 00:00:06 +02:00
Meredith L. Patterson
0fb9d77e40 remove error from HSVMContext, make svm_stack_ensure_cap return bool instead 2015-08-02 23:42:38 +02:00
Meredith L. Patterson
759fbe77e5 C++ bindings needed to use system_allocator's free() too 2015-08-02 22:03:30 +02:00
Meredith L. Patterson
6bffacefaf fix memory leak introduced by putting setjmp in the wrong place 2015-08-02 21:46:57 +02:00
Meredith L. Patterson
1ffd8d9276 Fix undefined behaviour around system_allocator, issue #133. 2015-08-02 21:32:47 +02:00
Meredith L. Patterson
0653a9e48a add explicit null checks to system_allocator malloc/realloc 2015-08-02 14:34:45 +02:00
TQ Hirsch
f69698d734 Merge pull request #135 from uucidl/master
Print user defined token type while pretty printing
2015-08-01 13:52:48 +02:00
Nicolas Léveillé
2a6233b74f Print user defined token type while pretty printing
The pretty printing format chosen is USER:<token name>

We use the registry function `h_get_token_type_name` which returns 0
when no name has been defined. This will print (null) as a token name.
2015-08-01 13:42:43 +02:00
TQ Hirsch
9030136d08 Merge pull request #132 from abiggerhammer/master
Usability improvements from the tutorial
2015-07-26 18:15:50 +02:00
Meredith L. Patterson
522bc7cf05 Merge branch 'master' of github.com:abiggerhammer/hammer 2015-05-04 19:01:05 -04:00
Meredith L. Patterson
39c9096fd6 changes from tutorial: add h_literal, make h_make_bytes more practical 2015-05-04 19:00:37 -04:00
Meredith L. Patterson
33af1ec65c Merge pull request #131 from michiexile/master
Algebraic Generating Functions from parser
2015-04-11 01:16:25 +02:00
Mikael Vejdemo-Johansson
d13657a411 Changed generating functions printouts to be copy-paste-able into SageMath.
Now we can do things like:

# copy-paste from output
ring.<t,L,tie,Cn,M,Ln,I,D,J,Rn,A,K,F,G> = QQ[]
ID = ring.ideal(L - (1*Cn*t),tie - (1*Ln*t),Cn - (1*I + 1*J),M - (1*t^2),Ln - (1*D + 1*L + 1*M),I - (1*Rn*t),D - (1*Rn*t),J - (1*Ln*t),Rn - (1*F + 1*G + 1*K),A - (1*tie),K - (1*t^2),F - (1*Ln*t),G - (1*Cn*t))

# we are interested in tie in terms of t; so we want to remove anything not these two:
ID.elimination_ideal([L,Cn,M,Ln,I,D,J,Rn,A,K,F,G])

# output from this SageMath command is
# Ideal (t^3 + 2*t^2*tie + t*tie - tie) of Multivariate Polynomial Ring in t, L, tie, Cn, M, Ln, I, D, J, Rn, A, K, F, G over Rational Field
# which we can solve for tie to get tie = t^3/(1-t-2*t^2) just as expected
2015-04-10 10:05:19 +02:00
Mikael Vejdemo-Johansson
a72aff9b39 refactored out the grammar handling. handles epsilons better 2015-04-08 17:32:12 +02:00
Mikael Vejdemo-Johansson
24e9e9de7f support naming of generating functions, and 0-weighting of symbols 2015-04-08 15:29:32 +02:00
Mikael Vejdemo-Johansson
1e95eac6cd removed h_repeat_n to enable desugaring 2015-04-08 14:06:58 +02:00
Mikael Vejdemo-Johansson
5100dc69da typo 2015-04-08 13:54:30 +02:00
Mikael Vejdemo-Johansson
8039d48537 removed use of h_many to get desugars 2015-04-08 13:53:45 +02:00
Mikael Vejdemo-Johansson
61a211559e fixed build errors wrt sentinels 2015-04-08 13:46:42 +02:00
Mikael Vejdemo-Johansson
9a1812bd49 added ties to build script 2015-04-08 13:44:14 +02:00
Mikael Vejdemo-Johansson
7fdc687bd4 parsers for the grammars in the tieknots paper 2015-04-08 09:33:20 +02:00
Mikael Vejdemo-Johansson
6b8a3f262f polished generating function code more 2015-04-07 22:14:32 +02:00
Mikael Vejdemo-Johansson
107d8c092b Generating function skeleton code 2015-04-07 22:13:18 +02:00
Meredith L. Patterson
8043c7f7b4 Merge pull request #24 from UpstandingHackers/master
Update from trunk
2015-03-15 23:29:57 +01:00
Meredith L. Patterson
26373bf25f Merge pull request #129 from pesco/h_bind
Add monadic bind combinator h_bind
2015-03-10 21:27:24 +01:00
Meredith L. Patterson
af260bdd58 Merge pull request #122 from mrdomino/fix-res_unamb-leak
Free res_unamb
2015-03-10 18:06:01 +01:00
Sven M. Hallberg
aa2dc7bcf5 put the message into the assert in aa_realloc 2015-03-04 14:54:42 +01:00
Sven M. Hallberg
be80fdedfc make arena-allocator implementation functions static 2015-03-04 14:52:28 +01:00