[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pcc-list
Subject:    Re: Labels and typedef names
From:       Anders Magnusson <ragge () ludd ! ltu ! se>
Date:       2008-07-01 8:03:31
Message-ID: 4869E4D3.8040308 () ludd ! ltu ! se
[Download RAW message or body]

Stefan Kempf wrote:
> This example produces a syntax error on 'a:'.
> I think the program is correct, though, since labels and
> ordinary identifiers are in different namespaces.
> 
True, please check in.

-- Ragge

> typedef int a;
> 
> int
> main(void)
> {
> 	a b;
> 
> a:
> 	return 0;
> }
> 
> Index: cc/ccom/cgram.y
> ===================================================================
> RCS file: /cvsroot/pcc/cc/ccom/cgram.y,v
> retrieving revision 1.208
> diff -u -p -r1.208 cgram.y
> --- cc/ccom/cgram.y	24 Jun 2008 19:32:15 -0000	1.208
> +++ cc/ccom/cgram.y	1 Jul 2008 07:30:00 -0000
> @@ -857,6 +857,7 @@ cnstr:		   string { $$ = xasmop($1, bcon
>                  ;
>  
>  label:		   C_NAME ':' { deflabel($1); reached = 1; }
> +		|  C_TYPENAME ':' { deflabel($1); reached = 1; }
>  		|  C_CASE e ':' { addcase($2); reached = 1; }
>  		|  C_DEFAULT ':' { reached = 1; adddef(); flostat |= FDEF; }
>  		;
> 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic