Difference between revisions of "SwNodesBNF"

From Apache OpenOffice Wiki
Jump to: navigation, search
m
Line 16: Line 16:
 
  FooterNd = SwFooterStartNode
 
  FooterNd = SwFooterStartNode
  
<Document> ::= <Empty> <Footnote content> <Special content> <Change tracking> <Body content>
+
And now we get:
  
<Empty> ::= StartNd EndNd
+
<Document> ::= <Empty> <Footnote content> <Special content> <Change tracking> <Body content>
 
+
<Empty> ::= StartNd EndNd
<Body content> ::= StartNd <Content> EndNd
+
<Body content> ::= StartNd <Content> EndNd
 
+
<Content> ::= TextNd | <'Table> | <Section> | <Content> <Content>
<Content> ::= TextNd | <'Table> | <Section> | <Content> <Content>
+
<'Table> ::= TableNd <Cells> EndNd
 
+
<Cells> ::= <Cell> | <Cell> <Cells>
<'Table> ::= TableNd <Cells> EndNd
+
<Cell> ::= CellNd <Content> EndNd
 
+
<Section> ::= SectionNd <Content> EndNd
<Cells> ::= <Cell> | <Cell> <Cells>
+
<Special content> ::= <Empty> | StartNd <Special> EndNd
 
+
<Special> ::= <Special> <Special> | HeaderNd <Content> EndNd | FooterNd <Content> EndNd | FlyNd <Fly content> EndNd
<Cell> ::= CellNd <Content> EndNd
+
<Fly content> ::= OLENd | GraphicNd | <Content>
 
+
<Footnote content> ::= <Empty> | StartNd <Footnotes> EndNd
<Section> ::= SectionNd <Content> EndNd
+
<Footnotes> ::= <Footnote> | >Footnote> <Footnotes>
 
+
<Footnote> ::= FootnoteNd <Content> EndNd
<Special content> ::= <Empty> | StartNd <Special> EndNd
+
<Change tracking> ::= <Empty> | StartNd <Changes> EndNd
 
+
<Changes> ::= <Body content> | <Changes> <Changes>
<Special> ::= <Special> <Special> | HeaderNd <Content> EndNd | FooterNd <Content> EndNd | FlyNd <Fly content> EndNd
 
 
 
<Fly content> ::= OLENd | GraphicNd | <Content>
 
 
 
<Footnote content> ::= <Empty> | StartNd <Footnotes> EndNd
 
 
 
<Footnotes> ::= <Footnote> | >Footnote> <Footnotes>
 
 
 
<Footnote> ::= FootnoteNd <Content> EndNd
 
 
 
<Change tracking> ::= <Empty> | StartNd <Changes> EndNd
 
 
 
<Changes> ::= <Body content> | <Changes> <Changes>
 

Revision as of 15:39, 16 November 2007

Let us describe a "well-formed" SwNodes array of a Writer document in Backus-Naur form.

There are the following node types used as "terminal" symbols:

StartNd = SwNormalStartNode
EndNd = SwEndNode
TextNd = SwTxtNode
GraphicNd = SwGrfNode
OLENd = SwOLENode
TableNd = SwTableNode
SectionNd = SwSectionNode
CellNd = SwTableBoxStartNode
FlyNd = SwFlyStartNode
FootnoteNd = SwFootnoteStartNode
HeaderNd = SwHeaderStartNode
FooterNd = SwFooterStartNode

And now we get:

<Document> ::= <Empty> <Footnote content> <Special content> <Change tracking> <Body content>
<Empty> ::= StartNd EndNd
<Body content> ::= StartNd <Content> EndNd
<Content> ::= TextNd | <'Table> | <Section> | <Content> <Content>
<'Table> ::= TableNd <Cells> EndNd
<Cells> ::= <Cell> | <Cell> <Cells>
<Cell> ::= CellNd <Content> EndNd
<Section> ::= SectionNd <Content> EndNd
<Special content> ::= <Empty> | StartNd <Special> EndNd
<Special> ::= <Special> <Special> | HeaderNd <Content> EndNd | FooterNd <Content> EndNd | FlyNd <Fly content> EndNd
<Fly content> ::= OLENd | GraphicNd | <Content>
<Footnote content> ::= <Empty> | StartNd <Footnotes> EndNd
<Footnotes> ::= <Footnote> | >Footnote> <Footnotes>
<Footnote> ::= FootnoteNd <Content> EndNd
<Change tracking> ::= <Empty> | StartNd <Changes> EndNd
<Changes> ::= <Body content> | <Changes> <Changes>
Personal tools