Skip to content

Commit

Permalink
Merge commit 'f05a7ac82ee039c68e02dada278d2249554d40b1'
Browse files Browse the repository at this point in the history
* commit 'f05a7ac82ee039c68e02dada278d2249554d40b1':
  make no value object serializable for use in model checker project
  change return type of delay to void
  mak delay external
  • Loading branch information
Ehsan Khamespanah committed Sep 14, 2024
2 parents 0f83e6c + f05a7ac commit 1ec9ebd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.Serializable;

@Component
public abstract class AbstractSemanticCheck {
@Autowired
Expand All @@ -17,6 +19,14 @@ public abstract class AbstractSemanticCheck {
@Autowired
protected SymbolTable symbolTable;

public final static Object NO_VALUE = new Object();
public final static Object NO_VALUE = new NoValue();

private static class NoValue implements Serializable {
private static final long serialVersionUID = 1L;

// Ensure singleton instance
private Object readResolve() {
return NO_VALUE;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,9 @@ protected void initializeExpressionSemanticCheckContainer() {
protected void addMethodsOfRebecaExtensionToSymbolTable() {
super.addMethodsOfRebecaExtensionToSymbolTable();

SynchMethodDeclaration delayMethod = new SynchMethodDeclaration();
delayMethod.setName("delay");
addMethodToSymbolTable(CoreRebecaLabelUtility.BUILT_IN_METHOD, null, "delay", CoreRebecaTypeSystem.VOID_TYPE,
new Pair<Type, String>(CoreRebecaTypeSystem.INT_TYPE, "arg0"));
FormalParameterDeclaration fpd = new FormalParameterDeclaration();
fpd.setName("arg0");
fpd.setType(CoreRebecaTypeSystem.INT_TYPE);
delayMethod.getFormalParameters().add(fpd);
delayMethod.setReturnType(CoreRebecaTypeSystem.VOID_TYPE);

symbolTable.addMethod(null, delayMethod, TimedRebecaLabelUtility.DELAY);

SynchMethodDeclaration startTimerMethod = new SynchMethodDeclaration();
startTimerMethod.setName("startTimer");
Expand Down

0 comments on commit 1ec9ebd

Please sign in to comment.