Commit 758f7927 authored by Malte Heithoff's avatar Malte Heithoff

Merge remote-tracking branch 'origin/StartValueExtension' into StartValueExtension

# Conflicts:
#	src/test/resources/testing/InitialGuessFromParameter.ema
#	src/test/resources/testing/InitialGuessTest.ema
parents 5d3cf7bb 483636c2
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.embeddedmontiarc.cocos;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTPortInitial;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTSubComponent;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._cocos.EmbeddedMontiArcASTSubComponentCoCo;
import de.monticore.mcexpressions._ast.ASTAssignmentExpression;
import de.se_rwth.commons.logging.Log;
public class InitialGuessIsAssignment implements EmbeddedMontiArcASTSubComponentCoCo {
@Override
public void check(ASTSubComponent node) {
for (ASTPortInitial initialGuess : node.getPortInitialList()) {
if (initialGuess.getExpression() instanceof ASTAssignmentExpression) {
Log.error(String.format("0x079B7 Initial guess of has to be an assignment"),
node.get_SourcePositionStart());
}
}
}
}
......@@ -310,10 +310,12 @@ public class EMAComponentInstanceSymbol
}
public Optional<EMAComponentInstanceSymbol> getEnclosingComponent() {
if (getEnclosingScope() == null) return Optional.empty();
return (Optional<EMAComponentInstanceSymbol>) getEnclosingScope().getSpanningSymbol();
}
public Optional<EMAComponentInstanceSymbol> getParent() {
if (getEnclosingScope() == null) return Optional.empty();
return (Optional<EMAComponentInstanceSymbol>) getEnclosingScope().getSpanningSymbol();
}
......
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