/*
 * This file is released under terms of BSD license
 * See LICENSE file for more information
 */

package cx2x.xcodeml.xnode;

/**
 * XcodeML element attributes code.
 *
 * @author clementval
 */
public enum Xattr {
  COMPILER_INFO("compiler-info"),
  CONSTRUCT_NAME("construct_name"),
  FILE("file"),
  INTENT("intent"),
  IS_ASSUMED_SHAPE("is_assumed_shape"),
  IS_ALLOCATABLE("is_allocatable"),
  IS_EXTERNAL("is_external"),
  IS_INTERNAL("is_internal"),
  IS_INTRINSIC("is_intrinsic"),
  IS_OPTIONAL("is_optional"),
  IS_PARAMETER("is_parameter"),
  IS_POINTER("is_pointer"),
  IS_PRIVATE("is_private"),
  IS_PROGRAM("is_program"),
  IS_PUBLIC("is_public"),
  IS_RECURSIVE("is_recursive"),
  IS_SAVE("is_save"),
  IS_TARGET("is_target"),
  KIND("kind"),
  LANGUAGE("language"),
  LINENO("lineno"),
  NAME("name"),
  REPEAT_COUNT("repeat_count"),
  REF("ref"),
  RESULT_NAME("result_name"),
  RETURN_TYPE("return_type"),
  SCLASS("sclass"),
  SCOPE("scope"),
  SOURCE("source"),
  TIME("time"),
  TYPE("type"),
  VERSION("version");

  private final String name;

  Xattr(String s) {
    name = s;
  }

  public String toString() {
    return this.name;
  }

}

@@ -1158,10 +1158,128 @@
 e;%0A  %7D%0A%0A
+  public static Xattr fromString(String value)%7B%0A    return Xattr.valueOf(value.toUpperCase().replace(%22-%22, %22_%22));%0A  %7D%0A%0A
 %7D%0A

Add fromString()