public class StructParser extends Object
Declarations ::= { MagicDeclaration | DescriptionDeclaration | EnumDeclaration | SetDeclaration | TypedefDeclaration } EOF
MagicDeclaration ::= "magic" identifier ("ushort" hexLiteral[".." hexLiteral] | stringLiteral) ";"
DescriptionDeclaration ::= "description" identifier stringLiteral "," stringLiteral ";"
EnumDeclaration ::= EnumSpecifier identifier ";"
SetDeclaration ::= SetSpecifier identifier ";"
TypedefDeclaration ::= "typedef" TypeSpecifier identifier ";"
EnumSpecifier ::= "enum" ( identifier | "{" identifier ["=" magicOrIntLiteral] {"," identifier ["=" intLiteral]} "}" )
SetSpecifier ::= "set" ( identifier | "{" identifier "=" intLiteral {"," identifier "=" intLiteral} "}" )
TypeSpecifier ::= ( StructSpecifier | (PrimitiveSpecifier [EnumSpecifier | SetSpecifier]) ) [ArrayList]
StructSpecifier ::= "struct (identifier | "{" MemberDeclaration {"," MemberDeclaration } "}" )
MemberDeclaration ::= TypeSpecifier identifier [ArrayList] ";"
PrimitiveSpecifier ::= "uint1" | "uint2" | "uint4" | "uint5" | "uint8"
| "uint12" | "uint16" | "uint31LE" | "uint32"
| "int9" | "int16" | "int32"
| "ubyte" | "byte" | "short"
| "ushort" | "int" | "long" | "float" | "double"
| "extended"
| "char" | "charbyte" | "cstring" | "utf8" | "pstring"
| "pstring32"
| "utf16le" | "magic" | "mactimestamp" | "bcd2"
| "bcd4"
| "fixed16d16" | "fixed2d30" | "fixed8d8"
| "ataricolor"
ArrayList ::= "[" [ArraySize] "]" {"," identifier "[" [ArraySize] "]" }
ArraySize ::= () | intLiteral [("-"|"+"|"=="|"!=") intLiteral]
| Modifier and Type | Class and Description |
|---|---|
protected static class |
StructParser.ArraySize
ArraySize expression.
|
protected static class |
StructParser.Declarations
Declarations expression.
|
protected static class |
StructParser.DescriptionDeclaration
DescriptionDeclaration expression.
|
protected static class |
StructParser.EnumDeclaration
EnumDeclaration expression.
|
protected static class |
StructParser.EnumSpecifier
EnumSpecifier expression.
|
protected static class |
StructParser.IntLiteral
IntLiteral expression.
|
protected static class |
StructParser.MagicDeclaration
MagicDeclaration expression.
|
protected static class |
StructParser.MagicOrIntLiteral
MagicOrIntLiteral expression.
|
protected static class |
StructParser.MemberDeclaration
MemberDeclaration expression.
|
protected static class |
StructParser.PrimitiveSpecifier
PrimitiveSpecifier expression.
|
protected static class |
StructParser.SetDeclaration
SetDeclaration expression.
|
protected static class |
StructParser.SetSpecifier
SetSpecifier expression.
|
protected static class |
StructParser.StructSpecifier
StructSpecifier expression.
|
protected static class |
StructParser.TypedefDeclaration
TypedefDeclaration expression.
|
protected static class |
StructParser.TypeSpecifier
TypeSpecifier expression.
|
| Modifier and Type | Field and Description |
|---|---|
protected static long |
MAC_TIMESTAMP_EPOCH |
| Constructor and Description |
|---|
StructParser() |
StructParser(Reader r) |
| Modifier and Type | Method and Description |
|---|---|
String |
getDescription(Object magic) |
String |
getDescription(String magic) |
String |
getIdentifierName(String magic) |
String |
getName(Object magic) |
String |
getName(String magic) |
boolean |
isMagicDeclared(Object magic) |
boolean |
isMagicDeclared(String magic) |
boolean |
isTypeDeclared(Object magic) |
boolean |
isTypeDeclared(String magic) |
protected void |
parse(Reader r) |
StructTableModel |
readStruct(int magic,
byte[] data) |
StructTableModel |
readStruct(int magic,
InputStream data) |
StructTableModel |
readStruct(String magic,
byte[] data) |
StructTableModel |
readStruct(String magic,
InputStream data) |
public StructParser()
public StructParser(Reader r) throws IOException, ParseException
IOExceptionParseExceptionpublic boolean isMagicDeclared(String magic)
public boolean isMagicDeclared(Object magic)
public boolean isTypeDeclared(String magic)
public boolean isTypeDeclared(Object magic)
public StructTableModel readStruct(String magic, byte[] data) throws IOException
IOExceptionpublic StructTableModel readStruct(int magic, byte[] data) throws IOException
IOExceptionpublic StructTableModel readStruct(String magic, InputStream data) throws IOException
IOExceptionpublic StructTableModel readStruct(int magic, InputStream data) throws IOException
IOExceptionprotected void parse(Reader r) throws IOException, ParseException
IOExceptionParseExceptionCopyright © 2014. All Rights Reserved.