Commit ae646fa3 authored by Christoph Richter's avatar Christoph Richter
Browse files

Added EmbeddedMontiArcMathLanguage

parent 936e2e4f
package de.monticore.lang.embeddedmontiarcmathopt._symboltable;
import de.monticore.antlr4.MCConcreteParser;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.EmbeddedMontiArcMathLanguage;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.EmbeddedMontiArcMathModelLoader;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.EmbeddedMontiArcMathSymbolTableCreator;
import de.monticore.lang.embeddedmontiarcmathopt._parser.EmbeddedMontiArcMathOptParser;
import de.monticore.lang.mathopt._symboltable.MathOptLanguage;
import de.monticore.symboltable.MutableScope;
import de.monticore.symboltable.ResolvingConfiguration;
import java.util.Optional;
public class EmbeddedMontiArcMathOptLanguage extends EmbeddedMontiArcMathLanguage {
public EmbeddedMontiArcMathOptLanguage() {
super();
this.embeddedLanguages.clear();
this.embeddedLanguages.add(new MathOptLanguage());
}
@Override
protected EmbeddedMontiArcMathModelLoader provideModelLoader() {
return new EmbeddedMontiArcMathOptModelLoader(this);
}
@Override
public MCConcreteParser getParser() {
return new EmbeddedMontiArcMathOptParser();
}
@Override
public Optional<EmbeddedMontiArcMathSymbolTableCreator> getSymbolTableCreator(ResolvingConfiguration resolvingConfiguration, MutableScope enclosingScope) {
return Optional.of(new EmbeddedMontiArcMathOptSymbolTableCreator(resolvingConfiguration, enclosingScope));
}
}
package de.monticore.lang.embeddedmontiarcmathopt._symboltable;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.EmbeddedMontiArcMathLanguage;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.EmbeddedMontiArcMathModelLoader;
public class EmbeddedMontiArcMathOptModelLoader extends EmbeddedMontiArcMathModelLoader {
public EmbeddedMontiArcMathOptModelLoader(EmbeddedMontiArcMathOptLanguage language) {
super(language);
}
}
package de.monticore.lang.embeddedmontiarcmathopt._symboltable;
import de.monticore.ModelingLanguageFamily;
import de.monticore.io.paths.ModelPath;
import de.monticore.lang.embeddedmontiarc.LogConfig;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath.AbstractSymtabTest;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.EmbeddedMontiArcMathLanguage;
import de.monticore.lang.monticar.stream._symboltable.StreamLanguage;
import de.monticore.lang.monticar.struct._symboltable.StructLanguage;
import de.monticore.symboltable.GlobalScope;
import de.monticore.symboltable.Scope;
public abstract class EMAMOptAbstractSymtabTest extends AbstractSymtabTest {
protected static Scope createSymTab(String... modelPath) {
ModelingLanguageFamily fam = getModelingLanguageFamily();
final ModelPath mp = getModelPath(modelPath);
GlobalScope scope = new GlobalScope(mp, fam);
de.monticore.lang.monticar.Utils.addBuiltInTypes(scope);
LogConfig.init();
return scope;
}
protected static ModelingLanguageFamily getModelingLanguageFamily() {
ModelingLanguageFamily fam = super.getModelingLanguageFamily();
fam.addModelingLanguage(new EmbeddedMontiArcMathOptLanguage());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment