| 1 | <!-- Figure: a list of declarations followed by blocs. Another possibility: |
|---|
| 2 | blocs and declarations are arbitrarily mixed. |
|---|
| 3 | NB: I don't like the name Figure --> |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | <!ELEMENT figure ((constant | variable | argument)*, (bloc)*) > |
|---|
| 7 | <!ATTLIST figure name ID #REQUIRED> |
|---|
| 8 | |
|---|
| 9 | <!ELEMENT variable (identifier, (signed | unsigned | fixpoint | |
|---|
| 10 | float | pointer | array | record))> |
|---|
| 11 | |
|---|
| 12 | <!ELEMENT constant (identifier, (signed | unsigned | fixpoint | float))> |
|---|
| 13 | <!ATTLIST constant value CDATA #IMPLIED> |
|---|
| 14 | |
|---|
| 15 | <!ELEMENT argument (identifier, (signed | unsigned | fixpoint | |
|---|
| 16 | float | pointer | array | record))> |
|---|
| 17 | <!ATTLIST argument dir CDATA #REQUIRED> |
|---|
| 18 | <!-- Allowed values: in, out, inout> |
|---|
| 19 | |
|---|
| 20 | <!-- Identifier --> |
|---|
| 21 | |
|---|
| 22 | <!ELEMENT identifier (#PCDATA)> |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | <!-- Types --> |
|---|
| 26 | |
|---|
| 27 | <!ELEMENT signed EMPTY> |
|---|
| 28 | <!ATTLIST signed size CDATA #IMPLIED> |
|---|
| 29 | |
|---|
| 30 | <!ELEMENT unsigned EMPTY> |
|---|
| 31 | <!ATTLIST unsigned size CDATA #IMPLIED> |
|---|
| 32 | |
|---|
| 33 | <!ELEMENT fixpoint EMPTY> |
|---|
| 34 | <!ATTLIST fixpoint size CDATA #IMPLIED> |
|---|
| 35 | <!ATTLIST fixpoint precision CDATA #IMPLIED> |
|---|
| 36 | <!ATTLIST fixpoint rounding CDATA #IMPLIED> |
|---|
| 37 | |
|---|
| 38 | <!ELEMENT float EMPTY> |
|---|
| 39 | <!ATTLIST float exponent CDATA #IMPLIED> |
|---|
| 40 | <!ATTLIST float mantissa CDATA #IMPLIED> |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | <!ELEMENT pointer (signed | unsigned | fixpoint | float |
|---|
| 44 | | pointer | array | record)> |
|---|
| 45 | |
|---|
| 46 | <!-- All arrays are one dimensional. Many-dimensional arrays are |
|---|
| 47 | arrays of arrays of .... --> |
|---|
| 48 | |
|---|
| 49 | <!ELEMENT array ((signed | unsigned | fixpoint | float |
|---|
| 50 | | pointer | array | record), expression?)> |
|---|
| 51 | |
|---|
| 52 | <!ELEMENT record (variable *)> |
|---|
| 53 | <!ATTLIST record label ID #REQUIRED> |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | <!-- Expressions --> |
|---|
| 57 | |
|---|
| 58 | <!ELEMENT expression (identifier | (operator, expression*) | call)> |
|---|
| 59 | |
|---|
| 60 | <!ELEMENT operator (#PCDATA)> |
|---|
| 61 | |
|---|
| 62 | <!-- Needs a list of gcc allowed values: |
|---|
| 63 | - ordinary arithmetics, boolean and bitwise operators |
|---|
| 64 | |
|---|
| 65 | - are combined assignment operators (+=, ++, etc.) resolved by gcc? |
|---|
| 66 | |
|---|
| 67 | - are multiple assigments (as in x = a[i=j];) resolved by gcc? |
|---|
| 68 | |
|---|
| 69 | - is the comma (as in for(i=0, j=1; ...)) resolved by gcc? |
|---|
| 70 | |
|---|
| 71 | - dereferencing operators |
|---|
| 72 | - subscripting operators |
|---|
| 73 | - casts (?) |
|---|
| 74 | - sizeof (?) |
|---|
| 75 | --> |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | <!-- Elementary statements --> |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | <!ELEMENT statement (expression | call)> |
|---|
| 82 | <!ATTLIST statement label ID #REQUIRED> |
|---|
| 83 | |
|---|
| 84 | <!ELEMENT call (identifier, expression*)> |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | <!-- Hierarchical CDFG --> |
|---|
| 88 | |
|---|
| 89 | <!ELEMENT basicBloc (statement*, (outEdge)*, liveIn, liveOut)> |
|---|
| 90 | <!ATTLIST basicBloc label ID #REQUIRED> |
|---|
| 91 | |
|---|
| 92 | <!-- More hierarchy: replace statement* by (statement | bloc)* --> |
|---|
| 93 | |
|---|
| 94 | |
|---|
| 95 | <!ELEMENT loop (iterator, bloc, (outEdge)*, liveIn, liveOut)> |
|---|
| 96 | <!ATTLIST loop label ID #REQUIRED> |
|---|
| 97 | |
|---|
| 98 | <!-- Question: can a bloc have local declarations? |
|---|
| 99 | If so, a bloc is a figure !!! --> |
|---|
| 100 | |
|---|
| 101 | <!ELEMENT bloc (loop | basicBloc)*> |
|---|
| 102 | <!ATTLIST bloc label ID #REQUIRED> |
|---|
| 103 | |
|---|
| 104 | <!ELEMENT outEdge (expression)> |
|---|
| 105 | <!ATTLIST target IDREF #REQUIRED> |
|---|
| 106 | |
|---|
| 107 | <!-- Question: is this enough for handling |
|---|
| 108 | break, continue and goto statements? --> |
|---|
| 109 | |
|---|
| 110 | |
|---|
| 111 | <!ELEMENT liveIn (identifier)*> |
|---|
| 112 | <!ELEMENT liveOut (identifier)*> |
|---|
| 113 | |
|---|
| 114 | <!-- Iterators: to be defined more precisely --> |
|---|
| 115 | |
|---|
| 116 | <!ELEMENT iterator (for | while | do)> |
|---|
| 117 | |
|---|
| 118 | |
|---|
| 119 | <!-- Question: what is the gcc translation of |
|---|
| 120 | while((p = ...) != 0) ...; |
|---|
| 121 | or of |
|---|
| 122 | while(i++, j>=0){... |
|---|
| 123 | --> |
|---|