| java.lang.Object | |
| ↳ | com.pnfsoftware.jeb.core.units.code.asm.type.TypeStringParser |
A C type and prototype parser.
Examples:
ITypeManager typeman = TypeManager.createForIntel386();
IStructureType tHouse = typeman.createStructure("House");
typeman.addStructureField(tHouse, "field0", typeman.getType("int"));
TypeStringParser parser = new TypeStringParser(typeman);
parser.parseType("int a;"); // name is optional; semicolon is also optional
parser.parseType("int"); // name optional; semicolon optional
parser.parseType("House*");
parser.parseType("void (*f)()"); // for function pointers, a name (which will be discarded) is mandatory; semicolon is optional
parser.parseType("char* __cdecl f(int, double);");
// the format for anonymous prototypes is the following (no name; again, final semi-colon optional)
parser.parsePrototype("void()");
parser.parsePrototype("int();");
parser.parsePrototype("int(void)");
parser.parsePrototype("<__cdecl> int(int, int)");
parser.parsePrototype("<__cdecl> int(int, char*, ...)");
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
TypeStringParser(ITypeManager typeman)
Create a type parser.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| IPrototypeItem |
parsePrototype(String s)
Parse an anonymous prototype.@return
| ||||||||||
| INativeType |
parseType(String s)
Parse a type.@return
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Create a type parser.
| typeman | the type manager to be used as a source of existing types and recipient of newly-parsed types |
|---|
Parse an anonymous prototype.@return
| TypeStringParseException |
|---|