mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GP-4303 Collapse STARTSYM, ENDSYM, NEXT2SYM, etc. into single token type
This commit is contained in:
parent
d1dc48547e
commit
ae6f7b479c
12 changed files with 2390 additions and 3125 deletions
|
@ -344,6 +344,8 @@ specific_symbol[String purpose] returns [SpecificSymbol symbol]
|
|||
} else if(sym.getType() != symbol_type.start_symbol
|
||||
&& sym.getType() != symbol_type.end_symbol
|
||||
&& sym.getType() != symbol_type.next2_symbol
|
||||
&& sym.getType() != symbol_type.flowdest_symbol
|
||||
&& sym.getType() != symbol_type.flowref_symbol
|
||||
&& sym.getType() != symbol_type.operand_symbol
|
||||
&& sym.getType() != symbol_type.epsilon_symbol
|
||||
&& sym.getType() != symbol_type.varnode_symbol) {
|
||||
|
@ -841,6 +843,8 @@ pattern_symbol[String purpose] returns [PatternExpression expr]
|
|||
} else if(sym.getType() == symbol_type.start_symbol
|
||||
|| sym.getType() == symbol_type.end_symbol
|
||||
|| sym.getType() == symbol_type.next2_symbol
|
||||
|| sym.getType() == symbol_type.flowdest_symbol
|
||||
|| sym.getType() == symbol_type.flowref_symbol
|
||||
|| sym.getType() == symbol_type.epsilon_symbol
|
||||
|| sym.getType() == symbol_type.varnode_symbol) {
|
||||
SpecificSymbol ss = (SpecificSymbol) sym;
|
||||
|
@ -874,6 +878,8 @@ pattern_symbol2[String purpose] returns [PatternExpression expr]
|
|||
} else if(sym.getType() == symbol_type.start_symbol
|
||||
|| sym.getType() == symbol_type.end_symbol
|
||||
|| sym.getType() == symbol_type.next2_symbol
|
||||
|| sym.getType() == symbol_type.flowdest_symbol
|
||||
|| sym.getType() == symbol_type.flowref_symbol
|
||||
|| sym.getType() == symbol_type.operand_symbol
|
||||
|| sym.getType() == symbol_type.epsilon_symbol
|
||||
|| sym.getType() == symbol_type.varnode_symbol) {
|
||||
|
@ -945,6 +951,8 @@ cstatement[VectorSTL<ContextChange> r]
|
|||
|| sym.getType() == symbol_type.start_symbol
|
||||
|| sym.getType() == symbol_type.end_symbol
|
||||
|| sym.getType() == symbol_type.next2_symbol
|
||||
|| sym.getType() == symbol_type.flowdest_symbol
|
||||
|| sym.getType() == symbol_type.flowref_symbol
|
||||
|| sym.getType() == symbol_type.operand_symbol
|
||||
|| sym.getType() == symbol_type.epsilon_symbol
|
||||
|| sym.getType() == symbol_type.varnode_symbol) {
|
||||
|
@ -1178,6 +1186,8 @@ assignment returns [VectorSTL<OpTpl> value]
|
|||
} else if(sym.getType() != symbol_type.start_symbol
|
||||
&& sym.getType() != symbol_type.end_symbol
|
||||
&& sym.getType() != symbol_type.next2_symbol
|
||||
&& sym.getType() != symbol_type.flowdest_symbol
|
||||
&& sym.getType() != symbol_type.flowref_symbol
|
||||
&& sym.getType() != symbol_type.operand_symbol
|
||||
&& sym.getType() != symbol_type.epsilon_symbol
|
||||
&& sym.getType() != symbol_type.varnode_symbol) {
|
||||
|
@ -1313,7 +1323,9 @@ jump_symbol[String purpose] returns [VarnodeTpl value]
|
|||
unknownSymbolError($s.getText(), find($s), "start, end, or operand", purpose);
|
||||
} else if (sym.getType() == symbol_type.start_symbol ||
|
||||
sym.getType() == symbol_type.end_symbol ||
|
||||
sym.getType() == symbol_type.next2_symbol) {
|
||||
sym.getType() == symbol_type.next2_symbol ||
|
||||
sym.getType() == symbol_type.flowdest_symbol ||
|
||||
sym.getType() == symbol_type.flowref_symbol) {
|
||||
SpecificSymbol ss = (SpecificSymbol) sym;
|
||||
$value = new VarnodeTpl(find($s), new ConstTpl(ConstTpl.const_type.j_curspace),
|
||||
ss.getVarnode().getOffset(),
|
||||
|
@ -1518,6 +1530,8 @@ expr_apply returns [Object value]
|
|||
} else if(sym.getType() == symbol_type.start_symbol
|
||||
|| sym.getType() == symbol_type.end_symbol
|
||||
|| sym.getType() == symbol_type.next2_symbol
|
||||
|| sym.getType() == symbol_type.flowdest_symbol
|
||||
|| sym.getType() == symbol_type.flowref_symbol
|
||||
|| sym.getType() == symbol_type.operand_symbol
|
||||
|| sym.getType() == symbol_type.epsilon_symbol
|
||||
|| sym.getType() == symbol_type.varnode_symbol) {
|
||||
|
|
|
@ -41,7 +41,7 @@ public class FlowDestSymbol extends SpecificSymbol {
|
|||
|
||||
@Override
|
||||
public symbol_type getType() {
|
||||
return symbol_type.start_symbol;
|
||||
return symbol_type.flowdest_symbol;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -27,7 +27,7 @@ import ghidra.sleigh.grammar.Location;
|
|||
*/
|
||||
public class FlowRefSymbol extends SpecificSymbol {
|
||||
private AddrSpace const_space;
|
||||
|
||||
|
||||
public FlowRefSymbol(Location location, String nm, AddrSpace cspc) {
|
||||
super(location, nm);
|
||||
const_space = cspc;
|
||||
|
@ -36,13 +36,13 @@ public class FlowRefSymbol extends SpecificSymbol {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PatternExpression getPatternExpression() {
|
||||
public PatternExpression getPatternExpression() {
|
||||
return null; // Cannot be used in pattern expressions
|
||||
}
|
||||
|
||||
@Override
|
||||
public symbol_type getType() {
|
||||
return symbol_type.start_symbol;
|
||||
return symbol_type.flowref_symbol;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -35,5 +35,7 @@ public enum symbol_type {
|
|||
context_symbol,
|
||||
epsilon_symbol,
|
||||
label_symbol,
|
||||
flowdest_symbol,
|
||||
flowref_symbol,
|
||||
dummy_symbol
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue