[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

changes coming to the nyacc c99 parser

From: Matt Wette
Subject: changes coming to the nyacc c99 parser
Date: Thu, 5 Apr 2018 16:16:40 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

Just to let nyacc c99 uses know ...

In the process of testing my "FFI Helper" I have found it necessary to expand the
nyacc c99 parser a bit.

First of all, thanks to Taylan for providing great support for his scheme-bytestructures package.  This provide the C-Scheme compatibility needed to support calling into C

I am currently working on generating a dbus mainloop from libdbus and epoll with the ffi-helper.  It turns out that epoll used packed structures.  This means that the nyacc c99 parser has to be upgraded to parse the gcc __attributes__ extension and this structure needs to be carried up into the C-to-Scheme conversion process.  I still have a bit of work to go but it turns out that scheme-bytestructures provided a flags for
specifying packed structures.   Away I go to get this working ...

struct epoll_event {
  uint32_t events;
  epoll_data_t data;
} __attribute__ ((__packed__));


||    (decl (decl-spec-list
                (@ ("__packed__" ""))
                (ident "epoll_event")
                      (type-spec (typename "uint32_t")))
                    (comp-declr-list (comp-declr (ident "events"))))
                      (type-spec (typename "epoll_data_t")))
                    (comp-declr-list (comp-declr (ident "data"))))))))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]