/*******************************************************************************
* Copyright © 2011, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*
*******************************************************************************/
package org.eclipse.edt.compiler.core.dev.tools;
import java.util.Date;
import org.eclipse.edt.compiler.core.EGLKeywordHandler;
/**
* @author jshavor
*
* output to the console HashSet declaration for the EGL keywords
* copy and paste the results to EGLKeywordHandler
*/
public class EGLKeywordHashSetTool {
public static void main(String[] args) {
StringBuffer stringBuffer = new StringBuffer();
System.out.println();
System.out.print(" //Generated : "); //$NON-NLS-1$
System.out.println(new Date().toString());
System.out.println(" //This definition should be generated by org.eclipse.edt.compiler.internal.dev.tools.EGLKeywordHashSetTool"); //$NON-NLS-1$
System.out.print('\t');
System.out.println("private static HashSet keywordHashSet = new HashSet();"); //$NON-NLS-1$
System.out.print('\t');
System.out.println("static {"); //$NON-NLS-1$
String keywords[] = EGLKeywordHandler.getKeywordNames();
for (int i = 0; i < keywords.length; i++) {
String keyword = keywords[i];
stringBuffer.setLength(0);
stringBuffer.append('\t');
stringBuffer.append('\t');
stringBuffer.append("keywordHashSet.add("); //$NON-NLS-1$
stringBuffer.append('\"');
stringBuffer.append(keyword.toLowerCase());
stringBuffer.append('\"');
stringBuffer.append("); //$NON-NLS-1$"); //$NON-NLS-1$
System.out.println(stringBuffer);
}
System.out.print('\t');
System.out.println("}"); //$NON-NLS-1$
}
}