Update of /cvsroot/nice/Nice/src/bossa/parser
In directory sc8-pr-cvs1:/tmp/cvs-serv13900/src/bossa/parser
Modified Files:
Parser.jj
Log Message:
Added simple class initializers.
Index: Parser.jj
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v
retrieving revision 1.196
retrieving revision 1.197
diff -C2 -d -r1.196 -r1.197
*** Parser.jj 17 Jul 2003 23:14:37 -0000 1.196
--- Parser.jj 18 Jul 2003 22:56:49 -0000 1.197
***************
*** 971,976 ****
{ NiceClass impl = new NiceClass(res); }
// internal fields and methods
! { List fields = new ArrayList(), methods = null; }
(
LOOKAHEAD( getField(null, null) )
getField(impl, fields)
--- 971,985 ----
{ NiceClass impl = new NiceClass(res); }
// internal fields and methods
! { List fields = new ArrayList(), methods = null, initializers = null; }
(
+ // Initializer
+ { Statement init; }
+ init = Block()
+ {
+ if (initializers == null)
+ initializers = new LinkedList();
+ initializers.add(init);
+ }
+ |
LOOKAHEAD( getField(null, null) )
getField(impl, fields)
***************
*** 996,1000 ****
--- 1005,1013 ----
{
impl.setFields(fields);
+ if (initializers != null)
+ impl.setInitializers(initializers);
+
res.setImplementation(impl);
+
if (methods != null)
definitions.addAll(methods);
|