////////////////////////////////////////////////////////////////////////// // Read ////////////////////////////////////////////////////////////////////////// public static FAttrs read(FStore.Input input) { int n = input.u2(); if (n == 0) return none; FAttrs attrs = new FAttrs(); for (int i=0; i<n; ++i) { string name = input.name(); switch (name[0]) { case 'E': if (name == FConst.ErrTableAttr) { attrs.errTable(input); continue; } break; case 'F': if (name == FConst.FacetsAttr) { attrs.facets(input); continue; } break; case 'L': if (name == FConst.LineNumberAttr) { attrs.lineNumber(input); continue; } if (name == FConst.LineNumbersAttr) { attrs.lineNumbers(input); continue; } break; case 'S': if (name == FConst.SourceFileAttr) { attrs.sourceFile(input); continue; } break; } int skip = input.u2(); if (input.skip(skip) != skip) throw new System.IO.IOException("Can't skip over attr " + name); } return attrs; }
////////////////////////////////////////////////////////////////////////// // Read ////////////////////////////////////////////////////////////////////////// public static FAttrs read(FStore.Input input) { int n = input.u2(); if (n == 0) { return(none); } FAttrs attrs = new FAttrs(); for (int i = 0; i < n; ++i) { string name = input.name(); switch (name[0]) { case 'E': if (name == FConst.ErrTableAttr) { attrs.errTable(input); continue; } break; case 'F': if (name == FConst.FacetsAttr) { attrs.facets(input); continue; } break; case 'L': if (name == FConst.LineNumberAttr) { attrs.lineNumber(input); continue; } if (name == FConst.LineNumbersAttr) { attrs.lineNumbers(input); continue; } break; case 'S': if (name == FConst.SourceFileAttr) { attrs.sourceFile(input); continue; } break; } int skip = input.u2(); if (input.skip(skip) != skip) { throw new System.IO.IOException("Can't skip over attr " + name); } } return(attrs); }
// // if (attrs == null) return; // for (int i=0; i<attrs.Length; ++i) // attr(attrs[i]); //} public void attr(FAttrs attr) { /* * string name = name(attr.name); * if (name.equals(LineNumbersAttr) && !showLines) return; * println(" [" + name + "] len=" + attr.data.len); * if (name.equals(SourceFileAttr)) sourceFile(attr); * if (name.equals(ErrTableAttr)) errTable(attr); * if (name.equals(LineNumbersAttr)) lineNumbers(attr); * if (name.equals(FacetsAttr)) facets(attr); */ }
// // if (attrs == null) return; // for (int i=0; i<attrs.Length; ++i) // attr(attrs[i]); //} public void attr(FAttrs attr) { /* string name = name(attr.name); if (name.equals(LineNumbersAttr) && !showLines) return; println(" [" + name + "] len=" + attr.data.len); if (name.equals(SourceFileAttr)) sourceFile(attr); if (name.equals(ErrTableAttr)) errTable(attr); if (name.equals(LineNumbersAttr)) lineNumbers(attr); if (name.equals(FacetsAttr)) facets(attr); */ }
public static Facets mapFacets(Pod pod, FAttrs.FFacet[] ffacets) { if (ffacets == null || ffacets.Length == 0) return empty(); Hashtable map = new Hashtable(); for (int i=0; i<ffacets.Length; ++i) { FAttrs.FFacet ff = ffacets[i]; Type t = pod.findType(ff.type); map[t] = ff.val; } return new Facets(map); }
public void read(FStore.Input input) { if (input.fpod.m_fcodeVersion == null) throw new IOException("FStore.Input.version == null"); m_fields = new FField[input.u2()]; for (int i=0; i<m_fields.Length; i++) m_fields[i] = new FField().read(input); m_methods = new FMethod[input.u2()]; for (int i=0; i<m_methods.Length; i++) m_methods[i] = new FMethod().read(input); m_attrs = FAttrs.read(input); m_hollow = false; input.Close(); }
public void read(FStore.Input input) { if (input.fpod.m_fcodeVersion == null) { throw new IOException("FStore.Input.version == null"); } m_fields = new FField[input.u2()]; for (int i = 0; i < m_fields.Length; i++) { m_fields[i] = new FField().read(input); } m_methods = new FMethod[input.u2()]; for (int i = 0; i < m_methods.Length; i++) { m_methods[i] = new FMethod().read(input); } m_attrs = FAttrs.read(input); m_hollow = false; input.Close(); }
protected void readAttrs(FStore.Input input) { m_attrs = FAttrs.read(input); }
////////////////////////////////////////////////////////////////////////// // Facets ////////////////////////////////////////////////////////////////////////// public void attrs(FAttrs attrs) { }
/// <summary> /// Emit a attribute. /// </summary> private void emitAttributes(FAttrs attrs) { //if (attrs.sourceFile != null) //{ // AttrEmit attr = emitAttr("SourceFile"); // attr.info.u2(utf(attrs.sourceFile)); //} }