Macro macro = macros.get(macroName);
if (macro == null)
{
logger.error("Warning: entry '" + name + "' has no related macro, hence an empty semantics");
ret.setSemantics(new Semantics());
ret.setInterface(new FeatureStructure());
}
else
{
InstantiationContext context = new InstantiationContext();
FeatureStructure newHeader = Unifier.unify(macroHeader, macro.getHeader(), context);
if (newHeader == null)
logger.error("Warning: header of '" + name + "' does not unify with macro header '" + macro.getName() + "' : " + macro.getHeader());
FeatureStructure entryInterface = new FeatureStructure(macro.getMacroInterface());
entryInterface.instantiate(context);
ret.setInterface(entryInterface);
Semantics semantics = new Semantics(macro.getSemantics());
semantics.instantiate(context);
ret.setSemantics(semantics);
}
return ret;
}