From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johan Rydberg To: "Frank Ch. Eigler" Cc: cgen@sources.redhat.com Subject: Re: enums Date: Wed, 06 Dec 2000 03:23:00 -0000 Message-id: <3A2E21F0.A5A0C5FE@netinsight.se> References: <3A2DF94D.908E4C45@netinsight.se> <20001206061648.A1107@redhat.com> X-SW-Source: 2000-q4/msg00237.html "Frank Ch. Eigler" wrote: > : (values ("RESET") ("BUSERR" -) ("DPF" -) ("IPF" -) > : ("EXTINT" -) ("ALIGN" -) ("ILLEGAL" -) ("PEINT" -) > : ("DTLBMISS" -) ("ITLBMISS" -) ("RRANGE" -) > : ("SYSCALL" -) ("BREAK" -) ("RESERVED" -)) > > Is this intentional? Why define the others with value "-" ? Well, first i defined it like: ("RESET" #x100) ("BUFFER" #x200) And that didn't work at all. All the "-" values is just the result of a search-and-replace. > : And if I define the values like this, > : > : (values ("RESET" #x100) ("BUSERR" -) ("DPF" -) ("IPF" -) > : ("EXTINT" -) ("ALIGN" -) ("ILLEGAL" -) ("PEINT" -) > : ("DTLBMISS" -) ("ITLBMISS" -) ("RRANGE" -) > : ("SYSCALL" -) ("BREAK" -) ("RESERVED" -)) > : > : I get the following message for CGEN: > : ERROR: In procedure caar: > : ERROR: Wrong type argument in position 1: () > > Just a bug. Could you try running cgen with error backtracing? > (CGENFLAGS="-b"; works for guile 1.3.*) Ofcouse, here's the result: ERROR: In procedure caar: ERROR: Wrong type argument in position 1: () Backtrace: 0 (begin (apply display-error #f ...) (save-stack) ...) 1* (if (= (length args) 5) (begin (apply display-error #f ...) (save-stack) ...)) 2* [# wrong-type-arg "caar" ...] 3* [caar (() (prefix E_) (values # # ...))] 4 (let ((arg #) (elm-name #)) (case elm-name (# #) ...) ...) 5 (if (null? arg-list) nil ...) 6 [# (() (prefix E_) (values # # ...))] 7 (let ((arg #) (elm-name #)) (case elm-name (# #) ...) ...) 8 (if (null? arg-list) nil ...) 9 [# ((comment "exception vectors") () (prefix E_) ...)] 10 (let ((arg #) (elm-name #)) (case elm-name (# #) ...) ...) 11 (if (null? arg-list) nil ...) 12 [# ((name e-exception) (comment "exception vectors") () ...)] 13* (letrec ((loop #)) (loop arg-list)) 14 (let ((name nil) (comment "") (attrs nil) ...) (letrec (#) (loop arg-list)) ...) 15 [-enum-read "define-enum" (name e-exception) ...] 16* [apply # ("define-enum" (name e-exception) (comment "exception vectors") ...)] 17 (let ((e #)) (current-enum-add! e) ...) 18 [define-enum (name e-exception) (comment "exception vectors") ...] 19 [apply # ((name e-exception) (comment "exception vectors") () ...)] 20 (if (< (length #) (car num-args)) (reader-error (string-append "Incorrect number of arguments to " # ...) entry ...) ...) 21 (if (cdr num-args) (if (< # #) (reader-error # entry ...) ...) ...) 22 (let* ((handler #) (arg-spec #) (num-args #)) (if (cdr num-args) (if # # ...) ...)) 23 (if command (let* (# # #) (if # # ...)) ...) 24* (let ((command #)) (if command (let* # #) ...)) 25 [-reader-process-expanded-1 (define-enum (name e-exception) (comment "exception vectors") ...)] 26 (if (eq? (car entry) (quote begin)) (for-each -reader-process-expanded (cdr entry)) ...) 27 [-reader-process-expanded (define-enum (name e-exception) (comment "exception vectors") ...)] 28 (let ((expansion #)) (-reader-process-expanded expansion)) 29* [reader-process (define-enum (name e-exception) (comment "exception vectors") ...)] 30 (begin (reader-process entry) (loop (read))) ... 31 (if (eof-object? entry) #t ...) 32 [# (define-isa (name or32) (base-insn-bitsize 32) ...)] 33 (begin (reader-process entry) (loop (read))) 34 (if (eof-object? entry) #t ...) 35 [# (define-arch (name or32) (comment "OpenRISC 1000") ...)] 36 (begin (reader-process entry) (loop (read))) 37 (if (eof-object? entry) #t ...) 38 [# (include "simplify.inc")] 39* (letrec ((loop #)) (loop (read))) 40* [#] 41 [lazy-catch #t # ...] ... 42 (let* () (set! srcdir (find-srcdir #)) ...) 43* [cgen-opc ("./../cgen/cgen-opc.scm" "-s" "./../cgen" ...)] 44* [primitive-load "./../cgen/cgen-opc.scm"] -- Johan Rydberg, Net Insight AB, Sweden, +46-8-685 04 00 $ ON F$ERROR("LANGUAGE","ENGLISH","IN_MESSAGE").GT.F$ERROR("NORMAL") - THEN EXCUSE/OBJECT=ME