-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release' for version 2.1.6
- Loading branch information
Showing
9,229 changed files
with
23,235 additions
and
315,448 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
core/codegen-runtime/src/main/java/org/overture/codegen/runtime/EvaluatePP.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
core/codegen-runtime/src/main/java/org/overture/codegen/runtime/VDMThread.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.overture.codegen.runtime; | ||
/** | ||
* This class was defined as intermediate layer class in order to extend through it the Thread class | ||
* and activate the daemon property for the threads that are started. | ||
* The daemon property needs to be active in order for the Java threads to have similar behavior | ||
* as the VDM threads in respect to the JVM and the VDM debugger. | ||
* @author gkanos | ||
* | ||
*/ | ||
public class VDMThread extends Thread | ||
{ | ||
public VDMThread() | ||
{ | ||
setDaemon(true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
core/codegen/src/main/java/org/overture/codegen/analysis/vdm/NameCollector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.overture.codegen.analysis.vdm; | ||
|
||
import java.util.LinkedList; | ||
import java.util.List; | ||
|
||
import org.overture.ast.analysis.AnalysisException; | ||
import org.overture.ast.analysis.DepthFirstAnalysisAdaptor; | ||
import org.overture.ast.intf.lex.ILexNameToken; | ||
|
||
public class NameCollector extends DepthFirstAnalysisAdaptor | ||
{ | ||
private List<String> names; | ||
|
||
public NameCollector() | ||
{ | ||
this.names = new LinkedList<String>(); | ||
} | ||
|
||
public List<String> namesToAvoid() | ||
{ | ||
return names; | ||
} | ||
|
||
@Override | ||
public void inILexNameToken(ILexNameToken node) throws AnalysisException | ||
{ | ||
String name = node.getName(); | ||
|
||
if (!names.contains(name)) | ||
{ | ||
names.add(name); | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
core/codegen/src/main/java/org/overture/codegen/analysis/vdm/RenameAnalysis.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.overture.codegen.analysis.vdm; | ||
|
||
import java.util.List; | ||
|
||
import org.overture.ast.analysis.AnalysisException; | ||
import org.overture.ast.analysis.DepthFirstAnalysisAdaptor; | ||
import org.overture.ast.intf.lex.ILexNameToken; | ||
import org.overture.ast.lex.LexNameToken; | ||
|
||
class RenameAnalysis extends DepthFirstAnalysisAdaptor | ||
{ | ||
private List<Renaming> renamings; | ||
|
||
public RenameAnalysis(List<Renaming> renamings) | ||
{ | ||
this.renamings = renamings; | ||
} | ||
|
||
@Override | ||
public void caseILexNameToken(ILexNameToken node) | ||
throws AnalysisException | ||
{ | ||
for (Renaming r : renamings) | ||
{ | ||
if (node.getLocation().equals(r.getLoc())) | ||
{ | ||
node.parent().replaceChild(node, consLexNameToken(node, r.getNewName())); | ||
} | ||
} | ||
} | ||
|
||
private LexNameToken consLexNameToken(ILexNameToken defName, | ||
String newName) | ||
{ | ||
LexNameToken newLexName = new LexNameToken(defName.getModule(), newName, defName.getLocation(), defName.getOld(), defName.getExplicit()); | ||
newLexName.setTypeQualifier(defName.getTypeQualifier()); | ||
|
||
return newLexName; | ||
} | ||
} |
83 changes: 83 additions & 0 deletions
83
core/codegen/src/main/java/org/overture/codegen/analysis/vdm/Renaming.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
package org.overture.codegen.analysis.vdm; | ||
|
||
import org.overture.ast.intf.lex.ILexLocation; | ||
|
||
public class Renaming implements Comparable<Renaming> | ||
{ | ||
private ILexLocation loc; | ||
private String oldName; | ||
private String newName; | ||
|
||
public Renaming(ILexLocation loc, String oldName, String newName) | ||
{ | ||
if(loc == null) | ||
{ | ||
throw new IllegalArgumentException("Location cannot be null in Renaming"); | ||
} | ||
|
||
if(oldName == null || oldName.isEmpty()) | ||
{ | ||
throw new IllegalArgumentException("The old name of a renaming cannot be null or the empty String"); | ||
} | ||
|
||
if(newName == null || newName.isEmpty()) | ||
{ | ||
throw new IllegalArgumentException("The new name of a renaming cannot be null or the empty String"); | ||
} | ||
|
||
this.loc = loc; | ||
this.oldName = oldName; | ||
this.newName = newName; | ||
} | ||
|
||
public ILexLocation getLoc() | ||
{ | ||
return loc; | ||
} | ||
|
||
public String getOldName() | ||
{ | ||
return oldName; | ||
} | ||
|
||
public String getNewName() | ||
{ | ||
return newName; | ||
} | ||
|
||
@Override | ||
public String toString() | ||
{ | ||
return String.format("'%s' changed to '%s' %s", oldName, newName, loc); | ||
} | ||
|
||
@Override | ||
public int hashCode() | ||
{ | ||
return loc.hashCode(); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) | ||
{ | ||
if(this == obj) | ||
{ | ||
return true; | ||
} | ||
|
||
if(!(obj instanceof Renaming)) | ||
{ | ||
return false; | ||
} | ||
|
||
Renaming other = (Renaming) obj; | ||
|
||
return loc.equals(other.loc); | ||
} | ||
|
||
@Override | ||
public int compareTo(Renaming arg0) | ||
{ | ||
return arg0.getLoc().getStartOffset() - loc.getStartOffset(); | ||
} | ||
} |
Oops, something went wrong.