// Path: antlr4ide.core/src/main/java/com/github/jknack/antlr4ide/console/Console.java
// public interface Console {
// 
// 	/**
// 	 * Write an ERROR message into the console.
// 	 *
// 	 * @param message The message. Might includes place holder. See String#format
// 	 * @param args Message arguments.
// 	 */
// 	public void error(String message, Object...args);
// 	
// 	/**
// 	 * Write a WARNING message into the console.
// 	 *
// 	 * @param message The message. Might includes place holder. See String#format
// 	 * @param args Message arguments.
// 	 */
// 	public void warning(String message, Object...args);
// 	
// 	/**
// 	 * Write an INFO message into the console.
// 	 *
// 	 * @param message The message. Might includes place holder. See String#format
// 	 * @param args Message arguments.
// 	 */
// 	public void info(String message, Object...args);
// 	
// 	/**
// 	 * Write a DEBUG message into the console.
// 	 *
// 	 * @param message The message. Might includes place holder. See String#format
// 	 * @param args Message arguments.
// 	 */
// 	public void debug(String message, Object...args);
// 
// 	/**
// 	 * Write a TRACE message into the console.
// 	 *
// 	 * @param message The message. Might includes place holder. See String#format
// 	 * @param args Message arguments.
// 	 */
// 	public void trace(String message, Object...args);
// 	
// }
// 
// Path: antlr4ide.core/src/main/java/com/github/jknack/antlr4ide/console/ConsoleImpl.java
// public final class ConsoleImpl implements Console {
// 	
// 	public static final String QUALIFIER = "com.github.jknack.antlr4ide";
// 	public static final String KEY = "loglevel";
// 	
// 	/** default log level for console and loggers.*/
// 	public static final Level DEFAULT_LOGLEVEL = Level.INFO;
// 	
// 	/** default log level for console and loggers as a java.lang.String.*/
// 	public static final String DEFAULT_LOGLEVEL_AS_STRING = DEFAULT_LOGLEVEL.toString();
// 
// 	@Override
// 	public void error(String message, Object...args) {
// 		final Logger logger = getLogger();
// 		final String msg = format(message, args);
// 		logger.error(msg);
// 	}
// 	
// 	@Override
// 	public void warning(String message, Object...args) {
// 		final Logger logger = getLogger();
// 		final String msg = format(message, args);
// 		logger.warn(msg);
// 	}
// 	
// 	@Override
// 	public void info(String message, Object...args) {
// 		final Logger logger = getLogger();
// 		final String msg = format(message, args);
// 		logger.info(msg);
// 	}
// 	
// 	@Override
// 	public void debug(String message, Object...args) {
// 		final Logger logger = getLogger();
// 		final String msg = format(message, args);
// 		logger.debug(msg);
// 	}
// 
// 	@Override
// 	public void trace(String message, Object...args) {
// 		final Logger logger = getLogger();
// 		final String msg = format(message, args);
// 		logger.trace(msg);
// 	}
// 	
// 	public static Logger getLogger() {
// 		final Logger logger = LogManager.getRootLogger();
// 		logger.setAdditivity(true);
// 		// set log-level of logger
// 		Level level = getLogLevel();
// 		logger.setLevel(level);
// 		return logger;
// 	}
// 	
// 	private String format(final String message, final Object...args) {
// 		final String result = String.format(message, args);
// 		return result;
// 	}
// 	
// 	public static Level getLogLevel() {
// 		final IPreferencesService service = Platform.getPreferencesService();
// 		final String string = service.getString(QUALIFIER, KEY, 
// 				DEFAULT_LOGLEVEL_AS_STRING, null);
// 		final Level result = Level.toLevel(string);
// 		return result;
// 	}
// 	
// }


import static com.google.common.base.Preconditions.checkNotNull;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.xtext.generator.IOutputConfigurationProvider;
import org.eclipse.xtext.linking.ILinkingDiagnosticMessageProvider;
import org.eclipse.xtext.naming.IQualifiedNameProvider;
import com.github.jknack.antlr4ide.console.Console;
import com.github.jknack.antlr4ide.console.ConsoleImpl;
import com.github.jknack.antlr4ide.generator.Antlr4OutputConfigurationProvider;
import com.github.jknack.antlr4ide.lang.LangFactory;
import com.github.jknack.antlr4ide.scoping.Antlr4NameProvider;
import com.github.jknack.antlr4ide.validation.Antlr4MissingReferenceMessageProvider;
import com.google.inject.Binder;
package com.github.jknack.antlr4ide;




/**
 * The runtime module useful for create or customize Xtext.
 */
public class Antlr4RuntimeModule extends com.github.jknack.antlr4ide.AbstractAntlr4RuntimeModule {

  @Override
  public void configure(final Binder binder) {
    checkNotNull(binder);

    super.configure(binder);

    binder.bind(LangFactory.class).toInstance(LangFactory.eINSTANCE);

    binder.bind(ILinkingDiagnosticMessageProvider.Extended.class)
        .to(Antlr4MissingReferenceMessageProvider.class);

    binder.bind(ILaunchManager.class).toInstance(getLaunchManager());
    
    binder.bind(Console.class).toInstance(getConsole());
  }

  @Override
  public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
    return Antlr4NameProvider.class;
  }

  public Class<? extends IOutputConfigurationProvider> bindIOutputConfigurationProvider() {
    return Antlr4OutputConfigurationProvider.class;
  }

  protected ILaunchManager getLaunchManager() {
    return DebugPlugin.getDefault().getLaunchManager();
  }

  protected Console getConsole() {
// Path: antlr4ide.core/src/main/java/com/github/jknack/antlr4ide/console/Console.java
// public interface Console {
// 
// 	/**
// 	 * Write an ERROR message into the console.
// 	 *
// 	 * @param message The message. Might includes place holder. See String#format
// 	 * @param args Message arguments.
// 	 */
// 	public void error(String message, Object...args);
// 	
// 	/**
// 	 * Write a WARNING message into the console.
// 	 *
// 	 * @param message The message. Might includes place holder. See String#format
// 	 * @param args Message arguments.
// 	 */
// 	public void warning(String message, Object...args);
// 	
// 	/**
// 	 * Write an INFO message into the console.
// 	 *
// 	 * @param message The message. Might includes place holder. See String#format
// 	 * @param args Message arguments.
// 	 */
// 	public void info(String message, Object...args);
// 	
// 	/**
// 	 * Write a DEBUG message into the console.
// 	 *
// 	 * @param message The message. Might includes place holder. See String#format
// 	 * @param args Message arguments.
// 	 */
// 	public void debug(String message, Object...args);
// 
// 	/**
// 	 * Write a TRACE message into the console.
// 	 *
// 	 * @param message The message. Might includes place holder. See String#format
// 	 * @param args Message arguments.
// 	 */
// 	public void trace(String message, Object...args);
// 	
// }
// 
// Path: antlr4ide.core/src/main/java/com/github/jknack/antlr4ide/console/ConsoleImpl.java
// public final class ConsoleImpl implements Console {
// 	
// 	public static final String QUALIFIER = "com.github.jknack.antlr4ide";
// 	public static final String KEY = "loglevel";
// 	
// 	/** default log level for console and loggers.*/
// 	public static final Level DEFAULT_LOGLEVEL = Level.INFO;
// 	
// 	/** default log level for console and loggers as a java.lang.String.*/
// 	public static final String DEFAULT_LOGLEVEL_AS_STRING = DEFAULT_LOGLEVEL.toString();
// 
// 	@Override
// 	public void error(String message, Object...args) {
// 		final Logger logger = getLogger();
// 		final String msg = format(message, args);
// 		logger.error(msg);
// 	}
// 	
// 	@Override
// 	public void warning(String message, Object...args) {
// 		final Logger logger = getLogger();
// 		final String msg = format(message, args);
// 		logger.warn(msg);
// 	}
// 	
// 	@Override
// 	public void info(String message, Object...args) {
// 		final Logger logger = getLogger();
// 		final String msg = format(message, args);
// 		logger.info(msg);
// 	}
// 	
// 	@Override
// 	public void debug(String message, Object...args) {
// 		final Logger logger = getLogger();
// 		final String msg = format(message, args);
// 		logger.debug(msg);
// 	}
// 
// 	@Override
// 	public void trace(String message, Object...args) {
// 		final Logger logger = getLogger();
// 		final String msg = format(message, args);
// 		logger.trace(msg);
// 	}
// 	
// 	public static Logger getLogger() {
// 		final Logger logger = LogManager.getRootLogger();
// 		logger.setAdditivity(true);
// 		// set log-level of logger
// 		Level level = getLogLevel();
// 		logger.setLevel(level);
// 		return logger;
// 	}
// 	
// 	private String format(final String message, final Object...args) {
// 		final String result = String.format(message, args);
// 		return result;
// 	}
// 	
// 	public static Level getLogLevel() {
// 		final IPreferencesService service = Platform.getPreferencesService();
// 		final String string = service.getString(QUALIFIER, KEY, 
// 				DEFAULT_LOGLEVEL_AS_STRING, null);
// 		final Level result = Level.toLevel(string);
// 		return result;
// 	}
// 	
// }


// Path: antlr4ide.core/src/main/java/com/github/jknack/antlr4ide/Antlr4RuntimeModule.java
import static com.google.common.base.Preconditions.checkNotNull;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.xtext.generator.IOutputConfigurationProvider;
import org.eclipse.xtext.linking.ILinkingDiagnosticMessageProvider;
import org.eclipse.xtext.naming.IQualifiedNameProvider;
import com.github.jknack.antlr4ide.console.Console;
import com.github.jknack.antlr4ide.console.ConsoleImpl;
import com.github.jknack.antlr4ide.generator.Antlr4OutputConfigurationProvider;
import com.github.jknack.antlr4ide.lang.LangFactory;
import com.github.jknack.antlr4ide.scoping.Antlr4NameProvider;
import com.github.jknack.antlr4ide.validation.Antlr4MissingReferenceMessageProvider;
import com.google.inject.Binder;

package com.github.jknack.antlr4ide;




/**
 * The runtime module useful for create or customize Xtext.
 */
public class Antlr4RuntimeModule extends com.github.jknack.antlr4ide.AbstractAntlr4RuntimeModule {

  @Override
  public void configure(final Binder binder) {
    checkNotNull(binder);

    super.configure(binder);

    binder.bind(LangFactory.class).toInstance(LangFactory.eINSTANCE);

    binder.bind(ILinkingDiagnosticMessageProvider.Extended.class)
        .to(Antlr4MissingReferenceMessageProvider.class);

    binder.bind(ILaunchManager.class).toInstance(getLaunchManager());
    
    binder.bind(Console.class).toInstance(getConsole());
  }

  @Override
  public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
    return Antlr4NameProvider.class;
  }

  public Class<? extends IOutputConfigurationProvider> bindIOutputConfigurationProvider() {
    return Antlr4OutputConfigurationProvider.class;
  }

  protected ILaunchManager getLaunchManager() {
    return DebugPlugin.getDefault().getLaunchManager();
  }

  protected Console getConsole() {
	  return new ConsoleImpl();