Ejemplo n.º 1
0
        /// <summary>
        /// Matches a procedure definition
        /// </summary>
        private ParsedDestructor CreateParsedDestructor(Token destructorToken, ParsedScope parentScope)
        {
            /*
             * DESTRUCTOR [ PUBLIC ] class-name ( ) :
             * Destructor-body
             */

            // info we will extract from the current statement :
            string    name  = "";
            ParseFlag flags = 0;

            Token token;

            do
            {
                token = PeekAt(1); // next token
                if (token is TokenEos)
                {
                    break;
                }
                if (token is TokenComment)
                {
                    continue;
                }
                if (token is TokenWord)
                {
                    switch (token.Value.ToLower())
                    {
                    case "public":
                        flags |= ParseFlag.Public;
                        break;

                    default:
                        name = token.Value;
                        break;
                    }
                }
            } while (MoveNext());

            if (name == "")
            {
                return(null);
            }

            var newDestructor = new ParsedDestructor(name, destructorToken, parentScope)
            {
                // = end position of the EOS of the statement
                Flags       = flags,
                EndPosition = token.EndPosition
            };

            AddParsedItem(newDestructor, destructorToken.OwnerNumber);

            return(newDestructor);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Destructors
        /// </summary>
        public void Visit(ParsedDestructor pars)
        {
            // to code explorer
            var classNode  = GetExplorerListNode(pars.ClassName, CodeExplorerIconType.Block);
            var parentNode = GetExplorerListNode("Destructors", CodeExplorerIconType.Destructor, classNode);
            var newNode    = CodeItem.Factory.New(CodeExplorerIconType.Destructor);

            newNode.DisplayText   = pars.Name;
            newNode.Flags         = pars.Flags;
            newNode.DocumentOwner = pars.FilePath;
            newNode.GoToLine      = pars.Line;
            newNode.GoToColumn    = pars.Column;
            PushToCodeExplorer(parentNode, newNode);
        }
Ejemplo n.º 3
0
 public void Visit(ParsedDestructor pars)
 {
     AppendEverything(pars);
 }