Esempio n. 1
0
        public override bool Visit(MemberAccess access)
        {
            if (access.ReferencedDeclaration.HasValue)
            {
                ASTNode node = solidityAST.GetASTNodeByID(access.ReferencedDeclaration.Value);
                if (node is VariableDeclaration decl)
                {
                    result = decl;
                    return(false);
                }

                throw new Exception("Analysis Exception: Expected member access declaration to be of VariableDeclaration type, not " + node.GetType());
            }

            access.Expression.Accept(this);
            return(false);
        }
Esempio n. 2
0
        public override bool Visit(Identifier ident)
        {
            if (!solidityAST.GetIdToNodeMap().ContainsKey(ident.ReferencedDeclaration))
            {
                return(true);
            }

            ASTNode node = solidityAST.GetASTNodeByID(ident.ReferencedDeclaration);

            if (!(node is VariableDeclaration))
            {
                return(true);
            }

            VariableDeclaration decl = (VariableDeclaration)node;

            results.Remove(decl);
            return(false);
        }