Creates a token that represents an identifier.
4130
public static Token newIdentifier(String text, int startLine, int startColumn) {
        return new Token(Types.IDENTIFIER, text, startLine, startColumn);
    }
356292
def _make_marker_token(self, type_):
        """"""
        tok = Token(type_,
                    '',
                    self.line,
                    self.line_num,
                    self.start,
                    self.start)
        return tok
938067
private String createID(String facetTitleNormalised) {
        facetTitleNormalised = facetTitleNormalised.replaceAll("\\W", "_"); //replace non word characters ie [a-zA-Z_0-9]
        facetTitleNormalised = facetTitleNormalised.replaceAll("\\-", "_"); //replace non word characters ie [a-zA-Z_0-9]
        facetTitleNormalised = facetTitleNormalised.replaceAll("\\s", "_"); //replace non word characters ie [a-zA-Z_0-9]
        facetTitleNormalised = facetTitleNormalised.toLowerCase(); //replace non word characters ie [a-zA-Z_0-9]
        return "facetID" + facetTitleNormalised;
    }
1260802
private IdentifierToken eatId() {
    if (peekId()) {
      return eatIdOrKeywordAsId();
    } else {
      reportExpectedError(peekToken(), TokenType.IDENTIFIER);
      if (peekIdOrKeyword()) {
        return eatIdOrKeywordAsId();
      } else {
        return null;
      }
    }
  }
362847
private final static String generateIDMonomerNotation(String id, String count, String annotation) {
		if (id.length() > 1) {
			id = "[" + id + "]";
		}
		String result = id;
		try {
			if (!(Integer.parseInt(count) == 1)) {
				result += "'" + count + "'";
			}
		} catch (NumberFormatException e) {
			result += "'" + count + "'";
		}
		if (annotation != null) {
			result += "\"" + annotation + "\"";
		}
		return result;
	}
970208
def convert_ids_to_tokens(self, ids):
        """"""
        tokens = []
        for i in ids:
            tokens.append(self.ids_to_tokens[i])
        return tokens
158788
private function ID() {
        $text = '';
        do {
            $text .= $this->ch;
            $this->consume();
        } while ($this->isLETTER() || $this->isNUMBER() || $this->ch == '_');

        return new Token(Token::T_ID, $text);
    }
1032948
@SuppressWarnings("fallthrough")
    protected void identifier() throws ParseException {
        skipWhitespace();
        int pos = bp;

        if (isJavaIdentifierStart(ch)) {
            readJavaIdentifier();
            return;
        }

        throw new ParseException("dc.identifier.expected");
    }
874353
private static Token createDateToken(final String configuration) {
		if (configuration == null) {
			return new DateToken();
		} else {
			try {
				return new DateToken(configuration);
			} catch (IllegalArgumentException ex) {
				InternalLogger.log(Level.ERROR, "'" + configuration + "' is an invalid date format pattern");
				return new DateToken();
			}
		}
	}
992201
private TokenDefinition getTokenDefinition(ParseTreeNode tokenDefinition,
	    Map<String, ParseTreeNode> helpers, Map<String, ParseTreeNode> tokens)
	    throws GrammarException, TreeException {
	String tokenName = tokenDefinition.getChild("IDENTIFIER").getText();
	String pattern = createTokenDefinitionPattern(tokenDefinition, helpers,
		tokens);
	boolean ignoreCase = Boolean.valueOf((String) options
		.get("grammar.ignore-case"));
	if (tokenVisibility.get(tokenName) != null) {
	    return new TokenDefinition(tokenName, pattern,
		    tokenVisibility.get(tokenName), ignoreCase);
	} else {
	    return new TokenDefinition(tokenName, pattern, ignoreCase);
	}
    }
416826
def _generate_identifier():
    
    bit_length = 64
    byte_length = int(bit_length / 8)
    identifier = os.urandom(byte_length)
    return hexlify(identifier).decode('ascii')
77557
def identifier(self, camelsplit=False, ascii=True):
        """"""
        return self.nameify(camelsplit=camelsplit, ascii=ascii, sep='_')
1029190
def generate_id():
    """"""
    # TODO: Use six.string_type to Py3 compat
    try:
        return unicode(uuid1()).replace(u"-", u"")
    except NameError:
        return str(uuid1()).replace(u"-", u"")
1030864
def token_to_id(self, token):
        
        token = self.process_token(token)
        return self._token2id.get(token, len(self._token2id) - 1)
1316681
private static Token createToken(char symbol, StringBuilder nameBuf, StringBuilder valueBuf) {
        String value = null;
        if (valueBuf.length() > 0) {
            value = valueBuf.toString();
            valueBuf.setLength(0); // empty the value buffer
        }

        if (nameBuf.length() > 0) {
            TokenType type = Token.resolveTypeAsSymbol(symbol);
            String name = nameBuf.toString();
            nameBuf.setLength(0); // empty the name buffer

            int offset = name.indexOf(Token.GETTER_SEPARATOR);
            if (offset > -1) {
                String name2 = name.substring(0, offset);
                String getter = name.substring(offset + 1);
                Token token = new Token(type, name2);
                if (!getter.isEmpty()) {
                    token.setGetterName(getter);
                }
                token.setDefaultValue(value);
                return token;
            } else if (value != null) {
                TokenDirectiveType directiveType = TokenDirectiveType.resolve(name);
                if (directiveType != null) {
                    String getter = null;
                    String defaultValue = null;
                    offset = value.indexOf(Token.GETTER_SEPARATOR);
                    if (offset > -1) {
                        String value2 = value.substring(0, offset);
                        String getter2 = value.substring(offset + 1);
                        value = value2;
                        offset = getter2.indexOf(Token.VALUE_SEPARATOR);
                        if (offset > -1) {
                            String getter3 = getter2.substring(0, offset);
                            String value3 = getter2.substring(offset + 1);
                            if (!getter3.isEmpty()) {
                                getter = getter3;
                            }
                            if (!value3.isEmpty()) {
                                defaultValue = value3;
                            }
                        } else {
                            if (!getter2.isEmpty()) {
                                getter = getter2;
                            }
                        }
                    }
                    Token token = new Token(type, directiveType, value);
                    token.setGetterName(getter);
                    token.setDefaultValue(defaultValue);
                    return token;
                } else {
                    Token token = new Token(type, name);
                    token.setDefaultValue(value);
                    return token;
                }
            } else {
                return new Token(type, name);
            }
        } else {
            // when not exists tokenName then tokenType must be TEXT type
            return new Token(value);
        }
    }
88750
function customIdent(token, addTokenToMatch) {
    if (token === null) {
        return false;
    }

    var identEnd = consumeIdentifier(token.value, 0);
    if (identEnd !== token.value.length) {
        return false;
    }

    var name = token.value.toLowerCase();

    // § 3.2. Author-defined Identifiers: the <custom-ident> type
    // The CSS-wide keywords are not valid <custom-ident>s
    if (name === 'unset' || name === 'initial' || name === 'inherit') {
        return false;
    }

    // The default keyword is reserved and is also not a valid <custom-ident>
    if (name === 'default') {
        return false;
    }

    // TODO: ignore property specific keywords (as described https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident)

    addTokenToMatch();
    return true;
}
314712
private String parseIdentifier()
  {
    Token token = scanToken();

    if (token != Token.IDENTIFIER) { 
      throw error("expected identifier at {0}", token);
    }

    return _lexeme;
  }