Example #1
0
        public override object VisitMethod_declaration([NotNull] NyaParser.Method_declarationContext context)
        {
            // TODO: Break out constructor logic to new method

            string methodName = context.identifier().GetText();

            MethodDescriptor descriptor = new MethodDescriptor()
            {
                Name    = methodName,
                Context = context
            };

            if (_currentDescriptor != null)
            {
                _currentDescriptor.Methods.Add(descriptor);
            }
            else
            {
                GlobalMethods.Add(descriptor);
            }

            return(descriptor);
        }