logo
class

compiler::FAttr

sys::Obj
  compiler::FAttr

Mixin: compiler::FConst
  1  //
  2  // Copyright (c) 2006, Brian Frank and Andy Frank
  3  // Licensed under the Academic Free License version 3.0
  4  //
  5  // History:
  6  //   26 Dec 05  Brian Frank  Creation
  7  //   19 Aug 06  Brian Frank  Ported from Java to Fan
  8  //
  9  
 10  **
 11  ** FAttr is attribute meta-data for a FType or FSlot
 12  **
 13  class FAttr : FConst
 14  {
 15  
 16  //////////////////////////////////////////////////////////////////////////
 17  // Data
 18  //////////////////////////////////////////////////////////////////////////
 19  
 20    Str utf() { return data.seek(0).readUtf }
 21  
 22    Int u2() { return data.seek(0).readU2 }
 23  
 24  //////////////////////////////////////////////////////////////////////////
 25  // IO
 26  //////////////////////////////////////////////////////////////////////////
 27  
 28    Void write(OutStream out)
 29    {
 30      out.writeI2(name)
 31      FUtil.writeBuf(out, data)
 32    }
 33  
 34    FAttr read(InStream in)
 35    {
 36      name  = in.readU2
 37      data  = FUtil.readBuf(in)
 38      return this
 39    }
 40  
 41  //////////////////////////////////////////////////////////////////////////
 42  // Fields
 43  //////////////////////////////////////////////////////////////////////////
 44  
 45    Int name    // name index
 46    Buf data
 47  
 48  }

More Info