pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
carburetta: Update to 0.8.28
Module Name: pkgsrc-wip
Committed By: Michael Baeuerle <micha%NetBSD.org@localhost>
Pushed By: micha
Date: Wed Jul 8 18:05:32 2026 +0200
Changeset: 59a6804964fb82646d8cc7172b0653bc2074ff94
Modified Files:
carburetta/Makefile
carburetta/TODO
carburetta/distinfo
Removed Files:
carburetta/patches/patch-Makefile
Log Message:
carburetta: Update to 0.8.28
0.8.28 - 2026-01-11
- Will now emit #line so C/C++ compilation errors on generated code
will be located at the corresponding snippet code in the .cbrt input
file, where appropatiate. Use --nolinedir to disable.
- Can now emit a symbol_names[] table for all ordinal constants, this
can be useful when writing code that uses Carburetta's internal
structures more dynamically and you wish to emit debug information.
Only generated when --sym-names is specified.
- Instead of specifying a filename, you can now pass - (a dash) for
the filename and the grammar input will be read from stdin.
0.8.25 - 2025-04-14
- New 'visit' feature. When specifying either %visit or %visit_params
directives, Carburetta will now generate a new function
<prefix>stack_visit() that visits all the symbol datatypes inside
the stack, using stack internal runtime type information to dispatch
to the appropriate snippet of code.
Please see the https://carburetta.com/manual.html#prefixstack_visit
section of the manual for details on the function generated.
0.8.24 - 2025-02-10
- Fixed a bug where the generated parser would not correctly handle
%type with no %constructor, %destructor or %move (so a plain %type
with no initialization, destruction, nor any special data moving
operation).
This would cause the parser not to correctly move the data when
resizing buffers. This did not impact %class which defines these
operations implicitly.
- Disabled the address sanitizer (ASAN) on MSVC for the x86 debug
build, it trips a bug that appears to be unrelated to Carburetta
itself. ASAN is still enabled for the x64 build.
- Added the "kc" C99 compiler front-end and interpreter as an example.
Currently only builds on the MSVC build for x64 because the interpeter
uses x64 assembly to build a trampoline for function pointers, which
is both platform and machine specific (hence MSVC x64). The build
currently only builds a library and not yet a test program, and so is
a work in progress.
0.8.22 - 2024-12-31
- Removed many warnings on both gcc, clang and msvc.
- Fixed problems with variables that were not generated in parser-only
situations.
- Fixed internal self-use of Carburetta, where %on_alloc_error and
%on_internal_error assumed that user-defined parameters were available,
this is not the case when called from cleanup.
- Regenerate Carburetta self-use code. Resolve some issues with
Carburetta's own use of itself (ouroboros) - you wouldn't ordinarily
run into these because Carburetta has its own self-generated code checked
in to prevent the bootstrap problem.
- Carburetta internal issues due to not correctly passing the match and
variant of tokens.
- Many issues where %move semantics inside Carburetta did not clear
source pointers to NULL causing destruction to be called twice. There
is a more permanent solution for this below.
- New %move semantics, when a %type does not have an explicit %move, then
we no longer destruct the source data, but assume that the source is
destructed when the copy is destructed. So, for instance, suppose we
have %type char*, a malloc'ed string, then previously, you needed to
add an explicit %move that cleared the source to prevent the destructor
on the source from free'ing the pointer that was copied over.
The new behavior is that, when relying on the default %move (a memcpy),
the source is no longer destructed. This is very likely what users
would expect and reduces the need for %move directives on everything.
C++ %class types are not affected as these always generate a default
and valid C++ style %move with appropriate destruction semantics.
- Substantial updates to the Tilly example. Tilly is a tiling engine
that is useful for generating machine code from expression trees.
The Tilly example is a work in progress, it implements the algorithm
from the 1989 paper: "Code Generation Using Tree Matching and Dynamic
Programming" by Alfred V. Aho, Mahadevan Ganapathi and Steven W.K. Tjiang.
The Tilly example is a good example of how to use Carburetta to implement
a more complex multi-stage parser.
It continues to be a work in progress and needs more documentation.
- t16 and t17 test the new %move semantics for %type scenarios.
- Addition of %on_scan_token and $set_token(token-id) for scanner.
The snippet for %on_scan_token is inserted in the scan function when a new
token is needed. The snippet can chose to do nothing (in which case the lexer
will execute on the input and determine a new token), or it can insert a
token in the stream using $set_token(token-id); the token-id must be a
terminal, and no data can be set for the terminal (so the terminal should not
have any associated type.)
%on_next_token is now only generated for parsers.
- Since the previous release, there is now a new example in the form of Aex-GL.
Aex-GL is a portable OpenGL ES 2.0 software implementation in C, using Carburetta
to parse the GLSL ES 1.0 shader language. You can find the Aex-GL example in the
github repository at https://github.com/kingletbv/aex-gl
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=59a6804964fb82646d8cc7172b0653bc2074ff94
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
carburetta/Makefile | 2 +-
carburetta/TODO | 8 ++++-
carburetta/distinfo | 7 ++---
carburetta/patches/patch-Makefile | 66 ---------------------------------------
4 files changed, 11 insertions(+), 72 deletions(-)
diffs:
diff --git a/carburetta/Makefile b/carburetta/Makefile
index 9049c22ac7..1ed4701ba9 100644
--- a/carburetta/Makefile
+++ b/carburetta/Makefile
@@ -1,6 +1,6 @@
# $NetBSD$
-DISTNAME= carburetta-v0.8.20
+DISTNAME= carburetta-v0.8.28
PKGNAME= ${DISTNAME:S/-v/-/}
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GITHUB:=kingletbv/}
diff --git a/carburetta/TODO b/carburetta/TODO
index 4e7ec7ddd5..f094c1c17f 100644
--- a/carburetta/TODO
+++ b/carburetta/TODO
@@ -1 +1,7 @@
-- Fix segfault while building on NetBSD
+[ ] Fix segfault while building on NetBSD
+
+ mkdir -p build/objs/calc
+ build/carburetta examples/calc/calc.cbrt --c build/objs/calc/calc.c
+ examples/calc/calc.cbrt
+ gmake: *** [Makefile:39: build/objs/calc/calc.c] Segmentation fault
+ *** Error code 2
diff --git a/carburetta/distinfo b/carburetta/distinfo
index 8481997615..513dedf056 100644
--- a/carburetta/distinfo
+++ b/carburetta/distinfo
@@ -1,7 +1,6 @@
$NetBSD$
-BLAKE2s (carburetta-v0.8.20.tar.gz) = 49fffd09031c5c5d441188a7c82d784043cb6c91101b33955db2219879986aac
-SHA512 (carburetta-v0.8.20.tar.gz) = dc5b78b3c0050eadb1d731789f381b8795230965416f74f650c89f1a9a29b8a36fd5b9c8d9bfa4f65c56559afe08ebbe69b3b4ea46e38d14d0b16d95d7d6501d
-Size (carburetta-v0.8.20.tar.gz) = 264453 bytes
-SHA1 (patch-Makefile) = 70ee97ca145ef3cd42fc56165884539d91ae6e73
+BLAKE2s (carburetta-v0.8.28.tar.gz) = 6103997b0f6f0a624a05efa324d3825e77719ab6019691bd40f19bb5c22c51ad
+SHA512 (carburetta-v0.8.28.tar.gz) = a50808d3f58417a9232bd341b597a6cd73826a6246b5622c09cf82b8270ed73c346758a3539854266aabf193794b495721381b02519c3216af3fbc03102d2906
+Size (carburetta-v0.8.28.tar.gz) = 846891 bytes
SHA1 (patch-src_temp__output.c) = 2534236b8c2537011646e8fa4342ddf88ee24ceb
diff --git a/carburetta/patches/patch-Makefile b/carburetta/patches/patch-Makefile
deleted file mode 100644
index 107ff71805..0000000000
--- a/carburetta/patches/patch-Makefile
+++ /dev/null
@@ -1,66 +0,0 @@
-$NetBSD$
-
-Do not overwrite $CC from environment with specific compiler.
-Honor CPPFLAGS, CFLAGS and LDFLAGS for build.
-Honor DESTDIR and PREFIX for install.
-
---- Makefile.orig 2023-07-14 09:48:48.000000000 +0000
-+++ Makefile
-@@ -1,10 +1,8 @@
--CC=gcc
--#CC=clang
--CXXFLAGS=-Wall
-+# Modified version for pkgsrc
-
--OUT = build/linux
-+OUT = build
- SRC = src
--INTERMEDIATE = build/linux/objs
-+INTERMEDIATE = build/objs
-
- SOURCES = $(filter-out src/tokens_generated_scanners.c,$(wildcard $(SRC)/*.c))
- OBJECTS = $(patsubst $(SRC)/%.c,$(INTERMEDIATE)/%.o,$(SOURCES))
-@@ -19,10 +17,10 @@ all: $(OUT)/carburetta $(OUT)/calc $(OUT
-
- $(INTERMEDIATE)/%.o: $(SRC)/%.c
- @mkdir -p $(@D)
-- $(CC) -c -o $@ $<
-+ $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
-
- $(OUT)/carburetta: $(OBJECTS)
-- $(CC) -o $(OUT)/carburetta $(OBJECTS)
-+ $(CC) $(LDFLAGS) -o $(OUT)/carburetta $(OBJECTS)
-
- $(INTERMEDIATE)/calc/calc.c: $(OUT)/carburetta examples/calc/calc.cbrt
- mkdir -p $(@D)
-@@ -37,13 +35,13 @@ $(INTERMEDIATE)/template_scan/template_s
- $(OUT)/carburetta examples/template_scan/template_scan.cbrt --c $(INTERMEDIATE)/template_scan/template_scan.c
-
- $(OUT)/calc: $(INTERMEDIATE)/calc/calc.c
-- $(CC) -o $(OUT)/calc $(INTERMEDIATE)/calc/calc.c
-+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $(OUT)/calc $(INTERMEDIATE)/calc/calc.c
-
- $(OUT)/inireader: $(INTERMEDIATE)/inireader/iniparser.c examples/inireader/main.c
-- $(CC) -o $(OUT)/inireader -I$(INTERMEDIATE)/inireader -Iexamples/inireader $(INTERMEDIATE)/inireader/iniparser.c examples/inireader/main.c
-+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $(OUT)/inireader -I$(INTERMEDIATE)/inireader -Iexamples/inireader $(INTERMEDIATE)/inireader/iniparser.c examples/inireader/main.c
-
- $(OUT)/template_scan: $(INTERMEDIATE)/template_scan/template_scan.c
-- $(CC) -o $(OUT)/template_scan $(INTERMEDIATE)/template_scan/template_scan.c
-+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $(OUT)/template_scan $(INTERMEDIATE)/template_scan/template_scan.c
-
- .PRECIOUS: $(INTERMEDIATE)/tester/%.c
- $(INTERMEDIATE)/tester/%.c: tester/%.cbrt
-@@ -71,11 +69,11 @@ clean:
-
- .PHONY: install
- install: all
-- install $(OUT)/carburetta /usr/local/bin
-+ install $(OUT)/carburetta $(DESTDIR)$(PREFIX)/bin
-
- .PHONY: uninstall
- uninstall:
-- rm /usr/local/bin/carburetta
-+ rm $(DESTDIR)$(PREFIX)/bin/carburetta
-
- .PHONY: test
- test: all
Home |
Main Index |
Thread Index |
Old Index