summaryrefslogtreecommitdiff
path: root/src/analysis/scan/expr-int.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2023-08-06 16:54:57 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2023-08-06 16:54:57 (GMT)
commit4fcc35a52ccb025b6d803d85e017931cd2452960 (patch)
treee95920f16c273e41f9cae1ea2f02571c221a514e /src/analysis/scan/expr-int.h
parent74d062d4ec55d7ac3914bbf64b8b6c5ab52227df (diff)
Extend the ROST grammar with a first batch of new features.
Diffstat (limited to 'src/analysis/scan/expr-int.h')
-rw-r--r--src/analysis/scan/expr-int.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/analysis/scan/expr-int.h b/src/analysis/scan/expr-int.h
index dbfea6e..48668b5 100644
--- a/src/analysis/scan/expr-int.h
+++ b/src/analysis/scan/expr-int.h
@@ -39,16 +39,28 @@
typedef bool (* compare_expr_rich_fc) (const GScanExpression *, const GScanExpression *, RichCmpOperation, bool *);
/* Vérifie la validité d'une expression. */
-typedef bool (* check_expr_validity_fc) (const GScanExpression *);
+typedef bool (* check_expr_validity_fc) (const GScanExpression *); // REMME ?
/* Reproduit une expression en place dans une nouvelle instance. */
-typedef GScanExpression * (* dup_expr_fc) (const GScanExpression *);
+typedef GScanExpression * (* dup_expr_fc) (const GScanExpression *); // REMME ?
/* Reproduit une expression en place dans une nouvelle instance. */
typedef void (* copy_expr_fc) (GScanExpression *, const GScanExpression *);
/* Réduit une expression à une forme plus simple. */
-typedef bool (* reduce_expr_fc) (GScanExpression *, GScanContext *, GScanScope *, GScanExpression **);
+typedef ScanReductionState (* reduce_expr_fc) (GScanExpression *, GScanContext *, GScanScope *, GScanExpression **);
+
+/* Réduit une expression à une forme booléenne. */
+typedef bool (* reduce_expr_to_bool_fc) (GScanExpression *, GScanContext *, GScanScope *, GScanExpression **);
+
+/* Dénombre les éléments portés par une expression. */
+typedef bool (* count_scan_expr_fc) (const GScanExpression *, size_t *);
+
+/* Fournit un élément donné issu d'un ensemble constitué. */
+typedef bool (* get_scan_expr_fc) (const GScanExpression *, size_t, GScanExpression **);
+
+/* Réalise l'intersection entre deux ensembles. */
+typedef GScanExpression * (* intersect_scan_expr_fc) (GScanExpression *, const GScanExpression *, GScanContext *, GScanScope *);
/* Expression d'évaluation généraliste (instance) */
@@ -56,6 +68,8 @@ struct _GScanExpression
{
GObject parent; /* A laisser en premier */
+ ScanReductionState state; /* Etat synthétisé de l'élément*/
+
ExprValueType value_type; /* Type de valeur portée */
};
@@ -67,9 +81,15 @@ struct _GScanExpressionClass
compare_expr_rich_fc cmp_rich; /* Comparaison de façon précise*/
check_expr_validity_fc check; /* Validation de la cohérence */
- copy_expr_fc copy; /* Reproduction d'expression */
+ copy_expr_fc copyXXX; /* Reproduction d'expression */
dup_expr_fc dup; /* Reproduction d'expression */
+
reduce_expr_fc reduce; /* Simplification d'expression */
+ reduce_expr_to_bool_fc reduce_to_bool; /* Conversion en booléen */
+
+ count_scan_expr_fc count; /* Décompte d'éléments */
+ get_scan_expr_fc get; /* Extraction d'un élément */
+ intersect_scan_expr_fc intersect; /* Intersection entre ensembles*/
};