summaryrefslogtreecommitdiff
path: root/src/decomp/lang
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2010-12-12 00:16:28 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2010-12-12 00:16:28 (GMT)
commitd9fdfcf887a7a596a68db2500bb5e4d0b692abb6 (patch)
tree55d8a973b421ed832007a3757c0a61621a0bef44 /src/decomp/lang
parent544dfe87adfe15c8588ccffea712672e1b7c4179 (diff)
Created an instruction for the 'If Then Else' blocks.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@201 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/decomp/lang')
-rw-r--r--src/decomp/lang/java.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/decomp/lang/java.c b/src/decomp/lang/java.c
index b934a62..90a0ddc 100644
--- a/src/decomp/lang/java.c
+++ b/src/decomp/lang/java.c
@@ -53,6 +53,9 @@ static void g_java_output_init(GJavaOutput *);
/* Ajoute un commentaire à un tampon donné. */
static GBufferLine *g_java_output_write_comments(GJavaOutput *, GCodeBuffer *, const char *, size_t);
+/* Imprime dans un tampon donné une méthode de comparaison. */
+static void g_java_output_write_comp_sign(GJavaOutput *, GBufferLine *, CompSignType);
+
/* Débute la définition d'une classe. */
static GBufferLine *g_java_output_start_class(GJavaOutput *, GCodeBuffer *, const GOpenidaType *);
@@ -115,6 +118,8 @@ static void g_java_output_init(GJavaOutput *output)
lang->write_comments = (write_comments_fc)g_java_output_write_comments;
+ lang->comp_sign = (write_comp_sign_fc)g_java_output_write_comp_sign;
+
lang->start_class = (rlgbuftp_fc)g_java_output_start_class;
lang->end_class = (lgbuf_fc)g_java_output_end_class;
@@ -184,6 +189,54 @@ static GBufferLine *g_java_output_write_comments(GJavaOutput *output, GCodeBuffe
/******************************************************************************
* *
* Paramètres : output = encadrant de l'impression en langage de prog. *
+* line = tampon de sortie à disposition. *
+* sign = méthode de comparaison à imprimer. *
+* *
+* Description : Imprime dans un tampon donné une méthode de comparaison. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_java_output_write_comp_sign(GJavaOutput *output, GBufferLine *line, CompSignType sign)
+{
+ g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW);
+
+ switch (sign)
+ {
+ case CST_EQ:
+ g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "==", 2, RTT_SIGNS);
+ break;
+ case CST_NE:
+ g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "!=", 2, RTT_SIGNS);
+ break;
+ case CST_LT:
+ g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "<", 1, RTT_SIGNS);
+ break;
+ case CST_GE:
+ g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, ">=", 2, RTT_SIGNS);
+ break;
+ case CST_GT:
+ g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, ">", 1, RTT_SIGNS);
+ break;
+ case CST_LE:
+ g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "<=", 2, RTT_SIGNS);
+ break;
+ default:
+ g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "?", 1, RTT_SIGNS);
+ break;
+ }
+
+ g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, " ", 1, RTT_RAW);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : output = encadrant de l'impression en langage de prog. *
* buffer = tampon de sortie à disposition. *
* type = désignation de la classe à définir. *
* *