Initial Revision
[ohcount] / ext / ohcount_native / transition.h
1 /*
2  *  transition.h
3  *  Ohcount
4  *
5  *  Created by Jason Allen on 6/22/06.
6  *  Copyright 2006 Ohloh. All rights reserved.
7  *
8  */
9
10 #ifndef __transition_h__
11 #define __transition_h__
12
13 #include "state.h"
14
15 enum TokenEater {
16         FromEatsToken,
17         ToEatsToken,
18         NeitherEatsToken
19 };
20
21 // structs
22 typedef struct  {
23
24         // the regular expression that triggers this transision
25         char *regex;
26
27         // the states this transition maps
28         State *from_state;
29         State *to_state;
30
31         // which state should get the matched token attributed to it?
32         enum TokenEater token_eater;
33
34         // true if this transition should be ignored -- useful to preempt other matches
35         bool fake_transition;
36
37 } Transition;
38
39 #endif