From 1dd946b919ed84803e27af2697c83ffa8bafb34c Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Thu, 5 Apr 2018 21:13:13 +0200 Subject: [PATCH 2/2] trace function names being parsed. * module/nyacc/lang/c99/mach.d/c99act.scm (trace-function)[NYACC_TRACE]: Trace function names being parsed. (c99-act-v): Use it. --- module/nyacc/lang/c99/mach.d/c99act.scm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/module/nyacc/lang/c99/mach.d/c99act.scm b/module/nyacc/lang/c99/mach.d/c99act.scm index cfbdb7f..565f9b4 100644 --- a/module/nyacc/lang/c99/mach.d/c99act.scm +++ b/module/nyacc/lang/c99/mach.d/c99act.scm @@ -8,6 +8,12 @@ ;; version 3 of the License, or (at your option) any later version. ;; See the file COPYING.LESSER included with the this distribution. +(define (trace-function $1) + (when (getenv "NYACC_TRACE") + (display " :" (current-error-port)) + (display (cadr $1) (current-error-port)) + (display "\n" (current-error-port)))) + (define c99-act-v (vector ;; $start => translation-unit @@ -487,12 +493,15 @@ `(array-of ,$1 (var-len))) ;; direct-declarator => direct-declarator "(" parameter-type-list ")" (lambda ($4 $3 $2 $1 . $rest) + (trace-function $1) `(ftn-declr ,$1 ,(tl->list $3))) ;; direct-declarator => direct-declarator "(" identifier-list ")" (lambda ($4 $3 $2 $1 . $rest) + (trace-function $1) `(ftn-declr ,$1 ,(tl->list $3))) ;; direct-declarator => direct-declarator "(" ")" (lambda ($3 $2 $1 . $rest) + (trace-function $1) `(ftn-declr ,$1 (param-list))) ;; pointer => "*" type-qualifier-list pointer (lambda ($3 $2 $1 . $rest) -- 2.16.2