diff options
author | blazy <blazy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2007-08-03 17:04:06 +0000 |
---|---|---|
committer | blazy <blazy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2007-08-03 17:04:06 +0000 |
commit | 22ff08b38616ceef336f5f974d4edc4d37d955e8 (patch) | |
tree | 3ee53330a4b7306ba565fd1cc149a22299ecb48c /papers/cfrontend_new/syntax.etex | |
parent | 21a429c66efad3394024ba12203fa9a3d3d36fa8 (diff) | |
download | compcert-22ff08b38616ceef336f5f974d4edc4d37d955e8.tar.gz compcert-22ff08b38616ceef336f5f974d4edc4d37d955e8.zip |
Version longue et mise a jour du papier sur le front-end (premier jet).
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@383 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'papers/cfrontend_new/syntax.etex')
-rwxr-xr-x | papers/cfrontend_new/syntax.etex | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/papers/cfrontend_new/syntax.etex b/papers/cfrontend_new/syntax.etex new file mode 100755 index 00000000..344ab40e --- /dev/null +++ b/papers/cfrontend_new/syntax.etex @@ -0,0 +1,52 @@ +\begin{figure} + +\begin{syntax} +\syntaxclass{Types:} +{\it signedness} & ::= & "Signed" \alt "Unsigned" \\ +{\it intsize} & ::= & "I8" \alt "I16" \alt "I32" \\ +{\it floatsize} & ::= & "F32" \alt "F64" \\ +\tau & ::= & "Tint" ({\it intsize}, {\it signedness}) \\ + & \alt & "Tfloat" ({\it floatsize}) \\ + & \alt & "Tvoid" \\ + & \alt & "Tarray" (\tau, n) \\ + & \alt & "Tpointer" (\tau) \\ +% &\alt & "Tcomp_pointer" (\id) \\ + &\alt & "Tstruct" (\id,\seq {(\id,\tau)}) \\ + &\alt & "Tunion" (\id,\seq {(\id,\tau)}) \\ + & \alt & "Tfunction" (\seq \tau, \tau) +% +\syntaxclass{Expressions annotated with types:} +a & ::= & \unannot{a}{\tau} +\syntaxclass{Unannotated expressions:} +b & ::= & \id & variable identifier\\ + & \alt & n & integer constant\\ + & \alt & f & float constant \\ + & \alt & "sizeof"(\tau) & size of a type \\ + & \alt & \op_1 ~ a & unary arithmetic operation\\ + & \alt & a_1 ~\op_2 ~ a_2 & binary arithmetic operation\\ + & \alt & \hbox{"*"} a & dereferencing \\ + & \alt & a_1 [a_2] & array indexing \\ + & \alt & a \dot \id & field access \\ + & \alt & \hbox{"&"} a & address of \\ + & \alt & (\tau) a & cast \\ + & \alt & a_1 \hbox{" && "} a_2 \alt a_1 \hbox{" || "} a_2 + & sequential boolean operations \\ + & \alt & a(\seq a) & function call \\ +% +\op_2 & ::= & \hbox{"+"} \alt \hbox{"-"} \alt \hbox{"*"} \alt \hbox{"/"} \alt \hbox{"%"} + & arithmetic operators \\ + & \alt & \hbox{"<<"} \alt \hbox{">>"} \alt + \hbox{"&"} \alt \hbox{"|"} \alt \hbox{"^"} + & bitwise operators\\ + & \alt & \hbox{"<"} \alt \hbox{"<="} \alt \hbox{">"} \alt \hbox{">="} + \alt \hbox{"=="} \alt \hbox{"!="} + & relational operators \\ +\op_1 & ::= & \hbox{"-"} \alt \hbox{"~"} \alt \hbox{"!"}& unary operators +% +\end{syntax} +\caption{Abstract syntax of Clight (types and expressions). $\seq a$ denotes 0, 1 or several + occurrences of syntactic category $a$. $\opt a$ denotes an optional + occurrence of category $a$.} +\label{fig:syntax} +\end{figure} + |