mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-25 17:00:36 -09:00
Changes from review
This commit is contained in:
@@ -1079,11 +1079,11 @@ SKIP :
|
||||
TOKEN :
|
||||
{
|
||||
<INTEGER_LITERAL :
|
||||
<DECIMAL_LITERAL> ( "ull" | "ULL" | "ul" | "UL" | "ll" | "LL" | "l" | "L" | "U" | "u" | "i64" | "I64")? ("i")? ( ["0"-"9"] )*
|
||||
<DECIMAL_LITERAL> ("u"|"U")? ("ll"|"LL"|"l"|"L")? (("i"|"I") ("8"|"16"|"32"|"64"|"128"))?
|
||||
|
|
||||
<HEX_LITERAL> ( "ull" | "ULL" | "ul" | "UL" | "ll" | "LL" | "l" | "L" | "U" | "u" | "i64" | "I64")? ("i")? ( ["0"-"9"] )*
|
||||
<HEX_LITERAL> ("u"|"U")? ("ll"|"LL"|"l"|"L")? (("i"|"I") ("8"|"16"|"32"|"64"|"128"))?
|
||||
|
|
||||
<OCTAL_LITERAL> ( "ull" | "ULL" | "ul" | "UL" | "ll" | "LL" | "l" | "L" | "U" | "u" | "i64" | "I64")? ("i")? ( ["0"-"9"] )*
|
||||
<OCTAL_LITERAL> ("u"|"U")? ("ll"|"LL"|"l"|"L")? (("i"|"I") ("8"|"16"|"32"|"64"|"128"))?
|
||||
>
|
||||
|
|
||||
<#DECIMAL_LITERAL : [ "1"-"9" ] ( [ "0"-"9" ] )*>
|
||||
@@ -3079,39 +3079,46 @@ Object Constant() : {
|
||||
(
|
||||
t = <INTEGER_LITERAL>
|
||||
{
|
||||
String sval = t.image;
|
||||
if (sval.endsWith("i8") || sval.endsWith("I8")) {
|
||||
String sval = t.image.toLowerCase();
|
||||
if (sval.endsWith("i8")) {
|
||||
sval = sval.substring(0,sval.length()-2);
|
||||
}
|
||||
else if (sval.endsWith("i16") || sval.endsWith("I16")) {
|
||||
else if (sval.endsWith("i16")) {
|
||||
sval = sval.substring(0,sval.length()-3);
|
||||
}
|
||||
else if (sval.endsWith("i32") || sval.endsWith("I32")) {
|
||||
else if (sval.endsWith("i32")) {
|
||||
sval = sval.substring(0,sval.length()-3);
|
||||
}
|
||||
else if (sval.endsWith("i64") || sval.endsWith("I64")) {
|
||||
else if (sval.endsWith("i64")) {
|
||||
sval = sval.substring(0,sval.length()-3);
|
||||
}
|
||||
else if (sval.endsWith("i128")) {
|
||||
sval = sval.substring(0,sval.length()-4);
|
||||
}
|
||||
|
||||
if (sval.endsWith("ull") || sval.endsWith("ULL")) {
|
||||
if (sval.endsWith("ull")) {
|
||||
sval = sval.substring(0,sval.length()-3);
|
||||
}
|
||||
else if (sval.endsWith("ll") || sval.endsWith("LL")) {
|
||||
else if (sval.endsWith("ll")) {
|
||||
sval = sval.substring(0,sval.length()-2);
|
||||
}
|
||||
else if (sval.endsWith("ul") || sval.endsWith("UL")) {
|
||||
else if (sval.endsWith("ul")) {
|
||||
sval = sval.substring(0,sval.length()-2);
|
||||
}
|
||||
else if (sval.endsWith("l") || sval.endsWith("L")) {
|
||||
else if (sval.endsWith("l")) {
|
||||
sval = sval.substring(0,sval.length()-1);
|
||||
}
|
||||
else if (sval.endsWith("u") || sval.endsWith("U")) {
|
||||
else if (sval.endsWith("u")) {
|
||||
sval = sval.substring(0,sval.length()-1);
|
||||
}
|
||||
if (sval.startsWith("0x") || sval.startsWith("0X")) {
|
||||
if (sval.startsWith("0x")) {
|
||||
BigInteger bigConst = new BigInteger(sval.substring(2), 16);
|
||||
obj = Long.valueOf(bigConst.longValue());
|
||||
}
|
||||
else if (sval.startsWith("0") && sval.length() > 1) {
|
||||
BigInteger bigConst = new BigInteger(sval.substring(1), 8);
|
||||
obj = Long.valueOf(bigConst.longValue());
|
||||
}
|
||||
else {
|
||||
BigInteger bigConst = new BigInteger(sval);
|
||||
obj = Long.valueOf(bigConst.longValue());
|
||||
|
||||
Reference in New Issue
Block a user