//
//  PSSimpleT2Decompiler.h
//  GSFontTools
//
//  Created by Georg Seifert on 31.07.11.
//  Copyright 2011 schriftgestaltung.de. All rights reserved.
//

@class CFFGlobalSubrsIndex;
@class CFFPrivateDict;
@class CFFSubrsIndex;
@class PST2CharString;

@interface PSSimpleT2Decompiler : NSObject {
	CFFSubrsIndex *_localSubrs;
	NSUInteger _localBias;
	CFFGlobalSubrsIndex *_globalSubrs;
	NSUInteger _globalBias;
	NSMutableArray *_callingStack;
	NSMutableArray *_operandStack;
	NSUInteger _hintCount;
	NSUInteger _hintMaskBytes;
	NSUInteger _numRegions;
}

@property (nonatomic, retain) CFFSubrsIndex *localSubrs;
@property (nonatomic) NSUInteger localBias;
@property (nonatomic, retain) id globalSubrs;
@property (nonatomic) NSUInteger globalBias;
@property (nonatomic, retain) NSMutableArray *callingStack;
@property (nonatomic, retain) CFFPrivateDict *privateDict;

- (void)addToCallingStack:(id)_callingStackObject;

- (void)removeFromCallingStack:(id)_callingStackObject;

@property (nonatomic, retain) NSMutableArray *operandStack;
@property (nonatomic) NSUInteger hintCount;
@property (nonatomic) NSUInteger hintMaskBytes;

- (instancetype)initWithLocalSubrs:(CFFSubrsIndex *)localSubrs globalSubrs:(CFFGlobalSubrsIndex *)globalSubrs privateDict:(CFFPrivateDict *)privateDict;

- (void)reset;

- (id)performOperator:(int)op pos:(NSUInteger *)pos NS_RETURNS_RETAINED;

- (void)execute:(PST2CharString *)charstring;

- (id)pop;

- (NSMutableArray *)popall;

- (void)push:(id)value;

@end
