* src/tree.c (makeInline): Inline nodes remember their parent
rule.
* Replace "$$" in inline actions with "__".
* src/tree.h (struct Inline): Inline nodes remember their
parent rule.
* (main): Don't print #line directives for headers if
nolineFlag is set.
* src/compile.c (allocateVariables): Separated from
defineVariables.
* (Node_compile_c_ko): Allocates and sets local variables
during parse.
* (Rule_compile_c2): Generate yyEnter and yyLeave if rule has
variables.
* (preamble): Macros yyEnter and yyLeave manage local variable
space on stack during parsing.
* src/compile.c: Allow re-entrant parsing.
* Macro YYPARSEFROM_R names the function yyparsefrom_r().
* yyDone takes second argument, the yythunkpos at which actions
start.
* yyparsefrom_r saves and restores thunkpos and val state
during recursive parse.
* yyparsefrom resets thunkpos, val before recursive parse.
- Update to 0.1.18:
OBS-URL: https://build.opensuse.org/package/show/devel:tools/peg?expand=0&rev=3
79 lines
2.4 KiB
RPMSpec
79 lines
2.4 KiB
RPMSpec
#
|
|
# spec file for package peg
|
|
#
|
|
# Copyright (c) 2023 SUSE LLC
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
Name: peg
|
|
Version: 0.1.20
|
|
Release: 0
|
|
Summary: Recursive-Descent parser generators for C
|
|
License: MIT
|
|
Group: Development/Tools/Building
|
|
URL: https://piumarta.com/software/peg/
|
|
Source0: http://piumarta.com/software/peg/peg-%{version}.tar.gz
|
|
|
|
%description
|
|
peg(1) and leg(1) are tools for generating recursive-descent
|
|
parsers: programs that perform pattern matching on text. They
|
|
processes a Parsing Expression Grammar (PEG) to produce a program
|
|
that recognises legal sentences of that grammar. peg(1) processes
|
|
PEGs written using the original syntax described by Ford while
|
|
leg(1) processes PEGs written using slightly different syntax and
|
|
conventions that are intended to make it an attractive replacement
|
|
for parsers built with lex(1) and yacc(1). Unlike lex(1) and
|
|
yacc(1), peg(1) and leg(1) 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.
|
|
|
|
%prep
|
|
%setup -q
|
|
|
|
%build
|
|
# bootstrap tools
|
|
touch peg.peg-c leg.c
|
|
%make_build \
|
|
CC="gcc" \
|
|
OFLAGS="%{optflags -O}"
|
|
|
|
# re-build from scratch
|
|
touch peg.peg leg.leg
|
|
rm peg.o leg.o
|
|
%make_build \
|
|
CC="gcc" \
|
|
OFLAGS="%{optflags -O}"
|
|
|
|
%install
|
|
mkdir -p -m 755 \
|
|
%{buildroot}%{_bindir} \
|
|
%{buildroot}%{_mandir}/man1
|
|
install -c -s -m 755 \
|
|
peg leg %{buildroot}%{_bindir}
|
|
install -c -m 644 \
|
|
src/peg.1 %{buildroot}%{_mandir}/man1/
|
|
install -c -m 644 \
|
|
src/peg.1 %{buildroot}%{_mandir}/man1/leg.1
|
|
|
|
%files
|
|
%license LICENSE.txt
|
|
%doc README.txt
|
|
%{_bindir}/%{name}
|
|
%{_bindir}/leg
|
|
%{_mandir}/man1/%{name}.1%{?ext_man}
|
|
%{_mandir}/man1/leg.1%{?ext_man}
|
|
|
|
%changelog
|