repo.or.cz
/
mcs.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
remove NotWorking
[mcs.git]
/
tests
/
test-459.cs
blob
c4126d44e2c212cc83a06b67efe626a5927baa21
1
using
System
;
2
3
class
CC
{
4
5
public class
IfElseStateMachine
{
6
7
public enum
State
{
8
START
,
9
IF_SEEN
,
10
ELSEIF_SEEN
,
11
ELSE_SEEN
,
12
ENDIF_SEEN
,
13
MAX
14
}
15
16
public enum
Token
{
17
START
,
18
IF
,
19
ELSEIF
,
20
ELSE
,
21
ENDIF
,
22
EOF
,
23
MAX
24
}
25
26
State state
;
27
public
IfElseStateMachine
()
28
{
29
}
30
31
public void
HandleToken
(
Token tok
)
32
{
33
if
(
tok
==
Token
.
IF
) {
34
state
= (
State
)
tok
;
35
}
36
}
37
}
38
39
public static int
Main
()
40
{
41
new
IfElseStateMachine
().
HandleToken
(
IfElseStateMachine
.
Token
.
IF
);
42
return
0
;
43
}
44
}