Class Util
java.lang.Object
com.pnfsoftware.jeb.core.units.code.android.ir.compiler.Util
Utility routines to build IR templates.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcalculateProperties(INode root) Calculate and cache derived properties for a template tree.static LeafL(int id) Create a leaf node matching everything (terminals and non-terminals alike, of any bitsize).static LeafL(int id, int bitsize) Create a leaf node matching terminals and non-terminals of the provided bitsize.static LeafL(int id, int bitsize, int flags, INodeHandler customHandler) Create a leaf node.static LeafLC(long value) Create a leaf node matching a given immediate, regardless of its bitsize.static LeafLC(long value, int bitsize) Create a leaf node matching a given immediate with an explicit bitsize.static LeafLC(long value, int bitsize, int id) Create a leaf node matching a given immediate with an explicit bitsize.static LeafLI(int id) Create a leaf node matching immediates only.static LeafLIV(int id) Create a leaf node matching immediates and variables only.static LeafLT(int id) Create a leaf node matching all terminals, but terminals only.static LeafLV(int id) Create a leaf node matching variables only.static NodeCreate an operator-group node.static NodeCreate an operator node.static SubstitutionDefinitionCreate a substitution definition.
-
Method Details
-
N
Create an operator node.- Parameters:
operator- operator to matchoperands- child template nodes- Returns:
- the created node
-
N
Create an operator-group node.- Parameters:
opgrp- operator group to matchoperands- child template nodes- Returns:
- the created node
-
L
Create a leaf node.- Parameters:
id- leaf idbitsize- required bitsize, or 0 for anyflags- leaf matching flagscustomHandler- optional custom matching handler- Returns:
- the created leaf
-
L
Create a leaf node matching everything (terminals and non-terminals alike, of any bitsize).- Parameters:
id- leaf id- Returns:
- the created leaf
-
L
Create a leaf node matching terminals and non-terminals of the provided bitsize.- Parameters:
id- leaf idbitsize- required bitsize- Returns:
- the created leaf
-
LT
Create a leaf node matching all terminals, but terminals only.- Parameters:
id- leaf id- Returns:
- the created leaf
-
LI
Create a leaf node matching immediates only.- Parameters:
id- leaf id- Returns:
- the created leaf
-
LV
Create a leaf node matching variables only.- Parameters:
id- leaf id- Returns:
- the created leaf
-
LIV
Create a leaf node matching immediates and variables only.- Parameters:
id- leaf id- Returns:
- the created leaf
-
LC
Create a leaf node matching a given immediate with an explicit bitsize.- Parameters:
value- immediate valuebitsize- required bitsizeid- leaf id- Returns:
- the created leaf
-
LC
Create a leaf node matching a given immediate with an explicit bitsize.- Parameters:
value- immediate valuebitsize- required bitsize- Returns:
- the created leaf
-
LC
Create a leaf node matching a given immediate, regardless of its bitsize.- Parameters:
value- immediate value- Returns:
- the created leaf
-
SD
Create a substitution definition.- Parameters:
pattern- source patternreplacement- replacement pattern- Returns:
- the substitution definition
-
calculateProperties
Calculate and cache derived properties for a template tree.- Parameters:
root- root node
-