#import <Cocoa/Cocoa.h>
+@class VariableNode;
+
@interface StackFrame : NSObject
-{
- /**
- * Whether or not the stack frame has been fully loaded.
- */
- BOOL loaded_;
- /**
- * The position in the stack
- */
- NSUInteger index_;
-
- /**
- * File the current frame is in
- */
- NSString* filename_;
-
- /**
- * Cached, highlighted version of the source
- */
- NSString* source_;
-
- /**
- * Line number of the source the frame points to
- */
- NSUInteger lineNumber_;
-
- /**
- * Current-executing function
- */
- NSString* function_;
-
- /**
- * Variable list
- */
- NSArray* variables_;
-}
+/**
+ * Whether or not the stack frame has been fully loaded.
+ */
+@property(nonatomic) BOOL loaded;
+
+/**
+ * The position in the stack
+ */
+@property(readwrite, nonatomic) NSUInteger index;
+
+/**
+ * File the current frame is in
+ */
+@property(copy, nonatomic) NSString* filename;
+
+/**
+ * Cached, highlighted version of the source
+ */
+@property(copy, nonatomic) NSString* source;
+
+/**
+ * Line number of the source the frame points to
+ */
+@property(readwrite, nonatomic) NSUInteger lineNumber;
-@property BOOL loaded;
-@property (readwrite) NSUInteger index;
-@property (copy) NSString* filename;
-@property (copy) NSString* source;
-@property (readwrite) NSUInteger lineNumber;
-@property (copy) NSString* function;
-@property (retain) NSArray* variables;
+/**
+ * Current-executing function
+ */
+@property(copy, nonatomic) NSString* function;
+/**
+ * Variable list
+ */
+@property(retain, nonatomic) NSArray<VariableNode*>* variables;
+
+/**
+ * Whether or not this is the same stack scope as |frame|.
+ */
- (BOOL)isShiftedFrame:(StackFrame*)frame;
@end
@implementation StackFrame
-@synthesize loaded = loaded_;
-@synthesize index = index_;
-@synthesize filename = filename_;
-@synthesize source = source_;
-@synthesize lineNumber = lineNumber_;
-@synthesize function = function_;
-@synthesize variables = variables_;
+@synthesize loaded;
+@synthesize index;
+@synthesize filename;
+@synthesize source;
+@synthesize lineNumber;
+@synthesize function;
+@synthesize variables;
-- (void)dealloc
-{
+- (void)dealloc {
self.filename = nil;
self.source = nil;
self.function = nil;
[super dealloc];
}
-/**
- * Determines whether or not the given frame was shifted, rather than jumped. Essentially,
- * this checks if it's in the same file/function.
- */
-- (BOOL)isShiftedFrame:(StackFrame*)frame
-{
+- (BOOL)isShiftedFrame:(StackFrame*)frame {
return ([self.filename isEqualToString:frame.filename] && [self.function isEqualToString:frame.function]);
}
-/**
- * Returns a human-readable representation
- */
-- (NSString*)description
-{
+- (NSString*)description {
return [NSString stringWithFormat:@"#%d %@ [%@:%d]", self.index, self.function, self.filename, self.lineNumber];
}