summaryrefslogtreecommitdiff
path: root/src/decomp
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
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')
-rwxr-xr-xsrc/decomp/Makefile.am3
-rw-r--r--src/decomp/expr/Makefile.am1
-rw-r--r--src/decomp/expr/cond.c162
-rw-r--r--src/decomp/expr/cond.h60
-rw-r--r--src/decomp/instr/Makefile.am17
-rw-r--r--src/decomp/instr/ite.c182
-rw-r--r--src/decomp/instr/ite.h60
-rw-r--r--src/decomp/lang/java.c53
-rw-r--r--src/decomp/output-int.h5
-rw-r--r--src/decomp/output.c22
-rw-r--r--src/decomp/output.h19
11 files changed, 583 insertions, 1 deletions
diff --git a/src/decomp/Makefile.am b/src/decomp/Makefile.am
index 20694d0..ccae8ad 100755
--- a/src/decomp/Makefile.am
+++ b/src/decomp/Makefile.am
@@ -12,6 +12,7 @@ libdecomp_la_SOURCES = \
libdecomp_la_LIBADD = \
expr/libdecompexpr.la \
+ instr/libdecompinstr.la \
lang/libdecomplang.la
libdecomp_la_LDFLAGS =
@@ -23,4 +24,4 @@ AM_CPPFLAGS =
AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
-SUBDIRS = expr lang
+SUBDIRS = expr instr lang
diff --git a/src/decomp/expr/Makefile.am b/src/decomp/expr/Makefile.am
index d6d6d04..7507593 100644
--- a/src/decomp/expr/Makefile.am
+++ b/src/decomp/expr/Makefile.am
@@ -7,6 +7,7 @@ libdecompexpr_la_SOURCES = \
assign.h assign.c \
block.h block.c \
call.h call.c \
+ cond.h cond.c \
immediate.h immediate.c \
pseudo.h pseudo.c \
return.h return.c
diff --git a/src/decomp/expr/cond.c b/src/decomp/expr/cond.c
new file mode 100644
index 0000000..51309ca
--- /dev/null
+++ b/src/decomp/expr/cond.c
@@ -0,0 +1,162 @@
+
+/* OpenIDA - Outil d'analyse de fichiers binaires
+ * cond.c - représentation des conditions
+ *
+ * Copyright (C) 2010 Cyrille Bagard
+ *
+ * This file is part of OpenIDA.
+ *
+ * OpenIDA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenIDA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include "cond.h"
+
+
+#include "../expression-int.h"
+
+
+
+/* Définition d'une condition binaire quelconque (instance) */
+struct _GCondExpression
+{
+ GDecExpression parent; /* A laisser en premier */
+
+ GDecExpression *a; /* Premier élément à comparer */
+ CompSignType sign; /* Méthode de comparaison */
+ GDecExpression *b; /* Second élément à comparer */
+
+};
+
+
+/* Définition d'une condition binaire quelconque (classe) */
+struct _GCondExpressionClass
+{
+ GDecExpressionClass parent; /* A laisser en premier */
+
+};
+
+
+
+/* Initialise la classe des conditions binaires quelconques. */
+static void g_cond_expression_class_init(GCondExpressionClass *);
+
+/* Initialise une instance de condition binaire quelconque. */
+static void g_cond_expression_init(GCondExpression *);
+
+/* Imprime pour l'écran un version humaine d'une expression. */
+static void g_cond_expression_print(const GCondExpression *, GCodeBuffer *, GBufferLine *, GLangOutput *);
+
+
+
+/* Indique le type défini pour une condition binaire quelconque. */
+G_DEFINE_TYPE(GCondExpression, g_cond_expression, G_TYPE_DEC_EXPRESSION);
+
+
+/******************************************************************************
+* *
+* Paramètres : klass = classe à initialiser. *
+* *
+* Description : Initialise la classe des conditions binaires quelconques. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_cond_expression_class_init(GCondExpressionClass *klass)
+{
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : expr = instance à initialiser. *
+* *
+* Description : Initialise une instance de condition binaire quelconque. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_cond_expression_init(GCondExpression *expr)
+{
+ GDecInstruction *instr; /* Autre version de l'objet */
+
+ instr = G_DEC_INSTRUCTION(expr);
+
+ instr->print = (dec_instr_print_fc)g_cond_expression_print;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : a = second élément à comparer. *
+* sign = choix de la méthode de comparaison. *
+* b = second élément à comparer. *
+* *
+* Description : Exprime une condition binaire quelconque. *
+* *
+* Retour : Expression mise en place. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GDecInstruction *g_cond_expression_new(GDecExpression *a, CompSignType sign, GDecExpression *b)
+{
+ GCondExpression *result; /* Expression à retourner */
+
+ result = g_object_new(G_TYPE_COND_EXPRESSION, NULL);
+
+ result->a = a;
+ result->sign = sign;
+ result->b = b;
+
+ return G_DEC_INSTRUCTION(result);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : expr = expression à transcrire en version humaine. *
+* buffer = tampon où doit se réaliser l'insertion. *
+* line = ligne d'impression prête à emploi ou NULL. *
+* output = langage de programmation de sortie. *
+* *
+* Description : Imprime pour l'écran un version humaine d'une expression. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_cond_expression_print(const GCondExpression *expr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
+{
+ g_dec_instruction_print(G_DEC_INSTRUCTION(expr->a),
+ buffer, line, output);
+
+ g_lang_output_write_comp_sign(output, line, expr->sign);
+
+ g_dec_instruction_print(G_DEC_INSTRUCTION(expr->b),
+ buffer, line, output);
+
+}
diff --git a/src/decomp/expr/cond.h b/src/decomp/expr/cond.h
new file mode 100644
index 0000000..b6fd073
--- /dev/null
+++ b/src/decomp/expr/cond.h
@@ -0,0 +1,60 @@
+
+/* OpenIDA - Outil d'analyse de fichiers binaires
+ * cond.h - prototypes pour la représentation des conditions
+ *
+ * Copyright (C) 2010 Cyrille Bagard
+ *
+ * This file is part of OpenIDA.
+ *
+ * OpenIDA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenIDA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _DECOMP_EXPR_COND_H
+#define _DECOMP_EXPR_COND_H
+
+
+#include <glib-object.h>
+
+
+#include "../expression.h"
+#include "../instruction.h"
+
+
+
+#define G_TYPE_COND_EXPRESSION g_cond_expression_get_type()
+#define G_COND_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_cond_expression_get_type(), GCondExpression))
+#define G_IS_COND_EXPRESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_cond_expression_get_type()))
+#define G_COND_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_COND_EXPRESSION, GCondExpressionClass))
+#define G_IS_COND_EXPRESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_COND_EXPRESSION))
+#define G_COND_EXPRESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_COND_EXPRESSION, GCondExpressionClass))
+
+
+
+/* Définition d'une condition binaire quelconque (instance) */
+typedef struct _GCondExpression GCondExpression;
+
+/* Définition d'une condition binaire quelconque (classe) */
+typedef struct _GCondExpressionClass GCondExpressionClass;
+
+
+/* Indique le type défini pour une condition binaire quelconque. */
+GType g_cond_expression_get_type(void);
+
+/* Exprime une condition binaire quelconque. */
+GDecInstruction *g_cond_expression_new(GDecExpression *, CompSignType, GDecExpression *);
+
+
+
+#endif /* _DECOMP_EXPR_COND_H */
diff --git a/src/decomp/instr/Makefile.am b/src/decomp/instr/Makefile.am
new file mode 100644
index 0000000..b4e16eb
--- /dev/null
+++ b/src/decomp/instr/Makefile.am
@@ -0,0 +1,17 @@
+
+noinst_LTLIBRARIES = libdecompinstr.la
+
+libdecompinstr_la_SOURCES = \
+ ite.h ite.c
+
+libdecompinstr_la_LDFLAGS =
+
+libdecompinstr_la_LIBADD =
+
+INCLUDES = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS)
+
+AM_CPPFLAGS =
+
+AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
+
+SUBDIRS =
diff --git a/src/decomp/instr/ite.c b/src/decomp/instr/ite.c
new file mode 100644
index 0000000..f08df1e
--- /dev/null
+++ b/src/decomp/instr/ite.c
@@ -0,0 +1,182 @@
+
+/* OpenIDA - Outil d'analyse de fichiers binaires
+ * cond.c - représentation des conditions
+ *
+ * Copyright (C) 2010 Cyrille Bagard
+ *
+ * This file is part of OpenIDA.
+ *
+ * OpenIDA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenIDA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include "ite.h"
+
+
+#include "../instruction-int.h"
+
+
+
+/* Définition d'un aiguillage du flux d'exécution (instance) */
+struct _GITEInstruction
+{
+ GDecInstruction parent; /* A laisser en premier */
+
+ GDecExpression *cond; /* Condition prise en compte */
+
+ union
+ {
+ vmpa_t addr; /* Adresse de saut */
+ GDecExpression *expr; /* Expressions équivalentes */
+
+ } if_true;
+
+ union
+ {
+ vmpa_t addr; /* Adresse de saut */
+ GDecExpression *expr; /* Expressions équivalentes */
+
+ } if_false;
+
+};
+
+
+/* Définition d'un aiguillage du flux d'exécution (classe) */
+struct _GITEInstructionClass
+{
+ GDecInstructionClass parent; /* A laisser en premier */
+
+};
+
+
+
+/* Initialise la classe des aiguillages de flux d'exécution. */
+static void g_ite_instruction_class_init(GITEInstructionClass *);
+
+/* Initialise une instance d'aiguillage du flux d'exécution. */
+static void g_ite_instruction_init(GITEInstruction *);
+
+/* Imprime pour l'écran un version humaine d'une instruction. */
+static void g_ite_instruction_print(const GITEInstruction *, GCodeBuffer *, GBufferLine *, GLangOutput *);
+
+
+
+/* Indique le type défini pour un aiguillage du flux d'exécution. */
+G_DEFINE_TYPE(GITEInstruction, g_ite_instruction, G_TYPE_DEC_INSTRUCTION);
+
+
+/******************************************************************************
+* *
+* Paramètres : klass = classe à initialiser. *
+* *
+* Description : Initialise la classe des aiguillages de flux d'exécution. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_ite_instruction_class_init(GITEInstructionClass *klass)
+{
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : expr = instance à initialiser. *
+* *
+* Description : Initialise une instance d'aiguillage du flux d'exécution. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_ite_instruction_init(GITEInstruction *expr)
+{
+ GDecInstruction *instr; /* Autre version de l'objet */
+
+ instr = G_DEC_INSTRUCTION(expr);
+
+ instr->print = (dec_instr_print_fc)g_ite_instruction_print;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : cond = expression fixant le choix de l'aiguillage. *
+* if_true = adresse du saut si la condition est vérifiée. *
+* if_true = adresse du saut si la condition n'est pas vérifiée.*
+* *
+* Description : Exprime un aiguillage du flux en fonction d'une condition. *
+* *
+* Retour : Expression mise en place. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GDecInstruction *g_ite_instruction_new(GDecExpression *cond, vmpa_t if_true, vmpa_t if_false)
+{
+ GITEInstruction *result; /* Expression à retourner */
+
+ result = g_object_new(G_TYPE_ITE_INSTRUCTION, NULL);
+
+ result->cond = cond;
+ result->if_true.addr = if_true;
+ result->if_false.addr = if_false;
+
+ return G_DEC_INSTRUCTION(result);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : expr = instruction à transcrire en version humaine. *
+* buffer = tampon où doit se réaliser l'insertion. *
+* line = ligne d'impression prête à emploi ou NULL. *
+* output = langage de programmation de sortie. *
+* *
+* Description : Imprime pour l'écran un version humaine d'une instruction. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_ite_instruction_print(const GITEInstruction *expr, GCodeBuffer *buffer, GBufferLine *line, GLangOutput *output)
+{
+ g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, "if ", 3, RTT_KEY_WORD);
+
+ g_dec_instruction_print(G_DEC_INSTRUCTION(expr->cond),
+ buffer, line, output);
+
+ /*
+ g_dec_instruction_print(G_DEC_INSTRUCTION(expr->dest),
+ buffer, line, output);
+
+ g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, " = ", 3, RTT_SIGNS);
+
+ g_dec_instruction_print(G_DEC_INSTRUCTION(expr->src),
+ buffer, line, output);
+ */
+
+
+}
diff --git a/src/decomp/instr/ite.h b/src/decomp/instr/ite.h
new file mode 100644
index 0000000..cff073a
--- /dev/null
+++ b/src/decomp/instr/ite.h
@@ -0,0 +1,60 @@
+
+/* OpenIDA - Outil d'analyse de fichiers binaires
+ * ite.h - prototypes pour la représentation des conditions
+ *
+ * Copyright (C) 2010 Cyrille Bagard
+ *
+ * This file is part of OpenIDA.
+ *
+ * OpenIDA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * OpenIDA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef _DECOMP_EXPR_ITE_H
+#define _DECOMP_EXPR_ITE_H
+
+
+#include <glib-object.h>
+
+
+#include "../expression.h"
+#include "../instruction.h"
+
+
+
+#define G_TYPE_ITE_INSTRUCTION g_ite_instruction_get_type()
+#define G_ITE_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_ite_instruction_get_type(), GITEInstruction))
+#define G_IS_ITE_INSTRUCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_ite_instruction_get_type()))
+#define G_ITE_INSTRUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_ITE_INSTRUCTION, GITEInstructionClass))
+#define G_IS_ITE_INSTRUCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_ITE_INSTRUCTION))
+#define G_ITE_INSTRUCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_ITE_INSTRUCTION, GITEInstructionClass))
+
+
+
+/* Définition d'un aiguillage du flux d'exécution (instance) */
+typedef struct _GITEInstruction GITEInstruction;
+
+/* Définition d'un aiguillage du flux d'exécution (classe) */
+typedef struct _GITEInstructionClass GITEInstructionClass;
+
+
+/* Indique le type défini pour un aiguillage du flux d'exécution. */
+GType g_ite_instruction_get_type(void);
+
+/* Exprime un aiguillage du flux en fonction d'une condition. */
+GDecInstruction *g_ite_instruction_new(GDecExpression *, vmpa_t, vmpa_t);
+
+
+
+#endif /* _DECOMP_EXPR_ITE_H */
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. *
* *
diff --git a/src/decomp/output-int.h b/src/decomp/output-int.h
index 0d22aa5..8aae974 100644
--- a/src/decomp/output-int.h
+++ b/src/decomp/output-int.h
@@ -32,6 +32,9 @@
/* Ajoute un commentaire à un tampon donné. */
typedef GBufferLine * (* write_comments_fc) (GLangOutput *, GCodeBuffer *, const char *, size_t);
+/* Imprime dans un tampon donné une méthode de comparaison. */
+typedef void (* write_comp_sign_fc) (GLangOutput *, GBufferLine *, CompSignType);
+
/* Xxx. */
typedef GBufferLine * (* rlgbuftp_fc) (GLangOutput *, GCodeBuffer *, const GOpenidaType *);
@@ -50,6 +53,8 @@ struct _GLangOutput
write_comments_fc write_comments; /* Commentaires sur une ligne */
+ write_comp_sign_fc comp_sign; /* Méthde de comparaison */
+
rlgbuftp_fc start_class; /* Début de définition */
lgbuf_fc end_class; /* Fin de définition de classe */
diff --git a/src/decomp/output.c b/src/decomp/output.c
index 066096e..16cab19 100644
--- a/src/decomp/output.c
+++ b/src/decomp/output.c
@@ -101,6 +101,28 @@ GBufferLine *g_lang_output_write_comments(GLangOutput *output, GCodeBuffer *buff
/******************************************************************************
* *
* 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 : - *
+* *
+******************************************************************************/
+
+void g_lang_output_write_comp_sign(GLangOutput *output, GBufferLine *line, CompSignType sign)
+{
+ if (output->comp_sign != NULL)
+ output->comp_sign(output, line, sign);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : output = encadrant de l'impression en langage de prog. *
* buffer = tampon de sortie à disposition. *
* type = désignation de la classe à définir. *
* *
diff --git a/src/decomp/output.h b/src/decomp/output.h
index a4f72b2..73e1e76 100644
--- a/src/decomp/output.h
+++ b/src/decomp/output.h
@@ -51,6 +51,25 @@ GType g_lang_output_get_type(void);
/* Ajoute un commentaire à un tampon donné. */
GBufferLine *g_lang_output_write_comments(GLangOutput *, GCodeBuffer *, const char *, size_t);
+
+/* Liste des signes binaires de comparaison */
+typedef enum _CompSignType
+{
+ CST_EQ, /* == */
+ CST_NE, /* != */
+ CST_LT, /* < */
+ CST_GE, /* >= */
+ CST_GT, /* > */
+ CST_LE, /* <= */
+
+ CST_COUNT
+
+} CompSignType;
+
+/* Imprime dans un tampon donné une méthode de comparaison. */
+void g_lang_output_write_comp_sign(GLangOutput *, GBufferLine *, CompSignType);
+
+
/* Débute la définition d'une classe. */
GBufferLine *g_lang_output_start_class(GLangOutput *, GCodeBuffer *, const GOpenidaType *);