nyacc: new release 0.75.5

This commit is contained in:
Matt Wette 2017-02-17 08:30:20 -08:00 committed by Jan Nieuwenhuizen
parent 883a93ce60
commit 9559240282
5 changed files with 22 additions and 8 deletions

View file

@ -1,4 +1,4 @@
This is a version 0.75.4 of NYACC (Not Yet Another Compiler Compiler!).
This is a version 0.75.5 of NYACC (Not Yet Another Compiler Compiler!).
Copyright (C) 2015-2017 Matthew R. Wette

View file

@ -50,7 +50,7 @@
#:use-module (nyacc util)
)
(define *nyacc-version* "0.75.4")
(define *nyacc-version* "0.75.5")
;; @deffn proxy-? sym rhs

View file

@ -393,7 +393,6 @@
(throw 'c99-error "CPP error"))))
;; Composition of @code{read-cpp-line} and @code{eval-cpp-line}.
;; We should not be doing this!
(define (read-cpp-stmt ch)
(and=> (read-cpp-line ch) cpp-line->stmt))
@ -446,6 +445,7 @@
(let iter ((pair (read-token)))
(case (car ppxs)
((keep)
;;(simple-format #t "lx=>~S\n" pair)
pair)
((skip-done skip-look)
(iter (read-token)))

View file

@ -28,6 +28,9 @@
#:use-module (srfi srfi-2) ;; and-let*
#:use-module (sxml fold)
#:use-module (sxml match)
#:use-module (ice-9 popen) ; gen-cc-defs
#:use-module (ice-9 rdelim) ; gen-cc-defs
#:use-module (ice-9 regex) ; gen-cc-defs
)
;; include-helper for C99 std

View file

@ -1,6 +1,6 @@
;;; nyacc/lang/c99/util2.scm - C processing code
;;;
;;; Copyright (C) 2015,2016 Matthew R. Wette
;;; Copyright (C) 2015-2017 Matthew R. Wette
;;;
;;; This program is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
@ -175,6 +175,8 @@
;; (sx1 (merge-inc-trees! sx0))
;; (name-dict (fold match-decl-1 '() (cdr sx1))))
;; @end example
;; TODO: add enums because they are global!!
;; turn enum { ABC = 123 }; into '(ABC . (enum .. "ABC" "123" .. )
(define (match-decl decl seed)
(let* ((tag (sx-ref decl 0)) (attr (sx-attr decl)))
(case tag
@ -183,9 +185,8 @@
(tbd (sx-ref decl 2))) ; (init-declr-list ...) OR ...
(cond
((or (not tbd) (eqv? 'comment (sx-tag tbd)))
(display "ISSUE: some decls have no init-declr-list\n")
;; no init-declr-list => struct or union def or param-decl
;;(display "spec:\n") (pretty-print spec)
;; no init-declr-list => struct or union def or param-decl enum
;;(display "spec:\n") (pretty-print decl)
(sxml-match spec
((decl-spec-list
(type-spec
@ -195,8 +196,18 @@
(type-spec
(union-def (ident ,name) . ,rest2) . ,rest1))
(acons `(union . ,name) decl seed))
((decl-spec-list
(type-spec
(enum-def
(enum-def-list
(enum-defn
(ident "ABC")
(p-expr (fixed "123")))))))
;; TODO
seed)
(,otherwise
(display "otherwise:\n") (pretty-print (cdr spec))
;; e.g., enum { VAL = 1 };
;;(simple-format #t "+++ otherwise: ~S\n" tbd) (pretty-print decl)
seed)))
(else ;; decl with init-declr-list
(let* ((id-l tbd) (tail (sx-tail decl 3)))