Table of Contents

Method Parse

Namespace
Microlithix.Text.Ansi
Assembly
AnsiParser.dll

Parse(char)

Parses a single character.

Any produced elements will be sent to the callback method provided to the constructor.

public void Parse(char ch)

Parameters

ch char

The UTF-16 character to be parsed

Remarks

Call this method once for each character in an input stream in order to parse the stream into elements representing printable text strings, control codes, and escape sequences.

A callback method needs to have been provided to the constructor when the AnsiStreamParser instance was created.

The callback method is invoked once for each produced element. Note that a single call to this method may result in the production of zero, one, or more elements and callback invocations.

The character will be parsed in the context of any character stream already received by prior invocations of this method.

Exceptions

InvalidOperationException

Calling this method on an instance of AnsiStreamParser created using its parameterless contructor will throw an exception.

Parse(char, Action<IAnsiStreamParserElement>)

Parses a single character.

Any produced elements will be sent to the provided callback method.

public void Parse(char ch, Action<IAnsiStreamParserElement> callback)

Parameters

ch char

The UTF-16 character to be parsed

callback Action<IAnsiStreamParserElement>

The function to receive the parsed elements

Remarks

Call this method once for each character in an input stream in order to parse the stream into elements representing printable text strings, control codes, and escape sequences.

The callback method is invoked once for each produced element. Note that a single call to this method may result in the production of zero, one, or more elements and callback invocations.

The character will be parsed in the context of the character stream already received by prior invocations of this method.