Productions

Top  Previous  Next

Examples > Conversion of an Atari text > Productions

 

While the Exchange example only used one production, the Atari project consists of three. It would have been possible to use only one production here too, it then would be quite extensive, though.

For the following explanations at first the text inside of the brackets "{ ="and "=}" shall be ignored.  (see Actions).

 

The rule special_char consists of the alternative symbols of the special characters.

 

paragraph  | ae  | Ae | oe  | Oe  | ue   | UE   | sz

 

The alternative relation is expressed by the character '|'.

The rule special_char matches the source text at positions where a special character can be found.

 

The production textattribute consists of the alternative symbols for the characters by which the Atari text attributes are defined.

 

bold_begin

| bold_end

| italic_begin

| italic_end

| underline_begin

| underline_end

 

The production textattribute matches the source text at positions where a character can be found, by which the Atari text attributes are defined.

 

Finally the start production: Atari.

 

(

special_char

| textattribute

| normal_text 

)+

 

Perhaps who has studied the first example attentively, will have noticed the structural similarity between the normal_text token of this example and the SKIP node of the Exchange example. The normal_text token was actually defined here only for didactic purposes and the production could have been formulated also analogously to the Exchange example

 

(

special_char

| textattribute

| SKIP

)+

 

The normal_text token describes all text, which doesn't contain any text attribute or special character and the SKIP node of the Exchange example described all text, which doesn't contain the words "God" or  "Man".

 

 



This page belongs to the TextTransformer Documentation

Home  Content  German