my @classes = qw(SFBool SFColor SFFloat SFImage SFInt32 SFNode
		 SFRotation SFString SFTime SFVec2f SFVec3f
		 MFColor MFFloat MFInt32 MFNode
		 MFRotation MFString MFTime MFVec2f MFVec3f);

open O, ">FWCreateField.java";
print O "//AUTOMATICALLY GENERATED BY gencreate.pl.\n";
print O "//DO NOT EDIT!!!!\n\n";
print O "package vrml;\n";
print O "import vrml.field.*;\n";
print O "\npublic class FWCreateField {\n";

print O "    public static Field createField(String type) {\n";
print O "        type = type.intern();\n       ";
for (@classes) {
    print O qq{ if (type == "$_")\n};
    print O qq{            return new $_();\n        else};
}
print O "\n            throw new IllegalArgumentException";
print O "(\"Unknown field type \"+type);\n    }\n\n";

print O "    public static ConstField createConstField(String type) {\n";
print O "        type = type.intern();\n       ";
for (@classes) {
    print O qq{ if (type == "$_")\n};
    print O qq{            return new Const$_();\n        else};
}
print O "\n            throw new IllegalArgumentException(";
print O "\"Unknown field type \"+type);\n    }\n";

print O "}\n";

