Ejemplo n.º 1
0
        /// <summary>
        /// Interfaces
        /// </summary>
        public void Visit(ParsedInterface pars)
        {
            var newNode = CodeItem.Factory.New(CodeExplorerIconType.Interface);

            newNode.DisplayText   = pars.Name;
            newNode.Flags         = pars.Flags;
            newNode.SubText       = null;
            newNode.DocumentOwner = pars.FilePath;
            newNode.GoToLine      = pars.Line;
            newNode.GoToColumn    = pars.Column;

            _nodeDictionary.Add(pars.Name, newNode);
            PushToCodeExplorer(null, newNode);
        }
Ejemplo n.º 2
0
 public void Visit(ParsedInterface pars)
 {
     AppendEverything(pars);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Matches a procedure definition
        /// </summary>
        private ParsedInterface CreateParsedInterface(Token interfaceToken)
        {
            /*
             * INTERFACE interface-type-name
             * [ INHERITS super-interface-name [ , super-interface-name ] ... ] :
             * interface-body
             */

            // info we will extract from the current statement :
            string name     = "";
            string Inherits = "";

            Token token;
            int   state = 0;

            do
            {
                token = PeekAt(1); // next token
                if (token is TokenEos)
                {
                    break;
                }
                if (token is TokenComment)
                {
                    continue;
                }
                if (token is TokenWord)
                {
                    if (state == 0)
                    {
                        name = token.Value;
                        state++;
                    }
                    else
                    {
                        switch (token.Value.ToLower())
                        {
                        case "inherits":
                            state = 2;
                            break;

                        default:
                            if (state == 2)
                            {
                                Inherits = token.Value;
                                state--;
                            }
                            break;
                        }
                    }
                    continue;
                }
                if (token is TokenString)
                {
                    if (state == 0)
                    {
                        name = GetTokenStrippedValue(token);
                        state++;
                    }
                    continue;
                }
            } while (MoveNext());

            if (state < 1)
            {
                return(null);
            }

            var newInterface = new ParsedInterface(name, interfaceToken, Inherits)
            {
                // = end position of the EOS of the statement
                EndPosition = token.EndPosition
            };

            AddParsedItem(newInterface, interfaceToken.OwnerNumber);

            return(newInterface);
        }