A fragment defining the X-Axis of a data graph

Below we briefly discuss a *fragment* of the full x,y graph grammar dealing with the X-Axis structure
highlighted in the previous example. The fragment consists of three productions. The full grammar is also available for browsing. After looking over this fragment,
you can proceed to the discussion of how the grammar rules drive the parsing process.

The overall structure of this grammar fragment is:

- An
`Image`is defined as a set of diagrams so that a multi-part diagram can be parsed, e.g., two data-graphs, one above the other.

- A
`Diagram`is made up primarily of axes and data.

- An
`X-Axis`has five components:

- The
`X-Axis-Line`which is the long line to which the tick marks are attached. - The
`X-Ticks`which are a set of short vertical lines very near the x-axis-line. - The
`X-Labels`which must each be close to and below their corresponding ticks. `X-Annotation`which is an arrow with attached text.`X-Text`which is the overall axis label below the tick labels.

- The

**The grammar fragment:**

;;; ****************** < Image > ****************** ( Image -> Set ( Diagram ) ); ;;; ****************** < Diagram > ****************** ( Diagram -> Axis X-Axis Y-Axis Data (Axis) (X-Axis ($ :axis Axis)) (Y-Axis ($ :axis Axis)) (Data ($ (difference* (contain Axis '?) (union* X-Axis Y-Axis)) :x-ln (ln (X-Line Axis)) :y-ln (ln (Y-Line Axis)) :axis Axis)) ); ;;; ****************** < X-AXIS > ****************** ( X-Axis -> X-Axis-Line X-Ticks X-Labels X-Annotation X-Text (:optional X-Annotation X-Text) (X-Axis-Line (X-Line (get-val axis))) (X-Ticks ($ :x-line X-Axis-Line) :constraints (>= (size X-Ticks) 3)) (X-Labels (below '? X-Axis-Line :strip t)) (X-Annotation (difference* (near X-Axis-Line 700) (union* X-Ticks X-Labels))) ; label-size (X-Text (near&below '? X-Labels (* 2 (height X-Labels))) ) )

Next: How the Grammar Rules Drive the Parsing Process |

Back to Index page |