xref: /aosp_15_r20/external/antlr/runtime/ObjC/Framework/PtrStack.h (revision 16467b971bd3e2009fad32dd79016f2c7e421deb)
1*16467b97STreehugger Robot //
2*16467b97STreehugger Robot //  PtrStack.h
3*16467b97STreehugger Robot //  ANTLR
4*16467b97STreehugger Robot //
5*16467b97STreehugger Robot //  Created by Alan Condit on 6/9/10.
6*16467b97STreehugger Robot //  Copyright 2010 Alan's MachineWorks. All rights reserved.
7*16467b97STreehugger Robot //ptrBuffer
8*16467b97STreehugger Robot 
9*16467b97STreehugger Robot #import <Foundation/Foundation.h>
10*16467b97STreehugger Robot #import "ACNumber.h"
11*16467b97STreehugger Robot #import "BaseStack.h"
12*16467b97STreehugger Robot #import "RuleMemo.h"
13*16467b97STreehugger Robot 
14*16467b97STreehugger Robot //#define GLOBAL_SCOPE       0
15*16467b97STreehugger Robot //#define LOCAL_SCOPE        1
16*16467b97STreehugger Robot #define HASHSIZE         101
17*16467b97STreehugger Robot #define HBUFSIZE      0x2000
18*16467b97STreehugger Robot 
19*16467b97STreehugger Robot @interface PtrStack : BaseStack {
20*16467b97STreehugger Robot 	//PtrStack *fNext;
21*16467b97STreehugger Robot     // TStringPool *fPool;
22*16467b97STreehugger Robot }
23*16467b97STreehugger Robot 
24*16467b97STreehugger Robot //@property (copy) PtrStack *fNext;
25*16467b97STreehugger Robot //@property (copy) TStringPool *fPool;
26*16467b97STreehugger Robot 
27*16467b97STreehugger Robot // Contruction/Destruction
28*16467b97STreehugger Robot + (PtrStack *)newPtrStack;
29*16467b97STreehugger Robot + (PtrStack *)newPtrStack:(NSInteger)cnt;
30*16467b97STreehugger Robot - (id)init;
31*16467b97STreehugger Robot - (id)initWithLen:(NSInteger)aLen;
32*16467b97STreehugger Robot - (void)dealloc;
33*16467b97STreehugger Robot 
34*16467b97STreehugger Robot // Instance Methods
35*16467b97STreehugger Robot - (id) copyWithZone:(NSZone *)aZone;
36*16467b97STreehugger Robot /* clear -- reinitialize the maplist array */
37*16467b97STreehugger Robot 
38*16467b97STreehugger Robot #ifdef DONTUSENOMO
39*16467b97STreehugger Robot /* form hash value for string s */
40*16467b97STreehugger Robot - (NSInteger)hash:(NSString *)s;
41*16467b97STreehugger Robot /*   look for s in ptrBuffer  */
42*16467b97STreehugger Robot - (id)lookup:(NSString *)s;
43*16467b97STreehugger Robot /* look for s in ptrBuffer  */
44*16467b97STreehugger Robot - (id)install:(id)sym;
45*16467b97STreehugger Robot #endif
46*16467b97STreehugger Robot 
47*16467b97STreehugger Robot #ifdef DONTUSENOMO
48*16467b97STreehugger Robot - (id)getTType:(NSString *)name;
49*16467b97STreehugger Robot - (id)getName:(NSInteger)ttype;
50*16467b97STreehugger Robot #endif
51*16467b97STreehugger Robot 
52*16467b97STreehugger Robot @end
53