コード例 #1
0
        public virtual void EnterTitleCompilerStatement(Token titleToken, Token titleLiteral)
        {
            TitleDirective titleDirective = (TitleDirective)CompilerDirective;

            System.Diagnostics.Debug.Assert(titleLiteral.TokenFamily == TokenFamily.AlphanumericLiteral);
            string title = ((AlphanumericLiteralTokenValue)titleLiteral.LiteralValue).Text;

            titleDirective.Title = title;
        }
コード例 #2
0
        public override void EnterTitleCompilerStatement(CobolCompilerDirectivesParser.TitleCompilerStatementContext context)
        {
            TitleDirective titleDirective = new TitleDirective();

            CompilerDirective = titleDirective;

            string title = ParseTreeUtils.GetAlphanumericLiteral(context.alphanumericValue2());

            titleDirective.Title = title;
        }
コード例 #3
0
        public void GetStringTest_ShortForm()
        {
            // Arrange
            string           title        = "some title";
            Directive        directive    = new TitleDirective(title);
            string           expectedText = $"{{t: {title}}}";
            DirectiveHandler sut          = TitleHandler.Instance;

            // Act
            string text = sut.GetString(directive, shorten: true);

            // Assert
            Assert.AreEqual(expectedText, text);
        }
コード例 #4
0
        public virtual void StartTitleCompilerStatement()
        {
            TitleDirective titleDirective = new TitleDirective();

            CompilerDirective = titleDirective;
        }