Class ByteCodeDirective

java.lang.Object
org.ek9lang.compiler.directives.ResolutionDirective
org.ek9lang.compiler.directives.ByteCodeDirective
All Implemented Interfaces:
Directive

public class ByteCodeDirective extends ResolutionDirective
To be used in EK9 source code to assert that generated JVM bytecode matches expectations.
@BYTECODE: CODE_GENERATION_AGGREGATES: TYPE: "Example": `
  public class Example {
    public Example();
      Code:
        0: aload_0
        1: invokespecial #CP  // Method java/lang/Object."<init>":()V
        4: return
  }
`
  • Constructor Details

    • ByteCodeDirective

      public ByteCodeDirective(DirectiveSpec spec)
      A new bytecode validation directive. The symbol name identifies the construct to validate bytecode for. The additionalName contains the expected normalized bytecode output from javap.
  • Method Details

    • type

      public DirectiveType type()
      Description copied from interface: Directive
      What s the type of the directive.