Creates the name inside an enumeration for distinguishing data
        types.
497839
def EntryTagName(self, entry):
        """"""
        name = "%s_%s" % (self._name, entry.Name())
        return name.upper()
244085
def enums(*names):
    
    if len(names) != len(list(set(names))):
        raise TypeError("Names in an enumeration must be unique")

    item_types = set(True if isinstance(x, tuple) else False for x in names)
    if len(item_types) == 2:
        raise TypeError("Mixing of ordered and unordered enumeration items is not allowed")
    else:
        is_ordered = item_types.pop() is True
        if not is_ordered:
            names = [(None, x) for x in names]
        return [EnumValue(name, order) for order, name in names]
1325463
def enum(cls, options, values):
    """"""
    names, real = zip(*options)
    del names  # unused

    def factory(i, name):
      return cls(i, name, (len(real),), lambda a: real[a[0]], values)
    return factory
1029449
def ENUM_CONSTANT_DECL(self, cursor):
        """"""
        name = cursor.displayname
        value = cursor.enum_value
        pname = self.get_unique_name(cursor.semantic_parent)
        parent = self.get_registered(pname)
        obj = typedesc.EnumValue(name, value, parent)
        parent.add_value(obj)
        return obj
5290
public EnumType createEnumType(String name, Node source, JSType elementsType) {
    return new EnumType(this, name, source, elementsType);
  }
248381
public static TypeName typeName(String typeName) {
		TypeName[] values = { TypeName.BOOLEAN, TypeName.BYTE, TypeName.CHAR, TypeName.DOUBLE, TypeName.FLOAT,
				TypeName.INT, TypeName.LONG, TypeName.SHORT, TypeName.VOID };

		for (TypeName item : values) {
			if (item.toString().equals(typeName)) {
				return item;
			}
		}

		LiteralType literalName = LiteralType.of(typeName);
		if (literalName.isParametrizedType()) {
			return ParameterizedTypeName.get(className(literalName.getRawType()),
					typeName(literalName.getTypeParameter()));
		}
		if (literalName.isArray()) {
			return ArrayTypeName.of(typeName(literalName.getRawType()));
		}

		return ClassName.bestGuess(typeName);
	}
856119
def do_enum(self, parent=None, ident=0):
        
        # TC_ENUM classDesc newHandle enumConstantName
        enum = JavaEnum()
        _, classdesc = self._read_and_exec_opcode(
            ident=ident + 1,
            expect=(
                self.TC_CLASSDESC,
                self.TC_PROXYCLASSDESC,
                self.TC_NULL,
                self.TC_REFERENCE,
            ),
        )
        enum.classdesc = classdesc
        self._add_reference(enum, ident)
        _, enumConstantName = self._read_and_exec_opcode(
            ident=ident + 1, expect=(self.TC_STRING, self.TC_REFERENCE)
        )
        enum.constant = enumConstantName
        return enum
1134282
def _enum_generator(descriptor):
    ''
    vals = descriptor.enum_type.values_by_number.keys()
    return gen.IterValueGenerator(descriptor.name, vals)
475084
def describe_enum(enum_definition):
    
    enum_descriptor = EnumDescriptor()
    enum_descriptor.name = enum_definition.definition_name().split('.')[-1]

    values = []
    for number in enum_definition.numbers():
        value = enum_definition.lookup_by_number(number)
        values.append(describe_enum_value(value))

    if values:
        enum_descriptor.values = values

    return enum_descriptor
564993
private void generateDN() {
        if (names.length == 1) {
            dn = names[0].toString();
            return;
        }

        StringBuilder sb = new StringBuilder(48);
        if (names != null) {
            for (int i = names.length - 1; i >= 0; i--) {
                if (i != names.length - 1) {
                    sb.append(", ");
                }
                sb.append(names[i].toString());
            }
        }
        dn = sb.toString();
    }
850033
private NameInfo getNameInfoForName(String name, SymbolType type) {
    Map<String, NameInfo> map = type == PROPERTY ? propertyNameInfo : varNameInfo;
    if (map.containsKey(name)) {
      return map.get(name);
    } else {
      NameInfo nameInfo = new NameInfo(name);
      map.put(name, nameInfo);
      symbolGraph.createNode(nameInfo);
      return nameInfo;
    }
  }
1360855
public final void createdName() throws RecognitionException {
		int createdName_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 131) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1250:5: ( Identifier ( typeArguments )? ( '.' Identifier ( typeArguments )? )* | primitiveType )
			int alt180=2;
			int LA180_0 = input.LA(1);
			if ( (LA180_0==Identifier) ) {
				alt180=1;
			}
			else if ( (LA180_0==65||LA180_0==67||LA180_0==71||LA180_0==77||LA180_0==85||LA180_0==92||LA180_0==94||LA180_0==105) ) {
				alt180=2;
			}

			else {
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 180, 0, input);
				throw nvae;
			}

			switch (alt180) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1250:7: Identifier ( typeArguments )? ( '.' Identifier ( typeArguments )? )*
					{
					match(input,Identifier,FOLLOW_Identifier_in_createdName6032); if (state.failed) return;
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1250:18: ( typeArguments )?
					int alt177=2;
					int LA177_0 = input.LA(1);
					if ( (LA177_0==53) ) {
						alt177=1;
					}
					switch (alt177) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1250:18: typeArguments
							{
							pushFollow(FOLLOW_typeArguments_in_createdName6034);
							typeArguments();
							state._fsp--;
							if (state.failed) return;
							}
							break;

					}

					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1251:9: ( '.' Identifier ( typeArguments )? )*
					loop179:
					while (true) {
						int alt179=2;
						int LA179_0 = input.LA(1);
						if ( (LA179_0==47) ) {
							alt179=1;
						}

						switch (alt179) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1251:10: '.' Identifier ( typeArguments )?
							{
							match(input,47,FOLLOW_47_in_createdName6046); if (state.failed) return;
							match(input,Identifier,FOLLOW_Identifier_in_createdName6048); if (state.failed) return;
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1251:25: ( typeArguments )?
							int alt178=2;
							int LA178_0 = input.LA(1);
							if ( (LA178_0==53) ) {
								alt178=1;
							}
							switch (alt178) {
								case 1 :
									// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1251:25: typeArguments
									{
									pushFollow(FOLLOW_typeArguments_in_createdName6050);
									typeArguments();
									state._fsp--;
									if (state.failed) return;
									}
									break;

							}

							}
							break;

						default :
							break loop179;
						}
					}

					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1252:7: primitiveType
					{
					pushFollow(FOLLOW_primitiveType_in_createdName6061);
					primitiveType();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 131, createdName_StartIndex); }

		}
	}
716643
public function CreateTypeName($ename)
    {
        $scope = '';
        for ($i = 0; $i < count($this->complexTypeStack); $i++) {
            $scope .= $this->complexTypeStack[$i] . '_';
        }
        return $scope . $ename . '_ContainedType';
    }
77314
def create_enum_subset(enum_type, help_string=NO_HELP, default=NO_DEFAULT):
        # type: (Type[Enum], str, EnumSubset) -> EnumSubset
        
        # noinspection PyTypeChecker
        return ParamEnumSubset(
            help_string=help_string,
            default=default,
            enum_type=enum_type,
        )
1184655
private int addExtendedName(int maxlength)
    {
        for (int i = TYPE_NAMES_.length - 1; i >= 0; i --) {
            // for each category, count the length of the category name
            // plus 9 =
            // 2 for <>
            // 1 for -
            // 6 for most hex digits per code point
            int length = 9 + add(m_nameSet_, TYPE_NAMES_[i]);
            if (length > maxlength) {
                maxlength = length;
            }
        }
        return maxlength;
    }
556917
public final void createdName() throws RecognitionException {
		try {
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:609:5: ( ID ( typeArguments )? ( DOT ID ( typeArguments )? )* | primitiveType )
			int alt71=2;
			int LA71_0 = input.LA(1);
			if ( (LA71_0==ID) ) {
				int LA71_1 = input.LA(2);
				if ( (!(((((helper.validateIdentifierKey(DroolsSoftKeywords.SHORT)))||((helper.validateIdentifierKey(DroolsSoftKeywords.LONG)))||((helper.validateIdentifierKey(DroolsSoftKeywords.BOOLEAN)))||((helper.validateIdentifierKey(DroolsSoftKeywords.BYTE)))||((helper.validateIdentifierKey(DroolsSoftKeywords.FLOAT)))||((helper.validateIdentifierKey(DroolsSoftKeywords.DOUBLE)))||((helper.validateIdentifierKey(DroolsSoftKeywords.INT)))||((helper.validateIdentifierKey(DroolsSoftKeywords.CHAR))))))) ) {
					alt71=1;
				}
				else if ( ((((helper.validateIdentifierKey(DroolsSoftKeywords.SHORT)))||((helper.validateIdentifierKey(DroolsSoftKeywords.LONG)))||((helper.validateIdentifierKey(DroolsSoftKeywords.BOOLEAN)))||((helper.validateIdentifierKey(DroolsSoftKeywords.BYTE)))||((helper.validateIdentifierKey(DroolsSoftKeywords.FLOAT)))||((helper.validateIdentifierKey(DroolsSoftKeywords.DOUBLE)))||((helper.validateIdentifierKey(DroolsSoftKeywords.INT)))||((helper.validateIdentifierKey(DroolsSoftKeywords.CHAR))))) ) {
					alt71=2;
				}

				else {
					if (state.backtracking>0) {state.failed=true; return;}
					int nvaeMark = input.mark();
					try {
						input.consume();
						NoViableAltException nvae =
							new NoViableAltException("", 71, 1, input);
						throw nvae;
					} finally {
						input.rewind(nvaeMark);
					}
				}

			}

			else {
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 71, 0, input);
				throw nvae;
			}

			switch (alt71) {
				case 1 :
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:609:7: ID ( typeArguments )? ( DOT ID ( typeArguments )? )*
					{
					match(input,ID,FOLLOW_ID_in_createdName3476); if (state.failed) return;
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:609:10: ( typeArguments )?
					int alt68=2;
					int LA68_0 = input.LA(1);
					if ( (LA68_0==LESS) ) {
						alt68=1;
					}
					switch (alt68) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:609:10: typeArguments
							{
							pushFollow(FOLLOW_typeArguments_in_createdName3478);
							typeArguments();
							state._fsp--;
							if (state.failed) return;
							}
							break;

					}

					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:610:9: ( DOT ID ( typeArguments )? )*
					loop70:
					while (true) {
						int alt70=2;
						int LA70_0 = input.LA(1);
						if ( (LA70_0==DOT) ) {
							alt70=1;
						}

						switch (alt70) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:610:11: DOT ID ( typeArguments )?
							{
							match(input,DOT,FOLLOW_DOT_in_createdName3491); if (state.failed) return;
							match(input,ID,FOLLOW_ID_in_createdName3493); if (state.failed) return;
							// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:610:18: ( typeArguments )?
							int alt69=2;
							int LA69_0 = input.LA(1);
							if ( (LA69_0==LESS) ) {
								alt69=1;
							}
							switch (alt69) {
								case 1 :
									// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:610:18: typeArguments
									{
									pushFollow(FOLLOW_typeArguments_in_createdName3495);
									typeArguments();
									state._fsp--;
									if (state.failed) return;
									}
									break;

							}

							}
							break;

						default :
							break loop70;
						}
					}

					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:611:11: primitiveType
					{
					pushFollow(FOLLOW_primitiveType_in_createdName3510);
					primitiveType();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}
		}

		catch (RecognitionException re) {
		    throw re;
		}

		finally {
			// do for sure before leaving
		}
	}
1117059
private static String descriptorToInternalName(String descriptor) {
        switch (descriptor.charAt(0)) {
            case 'B':
            case 'C':
            case 'D':
            case 'F':
            case 'I':
            case 'J':
            case 'S':
            case 'Z':
            case 'V':
            case '[':
                return descriptor;
            case 'L':
                return classDescriptorToInternalName(descriptor);
            default:
                throw new IllegalArgumentException("bad descriptor:" +
                    descriptor);
        }
    }