Table of Contents

Class CLexer

Namespace
PdfSharp.Pdf.Content
Assembly
PdfSharp-gdi.dll

Lexical analyzer for PDF content files. Adobe specifies no grammar, but it seems that it is a simple post-fix notation.

public class CLexer
Inheritance
CLexer
Inherited Members

Constructors

CLexer(byte[])

Initializes a new instance of the Lexer class.

public CLexer(byte[] content)

Parameters

content byte[]

CLexer(MemoryStream)

Initializes a new instance of the Lexer class.

public CLexer(MemoryStream content)

Parameters

content MemoryStream

Properties

ContLength

Gets the length of the content.

public int ContLength { get; }

Property Value

int

Position

Gets or sets the position in the content.

public int Position { get; set; }

Property Value

int

Symbol

Gets or sets the current symbol.

public CSymbol Symbol { get; set; }

Property Value

CSymbol

Token

Gets the current token.

public string Token { get; }

Property Value

string

Methods

MoveToNonWhiteSpace()

If the current character is not a white space, the function immediately returns it. Otherwise, the PDF cursor is moved forward to the first non-white space or EOF. White spaces are NUL, HT, LF, FF, CR, and SP.

public char MoveToNonWhiteSpace()

Returns

char

ScanComment()

Scans a comment line. (Not yet used, comments are skipped by lexer.)

public CSymbol ScanComment()

Returns

CSymbol

ScanDictionary()

Scans the dictionary.

protected CSymbol ScanDictionary()

Returns

CSymbol

ScanHexadecimalString()

Scans a hexadecimal string.

public CSymbol ScanHexadecimalString()

Returns

CSymbol

ScanInlineImage()

Scans the bytes of an inline image. NYI: Just scans over it.

public CSymbol ScanInlineImage()

Returns

CSymbol

ScanLiteralString()

Scans a literal string.

public CSymbol ScanLiteralString()

Returns

CSymbol

ScanName()

Scans a name.

public CSymbol ScanName()

Returns

CSymbol

ScanNextToken()

Reads the next token and returns its type.

public CSymbol ScanNextToken()

Returns

CSymbol

ScanNumber()

Scans an integer or real number.

public CSymbol ScanNumber()

Returns

CSymbol

ScanOperator()

Scans an operator.

public CSymbol ScanOperator()

Returns

CSymbol