-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSS_action.java
More file actions
49 lines (47 loc) · 1.12 KB
/
Copy pathSS_action.java
File metadata and controls
49 lines (47 loc) · 1.12 KB
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
/*
* SaySentence Engine -- An open source SayScript Interpreter and Environment.
*
* Copyright (C) 2013, ParseTree Corporation.
*
* Steve Murphy <murf@parsetree.com>
*
* This program is free software, distributed under the terms of
* the Lesser GNU General Public License Version 2.1. See the LICENSE file
* at the top of the source tree.
*/
class SS_action
{
static final int SS_ACTION_CUT = 1;
static final int SS_ACTION_RANGE_ERROR = 2;
static final int SS_ACTION_RESTART = 3;
static final int SS_ACTION_DONE = 4;
static final int SS_ACTION_NEGATE = 5;
static final int SS_ACTION_NEXT = 6;
static final int SS_ACTION_ZERO = 7;
int action_type;
int arg;
void print()
{
System.out.println("Action: " + get_rep2() + ";");
}
String get_rep2()
{
switch( action_type )
{
case SS_ACTION_CUT:
return "CUT(" + arg + ")";
case SS_ACTION_ZERO:
return "ZERO(" + arg + ")";
case SS_ACTION_RANGE_ERROR:
return "RANGE_ERROR";
case SS_ACTION_RESTART:
return "RESTART";
case SS_ACTION_DONE:
return "DONE";
case SS_ACTION_NEGATE:
return "NEGATE";
default:
return "HUH???";
}
}
}