C# Class PdfSharp.Pdf.Content.CLexer

Lexical analyzer for PDF content files. Adobe specifies no grammar, but it seems that it is a simple post-fix notation.
显示文件 Open project: DavidS/MigraDoc Class Usage Examples

Private Properties

Property Type Description
AppendAndScanNextChar char
IsDelimiter bool
IsOperatorChar bool
IsWhiteSpace bool
ScanNextChar char

Public Methods

Method Description
CLexer ( byte content ) : System

Initializes a new instance of the Lexer class.

ClearToken ( ) : void

Resets the current token to the empty string.

MoveToNonWhiteSpace ( ) : char

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.

ScanComment ( ) : CSymbol

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

ScanHexadecimalString ( ) : CSymbol
ScanInlineImage ( ) : CSymbol

Scans the bytes of an inline image

ScanLiteralString ( ) : CSymbol
ScanName ( ) : CSymbol

Scans a name.

ScanNextToken ( ) : CSymbol

Reads the next token and returns its type.

ScanNumber ( ) : CSymbol

Scans an integer or real number.

ScanOperator ( ) : CSymbol

Scans an operator.

Private Methods

Method Description
AppendAndScanNextChar ( ) : char

Appends current character to the token and reads next one.

IsDelimiter ( char ch ) : bool

Indicates whether the specified character is a PDF delimiter character.

IsOperatorChar ( char ch ) : bool

Indicates whether the specified character is an content operator character.

IsWhiteSpace ( char ch ) : bool

Indicates whether the specified character is a content stream white-space character.

ScanNextChar ( ) : char

Move current position one character further in content stream.

Method Details

CLexer() public method

Initializes a new instance of the Lexer class.
public CLexer ( byte content ) : System
content byte
return System

ClearToken() public method

Resets the current token to the empty string.
public ClearToken ( ) : void
return void

MoveToNonWhiteSpace() public method

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 MoveToNonWhiteSpace ( ) : char
return char

ScanComment() public method

Scans a comment line. (Not yet used, comments are skipped by lexer.)
public ScanComment ( ) : CSymbol
return CSymbol

ScanHexadecimalString() public method

public ScanHexadecimalString ( ) : CSymbol
return CSymbol

ScanInlineImage() public method

Scans the bytes of an inline image
public ScanInlineImage ( ) : CSymbol
return CSymbol

ScanLiteralString() public method

public ScanLiteralString ( ) : CSymbol
return CSymbol

ScanName() public method

Scans a name.
public ScanName ( ) : CSymbol
return CSymbol

ScanNextToken() public method

Reads the next token and returns its type.
public ScanNextToken ( ) : CSymbol
return CSymbol

ScanNumber() public method

Scans an integer or real number.
public ScanNumber ( ) : CSymbol
return CSymbol

ScanOperator() public method

Scans an operator.
public ScanOperator ( ) : CSymbol
return CSymbol