Browse Source

textproc/peg: [New port] recursive-descent parser generators for C

WWW: https://www.piumarta.com/software/peg/

Sponsored by:	The FreeBSD Foundation
2022Q3
Joseph Mingrone 2 weeks ago
parent
commit
b001febccb
No known key found for this signature in database
GPG Key ID: 36A40C83B0D6EF9E
  1. 1
      textproc/Makefile
  2. 21
      textproc/peg/Makefile
  3. 3
      textproc/peg/distinfo
  4. 19
      textproc/peg/files/patch-Makefile
  5. 17
      textproc/peg/pkg-descr

1
textproc/Makefile

@ -1219,6 +1219,7 @@
SUBDIR += pecl-xdiff2
SUBDIR += pecl-yaml
SUBDIR += peco
SUBDIR += peg
SUBDIR += perl2html
SUBDIR += php-mecab
SUBDIR += php74-ctype

21
textproc/peg/Makefile

@ -0,0 +1,21 @@
PORTNAME= peg
DISTVERSION= 0.1.18
CATEGORIES= textproc
MASTER_SITES= https://www.piumarta.com/software/peg/
MAINTAINER= jrm@FreeBSD.org
COMMENT= Recursive-descent parser generators for C
LICENSE= MIT
USES= gmake
PLIST_FILES= bin/leg \
bin/peg \
man/man1/peg.1.gz
post-patch:
@${REINPLACE_CMD} -e 's,%%STAGEDIR%%,${STAGEDIR},g' \
-e 's,%%PREFIX%%,${PREFIX},g' ${WRKSRC}/Makefile
.include <bsd.port.mk>

3
textproc/peg/distinfo

@ -0,0 +1,3 @@
TIMESTAMP = 1655934585
SHA256 (peg-0.1.18.tar.gz) = 20193bdd673fc7487a38937e297fff08aa73751b633a086ac28c3b34890f9084
SIZE (peg-0.1.18.tar.gz) = 57776

19
textproc/peg/files/patch-Makefile

@ -0,0 +1,19 @@
--- Makefile.orig 2016-07-22 00:55:15 UTC
+++ Makefile
@@ -1,4 +1,4 @@
-CFLAGS = -g -Wall $(OFLAGS) $(XFLAGS) -Isrc
+CFLAGS = -Wall $(OFLAGS) $(XFLAGS) -Isrc
OFLAGS = -O3 -DNDEBUG
#OFLAGS = -pg
@@ -14,8 +14,8 @@ leg : leg.o $(OBJS)
$(CC) $(CFLAGS) -o $@-new leg.o $(OBJS)
mv $@-new $@
-ROOT =
-PREFIX = /usr/local
+ROOT = %%STAGEDIR%%
+PREFIX = %%PREFIX%%
BINDIR = $(ROOT)$(PREFIX)/bin
MANDIR = $(ROOT)$(PREFIX)/man/man1

17
textproc/peg/pkg-descr

@ -0,0 +1,17 @@
peg and leg are tools for generating recursive-descent parsers: programs
that perform pattern matching on text. They processes a Parsing
Expression Grammar (PEG) [Ford 2004] to produce a program that
recognises legal sentences of that grammar. peg processes PEGs written
using the original syntax described by Ford; leg processes PEGs written
using slightly different syntax and conventions that are intended to
make it an attractive replacement for parsers built with lex and
yacc. Unlike lex and yacc, peg and leg support unlimited backtracking,
provide ordered choice as a means for disambiguation, and can combine
scanning (lexical analysis) and parsing (syntactic analysis) into a
single activity.
[Ford 2004] Bryan Ford, Parsing Expression Grammars: A Recognition-Based
Syntactic Foundation. ACM SIGPLAN Symposium on Principles of Programming
Languages (POPL), 2004.
WWW: https://www.piumarta.com/software/peg/
Loading…
Cancel
Save