Пример #1
0
        public void processAssignment(IAssignment assignment, out bool cGenerated, out string str)
        {
            string varName = assignment.getVarName();

            if (!types.ContainsKey(varName))
            {
                throw new VariableDoesNotExistException(varName);
            }
            COOPType coopType = assignment.getCOOPObject().actualType, varType = types[varName];


            cGenerated = false;
            str        = "";
            if (coopType.Equals(varType))
            {
                cGenerated = true;
                str        = $"{varName} = {assignment.getCOOPObjectString()}";
            }
            else if (varType.isParent(coopType) && !varType.isStrictlyClass() && coopType.isStrictlyClass())
            {
                types[varName] = coopType;
                cGenerated     = true;
                str            = $"{(coopType as COOPClass).toUsableToC()} {varName} = {assignment.getCOOPObjectString()}";
            }
        }