コード例 #1
0
        public override ItemSequence VisitLexerRuleSpec([NotNull] ANTLRv4Parser.LexerRuleSpecContext context)
        {
            var displayName = context.FRAGMENT()?.GetText() + " " + context.TOKEN_REF();
            var comments    = context.DOC_COMMENT().Select(x => x.GetText()).Select(CreateComment).Select(x => Create($"{context.TOKEN_REF().GetText()} Comment", DiagramOf(x)));

            return(comments.Concat(SequenceOf(displayName, Transform(context.lexerRuleBlock().lexerAltList()))));
        }
コード例 #2
0
            public override void EnterLexerRuleSpec([NotNull] ANTLRv4Parser.LexerRuleSpecContext context)
            {
                Rules.Add(context);
                ITerminalNode token_ref = context.TOKEN_REF();

                LHS.Add(token_ref);
                current_nonterminal      = token_ref;
                RHS[current_nonterminal] = new List <ITerminalNode>();
            }