2009-01-09 02:52:56 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* Copyright (c) 2002 - 2006 IBM Corporation.
|
|
|
|
* 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
|
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* Created on Oct 7, 2005
|
|
|
|
*/
|
|
|
|
package com.ibm.wala.cast.java.translator.polyglot;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
import com.ibm.wala.cast.java.loader.JavaSourceLoaderImpl;
|
|
|
|
import com.ibm.wala.cast.java.translator.SourceModuleTranslator;
|
|
|
|
import com.ibm.wala.classLoader.IClassLoader;
|
|
|
|
import com.ibm.wala.ipa.callgraph.impl.SetOfClasses;
|
|
|
|
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
|
|
|
import com.ibm.wala.types.ClassLoaderReference;
|
|
|
|
|
|
|
|
public class PolyglotSourceLoaderImpl extends JavaSourceLoaderImpl {
|
2009-04-13 19:39:48 +00:00
|
|
|
private final IRTranslatorExtension fExtInfo;
|
2009-01-09 02:52:56 +00:00
|
|
|
|
2009-04-13 19:39:48 +00:00
|
|
|
public PolyglotSourceLoaderImpl(ClassLoaderReference loaderRef, IClassLoader parent, SetOfClasses exclusions,
|
|
|
|
IClassHierarchy cha, IRTranslatorExtension extInfo) throws IOException {
|
|
|
|
super(loaderRef, parent, exclusions, cha);
|
|
|
|
this.fExtInfo = extInfo;
|
|
|
|
}
|
2009-01-09 02:52:56 +00:00
|
|
|
|
2009-04-13 19:39:48 +00:00
|
|
|
public IRTranslatorExtension getTranslatorExtension() {
|
|
|
|
return fExtInfo;
|
|
|
|
}
|
2009-01-09 02:52:56 +00:00
|
|
|
|
2009-04-13 19:39:48 +00:00
|
|
|
protected SourceModuleTranslator getTranslator() {
|
|
|
|
return new PolyglotSourceModuleTranslator(cha.getScope(), fExtInfo, this);
|
|
|
|
}
|
2009-01-09 02:52:56 +00:00
|
|
|
}
|