[Nice-commit] Nice/src/bossa/parser Parser.jj,1.141,1.142
                
                Brought to you by:
                
                    bonniot
                    
                
            
            
        
        
        
    | 
     
      
      
      From: <bo...@us...> - 2003-02-23 00:58:59
      
     
   | 
Update of /cvsroot/nice/Nice/src/bossa/parser
In directory sc8-pr-cvs1:/tmp/cvs-serv3052/src/bossa/parser
Modified Files:
	Parser.jj 
Log Message:
Factorize code for constant character expressions.
Index: Parser.jj
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v
retrieving revision 1.141
retrieving revision 1.142
diff -C2 -d -r1.141 -r1.142
*** Parser.jj	21 Feb 2003 21:51:26 -0000	1.141
--- Parser.jj	23 Feb 2003 00:58:56 -0000	1.142
***************
*** 1502,1505 ****
--- 1502,1517 ----
  }
  
+ Expression charConstantExp():
+ {
+   Token t;
+ }
+ {
+   t = <CHARACTER_LITERAL> 
+   { return ConstantExp.makeChar
+       (new LocatedString(t.image.substring(1, t.image.length() - 1),
+ 			 new Location(t)));
+   }
+ }
+ 
  StringConstantExp stringConstantExp():
  {
***************
*** 2115,2123 ****
  | res=intConstantExp() 
  | res=floatConstantExp()
! | t=<CHARACTER_LITERAL> 
!     { res=ConstantExp.makeChar
!       (new LocatedString(t.image.substring(1,t.image.length()-1),
! 			 new Location(t)));
!     }
  | res=stringConstantExp()
    )
--- 2127,2131 ----
  | res=intConstantExp() 
  | res=floatConstantExp()
! | res=charConstantExp()
  | res=stringConstantExp()
    )
***************
*** 2135,2143 ****
    "null" { res = NullExp.instance; }
  | res=intConstantExp() 
! | t=<CHARACTER_LITERAL> 
!     { res=ConstantExp.makeChar
!       (new LocatedString(t.image.substring(1,t.image.length()-1),
! 			 new Location(t)));
!     }
    )
  { return res; }
--- 2143,2147 ----
    "null" { res = NullExp.instance; }
  | res=intConstantExp() 
! | res=charConstantExp()
    )
  { return res; }
 |