-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
204 additions
and
25 deletions.
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
18 changes: 16 additions & 2 deletions
18
...ausalReasoningSystem/functional/language/runtime/ResultAndControlflowPropagationInfo.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 |
---|---|---|
@@ -1,14 +1,28 @@ | ||
package ptrman.causalReasoningSystem.functional.language.runtime; | ||
|
||
import ptrman.causalReasoningSystem.functional.language.codegen.Typeinfo; | ||
|
||
/** | ||
* Created by r0b3 on 11.12.2015. | ||
* Used by the generated code to propagate results and controlflow information | ||
* | ||
*/ | ||
class ResultAndControlflowPropagationInfo { | ||
public class ResultAndControlflowPropagationInfo { | ||
int resultInteger; | ||
|
||
// called from generated code | ||
public static ResultAndControlflowPropagationInfo createResultForConstantInteger(final int value) { | ||
ResultAndControlflowPropagationInfo result = new ResultAndControlflowPropagationInfo(); | ||
result.resultInteger = value; | ||
return result; | ||
} | ||
|
||
// used by codegeneration | ||
public static String codegenGetJavaFunctionnameForCreationOfType(Typeinfo typeinfo) { | ||
if( typeinfo.type == Typeinfo.EnumType.INTEGER ) { | ||
return "createResultForConstantInteger"; | ||
} | ||
|
||
throw new RuntimeException("Internal Error: No function for Static Runtime found to create value of type!"); | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
java/ptrman/causalReasoningSystem/functional/language/runtime/TypeConversation.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 ptrman.causalReasoningSystem.functional.language.runtime; | ||
|
||
/** | ||
* Used by the generated code to extract values or convert results from one type to another | ||
*/ | ||
public class TypeConversation { | ||
public static int passThroughInteger(ResultAndControlflowPropagationInfo data) { | ||
return data.resultInteger; | ||
} | ||
|
||
/* | ||
public static int passThroughBoolean(ResultAndControlflowPropagationInfo data) { | ||
return data.resultBoolean; | ||
} | ||
*/ | ||
} |
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