protected override void VisitAssignment(AssignmentNode node)
        {
            ReferenceNode referenceNode = node.LeftSideNode;
            Symbol        symbol        = referenceNode.Symbol;

            if (symbol?.Node is ConstDefinitionNode)
            {
                node.Annotations.Add(new ConstValueChangedWarning(referenceNode.Name));
            }

            base.VisitAssignment(node);
        }
예제 #2
0
        protected override void VisitAssignment(AssignmentNode node)
        {
            Visit(node.LeftSideNode);

            SymbolTypePair assignmentType = GetSymbolTypePairFromSymbol(node.LeftSideNode.Symbol);

            /*
             * if (node.LeftSideNode.BuiltinType == SymbolType.Float)
             * {
             *  _isInsideFloatExpression = true;
             * }
             */

            _currentExpressionTypes.Push(assignmentType);
            Visit(node.RightSideNode);
            _currentExpressionTypes.Pop();

            //_isInsideFloatExpression = false;

            /*
             * IncompatibleTypeAssignmentError
             * TODO check assignment types compability
             */
        }
예제 #3
0
 protected virtual T VisitAssignment(AssignmentNode node)
 {
     Visit(node.LeftSideNode);
     Visit(node.RightSideNode);
     return(DefaultResult);
 }
 protected virtual void VisitAssignment(AssignmentNode node)
 {
     Visit(node.LeftSideNode);
     Visit(node.RightSideNode);
 }
예제 #5
0
        protected override void VisitAssignment(AssignmentNode node)
        {
            ReferenceNode referenceNode = node.LeftSideNode;

            if (referenceNode.Symbol is InstanceSymbol)
            {
                // instances as of now aren't of type NestableSymbol, they can appear tough
                // however they are always initialized when they are created
                return;
            }

            Visit(node.RightSideNode);
            NestableSymbol nestableSymbol = (NestableSymbol)referenceNode.Symbol;

            switch (nestableSymbol?.Node)
            {
            case ConstDefinitionNode _:
            case ParameterDeclarationNode _:
                break;

            case VarDeclarationNode _:



                if (_currentBlockSymbol == null)
                {
                    throw new Exception();
                }

                NestableSymbol baseSymbol = referenceNode.BaseSymbol as NestableSymbol;
                if (baseSymbol == null)
                {
                    break;
                }

                ReferenceData referenceData = GetDataFromReferenceNode(referenceNode);
                if (referenceData == null || referenceData.HasDotInPath)
                {
                    break;
                }

                string relativePath = referenceData.PreDotPath;

                if (_currentBlockSymbol is SubclassSymbol currentSubclassSymbol)
                {
                    if (baseSymbol.ParentBlockSymbol == currentSubclassSymbol.BaseClassSymbol)
                    {
                        _initializedAttributesPaths.Add(relativePath);
                        break;
                    }
                }

                if (nestableSymbol.ParentBlockSymbol == _currentBlockSymbol)
                {
                    _initializedLocalsPaths.Add(relativePath);
                }

                break;
            }

            Visit(node.LeftSideNode);
        }