# RtfSyntaxParser

Parses RTF tokens into a nested syntax tree.

Class 

`OfficeIMO.Rtf.Syntax`

**Namespace**

`OfficeIMO.Rtf.Syntax`

**Assembly**

`OfficeIMO.Rtf`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[RtfSyntaxParser.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Syntax/RtfSyntaxParser.cs#L13)

**Modifiers**

static

Parses RTF tokens into a nested syntax tree.

## Inheritance

- object
- RtfSyntaxParser

Filter members 

Show inherited

## Methods

Parse 3 overloads

`public static RtfSyntaxTree Parse(string rtf)` [#](#method-parse-string)

[RtfSyntaxParser.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Syntax/RtfSyntaxParser.cs#L13)

Parses RTF text into a syntax tree.

Parameters

**rtf string required**

Returns

`RtfSyntaxTree`

`public static RtfSyntaxTree Parse(string rtf, int maxDepth)` [#](#method-parse-string-int32)

[RtfSyntaxParser.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Syntax/RtfSyntaxParser.cs#L20)

Parses RTF text into a syntax tree while limiting nested group depth.

Parameters

**rtf string required**

**maxDepth int required**

Returns

`RtfSyntaxTree`

`public static RtfSyntaxTree Parse(string rtf, RtfLoadOptions? options, CancellationToken cancellationToken = default)` [#](#method-parse-string-officeimo-rtf-rtfloadoptions-threading-cancellationtoken)

[RtfSyntaxParser.cs:27](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Syntax/RtfSyntaxParser.cs#L27)

Parses RTF text using the configured resource limits and cancellation token.

Parameters

**rtf string required**

**options OfficeIMO.Rtf.RtfLoadOptions? required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`RtfSyntaxTree`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:5B013C1F9169555D5FEAA8DAB8F74AD1A0312BA81FCA557A199C30D5696CDB6E -->
