#line 11 "/home/travis/build/felix-lang/felix/src/packages/debug.fdoc"
  // the internal representation of a Felix source location
  // has to be global to simplify compiler hack
  type flx_location_t = "flx::rtl::flx_range_srcref_t";
  
  class Debug
  {
    const FLX_SRCLOC : flx_location_t = "#srcloc";
      // NOTE: this doesn't actually work! The replacement typically
      // occurs in the wrong place: one gets the location of FLX_SRCLOC
      // right here in the debug class .. not useful!
    ctor flx_location_t : +char * int * int * int * int = "::flx::rtl::flx_range_srcref_t($a)";
    fun filename: flx_location_t -> +char = "$1.filename";
    fun startline: flx_location_t -> int = "$1.startline";
    fun startcol: flx_location_t -> int = "$1.startcol";
    fun endline: flx_location_t -> int = "$1.endline";
    fun endcol: flx_location_t -> int = "$1.endcol";
  
    instance Str[flx_location_t] {
      fun str(var x:flx_location_t)=>
      string (x.filename) + ":"+ x.startline.str + "[" + x.startcol.str + "]" + "-" +
      x.endline.str + "[" + x.endcol.str + "]";
    }
  
    // hack to emit C++ source file locations
    const CPP_FUNCTION : +char = "__FUNCTION__";
    const CPP_FILE: +char = "__FILE__";
    const CPP_LINE: int = "__LINE__";
  
    // hack to emit C code an expression would generate
    fun repr_expr[t]: t -> string = '\\"$a:?1\\"';
  
    // hack to emit C typename of a Felix type
    const repr_type[t]:string = '\\"?1\\"';
    proc enable_local_udp_trace : 1 = "::flx::debug::enable_local_udp_trace();"
      requires header '#include "flx_udp_trace.hpp"'
    ;
    proc send_udp_trace_message : string = "::flx::debug::send_udp_trace_message($1);"
      requires header '#include "flx_udp_trace.hpp"';
    ;
  
  }