enums

Doug Evans dje@transmeta.com
Wed Dec 6 09:28:00 GMT 2000


Johan Rydberg writes:
 > Doug Evans wrote:
 > 
 > > Take the line with () out.
 > 
 > Well, it "works" (cgen doesn't complain that is) now. But the
 > result int the "desc.h" file is still the same.

Righto.  One more

 (define-enum
   (name e-exception)
   (comment "exception vectors")
-   ()
   (prefix E_)
-  (values ("RESET") ("BUSERR" -) ("DPF" -) ("IPF" -)  
+  (values (("RESET") ("BUSERR" -) ("DPF" -) ("IPF" -)  
 	  ("EXTINT" -) ("ALIGN" -) ("ILLEGAL" -) ("PEINT" -) 
 	  ("DTLBMISS" -) ("ITLBMISS" -) ("RRANGE" -)  
-	  ("SYSCALL" -) ("BREAK" -) ("RESERVED" -))
+	  ("SYSCALL" -) ("BREAK" -) ("RESERVED" -)) )
 )

I think I chose to require the extra parens in case I wanted to
add a new parameter.  If y'all can't imagine anything
being added we can change things - without the parens is simpler.

[One can certainly argue cgen should prohibit extra args
to avoid breaking a port in the future if it should happen to have
junk there - the extra args are silently ignored now.
This gets back to being more robust with bad input.]


More information about the Cgen mailing list