All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ow2.mind.MindcModule Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (C) 2010 STMicroelectronics
 *
 * This file is part of "Mind Compiler" is free software: you can redistribute 
 * it and/or modify it under the terms of the GNU Lesser General Public License 
 * as published by the Free Software Foundation, either version 3 of the 
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT 
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see .
 *
 * Contact: [email protected]
 *
 * Authors: Matthieu Leclercq
 * Contributors: 
 */

package org.ow2.mind;

import org.ow2.mind.adl.compilation.AnnotationFlagsCompilationCommandFactory;
import org.ow2.mind.adl.compilation.BasicCompilationCommandFactory;
import org.ow2.mind.adl.compilation.CompilationCommandFactory;
import org.ow2.mind.adl.compilation.ContextFlagsCompilationCommandFactory;
import org.ow2.mind.inject.AbstractMindModule;
import org.ow2.mind.target.BasicTargetDescriptorLoader;
import org.ow2.mind.target.CacheLoader;
import org.ow2.mind.target.ExtensionLoader;
import org.ow2.mind.target.FlagSorterLoader;
import org.ow2.mind.target.InterpolationLoader;
import org.ow2.mind.target.LinkerScriptLoader;
import org.ow2.mind.target.TargetCompilationCommandFactory;
import org.ow2.mind.target.TargetDescriptorLoader;

public class MindcModule extends AbstractMindModule {

  protected void configureADLCompiler() {
    bind(ADLCompiler.class).to(BasicADLCompiler.class);
  }

  protected void configureTargetDescriptorLoader() {
    bind(TargetDescriptorLoader.class).toChainStartingWith(CacheLoader.class)
        .followedBy(LinkerScriptLoader.class)
        .followedBy(InterpolationLoader.class)
        .followedBy(FlagSorterLoader.class).followedBy(ExtensionLoader.class)
        .endingWith(BasicTargetDescriptorLoader.class);
  }

  // override ADLBackend
  protected void configureCompilationCommandFactory() {
    bind(CompilationCommandFactory.class)
        .toChainStartingWith(AnnotationFlagsCompilationCommandFactory.class)
        .followedBy(ContextFlagsCompilationCommandFactory.class)
        .followedBy(TargetCompilationCommandFactory.class)
        .endingWith(BasicCompilationCommandFactory.class);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy