internal static PlugIn FromBinaryReader(BinaryReader reader, AxData parent, int index) { PlugIn ret = new PlugIn(index); ret.int_0 = reader.ReadInt32(); int dllNameOffset = reader.ReadInt32(); int exportNameOffset = reader.ReadInt32(); ret.int_3 = reader.ReadInt32(); ret.dllName = parent.ReadStringLiteral(dllNameOffset); ret.exportName = parent.ReadStringLiteral(exportNameOffset); return(ret); }
internal static Function FromBinaryReader(BinaryReader reader, AxData parent, int index) { Function ret = new Function(index); ret.dllIndex = reader.ReadInt16(); ret.functionIndex = reader.ReadInt16(); int paramStart = reader.ReadInt32(); int paramCount = reader.ReadInt32(); if (paramCount != 0) { ret.functionParams = parent.FunctionParams.GetRange(paramStart, paramCount); } ret.strIndex = reader.ReadInt32(); if (ret.strIndex >= 0) { ret.defaultName = parent.ReadStringLiteral(ret.strIndex); } ret.paramSizeSum = reader.ReadInt32(); ret.labelIndex = reader.ReadInt32(); ret.int_0 = reader.ReadInt16(); ret.flags = reader.ReadInt16(); switch (ret.Type) { case FunctionType.defcfunc: case FunctionType.deffunc: Label label = parent.GetLabel(ret.labelIndex); if (label != null) { label.SetFunction(ret); } ret.label = label; break; case FunctionType.func: case FunctionType.cfunc: case FunctionType.comfunc: Usedll dll = parent.GetUsedll(ret.dllIndex); if (dll != null) { dll.AddFunction(ret); } ret.dll = dll; break; case FunctionType.module: parent.Modules.Add(ret); break; } return(ret); }
internal static Usedll FromBinaryReader(BinaryReader reader, AxData parent, int index) { Usedll ret = new Usedll(index); ret.type = reader.ReadInt32(); int nameOffset = reader.ReadInt32(); ret.int_2 = reader.ReadInt32(); int clsNameOffset = reader.ReadInt32(); switch (ret.Type) { case UsedllType.usecom: ret.name = parent.ReadIidCodeLiteral(nameOffset); ret.clsName = parent.ReadStringLiteral(clsNameOffset); break; case UsedllType.uselib: ret.name = parent.ReadStringLiteral(nameOffset); break; } return(ret); }
private PrimitiveToken createPrimitive(AxData data, HspDictionaryValue dicValue, int theTokenOffset, int type, int flag, int value, int extraValue) { PrimitiveTokenDataSet dataset = new PrimitiveTokenDataSet(); dataset.Parent = data; dataset.DicValue = dicValue; dataset.TokenOffset = theTokenOffset; dataset.Type = type; dataset.Flag = flag; dataset.Value = value; dataset.Name = dicValue.Name; switch (dicValue.Type) { case HspCodeType.Label: return(new LabelPrimitive(dataset)); case HspCodeType.Integer: return(new IntegerPrimitive(dataset)); case HspCodeType.Double: return(new DoublePrimitive(dataset, data.ReadDoubleLiteral(value))); case HspCodeType.String: return(new StringPrimitive(dataset, data.ReadStringLiteral(value))); case HspCodeType.Symbol: return(new SymbolPrimitive(dataset)); case HspCodeType.Param: return(new ParameterPrimitive(dataset)); case HspCodeType.Variable: return(new GlobalVariablePrimitive(dataset)); case HspCodeType.Operator: return(new OperatorPrimitive(dataset)); case HspCodeType.IfStatement: case HspCodeType.ElseStatement: if (extraValue >= 0) { return(new IfStatementPrimitive(dataset, extraValue)); } else { return(new HspFunctionPrimitive(dataset)); } case HspCodeType.HspFunction: return(new HspFunctionPrimitive(dataset)); case HspCodeType.OnStatement: return(new OnFunctionPrimitive(dataset)); case HspCodeType.OnEventStatement: return(new OnEventFunctionPrimitive(dataset)); case HspCodeType.McallStatement: return(new McallFunctionPrimitive(dataset)); case HspCodeType.UserFunction: return(new UserFunctionPrimitive(dataset)); case HspCodeType.DllFunction: return(new DllFunctionPrimitive(dataset)); case HspCodeType.PlugInFunction: return(new PlugInFunctionPrimitive(dataset)); case HspCodeType.ComFunction: return(new ComFunctionPrimitive(dataset)); case HspCodeType.NONE: default: break; } return(new UnknownPrimitive(dataset)); }