This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: enums


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.]

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]