Пример #1
0
            public override void EnterMethod([NotNull] SomeLanguageParser.MethodContext context)
            {
                string methodName = context.methodName().GetText();
                InstructionListener instructionlistener = new InstructionListener();

                foreach (var instruction in context.instruction())
                {
                    instruction.EnterRule(instructionlistener);
                }
                List <Instruction> instructions = instructionlistener.getInstructions();

                methods.Add(new Method(methodName, instructions));
            }
Пример #2
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="SomeLanguageParser.method"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitMethod([NotNull] SomeLanguageParser.MethodContext context)
 {
 }