/*******************************************************************************
* 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 code for EGLDefinedKeywordCompletions.getDefinedKeywordCompletions()
* copy and paste the results to EGLDefinedKeywordCompletions.getDefinedKeywordCompletions()
*/
public class EGLDefinedKeywordCompletionTool {
public static void main(String[] args) {
StringBuffer stringBuffer = new StringBuffer();
String prefixTabs = " "; //$NON-NLS-1$
System.out.println();
System.out.print(prefixTabs);
System.out.println("//EGL defined keyword completions"); //$NON-NLS-1$
System.out.print(prefixTabs);
System.out.print("//Generated : "); //$NON-NLS-1$
System.out.println(new Date().toString());
System.out.print(prefixTabs);
System.out.println("//These keyword completions should be generated by org.eclipse.edt.compiler.internal.dev.tools.EGLDefinedKeywordCompletionTool"); //$NON-NLS-1$
String keywords[] = EGLKeywordHandler.getKeywordNames();
for (int i = 0; i < keywords.length; i++) {
String keyword = keywords[i];
stringBuffer.setLength(0);
stringBuffer.append(prefixTabs);
stringBuffer.append("completionList.add(new EGLKeywordCompletion(NodeTypes."); //$NON-NLS-1$
stringBuffer.append(keyword.toUpperCase());
stringBuffer.append(", IEGLConstants.KEYWORD_"); //$NON-NLS-1$
stringBuffer.append(keyword.toUpperCase());
stringBuffer.append("));"); //$NON-NLS-1$
System.out.println(stringBuffer);
}
}
}