[go: up one dir, main page]

Menu

[r4]: / easyfsm.h  Maximize  Restore  History

Download this file

51 lines (35 with data), 745 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef EASYFSM_H
#define EASYFSM_H
#include <vector>
#include <string>
#include <map>
#define REP( i , j , k ) for( int i = 0 ; i < k ; ++i )
#ifdef DEBUG
#define D if( 1 )
#else
#define D if( 0 )
#endif
#define DEBUG
#define DEB( var... ) fprintf( stderr , var )
using namespace std;
extern "C" {
extern int yylex();
extern int yyerror( char *s, ... );
extern int yylineno;
extern int yyparse();
extern bool ChangeInput( char * );
}
struct ENTRY
{
string start;
string end;
string condition;
ENTRY();
ENTRY( string, string, string );
ENTRY( char *, char *, char * );
~ENTRY();
};
extern vector <ENTRY> ENTRIES;
extern map < string , vector< ENTRY > > FSM;
void NewEntry( char * start , char * end , char * cond );
#endif