unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* [ANN] nyacc 0.80.3 released
@ 2017-06-18 22:07 Matt Wette
  2017-07-24 12:35 ` 0ULL [WAS: [ANN] nyacc 0.80.3 released] Jan Nieuwenhuizen
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Matt Wette @ 2017-06-18 22:07 UTC (permalink / raw)
  To: Guile User, guile-devel

NYACC V0.80.3 is released.

This release has work on the ffi-helper and numerous bug fixes:
1) use 0 for undefined identifiers in CPP conditional expressions
2) fixed lex routine make-ident-like-p to check for zero-length strings
3) fixed bug in c99/util2.smc that added comments in struct cleanup
4) changed c99/util2.scm:c99-trans-unit->udict to use fold-right


NYACC, for Not Yet Another Compiler Compiler!, is set of guile modules for
generating parsers and lexical analyzers.  It also provides sample parsers
and pretty-printers using SXML trees as an intermediate representation.

NYACC maturity is beta level.

NYACC is free software; the full source distribution is available through

tarball repository:
    https://download.savannah.gnu.org/releases/nyacc/

git repository:
    git://git.savannah.nongnu.org/nyacc.git

home page, project page, user's guide:
    http://www.nongnu.org/nyacc
    https://savannah.nongnu.org/projects/nyacc
    http://www.nongnu.org/nyacc/nyacc-ug.html

For support see:
    https://savannah.nongnu.org/support/?group=nyacc




^ permalink raw reply	[flat|nested] 5+ messages in thread

* 0ULL  [WAS: [ANN] nyacc 0.80.3 released]
  2017-06-18 22:07 [ANN] nyacc 0.80.3 released Matt Wette
@ 2017-07-24 12:35 ` Jan Nieuwenhuizen
  2017-07-24 12:49 ` Unexpected extra parens on struct-ref " Jan Nieuwenhuizen
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jan Nieuwenhuizen @ 2017-07-24 12:35 UTC (permalink / raw)
  To: Matt Wette; +Cc: Guile User

Matt Wette writes:

Hi Matt,

> NYACC V0.80.3 is released.

In the process of compiling tinycc and Guile's eval.c I found some minor
bugs, here's the first.

Greetings,
janneke


int
main ()
{
  return 0ULL;
}

scaffold/tests/t.c:26: parse failed at state 259, on input "L"
scaffold/tests/t.c:26: C99 parse error



-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Unexpected extra parens on struct-ref [WAS: [ANN] nyacc 0.80.3 released]
  2017-06-18 22:07 [ANN] nyacc 0.80.3 released Matt Wette
  2017-07-24 12:35 ` 0ULL [WAS: [ANN] nyacc 0.80.3 released] Jan Nieuwenhuizen
@ 2017-07-24 12:49 ` Jan Nieuwenhuizen
  2017-07-24 12:52 ` Jan Nieuwenhuizen
  2017-07-24 12:59 ` libguile/eval.c: parse failed on input "x37" " Jan Nieuwenhuizen
  3 siblings, 0 replies; 5+ messages in thread
From: Jan Nieuwenhuizen @ 2017-07-24 12:49 UTC (permalink / raw)
  To: Matt Wette; +Cc: Guile User

Matt Wette writes:

> NYACC V0.80.3 is released.

This works as expected:

    typedef struct foo {
      int bar;
    } baz;

    int
    main ()
    {
      struct foo f;

      return 0;
    }

=>

    (trans-unit
      (decl (decl-spec-list
              (stor-spec (typedef))
              (type-spec
                (struct-def
                  (ident "foo")
                  (field-list
                    (comp-decl
                      (decl-spec-list (type-spec (fixed-type "int")))
                      (comp-declr-list (comp-declr (ident "bar"))))))))
            (init-declr-list (init-declr (ident "baz"))))
      (fctn-defn
        (decl-spec-list (type-spec (fixed-type "int")))
        (ftn-declr (ident "main") (param-list))
        (compd-stmt
          (block-item-list
            (decl (decl-spec-list
                    (type-spec (struct-ref (ident "foo"))))
                  (init-declr-list (init-declr (ident "f"))))
            (return (p-expr (fixed "0")))))))


but typedef'ing struct foo to foo like so:

    typedef struct foo {
      int bar;
    } foo;

    int
    main ()
    {
      struct foo f;

      return 0;
    }

gives unexpected parens when using it in main:

    (trans-unit
      (decl (decl-spec-list
              (stor-spec (typedef))
              (type-spec
                (struct-def
                  (ident "foo")
                  (field-list
                    (comp-decl
                      (decl-spec-list (type-spec (fixed-type "int")))
                      (comp-declr-list (comp-declr (ident "bar"))))))))
            (init-declr-list (init-declr (ident "foo"))))
      (fctn-defn
        (decl-spec-list (type-spec (fixed-type "int")))
        (ftn-declr (ident "main") (param-list))
        (compd-stmt
          (block-item-list
            (decl (decl-spec-list
                    (type-spec (struct-ref (ident ("foo")))))
                  (init-declr-list (init-declr (ident "f"))))
            (return (p-expr (fixed "0")))))))


This bit: (struct-ref (ident ("foo")))

There seem to be more places where the extra parens occur.

Greetings,
janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [WAS: [ANN] nyacc 0.80.3 released]
  2017-06-18 22:07 [ANN] nyacc 0.80.3 released Matt Wette
  2017-07-24 12:35 ` 0ULL [WAS: [ANN] nyacc 0.80.3 released] Jan Nieuwenhuizen
  2017-07-24 12:49 ` Unexpected extra parens on struct-ref " Jan Nieuwenhuizen
@ 2017-07-24 12:52 ` Jan Nieuwenhuizen
  2017-07-24 12:59 ` libguile/eval.c: parse failed on input "x37" " Jan Nieuwenhuizen
  3 siblings, 0 replies; 5+ messages in thread
From: Jan Nieuwenhuizen @ 2017-07-24 12:52 UTC (permalink / raw)
  To: Matt Wette; +Cc: Guile User

Matt Wette writes:

> NYACC V0.80.3 is released.

This will expand the both THEN clauses, having main return 0; where in
the second case, the ELSE clause should be expanded, having main return
2.

This #define / #undef trick is used by tinycc, I just found it and now
worked around it by setting a second define instead.

    #define DEF

    #ifdef DEF
    int def () {return 0;}
    #else
    int def () {return 1;}
    #endif

    #undef DEF

    #ifdef DEF
    int expand () {return 0;}
    #else
    int expand () {return 2;}
    #endif

    int
    main ()
    {
      return def () + expand ();
    }

Greetings,
janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com



^ permalink raw reply	[flat|nested] 5+ messages in thread

* libguile/eval.c: parse failed on input "x37" [WAS: [ANN] nyacc 0.80.3 released]
  2017-06-18 22:07 [ANN] nyacc 0.80.3 released Matt Wette
                   ` (2 preceding siblings ...)
  2017-07-24 12:52 ` Jan Nieuwenhuizen
@ 2017-07-24 12:59 ` Jan Nieuwenhuizen
  3 siblings, 0 replies; 5+ messages in thread
From: Jan Nieuwenhuizen @ 2017-07-24 12:59 UTC (permalink / raw)
  To: Matt Wette; +Cc: Guile User

Matt Wette writes:

The below condensed excerpt from Guile's eval.c gives

    (unknown):1: parse failed at state 299, on input "x37"
    scaffold/tests/t.c:55: C99 parse error

This looks pretty tricky and I'm not really working on this atm, just
thought to let you know.

Greetings,
janneke


typedef int scm_t_bits;
typedef int scm_t_cell;
typedef int *SCM;

#define SCM_UNPACK(x) ((scm_t_bits) (x))
#define SCM_UNPACK_POINTER(x) ((scm_t_bits *) (SCM_UNPACK (x)))
#define SCM_PACK_POINTER(x) (SCM_PACK ((scm_t_bits) (x)))
#define SCM2PTR(x) ((scm_t_cell *) (SCM_UNPACK_POINTER (x)))
#define SCM_GC_CELL_OBJECT(x, n) (((SCM *)SCM2PTR (x)) [n])
#define SCM_GC_CELL_WORD(x, n)   (SCM_UNPACK (SCM_GC_CELL_OBJECT ((x), (n))))
#define SCM_CELL_WORD(x, n) SCM_GC_CELL_WORD ((x), (n))
#define SCM_CELL_WORD_0(x) SCM_CELL_WORD ((x), 0)
#define SCM_CELL_TYPE(x) SCM_CELL_WORD_0 (x)


#define SCM_IMP(x) 		(6 & SCM_UNPACK (x))
#define SCM_NIMP(x) 		(!SCM_IMP (x))
#define SCM_HEAP_OBJECT_P(x)    (SCM_NIMP (x))

#define SCM_TYP7(x) 		(0x7f & SCM_CELL_TYPE (x))
#define SCM_HAS_HEAP_TYPE(x, type, tag)                         \
  (SCM_NIMP (x) && type (x) == (tag))
#define SCM_HAS_TYP7(x, tag)    (SCM_HAS_HEAP_TYPE (x, SCM_TYP7, tag))
#define scm_tc7_atomic_box	0x37

int
main ()
{
  return SCM_HAS_TYP7 (0, scm_tc7_atomic_box);
}

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-24 12:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-18 22:07 [ANN] nyacc 0.80.3 released Matt Wette
2017-07-24 12:35 ` 0ULL [WAS: [ANN] nyacc 0.80.3 released] Jan Nieuwenhuizen
2017-07-24 12:49 ` Unexpected extra parens on struct-ref " Jan Nieuwenhuizen
2017-07-24 12:52 ` Jan Nieuwenhuizen
2017-07-24 12:59 ` libguile/eval.c: parse failed on input "x37" " Jan Nieuwenhuizen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).