# Class: MaiaCompiler

## MaiaCompiler()

#### new MaiaCompiler()

MaiaScript compiler class.

Source:
  - MaiaCompiler.js, line 24

### Methods

#### compile(xml) → {string}

Compiles the MaiaScript XML tree for JavaScript.

##### Parameters:

Name | Type | Description
--- | --- | ---
`xml` | xml | The XML data.

Source:
  - MaiaCompiler.js, line 1403

##### Returns:

XML data converted to JavaScript.

Type
  string

#### parse(mil, parentNodeInfo, isKernelFunction) → {string}

Compiles the code in Maia Internal Language (MIL) for JavaScript.

##### Parameters:

Name | Type | Description
--- | --- | ---
`mil` | json | Code in Maia Internal Language (MIL).
`parentNodeInfo` | string | Parent node data.
`isKernelFunction` | boolean | Parent node is a kernel function.

Source:
  - MaiaCompiler.js, line 270

##### Returns:

MIL code converted to JavaScript.

Type
  string

#### parseComplexNumber(text) → {string}

Compiles a complex number to JSON.

##### Parameters:

Name | Type | Description
--- | --- | ---
`text` | string | The expression representing the complex number.

Source:
  - MaiaCompiler.js, line 212

##### Returns:

Number converted to JSON.

Type
  string

#### xmlToJson(xml) → {json}

Convert XML to JSON.

##### Parameters:

Name | Type | Description
--- | --- | ---
`xml` | xml | The XML data.

Source:
  - MaiaCompiler.js, line 93

##### Returns:

XML data converted to a JSON object.

Type
  json

#### xmlToMil(xml, itemName) → {json}

Compiles the MaiaScript XML tree for Maia Internal Code (MIL).

##### Parameters:

Name | Type | Description
--- | --- | ---
`xml` | xml | The XML data.
`itemName` | string | Name of the item being analyzed.

Source:
  - MaiaCompiler.js, line 127

##### Returns:

XML data converted to a MIL object.

Type
  json

#### (inner) init()

Creates the attributes of the class.

Source:
  - MaiaCompiler.js, line 30