Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c080014c15
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 52 lines (32 sloc) 1.014 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
//
// JSTScanner.h
// jstalk
//
// Created by August Mueller on 1/16/09.
// Copyright 2009 Flying Meat Inc. All rights reserved.
//

#import <Cocoa/Cocoa.h>


@interface JSTScanner : NSObject {
    NSString *_jsString;
    unichar *_uString;
    NSRange _currentRange;
    NSUInteger _stringLength;
    unichar _breakChar;
    BOOL _tokenIsBreakChar;
    
    // state stuff.
    BOOL _inComment;
    BOOL _inQuote;
    BOOL _inJSTalk;
    
    
    NSMutableArray *_frames;
    
}

@property (retain) NSString *jsString;
@property (retain) NSMutableArray *frames;

+ (JSTScanner*) scannerWithString:(NSString*)s;

- (void) scan;
- (NSString*) nextToken;

@end




#define isBreakChar(c) ((c == ' ') || (c == '\r') || (c == '\n') || (c == '\t') ||\
(c == '\"') || (c == '\'') || (c == '(') || (c == ')') ||\
(c == '{') || (c == '}') || (c == '/') || (c == '*') ||\
(c == '\\')\
)




Something went wrong with that request. Please try again.