1// $ANTLR ${project.version} ${buildNumber} T.g 2011-05-06 19:14:23 2 3/* ============================================================================= 4 * Standard antlr3 OBJC runtime definitions 5 */ 6#import <Cocoa/Cocoa.h> 7#import <ANTLR/ANTLR.h> 8/* End of standard antlr3 runtime definitions 9 * ============================================================================= 10 */ 11 12/* parserHeaderFile */ 13#ifndef ANTLR3TokenTypeAlreadyDefined 14#define ANTLR3TokenTypeAlreadyDefined 15typedef enum { 16 ANTLR_EOF = -1, 17 INVALID, 18 EOR, 19 DOWN, 20 UP, 21 MIN 22} ANTLR3TokenType; 23#endif 24 25#pragma mark Tokens 26#ifdef EOF 27#undef EOF 28#endif 29#define EOF -1 30#define T__7 7 31#define ID 4 32#define INT 5 33#define WS 6 34#pragma mark Dynamic Global Scopes 35#pragma mark Dynamic Rule Scopes 36#pragma mark Rule Return Scopes start 37 38/* Interface grammar class */ 39@interface TParser : ANTLRParser { /* line 572 */ 40/* ObjC start of ruleAttributeScopeMemVar */ 41 42 43/* ObjC end of ruleAttributeScopeMemVar */ 44/* ObjC start of globalAttributeScopeMemVar */ 45 46 47/* ObjC end of globalAttributeScopeMemVar */ 48/* ObjC start of actions.(actionScope).memVars */ 49 50/* With this true, enum is seen as a keyword. False, it's an identifier */ 51BOOL enableEnum; 52 53/* ObjC end of actions.(actionScope).memVars */ 54/* ObjC start of memVars */ 55/* ObjC end of memVars */ 56 57 } 58 59/* ObjC start of actions.(actionScope).properties */ 60/* ObjC end of actions.(actionScope).properties */ 61/* ObjC start of properties */ 62/* ObjC end of properties */ 63 64+ (void) initialize; 65+ (id) newTParser:(id<ANTLRTokenStream>)aStream; 66/* ObjC start of actions.(actionScope).methodsDecl */ 67/* ObjC end of actions.(actionScope).methodsDecl */ 68 69/* ObjC start of methodsDecl */ 70/* ObjC end of methodsDecl */ 71 72- (void)stat; 73- (void)identifier; 74- (void)enumAsKeyword; 75- (void)enumAsID; 76 77 78@end /* end of TParser interface */ 79 80/** Demonstrates how semantic predicates get hoisted out of the rule in 81 * which they are found and used in other decisions. This grammar illustrates 82 * how predicates can be used to distinguish between enum as a keyword and 83 * an ID *dynamically*. :) 84 85 * Run "java org.antlr.Tool -dfa t.g" to generate DOT (graphviz) files. See 86 * the T_dec-1.dot file to see the predicates in action. 87 */