API Docs for: 0.0.1
Show:

Parser Class

Extends Synchronizable
Defined in: lib/parser.js:35
Module: niviz

Abstract parser interface.

Constructor

Parser

(
  • data
)

Defined in lib/parser.js:35

Parameters:

  • data Object

    The data to parse.

Item Index

Methods

Properties

Methods

end

() chainable

Defined in lib/parser.js:176

This method must be called by the parsing methods when the parsing has finished.

implement

(
  • C
  • format
  • [base]
)
Function static

Defined in lib/parser.js:88

Makes the passed-in constructor inherit from Parser and registers it for the given format.

Parameters:

  • C Function

    The constructor.

  • format String

    The name of the format.

  • [base] String optional

    The format from which to inherit.

Returns:

Function:

The extended constructor.

parse

(
  • data
  • fmt
  • [callback]
)
Object static

Defined in lib/parser.js:108

Parses data using a suitable parser. See .formats for a list of supported formats.

Parameters:

  • data String

    The input data.

  • fmt String

    The format.

  • [callback] Function optional

    The callback function.

Returns:

Object:

The parse result.

parse

(
  • [callback]
)
Object

Defined in lib/parser.js:130

Starts the parsing process; in sync mode this method blocks until the parsing has finished, otherwise it should return immediately!

If given a callback, it must be bound to the end and error events.

Parameters:

Returns:

Object:

The parse result.

parse

()

Defined in lib/parser.js:157

verify

() chainable

Defined in lib/parser.js:165

Verify that all syntactic and semantic requirements are met by the parsed entity.

Properties

data

Object

Defined in lib/parser.js:50

format

Object static

Defined in lib/parser.js:65

Registry of parser implementations.

formats

Array static

Defined in lib/parser.js:75

The list of supported formats.

result

Object

Defined in lib/parser.js:56