コード例 #1
0
        /// <summary>
        /// Protocol Message definition handling.
        ///
        /// IDENTIFIER (',' message_definition)?
        /// </summary>
        /// <param name="context"></param>
        public override void EnterMessage_definition(KryptonParser.Message_definitionContext context)
        {
            var parent = _memberContainers.Peek();
            var name   = context.IDENTIFIER().GetText();

            // Verify our name is unique
            if (parent.TryFindMember(name, out var _))
            {
                throw new KryptonParserException($"Multiple definitions for {name}.");
            }

            var message = _file.MessageFactory.Create(name, parent);

            parent.AddMember(message);

            _documentables.Push(message);
        }
コード例 #2
0
 public override void ExitMessage_definition(KryptonParser.Message_definitionContext context)
 {
     _documentables.Pop();
 }