mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 09:38:19 +00:00
43 lines
638 B
C++
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);
|
|
}
|