-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use Java 13. * Fix resolution of references to enum. * Fix the initialization of enum variables.
- Loading branch information
Showing
7 changed files
with
71 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
import java.util.*; | ||
import java.math.BigInteger; | ||
|
||
public class PSSEnumInst extends PSSIntInst { | ||
|
||
public PSSEnumInst(String id, String type, PSSModel type_decl, boolean rand) { | ||
public PSSEnumInst(String id, String type, PSSEnumModel type_decl, boolean rand) { | ||
super(id, rand, 32, true); | ||
|
||
/* | ||
* PSS 2.0, Section 8.4 Enumeration types: | ||
* When not initialized, the default value of an enum field shall be the first | ||
* enum_item in the list. This is not necessarily the value 0 nor the enum_item | ||
* with the minimum value. | ||
*/ | ||
String[] items = type_decl.getEnumItems(); | ||
if (items.length > 0) { | ||
m_val = new PSSIntVal(BigInteger.valueOf(type_decl.getEnumItemValue(items[0]))); | ||
} | ||
} | ||
} |
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