Namespace: PdfSharp.Pdf.Content
Lexical analyzer for PDF content files. Adobe specifies no grammar, but it seems that it is a simple post-fix notation.
public class CLexer
Gets or sets the current symbol.
public CSymbol Symbol { get; set; }
Gets the current token.
public string Token { get; }
Gets the length of the content.
public int ContLength { get; }
Gets or sets the position in the content.
public int Position { get; set; }
Initializes a new instance of the Lexer class.
public CLexer(Byte[] content)
content
Byte[]
Initializes a new instance of the Lexer class.
public CLexer(MemoryStream content)
content
MemoryStream
Reads the next token and returns its type.
public CSymbol ScanNextToken()
Scans a comment line. (Not yet used, comments are skipped by lexer.)
public CSymbol ScanComment()
Scans the bytes of an inline image. NYI: Just scans over it.
public CSymbol ScanInlineImage()
Scans a name.
public CSymbol ScanName()
Scans the dictionary.
protected CSymbol ScanDictionary()
Scans an integer or real number.
public CSymbol ScanNumber()
Scans an operator.
public CSymbol ScanOperator()
Scans a literal string.
public CSymbol ScanLiteralString()
Scans a hexadecimal string.
public CSymbol ScanHexadecimalString()
Move current position one character further in content stream.
internal char ScanNextChar()
Appends current character to the token and reads next one.
internal char AppendAndScanNextChar()
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()
Indicates whether the specified character is a content stream white-space character.
internal static bool IsWhiteSpace(char ch)
ch
Char
Indicates whether the specified character is an content operator character.
internal static bool IsOperatorChar(char ch)
ch
Char
Indicates whether the specified character is a PDF delimiter character.
internal static bool IsDelimiter(char ch)
ch
Char