Method added by VoltDB to make reserved words more consistent in DDL.
SEE: ENG-912
778491
boolean isSimpleName(boolean isStrictSQLNames) {
        if (isStrictSQLNames) {
            return isNonReservedIdentifier() && token.namePrefix == null;
        } else {
            return isNonCoreReservedIdentifier() && token.namePrefix == null;
        }
    }
380566
function checkForReservedFieldName(args) {
  if (!args) {
    return;
  }
  if (args.databaseTypeName) {
    checkFieldName(args.name, args.databaseTypeName, args.shouldThrow);
  } else {
    for (let i = 0, types = Object.keys(DatabaseTypes); i < types.length; i++) {
      checkFieldName(args.name, DatabaseTypes[types[i]], args.shouldThrow);
    }
  }
}
1097605
@Override
    public void runDDL(String ddl) {
        String modifiedDdl = transformDDL(ddl);
        printTransformedSql(ddl, modifiedDdl);
        super.runDDL(modifiedDdl, false);
    }
351476
protected void checkRegisteredDataUsingReservedWord(ActionRuntime runtime, WebContext context, String varKey) {
        if (isSuppressRegisteredDataUsingReservedWordCheck()) {
            return;
        }
        if (context.getVariableNames().contains(varKey)) {
            throwThymeleafRegisteredDataUsingReservedWordException(runtime, context, varKey);
        }
    }
1160630
public static HSQLDDLInfo preprocessHSQLDDL(String ddl) {
        ddl = SQLLexer.stripComments(ddl);

        Matcher matcher = HSQL_DDL_PREPROCESSOR.matcher(ddl);
        if (matcher.find()) {
            String verbString = matcher.group("verb");
            HSQLDDLInfo.Verb verb = HSQLDDLInfo.Verb.get(verbString);
            if (verb == null) {
                return null;
            }

            String nounString = matcher.group("object");
            HSQLDDLInfo.Noun noun = HSQLDDLInfo.Noun.get(nounString);
            if (noun == null) {
                return null;
            }
            boolean createStream = verb.equals(HSQLDDLInfo.Verb.CREATE) &&
                                   noun.equals(HSQLDDLInfo.Noun.STREAM);

            String name = matcher.group("name");
            if (name == null) {
                return null;
            }

            String secondName = matcher.group("subject");
            if (secondName != null) {
                secondName = secondName.toLowerCase();
            }

            // cascade/if exists are interesting on alters and drops
            boolean cascade = false;
            boolean ifexists = false;
            if (verb != HSQLDDLInfo.Verb.CREATE) {
                matcher = DDL_IFEXISTS_OR_CASCADE_CHECK.matcher(ddl);
                if (matcher.matches()) {
                    // Don't be too sensitive to regex specifics by assuming null always
                    // indicates a missing clause. Look for empty too.
                    String existsClause = matcher.group("exists");
                    String cascadeClause = matcher.group("cascade");
                    ifexists = existsClause != null && !existsClause.isEmpty();
                    cascade = cascadeClause != null && !cascadeClause.isEmpty();
                }
            }

            return new HSQLDDLInfo(verb, noun, name.toLowerCase(), secondName, cascade, ifexists, createStream);
        }
        return null;
    }
497866
public Sql[] generateSql(DropSynonymStatement statement, Database database, SqlGeneratorChain chain) {
		StringBuilder sql = new StringBuilder("DROP ");

		if (statement.isPublic() != null && statement.isPublic()) {
			sql.append("PUBLIC ");
		}

		sql.append("SYNONYM ");

		if (statement.getSynonymSchemaName() != null) {
			sql.append(statement.getSynonymSchemaName()).append(".");
		}

		sql.append(statement.getSynonymName());

		if (statement.isForce() != null && statement.isForce()) {
			sql.append(" FORCE");
		}

		return new Sql[] { new UnparsedSql(sql.toString()) };
	}
422791
function reassignConditionalStatementIds(conditionalStatement) {
        conditionalStatement.sourceField = tempFieldPageIdsMap[conditionalStatement.sourceField] || conditionalStatement.sourceField;
        return conditionalStatement;
      }
1277709
static void fixReservedIdentifiers(Map<?, String> methodToIdentifier) {
    for (Map.Entry<?, String> entry : methodToIdentifier.entrySet()) {
      if (SourceVersion.isKeyword(entry.getValue())) {
        entry.setValue(disambiguate(entry.getValue(), methodToIdentifier.values()));
      }
    }
  }
1280385
public String fixDatabaseProductName(String strDatabaseProductName)
    {
    	if (strDatabaseProductName == null)
    		return null;
    	if (strDatabaseProductName.lastIndexOf(' ') != -1)
    		strDatabaseProductName = strDatabaseProductName.substring(strDatabaseProductName.lastIndexOf(' ') + 1);
    	return strDatabaseProductName.toLowerCase();
    }
1068963
void addIndexCondition(Expression[] exprList, Index index, int colCount,
                           boolean isJoin) {
// VoltDB extension
        if (rangeIndex == index && isJoinIndex && (!isJoin) &&
                (multiColumnCount > 0) && (colCount == 0)) {
            // This is one particular set of conditions which broke the classification of
            // ON and WHERE clauses.
            return;
        }
// End of VoltDB extension
        rangeIndex  = index;
        isJoinIndex = isJoin;

        for (int i = 0; i < colCount; i++) {
            Expression e = exprList[i];

            indexEndCondition =
                ExpressionLogical.andExpressions(indexEndCondition, e);
        }

        if (colCount == 1) {
            indexCondition = exprList[0];
        } else {
            findFirstExpressions = exprList;
            isMultiFindFirst     = true;
            multiColumnCount     = colCount;
        }
    }
1230944
def remove_reserved_keys(self, op):
        
        sanitized = {}
        reserved = {}
        
        for k in op.keys():
            if str(k) not in RESERVED_KEYS:
                sanitized[str(k)] = copy.deepcopy(op[k])
            else:
                reserved[str(k)] = copy.deepcopy(op[k])
                
        return sanitized, reserved
10444
private void validateName(String name) throws DDFException {
    Boolean isNameExisted;
    try {
      this.getManager().getDDFByName(name);
      isNameExisted = true;
    } catch (DDFException e) {
      isNameExisted = false;
    }
    if(isNameExisted) {
      throw new DDFException(String.format("DDF with name %s already exists", name));
    }

    Pattern p = Pattern.compile("^[a-zA-Z0-9_-]*$");
    Matcher m = p.matcher(name);
    if(!m.find()) {
      throw new DDFException(String.format("Invalid name %s, only allow alphanumeric (uppercase and lowercase a-z, " +
          "numbers 0-9) and dash (\"-\") and underscore (\"_\")", name));
    }
  }
39547
function validateCommonReservedWords(name){
  // Using regular expressions to find string literals can often have a
  // negative effect on performance.
  if (name ==='break') { return false; }
  if (name === 'case') { return false; }
  if (name === 'catch') { return false; }
  if (name === 'continue') { return false; }
  if (name === 'debugger') { return false; }
  if (name === 'default') { return false; }
  if (name === 'delete') { return false; }
  if (name === 'do') { return false; }
  if (name === 'else') { return false; }
  if (name === 'finally') { return false; }
  if (name === 'for') { return false; }
  if (name === 'function') { return false; }
  if (name === 'if') { return false; }
  if (name === 'in') { return false; }
  if (name === 'instanceof') { return false; }
  if (name === 'new') { return false; }
  if (name === 'return') { return false; }
  if (name === 'switch') { return false; }
  if (name === 'this') { return false; }
  if (name === 'throw') { return false; }
  if (name === 'try') { return false; }
  if (name === 'typeof') { return false; }
  if (name === 'var') { return false; }
  if (name === 'void') { return false; }
  if (name === 'while') { return false; }
  if (name === 'with') { return false; }
  if (name === 'class') { return false; }
  if (name === 'const') { return false; }
  if (name === 'export') { return false; }
  if (name === 'extends') { return false; }
  if (name === 'import') { return false; }
  if (name === 'super') { return false; }
  if (name === 'implements') { return false; }
  if (name === 'interface') { return false; }
  if (name === 'let') { return false; }
  if (name === 'package') { return false; }
  if (name === 'private') { return false; }
  if (name === 'protected') { return false; }
  if (name === 'public') { return false; }
  if (name === 'static') { return false; }
  if (name === 'yield') { return false; }
  if (name === 'null') { return false; }
  if (name === 'true') { return false; }
  if (name === 'false') { return false; }
  if (name === 'NaN') { return false; }
  if (name === 'Infinity') { return false; }
  if (name === 'undefined') { return false; }

  return true;
}
370689
private ReservedElement readReserved(Location location, String documentation) {
    ImmutableList.Builder<Object> valuesBuilder = ImmutableList.builder();

    while (true) {
      char c = reader.peekChar();
      if (c == '"' || c == '\'') {
        valuesBuilder.add(reader.readQuotedString());
      } else {
        int tagStart = reader.readInt();

        c = reader.peekChar();
        if (c != ',' && c != ';') {
          if (!reader.readWord().equals("to")) {
            throw reader.unexpected("expected ',', ';', or 'to'");
          }
          int tagEnd = reader.readInt();
          valuesBuilder.add(Range.closed(tagStart, tagEnd));
        } else {
          valuesBuilder.add(tagStart);
        }
      }
      c = reader.readChar();
      if (c == ';') break;
      if (c != ',') throw reader.unexpected("expected ',' or ';'");
    }

    ImmutableList<Object> values = valuesBuilder.build();
    if (values.isEmpty()) {
      throw reader.unexpected("'reserved' must have at least one field name or tag");
    }
    return new ReservedElement(location, documentation, values);
  }
192641
@Deprecated 
	private String idSuffix(String name, DomainObject to) {
		if (useIdSuffixInForeignKey()) {
			Attribute idAttribute = getIdAttribute(to);
			if (idAttribute != null) {
				String idName = idAttribute.getDatabaseColumn().toUpperCase();
				String convertedName = convertDatabaseName(name);
				if (idName.equals(convertedName) && idName.startsWith(to.getDatabaseTable())) {
					idName = idName.substring(to.getDatabaseTable().length());
				} else if (idName.startsWith(convertedName)) {
					idName = idName.substring(convertedName.length());
				}
				if (idName.startsWith("_")) {
					return idName;
				} else {
					return ("_" + idName);
				}
			}
		}
		return "";
	}
795071
private void generateNames(Set<Property> props, Set<String> reservedNames) {
    nameGenerator.reset(reservedNames, "", reservedFirstCharacters, reservedNonFirstCharacters);
    for (Property p : props) {
      if (generatePseudoNames) {
        p.newName = "$" + p.oldName + "$";
      } else {
        // If we haven't already given this property a reusable name.
        if (p.newName == null) {
          p.newName = nameGenerator.generateNextName();
        }
      }
      reservedNames.add(p.newName);
    }
  }
712675
public void ensureIndex(String collName, String name, String fields, boolean unique, boolean dropDupsOnCreate) {

        BasicDBObject dbFields = parseFieldsString(fields);

        final BasicDBObjectBuilder keyOpts = new BasicDBObjectBuilder();
        if (name != null && name.length() != 0) {
            keyOpts.add("name", name);
        }
        if (unique) {
            keyOpts.add("unique", true);
            if (dropDupsOnCreate) {
                keyOpts.add("dropDups", true);
            }
        }

        final DBCollection dbColl = getCollection(getCollName(collName));

        final BasicDBObject opts = (BasicDBObject) keyOpts.get();
        if (opts.isEmpty()) {
            LOGGER.debug("Ensuring index for " + dbColl.getName() + " with keys:" + dbFields);
            dbColl.createIndex(dbFields);
        } else {
            LOGGER.debug("Ensuring index for " + dbColl.getName() + " with keys:" + fields + " and opts:" + opts);
            dbColl.createIndex(dbFields, opts);
        }
    }