Tim Landscheidt | 1 Nov 02:30
Picon

m4 and skeleton system

Hi,

I'm looking at adding support for PHP to flex, and it looks
generally feasible.

  What I don't quite understand is the reasoning behind
flex's skeleton system.  While Bison's is pretty straight
forward, - CMIIW - flex processes the skeleton with m4 to a
C array, then implements some "%if-..." control structures
of its own and processes the result again with m4 (offering
the user another set of control structures for his code).
The only technical advantage to Bison's that I can see from
a distance is that in this way the whole shebang is contain-
ed in one binary.

  So with regard to my goal, should I go for "%if-php-only",
or would a patch to streamline the skeleton system first be
met favourably?

TIA,
Tim
Tim Landscheidt | 8 Nov 20:10
Picon

Re: m4 and skeleton system

I wrote:

> [...]
>   What I don't quite understand is the reasoning behind
> flex's skeleton system.  While Bison's is pretty straight
> forward, - CMIIW - flex processes the skeleton with m4 to a
> C array, then implements some "%if-..." control structures
> of its own and processes the result again with m4 (offering
> the user another set of control structures for his code).
> The only technical advantage to Bison's that I can see from
> a distance is that in this way the whole shebang is contain-
> ed in one binary.

>   So with regard to my goal, should I go for "%if-php-only",
> or would a patch to streamline the skeleton system first be
> met favourably?

Attached is an initial patch to remove the m4 preprocessing
(cf. <URI:https://github.com/scfc/flex/tree/m4-nopreproc>
for finer granularity).

  It should change the output only when "--tables-file" is
used in that the copyright notice (*1) is now reproduced
verbatim, i. e. the "``AS IS''" is no longer mangled to "`AS
IS'".

  It introduces a new option "--skeldir" which points to a
directory containing (for now) "flexint.h",
"tables_shared.c" and "tables_shared.h".

(Continue reading)

Tim Landscheidt | 19 Nov 02:36
Picon

[PATCH] Convert the testsuite to autotest

Hi,

attached is a bzipped patch to convert the testsuite to
autotest.  A fine-grained version that proves that the data
files are imported verbatim can be found at
<URI:https://github.com/scfc/flex/tree/autotest>.

  The patch is based on my previous "m4-nopreproc" patch but
it should be possible to adapt it to HEAD if care is taken
of the "--skeldir" option.

Tim
Attachment (flex-autotest.patch.bz2): application/x-bzip2, 67 KiB
_______________________________________________
help-flex mailing list
help-flex <at> gnu.org
https://lists.gnu.org/mailman/listinfo/help-flex
Hans Aberg | 19 Nov 13:26
Picon

Re: [PATCH] Convert the testsuite to autotest

On 19 Nov 2011, at 02:36, Tim Landscheidt wrote:

> Hi,
> 
> attached is a bzipped patch to convert the testsuite to
> autotest.  

There is currently no Flex developer or maintainer.

Hans
Tim Landscheidt | 19 Nov 19:53
Picon

Re: [PATCH] Convert the testsuite to autotest

Hans Aberg <haberg-1 <at> telia.com> wrote:

>> attached is a bzipped patch to convert the testsuite to
>> autotest.

> There is currently no Flex developer or maintainer.

I had assumed this, but:

- as yesterday's xkcd so nicely illustrated, who knows what
  will be in 2019, and
- there are certainly readers of this mailing list who won't
  consider themselves *flex* developers, but might glance at
  patches or try to compile them on their own machines and
  give some advice and/or feedback.

So noone should feel compelled to answer, but I appreciate
it :-).

Tim
Tim Landscheidt | 20 Nov 23:21
Picon

Re: [PATCH] Convert the testsuite to autotest

I wrote:

> attached is a bzipped patch to convert the testsuite to
> autotest.  A fine-grained version that proves that the data
> files are imported verbatim can be found at
> <URI:https://github.com/scfc/flex/tree/autotest>.

>   The patch is based on my previous "m4-nopreproc" patch but
> it should be possible to adapt it to HEAD if care is taken
> of the "--skeldir" option.

After applying Fedora's patch for C++, I noticed that the
expected output for "c++-basic" and "c++-multiple-scanners"
was wrong.  Attached patch fixes that.

Tim
diff --git a/tests/c++-basic.at b/tests/c++-basic.at
index af95eed..7256d35 100644
--- a/tests/c++-basic.at
+++ b/tests/c++-basic.at
@@ -61,7 +61,9 @@ AT_DATA([[test.input]], [[0000 foo 1111 foo 0000 bar
 AT_CHECK([["$abs_top_builddir/flex" --skeldir "$abs_top_builddir/data" -+ scanner.l]])
 AT_CHECK([[$CXX -c -o scanner.o -I"$abs_top_builddir" $CPPFLAGS $CXXFLAGS scanner.cpp]])
 AT_CHECK([[$CXX -o test-c++-basic $LDFLAGS scanner.o]])
-AT_CHECK([[./test-c++-basic < test.input]], [[0]], [[TEST RETURNING OK.
+AT_CHECK([[./test-c++-basic < test.input]], [[0]], [[
+
+TEST RETURNING OK.
(Continue reading)


Gmane