JsonToAst
loreline.JsonToAst (Class)
Utility class for reconstructing AST nodes from their JSON representation. This is the reverse of the toJson() methods on each node class.
Static Members
Reconstructs a Script from its JSON representation.
| Name | Type | Description |
|---|---|---|
json |
Dynamic | The JSON object (as returned by Script.toJson()) |
| Returns | Description |
|---|---|
| Script | The reconstructed Script |
Reconstructs any AST Node from its JSON representation. Dispatches based on the "type" field.
| Name | Type | Description |
|---|---|---|
json |
Dynamic | The JSON object (as returned by node.toJson()) |
| Returns | Description |
|---|---|
| Node | The reconstructed Node |
Private Members
| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| Comment |
stateFromJson(json: Dynamic): NStateDecl| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NStateDecl |
objectFieldFromJson(json: Dynamic): NObjectField| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NObjectField |
characterFromJson(json: Dynamic): NCharacterDecl| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NCharacterDecl |
| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NBeatDecl |
stringPartFromJson(json: Dynamic): NStringPart| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NStringPart |
stringLiteralFromJson(json: Dynamic): NStringLiteral| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NStringLiteral |
textStatementFromJson(json: Dynamic): NTextStatement| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NTextStatement |
dialogueStatementFromJson(json: Dynamic): NDialogueStatement| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NDialogueStatement |
choiceStatementFromJson(json: Dynamic): NChoiceStatement| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NChoiceStatement |
choiceOptionFromJson(json: Dynamic): NChoiceOption| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NChoiceOption |
| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NBlock |
ifStatementFromJson(json: Dynamic): NIfStatement| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NIfStatement |
alternativeFromJson(json: Dynamic): NAlternative| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NAlternative |
| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NCall |
transitionFromJson(json: Dynamic): NTransition| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NTransition |
| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NBeatCall |
insertionFromJson(json: Dynamic): NInsertion| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NInsertion |
functionDeclFromJson(json: Dynamic): NFunctionDecl| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NFunctionDecl |
| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NLiteral |
| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NAccess |
| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NAssign |
arrayAccessFromJson(json: Dynamic): NArrayAccess| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NArrayAccess |
| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NBinary |
| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NUnary |
| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NTernary |
importStatementFromJson(json: Dynamic): NImportStatement| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NImportStatement |
| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| NodeId |
| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| Position |
extractComments(json: Dynamic): AnonStruct| Name | Type |
|---|---|
json |
Dynamic |
| Returns |
|---|
| AnonStruct |
| Name | Type |
|---|---|
node |
AstNode |
json |
Dynamic |
blockStyleFromString(s: String): BlockStyle| Name | Type |
|---|---|
s |
String |
| Returns |
|---|
| BlockStyle |
conditionStyleFromString(s: String): ConditionStyle| Name | Type |
|---|---|
s |
String |
| Returns |
|---|
| ConditionStyle |
alternativeModeFromString(s: String): AlternativeMode| Name | Type |
|---|---|
s |
String |
| Returns |
|---|
| AlternativeMode |
| Name | Type |
|---|---|
s |
String |
| Returns |
|---|
| Quotes |
tokenTypeFromString(s: String): Anonymous| Name | Type |
|---|---|
s |
String |
| Returns |
|---|
| Anonymous |
Metadata
| Name | Parameters |
|---|---|
:hxGen |
- |