void processTypeBlock(InputStream input, PrintStream out) throws IOException, InvalidRCodeException { byte[] segment = new byte[typeBlockSize]; int bytesRead = input.read(segment); if (bytesRead != typeBlockSize) { throw new InvalidRCodeException("Not enough bytes in type block"); } if (out != null) { out.printf("%n**********%nTYPE BLOCK%n***********%n"); printByteBuffer(out, segment); } if ((version & 0x3FFF) >= 1200) { this.typeInfo = TypeInfoV12.newTypeInfo(segment, order); } else { this.typeInfo = TypeInfoV11.newTypeInfo(segment, order); } }
public static TypeInfoV11 newTypeInfo(byte[] segment, ByteOrder order) throws InvalidRCodeException { TypeInfoV11 typeInfo = new TypeInfoV11(); String str = RCodeInfo.readNullTerminatedString(segment, textAreaOffset + ByteBuffer.wrap(segment, currOffset, Integer.BYTES).order(order).getInt()); typeInfo.getInterfaces().add(str); currOffset += 24; IMethodElement mthd = MethodElementV11.fromDebugSegment(name, set, segment, currOffset, textAreaOffset, order); currOffset += mthd.getSizeInRCode(); typeInfo.getMethods().add(mthd); break; case PROPERTY: IPropertyElement prop = PropertyElementV11.fromDebugSegment(name, set, segment, currOffset, textAreaOffset, order); currOffset += prop.getSizeInRCode(); typeInfo.getProperties().add(prop); break; case VARIABLE: IVariableElement var = VariableElementV11.fromDebugSegment(name, set, segment, currOffset, textAreaOffset, order); currOffset += var.getSizeInRCode(); typeInfo.getVariables().add(var); break; case TABLE: ITableElement tbl = TableElementV11.fromDebugSegment(name, set, segment, currOffset, textAreaOffset, order); currOffset += tbl.getSizeInRCode(); typeInfo.getTables().add(tbl); break; case BUFFER: IBufferElement buf = BufferElementV11.fromDebugSegment(name, set, segment, currOffset, textAreaOffset, order); currOffset += buf.getSizeInRCode();
private static final ITypeInfo getProgressLangObject() { ITypeInfo info = new TypeInfoV11(PROGRESS_LANG_OBJECT, null, null, 0); info.getMethods().add(new MethodElementV11("Clone", EnumSet.of(AccessType.PUBLIC), 0, DataType.CLASS.getNum(), PROGRESS_LANG_OBJECT, 0, EMPTY_PARAMETERS)); info.getMethods().add( new MethodElementV11("Equals", EnumSet.of(AccessType.PUBLIC), 0, DataType.LOGICAL.getNum(), "", 0, new IParameter[] { new MethodParameterV11(0, "otherObj", 2, MethodParameterV11.PARAMETER_INPUT, 0, DataType.CLASS.getNum(), PROGRESS_LANG_OBJECT, 0)})); info.getMethods().add(new MethodElementV11("GetClass", EnumSet.of(AccessType.PUBLIC), 0, DataType.CLASS.getNum(), "Progress.Lang.Class", 0, EMPTY_PARAMETERS)); info.getMethods().add(new MethodElementV11("ToString", EnumSet.of(AccessType.PUBLIC), 0, DataType.CHARACTER.getNum(), "", 0, EMPTY_PARAMETERS)); return info; } }
public static TypeInfoV11 newTypeInfo(byte[] segment, ByteOrder order) throws InvalidRCodeException { TypeInfoV11 typeInfo = new TypeInfoV11(); String str = RCodeInfo.readNullTerminatedString(segment, textAreaOffset + ByteBuffer.wrap(segment, currOffset, Integer.BYTES).order(order).getInt()); typeInfo.getInterfaces().add(str); currOffset += 24; IMethodElement mthd = MethodElementV11.fromDebugSegment(name, set, segment, currOffset, textAreaOffset, order); currOffset += mthd.getSizeInRCode(); typeInfo.getMethods().add(mthd); break; case PROPERTY: IPropertyElement prop = PropertyElementV11.fromDebugSegment(name, set, segment, currOffset, textAreaOffset, order); currOffset += prop.getSizeInRCode(); typeInfo.getProperties().add(prop); break; case VARIABLE: IVariableElement var = VariableElementV11.fromDebugSegment(name, set, segment, currOffset, textAreaOffset, order); currOffset += var.getSizeInRCode(); typeInfo.getVariables().add(var); break; case TABLE: ITableElement tbl = TableElementV11.fromDebugSegment(name, set, segment, currOffset, textAreaOffset, order); currOffset += tbl.getSizeInRCode(); typeInfo.getTables().add(tbl); break; case BUFFER: IBufferElement buf = BufferElementV11.fromDebugSegment(name, set, segment, currOffset, textAreaOffset, order); currOffset += buf.getSizeInRCode();
private static final ITypeInfo getProgressLangObject() { ITypeInfo info = new TypeInfoV11(PROGRESS_LANG_OBJECT, null, null, 0); info.getMethods().add(new MethodElementV11("Clone", EnumSet.of(AccessType.PUBLIC), 0, DataType.CLASS.getNum(), PROGRESS_LANG_OBJECT, 0, EMPTY_PARAMETERS)); info.getMethods().add( new MethodElementV11("Equals", EnumSet.of(AccessType.PUBLIC), 0, DataType.LOGICAL.getNum(), "", 0, new IParameter[] { new MethodParameterV11(0, "otherObj", 2, MethodParameterV11.PARAMETER_INPUT, 0, DataType.CLASS.getNum(), PROGRESS_LANG_OBJECT, 0)})); info.getMethods().add(new MethodElementV11("GetClass", EnumSet.of(AccessType.PUBLIC), 0, DataType.CLASS.getNum(), "Progress.Lang.Class", 0, EMPTY_PARAMETERS)); info.getMethods().add(new MethodElementV11("ToString", EnumSet.of(AccessType.PUBLIC), 0, DataType.CHARACTER.getNum(), "", 0, EMPTY_PARAMETERS)); return info; } }
void processTypeBlock(InputStream input, PrintStream out) throws IOException, InvalidRCodeException { byte[] segment = new byte[typeBlockSize]; int bytesRead = input.read(segment); if (bytesRead != typeBlockSize) { throw new InvalidRCodeException("Not enough bytes in type block"); } if (out != null) { out.printf("%n**********%nTYPE BLOCK%n***********%n"); printByteBuffer(out, segment); } if ((version & 0x3FFF) >= 1200) { this.typeInfo = TypeInfoV12.newTypeInfo(segment, order); } else { this.typeInfo = TypeInfoV11.newTypeInfo(segment, order); } }