version 1.9, 1997/03/08 17:00:54
|
version 1.10, 1997/03/10 11:45:45
|
Line 12
|
Line 12
|
|
|
<H4>Translated from French by Ethan Munson</H4> |
<H4>Translated from French by Ethan Munson</H4> |
|
|
<H4>Version of March 8, 1997</H4> |
<H4>Version of March 10, 1997</H4> |
|
|
<P>© 1996 INRIA |
<P>© 1996 INRIA |
|
|
Line 198
|
Line 198
|
<LI><A href="#sectc5219">The <TT>NoLineBreak</TT> rule</A> |
<LI><A href="#sectc5219">The <TT>NoLineBreak</TT> rule</A> |
<LI><A href="#sectc5220">The <TT>ChangeMainFile</TT> rule</A> |
<LI><A href="#sectc5220">The <TT>ChangeMainFile</TT> rule</A> |
<LI><A href="#sectc5221">The <TT>Set</TT> and <TT>Add</TT> rules</A> |
<LI><A href="#sectc5221">The <TT>Set</TT> and <TT>Add</TT> rules</A> |
|
<LI><A href="#sectc5221a">The <TT>Indent</TT> rule</A> |
<LI><A href="#sectc5222">Rule application order</A> |
<LI><A href="#sectc5222">Rule application order</A> |
<LI><A href="#sectc5223">Translation of logical attributes</A> |
<LI><A href="#sectc5223">Translation of logical attributes</A> |
<LI><A href="#sectc5224">Translation of specific presentations</A> |
<LI><A href="#sectc5224">Translation of specific presentations</A> |
Line 6209 graphical elements)
|
Line 6210 graphical elements)
|
Thus, for each node, the translator applies all rules associated with the |
Thus, for each node, the translator applies all rules associated with the |
element type, all rules associated with each attribute (local or global) |
element type, all rules associated with each attribute (local or global) |
carried by the element, and if the element is a leaf of the tree, it also |
carried by the element, and if the element is a leaf of the tree, it also |
applies Translation rules for characters, symbols, or graphical elements, |
applies translation rules for characters, symbols, or graphical elements, |
depending on the type of the leaf.</P> |
depending on the type of the leaf.</P> |
<P> |
<P> |
Rules associated with the content of leaves are different from all other |
Rules associated with the content of leaves are different from all other |
Line 6543 CONST
|
Line 6544 CONST
|
<H3><A name=sectc526>Variables</A></H3> |
<H3><A name=sectc526>Variables</A></H3> |
|
|
<P> |
<P> |
Variables allow to define file names or variable text which is generated by |
Variables allow to define variable text which is generated by the |
the <TT>Create</TT> and <TT>Write</TT> rules. Variables can be defined either |
<TT>Create</TT> and <TT>Write</TT> rules. They are also used to define |
|
file names which are used in the <TT>Create</TT>, <TT>ChangeMainFile</TT>, |
|
and <TT>Indent</TT> rules. Variables can be defined either |
in the <TT>VAR</TT> section of the translation schema or directly in the rules |
in the <TT>VAR</TT> section of the translation schema or directly in the rules |
which use them. Variables that define fine names must be declared in the |
which use them. Variables that define file names must be declared in the |
<TT>VAR</TT> section, and when the same variable is used several times in the |
<TT>VAR</TT> section, and when the same variable is used several times in the |
translation schema, it makes sense to define it globally in the <TT>VAR</TT> |
translation schema, it makes sense to define it globally in the <TT>VAR</TT> |
section. This section is only present if at least one variable is defined |
section. This section is only present if at least one variable is defined |
Line 7093 RULES
|
Line 7096 RULES
|
<H3><A name=sectc529>Translation rules</A></H3> |
<H3><A name=sectc529>Translation rules</A></H3> |
|
|
<P> |
<P> |
Thirteen types of translation rules can be associated with element types and |
Fourteen types of translation rules can be associated with element types and |
attribute values. They are the <TT>Create</TT>, <TT>Write</TT>, |
attribute values. They are the <TT>Create</TT>, <TT>Write</TT>, |
<TT>Read</TT>, <TT>Include</TT>, <TT>Get</TT>, <TT>Copy</TT>, <TT>Use</TT>, |
<TT>Read</TT>, <TT>Include</TT>, <TT>Get</TT>, <TT>Copy</TT>, <TT>Use</TT>, |
<TT>Remove</TT>, <TT>NoTranslation</TT>, <TT>NoLineBreak</TT>, |
<TT>Remove</TT>, <TT>NoTranslation</TT>, <TT>NoLineBreak</TT>, |
<TT>ChangeMainFile</TT>, <TT>Set</TT>, <TT>Add</TT> rules. Each rule has its |
<TT>ChangeMainFile</TT>, <TT>Set</TT>, <TT>Add</TT>, <TT>Indent</TT> rules. |
own syntax, although they are all based on very similar models.</P> |
Each rule has its own syntax, although they are all based on very similar |
|
models.</P> |
<PRE> |
<PRE> |
SimpleRule = 'Create' [ 'IN' VarID ] Object |
SimpleRule = 'Create' [ 'IN' VarID ] Object |
[ Position ] ';' / |
[ Position ] ';' / |
Line 7116 own syntax, although they are all based
|
Line 7120 own syntax, although they are all based
|
'NoTranslation' ';' / |
'NoTranslation' ';' / |
'NoLineBreak' ';' / |
'NoLineBreak' ';' / |
'ChangeMainFile' VarID [ Position ] ';' / |
'ChangeMainFile' VarID [ Position ] ';' / |
'Set' CounterID InitValue |
'Set' CounterID InitValue [ Position ] ';' / |
[ Position ] ';' / |
'Add' CounterID Increment [ Position ] ';' / |
'Add' CounterID Increment |
'Indent' [ 'IN' VarID ] [ IndentSign ] |
[ Position ] ';' . |
IndentValue [ Position ] ';' . |
</PRE> |
</PRE> |
</DIV> |
</DIV> |
|
|
Line 7694 the rule.</P>
|
Line 7698 the rule.</P>
|
</DIV> |
</DIV> |
|
|
<DIV class="subsection"> |
<DIV class="subsection"> |
|
<H3><A name=sectc5221a>The <TT>Indent</TT> rule</A></H3> |
|
|
|
<P> |
|
The <TT>Indent</TT> rule is used to modify the value of text indentation |
|
in the output files.</P> |
|
<P> |
|
Each time the translator creates a new line in an output file, it generates |
|
a variable number of space characters at the beginning of the new line. By |
|
default, the number of these characters (the indentation) is 0. It can be |
|
changed with the <TT>Indent</TT> rule.</P> |
|
<P> |
|
The rule begins with the <TT>Indent</TT> keyword, followed by the indentation |
|
sign (optional) and value and a keyword <TT>Before</TT> or <TT>After</TT> |
|
indicating that the indentation should be changed <A href="#sectc5222">before |
|
or after</A> the element's content is generated. If the position is not |
|
indicated, the indentation is changed before the element's content is |
|
generated. This rule, like all translation rules, is terminated by a |
|
semicolon.</P> |
|
<P> |
|
The indentation value is indicated by an integer, which is the number of |
|
space characters to be generated at the beginning of each new line. |
|
A sign (<TT>+</TT> or <TT>-</TT>) can appear before the integer to indicate |
|
that the value is relative: the current value of indentation is incremented |
|
(if sign is <TT>+</TT>) or decremented (if sign is <TT>-</TT>) by the |
|
specified value. |
|
<P> |
|
Like the <A href="#sectc5210"><TT>Create</TT> rule</A>, the <TT>Indent</TT> |
|
keyword can be followed by the <TT>IN</TT> keyword and by the name of a |
|
<A href="#sectc526">variable</A>. This means that the rule must not change |
|
indentation in the main output file, but in the file whose name is specified |
|
by the variable (by default, indentation is changed in the main output |
|
file).</P> |
|
<PRE> |
|
'Indent' [ 'IN' VarID ] [ IndentSign ] |
|
IndentValue [ Position ] ';' . |
|
|
|
IndentSign = '+' / '-' . |
|
IndentValue = NUMBER . |
|
</PRE> |
|
</DIV> |
|
|
|
<DIV class="subsection"> |
<H3><A name=sectc5222>Rule application order</A></H3> |
<H3><A name=sectc5222>Rule application order</A></H3> |
|
|
<P> |
<P> |
Line 8597 SimpleRule = 'Create' [ 'IN' VarID ]
|
Line 8643 SimpleRule = 'Create' [ 'IN' VarID ]
|
'NoTranslation' ';' / |
'NoTranslation' ';' / |
'NoLineBreak' ';' / |
'NoLineBreak' ';' / |
'ChangeMainFile' VarID [ Position ] ';' / |
'ChangeMainFile' VarID [ Position ] ';' / |
'Set' CounterID InitValue |
'Set' CounterID InitValue [ Position ] ';' / |
[ Position ] ';' / |
'Add' CounterID Increment [ Position ] ';' / |
'Add' CounterID Increment |
'Indent' [ 'IN' VarID ] [ IndentSign ] |
[ Position ] ';' . |
IndentValue [ Position ] ';' . |
|
|
|
IndentSign = '+' / '-' . |
|
IndentValue = NUMBER . |
|
|
Object = ConstID / CharString / |
Object = ConstID / CharString / |
BufferID / |
BufferID / |