Options
All
  • Public
  • Public/Protected
  • All
Menu

The ConfigParserGenerator class, extending the ConfigGenerator class and generating the code that parses a config structure.

Hierarchy

Index

Constructors

constructor

Properties

Protected code

code: string = ""

The generated code.

Protected comment

comment: string = "{{GENERATE_CONFIG_PARSER}}"

The template comment that this generator handles.

Protected config

config: ConfigModel

The config model: the generated code could depend on it.

Private cursor

cursor: number = -1

The index of the function that is being currently generated.

Private functions

functions: string[] = []

The array of generated functions.

Private indentation

indentation: number = 0

The current indentation as number of tabs.

Private isRoot

isRoot: boolean = true

If the current function to generate is the root one.

Protected keys

keys: (string | number)[] = []

A stack of inspected keys.

Protected structure

structure: StructureModel

The structure model: the generated code could depend on it.

Accessors

Protected countName

  • get countName(): string

Protected functionName

  • get functionName(): string

Private functionParameters

  • get functionParameters(): string

generated

  • get generated(): Code

Private indentationTabs

  • get indentationTabs(): string

Protected propCountName

  • get propCountName(): string

Protected propName

  • get propName(): string

Protected structName

  • get structName(): string

Methods

Private addFunction

  • addFunction(): void

Protected generate

  • generate(): void

Protected getPrimitivePrintfFormatter

Protected getPrimitiveType

Private parse

Protected print

  • print(str: string): void

Private printConditionalBlock

  • printConditionalBlock(type: "if" | "else if" | "else", condition: string | null, content: string[]): void
  • Prints a general conditional block.

    Parameters

    • type: "if" | "else if" | "else"

      The type of the block (if; else if; else).

    • condition: string | null

      The condition to print if the block is not an else.

    • content: string[]

      The content of the conditional block.

    Returns void

Private printConfigSwitch

Private printConfigSwitchArray

Private printConfigSwitchPrimitive

  • printConfigSwitchPrimitive(data: ConfigPrimitive, ifContent: string[]): void

Private printFunctionFirstLines

  • printFunctionFirstLines(): void

Generated using TypeDoc