Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

45 lines
559 B
C#

using System;
class CC {
public class IfElseStateMachine {
public enum State {
START,
IF_SEEN,
ELSEIF_SEEN,
ELSE_SEEN,
ENDIF_SEEN,
MAX
}
public enum Token {
START,
IF,
ELSEIF,
ELSE,
ENDIF,
EOF,
MAX
}
State state;
public IfElseStateMachine()
{
}
public void HandleToken(Token tok)
{
if(tok == Token.IF) {
state = (State) tok;
}
}
}
public static int Main ()
{
new IfElseStateMachine ().HandleToken (IfElseStateMachine.Token.IF);
return 0;
}
}