Update lympha

parent b056afc3
......@@ -83,30 +83,6 @@ CLIcom_segment = 0
from ast import NodeVisitor
class Evaluator(NodeVisitor):
def __init__(self, **kwargs):
self._namespace = kwargs
def visit_Name(self, node):
return self._namespace[node.id]
def visit_Num(self, node):
return node.n
def visit_NameConstant(self, node):
return node.value
def visit_UnaryOp(self, node):
val = self.visit(node.operand)
return operators[type(node.op)](val)
def visit_BinOp(self, node):
lhs = self.visit(node.left)
rhs = self.visit(node.right)
return operators[type(node.op)](lhs, rhs)
def generic_visit(self, node):
raise ValueError("malformed node or string: " + repr(node))
#Construction of the section model of the linked list.
class Statement(dict):
MARKER = object()
......@@ -323,27 +299,28 @@ def mapfunc():
except:
endnum = float(eval(str(endstring)))
if object_list[key].operator1 == "equiv" and float(object_list[key].global_relative_variable1) == float(str(endnum)):
print ("%s == %s ; exe" % (float(object_list[key].global_relative_variable1), float(str(endnum))))
op = "failed"
if object_list[key].operator1 == "equiv" and int(object_list[key].global_relative_variable1) == int(str(endnum)):
op = "=="
pre_statement_flow = 1
elif object_list[key].operator1 == "leq" and float(object_list[key].global_relative_variable1) <= float((endnum)):
print ("%s <= %s ; exe" % (float(object_list[key].global_relative_variable1), float(str(endnum))))
elif object_list[key].operator1 == "leq" and int(object_list[key].global_relative_variable1) >= int((endnum)):
op = ">="
pre_statement_flow = 1
elif object_list[key].operator1 == "geq" and (float(object_list[key].global_relative_variable1) >= float(str(endnum))):
print ("%s >= %s ; exe" % (float(object_list[key].global_relative_variable1), float(str(endnum))))
elif object_list[key].operator1 == "geq" and (int(object_list[key].global_relative_variable1) <= int(str(endnum))):
op = "<="
pre_statement_flow = 1
elif object_list[key].operator1 == "no" and float(object_list[key].global_relative_variable1) != float(str(endnum)):
print ("%s != %s ; exe" % (float(object_list[key].global_relative_variable1), float(str(endnum))))
elif object_list[key].operator1 == "no" and int(object_list[key].global_relative_variable1) != int(str(endnum)):
op = "!="
pre_statement_flow = 1
elif object_list[key].operator1 == "g" and float(object_list[key].global_relative_variable1) < float(str(endnum)):
print ("%s < %s ; exe" % (float(object_list[key].global_relative_variable1), float(str(endnum))))
elif object_list[key].operator1 == "g" and int(object_list[key].global_relative_variable1) < int(str(endnum)):
op = "<"
pre_statement_flow = 1
elif object_list[key].operator1 == "l" and float(object_list[key].global_relative_variable1) > float(str(endnum)):
print ("%s > %s ; exe" % (float(object_list[key].global_relative_variable1), float(str(endnum))))
elif object_list[key].operator1 == "l" and int(object_list[key].global_relative_variable1) > int(str(endnum)):
op = ">"
pre_statement_flow = 1
else:
pre_statement_flow = 0
print ("%s %s %s ; exe" % (int(object_list[key].global_relative_variable1), op, int(str(endnum))))
object_list[key].statement_flow = int(pre_statement_flow)
#For equations
......@@ -468,10 +445,10 @@ def mapfunc():
del CLI_filename, argv_len, filename, filenames, starts, steps, mode_graph, mode_state, filecheck, mode_exe, mode_show, mode_map, exe_list, show_list, map_list, substates, nextstates, specs, global_relative_variable1, global_relative_variable2, operator1, statement_flow, statement_value, exe_objects, object_list,
def statefunc():
global object_list
for key, obj in object_list.items():
print("%s" % object_list[key].name)
#def statefunc():
# global object_list
# for key, obj in object_list.items():
# print("%s" % object_list[key].name)
def stripComments(code):
code = str(code)
......@@ -650,14 +627,11 @@ def lexer():
#For non-binary values and equations
elif sides[0] != "" and sides[1] != "" :
print("YYY %s" % object_list[key].name)
#if 0 == len(operator_chop) :
object_list[key].statement_value = sides[1]
object_list[key].datatype = "valu"
print("DATA TYPE: %s" % object_list[key].datatype)
print("ZZZ")
#if CLIcom_segment == 1:
#CLIcom_segment = 2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment