Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 52 lines (32 sloc) 1.014 kb
ee99867 @ccgus oh geeze
authored
1 //
2 // JSTScanner.h
3 // jstalk
4 //
5 // Created by August Mueller on 1/16/09.
6 // Copyright 2009 Flying Meat Inc. All rights reserved.
7 //
8
9 #import <Cocoa/Cocoa.h>
10
11
12 @interface JSTScanner : NSObject {
13 NSString *_jsString;
14 unichar *_uString;
15 NSRange _currentRange;
16 NSUInteger _stringLength;
17 unichar _breakChar;
18 BOOL _tokenIsBreakChar;
19
20 // state stuff.
21 BOOL _inComment;
22 BOOL _inQuote;
23 BOOL _inJSTalk;
24
25
26 NSMutableArray *_frames;
27
28 }
29
30 @property (retain) NSString *jsString;
31 @property (retain) NSMutableArray *frames;
32
33 + (JSTScanner*) scannerWithString:(NSString*)s;
34
35 - (void) scan;
36 - (NSString*) nextToken;
37
38 @end
39
40
41
42
43 #define isBreakChar(c) ((c == ' ') || (c == '\r') || (c == '\n') || (c == '\t') ||\
44 (c == '\"') || (c == '\'') || (c == '(') || (c == ')') ||\
45 (c == '{') || (c == '}') || (c == '/') || (c == '*') ||\
46 (c == '\\')\
47 )
48
49
50
51
Something went wrong with that request. Please try again.