C# 클래스 MigraDoc.DocumentObjectModel.IO.DdlParser

A simple hand-coded parser for MigraDoc DDL.
파일 보기 프로젝트 열기: DavidS/MigraDoc 1 사용 예제들

Private Properties

프로퍼티 타입 설명
AdjustToNextBlock void
AdjustToNextStatement void
AssertCondition void
AssertSymbol void
AssertSymbol void
DdlParser System
DdlParser System
GetSymbolText string
IsHeaderFooter bool
IsParagraphContent bool
IsSpaceType bool
IsSymbolType bool
MoveToCode Symbol
MoveToNextParagraphContentLine bool
MoveToParagraphContent bool
ParseArea void
ParseArea void
ParseAssign void
ParseAttributeBlock void
ParseAttributeStatement void
ParseAttributes void
ParseAttributes void
ParseAxes void
ParseBarcode void
ParseBoldItalicEtc void
ParseBoolAssignment void
ParseCMYK System.Color
ParseCell void
ParseChart void
ParseChr void
ParseColor System.Color
ParseColorAssignment void
ParseColumn void
ParseColumns void
ParseDocument Document
ParseDocumentElements DocumentElements
ParseDocumentObject DocumentObject
ParseDocumentObjectAssignment void
ParseElementName string
ParseEnumAssignment void
ParseField void
ParseFont void
ParseFontColor void
ParseFontSize void
ParseFootnote void
ParseFormattedText void
ParseGray System.Color
ParseHeaderFooter void
ParseHyperlink void
ParseImage void
ParseIntegerAssignment void
ParseLegend void
ParsePageBreak void
ParseParagraph void
ParseParagraphContent void
ParsePoint void
ParseRGB System.Color
ParseRealAssignment void
ParseRow void
ParseRows void
ParseSection Section
ParseSeries void
ParseSeries void
ParseSpace void
ParseStringAssignment void
ParseStyleDefinition Style
ParseStyles Styles
ParseSymbol void
ParseTable void
ParseTextFrame void
ParseUnitAssignment void
ParseValueAssignment void
ParseValueTypeAssignment void
ReadCode Symbol
ReadText Symbol
RemoveTrailingBlank void
ReportParserException void
ReportParserException void
ReportParserException void
ReportParserInfo void
ThrowParserException void
ThrowParserException void

비공개 메소드들

메소드 설명
AdjustToNextBlock ( ) : void

Used for exception handling. Sets the DDL stream to the next valid position behind the current block.

AdjustToNextStatement ( ) : void

Used for exception handling. Sets the DDL stream to the next valid position behind the current statement.

AssertCondition ( bool cond, DomMsgID error ) : void

If cond is evaluated to false, a DdlParserException with the specified error will be thrown.

AssertSymbol ( Symbol symbol ) : void

If current symbol is not equal symbol a DdlParserException will be thrown.

AssertSymbol ( Symbol symbol, DomMsgID err ) : void

If current symbol is not equal symbol a DdlParserException with the specified message id will be thrown.

DdlParser ( string ddl, DdlReaderErrors errors ) : System

Initializes a new instance of the DdlParser class.

DdlParser ( string fileName, string ddl, DdlReaderErrors errors ) : System

Initializes a new instance of the DdlParser class.

GetSymbolText ( Symbol docSym ) : string

Determines the name/text of the given symbol.

IsHeaderFooter ( ) : bool

Determines if the current symbol is a header or footer.

IsParagraphContent ( ) : bool

Determines whether the next text is paragraph content or document element.

IsSpaceType ( string type ) : bool

Returns whether the specified type is a valid SpaceType.

IsSymbolType ( string type ) : bool

Returns whether the specified type is a valid enum for \symbol.

MoveToCode ( ) : Symbol

Shortcut for scanner.MoveToCode(). Moves to the next DDL token if Symbol is not set to a valid position.

MoveToNextParagraphContentLine ( bool rootLevel ) : bool

Shortcut for scanner.MoveToNextParagraphContentLine(). Moves to the first character of the content of a paragraph beyond an EOL. Returns true if such a character exists and belongs to the current paragraph. Returns false if a new line (at root level) or '}' occurs. If a new line caused the end of the paragraph, the DDL cursor is moved to the next valid content character or '}' respectively.

MoveToParagraphContent ( ) : bool

Shortcut for scanner.MoveToParagraphContent(). Moves to the first character the content of a paragraph starts with. Empty lines and comments are skipped. Returns true if such a character exists, and false if the paragraph ends without content.

ParseArea ( MigraDoc.DocumentObjectModel.Shapes.Charts.PlotArea area ) : void

Parses the keyword «\plotarea» inside a chart.

ParseArea ( MigraDoc.DocumentObjectModel.Shapes.Charts.TextArea area ) : void

Parses the keywords «\headerarea», «\toparea», «\bottomarea», «\footerarea», «\leftarea» or «\rightarea» inside a chart.

ParseAssign ( DocumentObject dom, ValueDescriptor vd ) : void

Parses an assign statement in an attribute declaration block.

ParseAttributeBlock ( DocumentObject element ) : void

Parses an attribute declaration block enclosed in braces «{…}».

ParseAttributeStatement ( DocumentObject dom ) : void

Parses a single statement in an attribute declaration block.

ParseAttributes ( DocumentObject element ) : void

Parses an attribute declaration block enclosed in brackets «[…]».

ParseAttributes ( DocumentObject element, bool readNextSymbol ) : void

Parses an attribute declaration block enclosed in brackets «[…]». If readNextSymbol is set to true, the closing bracket will be read.

ParseAxes ( MigraDoc.DocumentObjectModel.Shapes.Charts.Axis axis, Symbol symbolAxis ) : void

Parses the keywords «\xaxis», «\yaxis» or «\zaxis» inside a chart.

ParseBarcode ( DocumentElements elements ) : void
ParseBoldItalicEtc ( FormattedText formattedText, int nestingLevel ) : void

Parses the keywords «\bold», «\italic», and «\underline».

ParseBoolAssignment ( DocumentObject dom, ValueDescriptor vd ) : void

Parses the assignment to a boolean l-value.

ParseCMYK ( ) : System.Color

Parses «CMYK(c, m, y, k)» or «CMYK(a, c, m, y, k)».

ParseCell ( MigraDoc.DocumentObjectModel.Tables.Cell cell ) : void

Parses the keyword «\cell».

ParseChart ( DocumentElements elements ) : void

Parses the keyword «\chart».

ParseChr ( ParagraphElements elements ) : void

Parses the keyword «\chr».

ParseColor ( ) : System.Color

Parses a color. It can be «green», «123456», «0xFFABCDEF», «RGB(r, g, b)», «CMYK(c, m, y, k)», «CMYK(a, c, m, y, k)», «GRAY(g)», or «"MyColor"».

ParseColorAssignment ( DocumentObject dom, ValueDescriptor vd ) : void

Parses the assignment to a Color l-value.

ParseColumn ( Column column ) : void

Parses the keyword «\column».

ParseColumns ( MigraDoc.DocumentObjectModel.Tables.Table table ) : void

Parses the keyword «\columns».

ParseDocument ( Document document ) : Document

Parses the keyword «\document».

ParseDocumentElements ( DocumentElements elements, Symbol context ) : DocumentElements

Parses the document elements of a «\paragraph», «\cell» or comparable.

ParseDocumentObject ( ) : DocumentObject

Parses one of the keywords «\document», «\styles», «\section», «\table», «\textframe», «\chart» and «\paragraph» and returns the corresponding DocumentObject or DocumentObjectCollection.

ParseDocumentObjectAssignment ( DocumentObject dom, ValueDescriptor vd ) : void

Parses the assignment to a DocumentObject l-value.

ParseElementName ( ) : string

Parses code like «("name")».

ParseEnumAssignment ( DocumentObject dom, ValueDescriptor vd ) : void

Parses the assignment to an enum l-value.

ParseField ( ParagraphElements elements, int nestingLevel ) : void

Parses the keyword «\field».

ParseFont ( FormattedText formattedText, int nestingLevel ) : void

Parses the keyword «\font».

ParseFontColor ( FormattedText formattedText, int nestingLevel ) : void

Parses the keyword «\fontcolor».

ParseFontSize ( FormattedText formattedText, int nestingLevel ) : void

Parses the keyword «\fontsize».

ParseFootnote ( ParagraphElements elements, int nestingLevel ) : void

Parses the keyword «\footnote».

ParseFormattedText ( ParagraphElements elements, int nestingLevel ) : void

Parses the inner text of a paragraph. Parsing ends if '}' is reached or an empty line occurs on nesting level 0.

ParseGray ( ) : System.Color

Parses «GRAY(g)».

ParseHeaderFooter ( Section section ) : void

Parses the keywords «\header».

ParseHyperlink ( ParagraphElements elements, int nestingLevel ) : void

Parses the keyword «\hyperlink».

ParseImage ( Image image, bool paragraphContent ) : void

Parses the keyword «\image».

ParseIntegerAssignment ( DocumentObject dom, ValueDescriptor vd ) : void

Parses the assignment to an integer l-value.

ParseLegend ( MigraDoc.DocumentObjectModel.Shapes.Charts.Legend legend ) : void

Parses the keyword «\legend» inside a textarea.

ParsePageBreak ( DocumentElements elements ) : void

Parses a page break in a document elements container.

ParseParagraph ( DocumentElements elements ) : void

Parses the keyword «\paragraph».

ParseParagraphContent ( DocumentElements elements, Paragraph paragraph ) : void

Parses the inner text of a paragraph, i.e. stops on BraceRight and treats empty line as paragraph separator.

ParsePoint ( Point point ) : void

Parses the keyword «\point» inside a series.

ParseRGB ( ) : System.Color

Parses «RGB(r, g, b)».

ParseRealAssignment ( DocumentObject dom, ValueDescriptor vd ) : void

Parses the assignment to a floating point l-value.

ParseRow ( Row row ) : void

Parses the keyword «\row».

ParseRows ( MigraDoc.DocumentObjectModel.Tables.Table table ) : void

Parses the keyword «\rows».

ParseSection ( Sections sections ) : Section

Parses the keyword «\section».

ParseSeries ( MigraDoc.DocumentObjectModel.Shapes.Charts.Series series ) : void

Parses the keyword «\series» inside a chart.

ParseSeries ( MigraDoc.DocumentObjectModel.Shapes.Charts.XSeries series ) : void

Parses the keyword «\xvalues» inside a chart.

ParseSpace ( ParagraphElements elements, int nestingLevel ) : void

Parses the keyword «\space».

ParseStringAssignment ( DocumentObject dom, ValueDescriptor vd ) : void

Parses the assignment to a string l-value.

ParseStyleDefinition ( Styles styles ) : Style

Parses a style definition block within the keyword «\styles».

ParseStyles ( Styles styles ) : Styles

Parses the keyword «\styles».

ParseSymbol ( ParagraphElements elements ) : void

Parses the keyword «\symbol» resp. «\(».

ParseTable ( DocumentElements elements, MigraDoc.DocumentObjectModel.Tables.Table table ) : void

Parses the keyword «\table».

ParseTextFrame ( DocumentElements elements ) : void

Parses the keyword «\textframe».

ParseUnitAssignment ( DocumentObject dom, ValueDescriptor vd ) : void

Parses the assignment to a Unit l-value.

ParseValueAssignment ( DocumentObject dom, ValueDescriptor vd ) : void

Parses the assignment to a Value l-value.

ParseValueTypeAssignment ( DocumentObject dom, ValueDescriptor vd ) : void

Parses the assignment to a struct (i.e. LeftPosition) l-value.

ReadCode ( ) : Symbol

Shortcut for scanner.ReadCode(). Reads the next DDL token. Comments are ignored.

ReadText ( bool rootLevel ) : Symbol

Shortcut for scanner.ReadText(). Reads either text or \keyword from current position.

RemoveTrailingBlank ( ParagraphElements elements ) : void

Removes the last blank from the text. Used before a tab, a linebreak or a space will be added to the text.

ReportParserException ( MigraDoc.DocumentObjectModel.IO.DdlParserException ex ) : void

Adds the ErrorInfo from the ErrorInfoException2 to the ErrorManager2.

ReportParserException ( DomMsgID error ) : void

Creates an ErrorInfo based on the given error and parms and adds it to the ErrorManager2.

ReportParserException ( Exception innerException, DomMsgID errorCode ) : void

Creates an ErrorInfo based on the given inner exception, error and parms and adds it to the ErrorManager2.

ReportParserInfo ( DdlErrorLevel level, DomMsgID errorCode ) : void

Creates an ErrorInfo based on the given errorlevel, error and parms and adds it to the ErrorManager2.

ThrowParserException ( DomMsgID errorCode ) : void

Creates an ErrorInfo based on the DomMsgID and the specified parameters. Throws a DdlParserException with that ErrorInfo.

ThrowParserException ( Exception innerException, DomMsgID errorCode ) : void

Determines the error message based on the DomMsgID and the parameters. Throws a DdlParserException with that error message and the Exception as the inner exception.