diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2023-10-11 23:16:21 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2023-10-11 23:16:21 (GMT) |
commit | ab6b87b7309e2d00926615f6557016bee6ab0b71 (patch) | |
tree | bf69b93d2f0548fc845e68ae1e8519bd33d1da24 /src/analysis/scan/patterns/token.c | |
parent | 404097b7b07b336b427b3682ec2bc48d831cb2e9 (diff) |
Add two new functions to ROST grammar: modpath and maxcommon.
Diffstat (limited to 'src/analysis/scan/patterns/token.c')
-rw-r--r-- | src/analysis/scan/patterns/token.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/analysis/scan/patterns/token.c b/src/analysis/scan/patterns/token.c index 8b3a843..030e4a1 100644 --- a/src/analysis/scan/patterns/token.c +++ b/src/analysis/scan/patterns/token.c @@ -30,6 +30,7 @@ #include "token-int.h" +#include "tokens/nodes/plain.h" #include "../../../common/cpp.h" #include "../../../core/logs.h" @@ -342,6 +343,33 @@ void g_bytes_token_check(const GBytesToken *token, GScanContext *context, GBinCo } +/****************************************************************************** +* * +* Paramètres : token = définition de la bribe à consulter. * +* index = indice de la combinaison de modificateurs ciblée. * +* * +* Description : Retrouve l'origine d'une correspondance à partir d'un indice.* +* * +* Retour : Version humainement lisible de la combinaison gagnante. * +* * +* Remarques : - * +* * +******************************************************************************/ + +char *g_bytes_token_get_modifier_path(const GBytesToken *token, size_t index) +{ + char *result; /* Combinaison à retourner */ + + if (G_IS_SCAN_TOKEN_NODE_PLAIN(token->root)) + result = g_scan_token_node_plain_get_modifier_path(G_SCAN_TOKEN_NODE_PLAIN(token->root), index); + else + result = NULL; + + return result; + +} + + /* ---------------------------------------------------------------------------------- */ /* IMPLEMENTATION DES FONCTIONS DE CLASSE */ |