public Scope(Frame frame, Scope previous) { _identifiers = new Dictionary<string, FrameResource>(); Frame = frame; Previous = previous; }
public RegisterFrameResource(Frame frame, TypeBase type, Register register) : base(frame, type) { Register = register; if (type is PointerType) { _type = OperandValueType.Dword; } else { var typePrim = type as PrimitiveType; if (typePrim == null) throw new ArgumentException("Type must be a primitive.", nameof(type)); switch (typePrim.Type) { case Primitive.Int: _type = OperandValueType.Dword; break; case Primitive.Short: _type = OperandValueType.Word; break; case Primitive.Char: _type = OperandValueType.Byte; break; default: throw new NotSupportedException(); } } }
protected FrameResource(Frame frame, TypeBase type) { Frame = frame; Type = type; Disposed = false; }
public StackFrameResource(Frame frame, TypeBase type, int offset, int size) : base(frame, type) { Offset = offset; Size = size; if (type is PointerType) { _type = OperandValueType.Dword; } else { var typePrim = type as PrimitiveType; if (typePrim == null) return; switch (typePrim.Type) { case Primitive.Int: _type = OperandValueType.Dword; break; case Primitive.Short: _type = OperandValueType.Word; break; case Primitive.Char: _type = OperandValueType.Byte; break; default: throw new NotSupportedException(); } } }