From 578277e535e08f3b4aa33f0d6ed18966396ad23e Mon Sep 17 00:00:00 2001 From: Justin Viiret Date: Mon, 3 Apr 2017 12:30:30 +1000 Subject: [PATCH] limex_dump: dump LimEx type and flags in text --- src/nfa/limex_dump.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/nfa/limex_dump.cpp b/src/nfa/limex_dump.cpp index 852639ea..797e87ba 100644 --- a/src/nfa/limex_dump.cpp +++ b/src/nfa/limex_dump.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2016, Intel Corporation + * Copyright (c) 2015-2017, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -290,6 +290,20 @@ static void dumpLimexText(const limex_type *limex, FILE *f) { u32 size = limex_traits::size; + fprintf(f, "%u-bit LimEx NFA (%u shifts, %u exceptions)\n", size, + limex->shiftCount, limex->exceptionCount); + fprintf(f, "flags: "); + if (limex->flags & LIMEX_FLAG_COMPRESS_STATE) { + fprintf(f, "COMPRESS_STATE "); + } + if (limex->flags & LIMEX_FLAG_COMPRESS_MASKED) { + fprintf(f, "COMPRESS_MASKED "); + } + if (limex->flags & LIMEX_FLAG_CANNOT_DIE) { + fprintf(f, "CANNOT_DIE "); + } + fprintf(f, "\n\n"); + dumpMask(f, "init", (const u8 *)&limex->init, size); dumpMask(f, "init_dot_star", (const u8 *)&limex->initDS, size); dumpMask(f, "accept", (const u8 *)&limex->accept, size);