misc: docs, typo fixes, small cleanups

This commit is contained in:
Justin Viiret
2018-01-18 10:41:43 +11:00
committed by Chang, Harry
parent ea9d1f69fb
commit ce7cfbde82
16 changed files with 68 additions and 49 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2017, Intel Corporation
* Copyright (c) 2015-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -73,7 +73,7 @@ static
void populateInit(const NGHolder &g, const flat_set<NFAVertex> &unused,
stateset *init, stateset *initDS,
vector<NFAVertex> *v_by_index) {
DEBUG_PRINTF("graph kind: %u\n", (int)g.kind);
DEBUG_PRINTF("graph kind: %s\n", to_string(g.kind).c_str());
for (auto v : vertices_range(g)) {
if (contains(unused, v)) {
continue;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2017, Intel Corporation
* Copyright (c) 2015-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -542,7 +542,8 @@ unique_ptr<raw_dfa> buildMcClellan(const NGHolder &graph,
return nullptr;
}
DEBUG_PRINTF("attempting to build ?%d? mcclellan\n", (int)graph.kind);
DEBUG_PRINTF("attempting to build %s mcclellan\n",
to_string(graph.kind).c_str());
assert(allMatchStatesHaveReports(graph));
bool prunable = grey.highlanderPruneDFA && has_managed_reports(graph);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2017, Intel Corporation
* Copyright (c) 2015-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -87,7 +87,11 @@ private:
/** Find the set of characters that are not present in the reachability of
* graph \p g after a certain depth (currently 8). If a character in this set
* is encountered, it means that the NFA is either dead or has not progressed
* more than 8 characters from its start states. */
* more than 8 characters from its start states.
*
* This is only used to guide merging heuristics, use
* findLeftOffsetStopAlphabet for real uses.
*/
CharReach findStopAlphabet(const NGHolder &g, som_type som) {
const depth max_depth(MAX_STOP_DEPTH);
const InitDepths depths(g);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Intel Corporation
* Copyright (c) 2015-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -47,7 +47,11 @@ class NGHolder;
/** Find the set of characters that are not present in the reachability of
* graph \p g after a certain depth (currently 8). If a character in this set
* is encountered, it means that the NFA is either dead or has not progressed
* more than 8 characters from its start states. */
* more than 8 characters from its start states.
*
* This is only used to guide merging heuristics, use
* findLeftOffsetStopAlphabet for real uses.
*/
CharReach findStopAlphabet(const NGHolder &g, som_type som);
/** Calculate the stop alphabet for each depth from 0 to MAX_STOP_DEPTH. Then