~ubuntu-branches/ubuntu/wily/oolite/wily-proposed

« back to all changes in this revision

Viewing changes to tools/ScriptConverter/OOLegacyScriptToJavaScriptConverter.h

  • Committer: Package Import Robot
  • Author(s): Nicolas Boulenguez
  • Date: 2011-12-22 00:22:39 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20111222002239-pr3upeupp4jw1psp
Tags: 1.76-1
* New upstream.
* watch: scan upstream stable releases instead of dev snapshots.
* control: use default gobjc instead of explicit 4.6.
* rules: use dpkg-dev build flags.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
//  OOLegacyScriptToJavaScriptConverter.h
 
3
//  ScriptConverter
 
4
//
 
5
//  Created by Jens Ayton on 2007-11-24.
 
6
//  Copyright 2007 Jens Ayton. All rights reserved.
 
7
//
 
8
 
 
9
#import "OOCocoa.h"
 
10
#import "OOProblemReportManager.h"
 
11
 
 
12
 
 
13
extern NSString * const kOOScriptMetadataKeyName;
 
14
extern NSString * const kOOScriptMetadataKeyAuthor;
 
15
extern NSString * const kOOScriptMetadataKeyCopyright;
 
16
extern NSString * const kOOScriptMetadataKeyDescription;
 
17
extern NSString * const kOOScriptMetadataKeyVersion;
 
18
extern NSString * const kOOScriptMetadataKeyLicense;
 
19
 
 
20
 
 
21
@interface OOLegacyScriptToJavaScriptConverter: NSObject
 
22
{
 
23
        NSDictionary                            *_metadata;
 
24
        id <OOProblemReportManager>     _problemReporter;
 
25
        unsigned                                        _indent;
 
26
        NSMutableString                         *_result;
 
27
        NSMutableDictionary                     *_legalizedVariableNames;
 
28
        NSMutableSet                            *_usedLocalVariableNames;
 
29
        OOUInteger                                      _lastVariableUniqueTag;
 
30
        NSMutableDictionary                     *_initializers;
 
31
        NSMutableDictionary                     *_helperFunctions;
 
32
        OOUInteger                                      _initializerLocation;
 
33
        BOOL                                            _EOL;
 
34
        BOOL                                            _secondaryIndent;
 
35
        BOOL                                            _validConversion;
 
36
}
 
37
 
 
38
+ (NSString *) convertScript:(NSArray *)scriptActions
 
39
                                        metadata:(NSDictionary *)metadata
 
40
                         problemReporter:(id <OOProblemReportManager>)problemReporter;
 
41
 
 
42
+ (NSDictionary *) convertMultipleScripts:(NSDictionary *)scripts
 
43
                                                                 metadata:(NSDictionary *)metadata
 
44
                                                  problemReporter:(id <OOProblemReportManager>)problemReporter;
 
45
 
 
46
@end
 
47
 
 
48
 
 
49
@interface NSString (OOScriptConverterUtilities)
 
50
 
 
51
// Add escape codes for string so that it's a valid JavaScript literal (if you put "" or '' around it).
 
52
- (NSString *)escapedForJavaScriptLiteral;
 
53
 
 
54
// Remove occurances of */
 
55
- (NSString *)escapedForJavaScriptBlockComment;
 
56
 
 
57
@end
 
58
 
 
59
 
 
60
BOOL OOScriptConverterIsNumberLiteral(NSString *string);