-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtt_variable.py
35 lines (27 loc) · 1.28 KB
/
tt_variable.py
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
#==================================================
# tt_variable.py - 2009-01-13
# The Variable class for Turbo Turtle
# Copyright (c) 2009 by Richard Goedeken ([email protected])
#--------------------------------------------------
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from tt_types import *
class Variable:
def __init__(self, Name):
self.Name = Name
self.Type = ParamType.UNKNOWN
self.ArrayDim = None
self.CppName = None
def SetType(self, Type):
allowedtypes = (ParamType.UNKNOWN, ParamType.BOOLEAN, ParamType.NUMBER, ParamType.LISTNUM, ParamType.ARRAY, ParamType.QUOTEDWORD)
if Type not in allowedtypes:
return False
self.Type = Type
return True