zeek/src/CCL.cc
Robin Sommer 3957091e1b Renaming config.h to bro-config.h.
A couple times now I had this conflicting with files of the same name
in other projects.
2015-07-28 11:57:04 -07:00

43 lines
638 B
C++

// See the file "COPYING" in the main distribution directory for copyright.
#include "bro-config.h"
#include "CCL.h"
#include "RE.h"
#include "DFA.h"
CCL::CCL()
{
syms = new int_list;
index = -(rem->InsertCCL(this) + 1);
negated = 0;
}
CCL::~CCL()
{
delete syms;
}
void CCL::Negate()
{
negated = 1;
Add(SYM_BOL);
Add(SYM_EOL);
}
void CCL::Add(int sym)
{
ptr_compat_int sym_p = ptr_compat_int(sym);
// Check to see if the character is already in the ccl.
for ( int i = 0; i < syms->length(); ++i )
if ( (*syms)[i] == sym_p )
return;
syms->append(sym_p);
}
void CCL::Sort()
{
syms->sort(int_list_cmp);
}