Home docs DDL Parse Trees
Post

DDL Parse Trees

You may be surprised to see the real names of parameter and structure members on many of the wiki pages. NEX has automatically generated the code that encodes/decodes method parameters and structures from a data definition language (DDL), and many games contain the parse tree of the DDL declarations in their data segment. It’s encoded in big-endian byte order (regardless of the platform) and looks as follows:

TypeDescription
Uint32Magic number (0xCD652312)
Uint8Unknown (always 0)
Uint32Major version
Uint32Minor version
Uint32Micro version
Uint32Build version
NameSpaceRoot namespace

NameSpace

TypeDescription
Uint32Number of elements (N)
Element (N)Namespace elements

Element

TypeDescription
Uint8Type id
 Body

String

TypeDescription
Uint32Length (N)
Bytes (N)String (without null terminator)

DeclarationUse

TypeDescription
Uint8Declaration type (see element)
StringFull type name

Only if declaration type is TemplateInstance:

TypeDescription
StringBase type name
Uint8Number of arguments (N)
DeclarationUse (N)Argument declaration use

ParseTreeItem

TypeDescription
StringName

NameSpaceItem

The second parse tree item is always the same as the first parse tree item. I don’t know why it’s stored twice.

TypeDescription
ParseTreeItemParse tree item
ParseTreeItemParse tree item

Declaration

TypeDescription
NameSpaceItemNamespace item
StringDDL unit name
NamespaceProperties

DOClassDeclaration

TypeDescription
DeclarationDeclaration
StringParent class name
Uint32Class id
NamespaceNamespace

DatasetDeclaration

TypeDescription
DeclarationDeclaration
NamespaceVariables

TypeDeclaration

TypeDescription
DeclarationDeclaration

MethodDeclaration

TypeDescription
DeclarationDeclaration
NameSpaceParameters

Variable

TypeDescription
NameSpaceItemNamespace item
DeclarationUseDeclaration use
Uint32Array size

RMC

TypeDescription
MethodDeclarationMethod declaration
NameSpaceParameters

Action

TypeDescription
MethodDeclarationMethod declaration
NameSpaceParameters

AdapterDeclaration

TypeDescription
DeclarationDeclaration

PropertyDeclaration

TypeDescription
DeclarationDeclaration
Uint32Category mask
Uint32Allowed target mask

ProtocolDeclaration

TypeDescription
DeclarationDeclaration
NameSpaceMethods

Parameter

TypeDescription
VariableVariable
DeclarationUseDeclaration use
Uint32Array size
Uint8Type (1=input, 2=output, 3=both)

ReturnValue

TypeDescription
VariableVariable
DeclarationUseDeclaration use
Uint32Array size

ClassDeclaration

TypeDescription
TypeDeclarationType declaration
StringParent class name
NameSpaceClass members

TemplateDeclaration

TypeDescription
TypeDeclarationType declaration
Uint32Number of template arguments

SimpleTypeDeclaration

TypeDescription
TypeDeclarationType declaration

TemplateInstance

TypeDescription
TypeDeclarationType declaration
StringBase type name
Uint32Number of template arguments (N)
String (N)Template arguments

DDLUnitDeclaration

TypeDescription
DeclarationDeclaration
StringUnit name
StringUnit dir

DupSpaceDeclaration

TypeDescription
DeclarationDeclaration
Contents