Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseParse

The Class where the parsing of a language is implemented.

export
abstract
class

BaseParse

Hierarchy

Index

Constructors

constructor

  • new BaseParse(documentText: string, docType: string): BaseParse
  • Creates an instance of BaseParse.

    memberof

    BaseParse

    Parameters

    • documentText: string

      The text of the document.

    • docType: string

      The type of documentation to make

    Returns BaseParse

Properties

Protected allRegex

allRegex: ILanguage

The regular expressions and syntaxes for a language.

type

{ILanguage}

memberof

BaseParse

blockStartIndex

blockStartIndex: number = 0

The index of when the contructor's block start. This is used for when a cunstructor spans multiple lines.

type

{number}

memberof

BaseParse

Protected documentText

documentText: string

The document text.

type

{string}

memberof

BaseParse

Protected regex

regex: RegExp

The regular expression of what to match.

type

{RegExp}

memberof

BaseParse

Methods

Protected escapeComments

  • escapeComments(newlineRows: string[]): string
  • Escape every character in a string by returning a copy of the input string with the comments replaced with only hashes.

    memberof

    BaseParse

    Parameters

    • newlineRows: string[]

      The input text to replace every comment in.

    Returns string

    Return a copy of the input string with every character inside the comments with hashes.

Protected escapeStrings

  • escapeStrings(newlineRows: string[]): string
  • Escape every character in a string by returning a copy of the input string with the strings replaced with only hashes.

    memberof

    BaseParse

    Parameters

    • newlineRows: string[]

      The input text to replace every string in.

    Returns string

    Return a copy of the input string with every character inside the strings with hashes.

parse

  • parse(rows: string[]): object
  • Parse the regex.

    memberof

    BaseParse

    Parameters

    • rows: string[]

      The rows to parse from.

    Returns object

    The regex match groups.

    • [key: string]: string

Abstract parseBlock

  • parseBlock(rows: string[]): string[]
  • The parsed block of what to document.

    abstract
    memberof

    BaseParse

    Parameters

    • rows: string[]

      The rows to get the block from.

    Returns string[]

    The rows of the block.

Abstract parseParams

  • parseParams(params: string): IParams
  • The parsed params.

    abstract
    memberof

    BaseParse

    Parameters

    • params: string

      The params to parse.

    Returns IParams

    The parsed params.

Generated using TypeDoc