[Nice-commit] Nice/src/bossa/syntax EnumDefinition.java,1.8,1.9
Brought to you by:
bonniot
From: <ar...@us...> - 2004-01-16 00:14:10
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv28036/F:/nice/src/bossa/syntax Modified Files: EnumDefinition.java Log Message: Enums can implement interfaces now. Index: EnumDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/EnumDefinition.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** EnumDefinition.java 15 Dec 2003 14:04:13 -0000 1.8 --- EnumDefinition.java 16 Jan 2004 00:14:07 -0000 1.9 *************** *** 28,32 **** public EnumDefinition(LocatedString name, List/*LocatedString*/ elements, List/*MonoSymbol*/ fields, List/*List<Expression>*/ argsList, ! List globalDefs) { super(name, Node.global); --- 28,32 ---- public EnumDefinition(LocatedString name, List/*LocatedString*/ elements, List/*MonoSymbol*/ fields, List/*List<Expression>*/ argsList, ! List globalDefs, List/*TypeIdent*/ interfaces) { super(name, Node.global); *************** *** 35,39 **** (name,true,false, null, new ArrayList(0), new TypeIdent(new LocatedString("nice.lang.Enum",name.location())), ! null,null); NiceClass impl = new NiceClass(classDef); int fieldsCount = fields.size(); --- 35,39 ---- (name,true,false, null, new ArrayList(0), new TypeIdent(new LocatedString("nice.lang.Enum",name.location())), ! interfaces,null); NiceClass impl = new NiceClass(classDef); int fieldsCount = fields.size(); *************** *** 73,77 **** this.fields = fields; this.elementsArgs = argsList; ! symbols = new LinkedList(); for (int ord = 0; ord<elements.size(); ord++ ) --- 73,78 ---- this.fields = fields; this.elementsArgs = argsList; ! this.interfaces = interfaces; ! symbols = new LinkedList(); for (int ord = 0; ord<elements.size(); ord++ ) *************** *** 203,207 **** return "enum " + shortName + Util.map(" {", " , ", " }", elements); ! String res = "enum " + shortName + Util.map("(", ", ", ")", fields) + " {"; for (int i = 0; i < elements.size(); i++) { --- 204,212 ---- return "enum " + shortName + Util.map(" {", " , ", " }", elements); ! String res = "enum " + shortName + Util.map("(", ", ", ")", fields); ! if (interfaces != null) ! res += " implements " + Util.map(""," , ","", interfaces); ! ! res += " {"; for (int i = 0; i < elements.size(); i++) { *************** *** 221,223 **** --- 226,229 ---- List fields; List elementsArgs; + List interfaces; } |