wt2html/TokenTransformManager~SyncTokenTransformManager()

Subclass for phase 3, in-order and synchronous processing.

Show:

Constructor

new SyncTokenTransformManager()

...

Extends

Methods

addListenersOn(tokenEmitter)

Register to a token source, normally the tokenizer.

Register to a token source, normally the tokenizer. The event emitter emits a 'chunk' event with a chunk of tokens, and signals the end of tokens by triggering the 'end' event. XXX: Perform registration directly in the constructor?

Parameters:
Name Type Description
tokenEmitter EventEmitter

Token event emitter.

Inherited From:
Source:

addTransform(transformation, debugName, rank, type, name)

Add a transform registration.

Add a transform registration.

Parameters:
Name Type Description
transformation function
Properties
Name Type Description
token Token
frame Object
cb function
Properties
Name Type Description
result Object
Properties
Name Type Description
tokens Array.<Token>
return Object
Properties
Name Type Description
tokens Array.<Token>
debugName string

Debug string to identify the transformer in a trace.

rank number

A number in [0,3) with:

  • [0,1) in-order on input token stream,
  • [1,2) out-of-order and
  • [2,3) in-order on output token stream.
type string

One of 'tag', 'text', 'newline', 'comment', 'end', 'martian' (unknown token), 'any' (any token, matched before other matches).

name string

Tag name for tags, omitted for non-tags

Inherited From:
Source:

process(tokens)

...
Parameters:
Name Type Description
tokens Array.<Token>
Source:

setPipelineId()

Debugging aid: set pipeline id

.

Debugging aid: set pipeline id

Source: