Browse files

building cleanly

  • Loading branch information...
1 parent af67ab0 commit bf4a2bf95f7762de59b92f50df68f1f2435ce690 @itod committed Aug 31, 2012
View
13 .gitignore
@@ -25,4 +25,17 @@ build/
#SVN
.svn/
+.svn/*
+*.svn-base
+
+include/.svn/all-wcprops
+
+include/.svn/entries
+
+include/ParseKit/.svn/all-wcprops
+
+include/ParseKit/.svn/entries
+
+*.svn-base
+
*.svn-base
View
6 ParseKit.xcodeproj/project.pbxproj
@@ -1321,6 +1321,7 @@
isa = PBXGroup;
children = (
D34BAD630FF9C6AE00D7773A /* ParseKit_Prefix.pch */,
+ D3FDC8DB0FFC51F200F1F797 /* ParseKitMobile_Prefix.pch */,
D3C221900FFE8B8C004514FE /* ParseKit.h */,
D3C221910FFE8B8C004514FE /* PKTypes.h */,
D3C7D8710A411F6B005DD154 /* io */,
@@ -1750,7 +1751,6 @@
D380BA950F0F1C450009EC13 /* JSParseKit Framework */ = {
isa = PBXGroup;
children = (
- D3FDC8DB0FFC51F200F1F797 /* ParseKitMobile_Prefix.pch */,
D34BB04E0FF9EC4E00D7773A /* JSParseKit-Info.plist */,
D34BB0660FF9EDDF00D7773A /* JSParseKit.h */,
D34BB0670FF9EDDF00D7773A /* JSParseKit.m */,
@@ -3541,7 +3541,7 @@
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
+ GCC_PREFIX_HEADER = ParseKit_Prefix.pch;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "JSParseKit-Info.plist";
INSTALL_PATH = "$(HOME)/Library/Frameworks";
@@ -3569,7 +3569,7 @@
GCC_ENABLE_OBJC_GC = supported;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
+ GCC_PREFIX_HEADER = ParseKit_Prefix.pch;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "JSParseKit-Info.plist";
INSTALL_PATH = "$(HOME)/Library/Frameworks";
View
6 ParseKitMobile_Prefix.pch
@@ -4,4 +4,8 @@
#import <CoreGraphics/CoreGraphics.h>
#endif
-#define PLATFORM(TWITTER_STATE) 0
+//#define PLATFORM(PK_FEATURE) (defined PK_PLATFORM_##PK_FEATURE && PK_PLATFORM_##PK_FEATURE)
+
+#define PK_PLATFORM_EMAIL_STATE 0
+#define PK_PLATFORM_TWITTER_STATE 0
+
View
3 ParseKit_Prefix.pch
@@ -6,7 +6,8 @@
#import <Foundation/Foundation.h>
#endif
-#define PLATFORM(PK_FEATURE) (defined PK_PLATFORM_##PK_FEATURE && PK_PLATFORM_##PK_FEATURE)
+//#define PLATFORM(PK_FEATURE) (defined PK_PLATFORM_##PK_FEATURE && PK_PLATFORM_##PK_FEATURE)
#define PK_PLATFORM_EMAIL_STATE 0
#define PK_PLATFORM_TWITTER_STATE 0
+
View
23 include/ParseKit/.svn/text-base/PKHashtagState.h.svn-base
@@ -1,23 +0,0 @@
-//
-// PKHashtagState.h
-// ParseKit
-//
-// Created by Todd Ditchendorf on 10/22/11.
-// Copyright 2011 Todd Ditchendorf. All rights reserved.
-//
-
-#if PLATFORM(TWITTER_STATE)
-#import <Foundation/Foundation.h>
-#import <ParseKit/PKTokenizerState.h>
-
-/*!
- @class PKHashtagState
- @brief A hashtag state returns a hashtag from a reader.
- @details
- */
-@interface PKHashtagState : PKTokenizerState {
-
-}
-
-@end
-#endif
View
217 include/ParseKit/.svn/text-base/PKToken.h.svn-base
@@ -1,217 +0,0 @@
-// Copyright 2010 Todd Ditchendorf
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#import <Foundation/Foundation.h>
-#import <ParseKit/PKTypes.h>
-
-/*!
- @typedef enum PKTokenType
- @brief Indicates the type of a <tt>PKToken</tt>
- @var PKTokenTypeEOF A constant indicating that the endo fo the stream has been read.
- @var PKTokenTypeNumber A constant indicating that a token is a number, like <tt>3.14</tt>.
- @var PKTokenTypeQuotedString A constant indicating that a token is a quoted string, like <tt>"Launch Mi"</tt>.
- @var PKTokenTypeSymbol A constant indicating that a token is a symbol, like <tt>"&lt;="</tt>.
- @var PKTokenTypeWord A constant indicating that a token is a word, like <tt>cat</tt>.
- @var PKTokenTypeWhitespace A constant indicating that a token is whitespace, like <tt>\t</tt>.
- @var PKTokenTypeComment A constant indicating that a token is a comment, like <tt>// this is a hack</tt>.
- @var PKTokenTypeDelimtedString A constant indicating that a token is a delimitedString, like <tt><#foo></tt>.
-*/
-typedef enum {
- PKTokenTypeEOF,
- PKTokenTypeNumber,
- PKTokenTypeQuotedString,
- PKTokenTypeSymbol,
- PKTokenTypeWord,
- PKTokenTypeWhitespace,
- PKTokenTypeComment,
- PKTokenTypeDelimitedString,
- PKTokenTypeAny,
- PKTokenTypeURL,
- PKTokenTypeEmail,
-#if PLATFORM(TWITTER_STATE)
- PKTokenTypeTwitter,
- PKTokenTypeHashtag,
-#endif
-} PKTokenType;
-
-/*!
- @class PKToken
- @brief A token represents a logical chunk of a string.
- @details For example, a typical tokenizer would break the string <tt>"1.23 &lt;= 12.3"</tt> into three tokens: the number <tt>1.23</tt>, a less-than-or-equal symbol, and the number <tt>12.3</tt>. A token is a receptacle, and relies on a tokenizer to decide precisely how to divide a string into tokens.
-*/
-@interface PKToken : NSObject <NSCopying> {
- PKFloat floatValue;
- NSString *stringValue;
- PKTokenType tokenType;
-
- BOOL number;
- BOOL quotedString;
- BOOL symbol;
- BOOL word;
- BOOL whitespace;
- BOOL comment;
- BOOL delimitedString;
- BOOL URL;
- BOOL email;
-#if PLATFORM(TWITTER_STATE)
- BOOL twitter;
- BOOL hashtag;
-#endif
-
- id value;
- NSUInteger offset;
-}
-
-/*!
- @brief Factory method for creating a singleton <tt>PKToken</tt> used to indicate that there are no more tokens.
- @result A singleton used to indicate that there are no more tokens.
-*/
-+ (PKToken *)EOFToken;
-
-/*!
- @brief Factory convenience method for creating an autoreleased token.
- @param t the type of this token.
- @param s the string value of this token.
- @param n the number falue of this token.
- @result an autoreleased initialized token.
-*/
-+ (PKToken *)tokenWithTokenType:(PKTokenType)t stringValue:(NSString *)s floatValue:(PKFloat)n;
-
-/*!
- @brief Designated initializer. Constructs a token of the indicated type and associated string or numeric values.
- @param t the type of this token.
- @param s the string value of this token.
- @param n the number falue of this token.
- @result an autoreleased initialized token.
-*/
-- (id)initWithTokenType:(PKTokenType)t stringValue:(NSString *)s floatValue:(PKFloat)n;
-
-/*!
- @brief Returns true if the supplied object is an equivalent <tt>PKToken</tt>, ignoring differences in case.
- @param obj the object to compare this token to.
- @result true if <tt>obj</tt> is an equivalent <tt>PKToken</tt>, ignoring differences in case.
-*/
-- (BOOL)isEqualIgnoringCase:(id)obj;
-
-/*!
- @brief Returns more descriptive textual representation than <tt>-description</tt> which may be useful for debugging puposes only.
- @details Usually of format similar to: <tt>&lt;QuotedString "Launch Mi"></tt>, <tt>&lt;Word cat></tt>, or <tt>&lt;Number 3.14></tt>
- @result A textual representation including more descriptive information than <tt>-description</tt>.
-*/
-- (NSString *)debugDescription;
-
-/*!
- @property number
- @brief True if this token is a number. getter=isNumber
-*/
-@property (nonatomic, readonly, getter=isNumber) BOOL number;
-
-/*!
- @property quotedString
- @brief True if this token is a quoted string. getter=isQuotedString
-*/
-@property (nonatomic, readonly, getter=isQuotedString) BOOL quotedString;
-
-/*!
- @property symbol
- @brief True if this token is a symbol. getter=isSymbol
-*/
-@property (nonatomic, readonly, getter=isSymbol) BOOL symbol;
-
-/*!
- @property word
- @brief True if this token is a word. getter=isWord
-*/
-@property (nonatomic, readonly, getter=isWord) BOOL word;
-
-/*!
- @property whitespace
- @brief True if this token is whitespace. getter=isWhitespace
-*/
-@property (nonatomic, readonly, getter=isWhitespace) BOOL whitespace;
-
-/*!
- @property comment
- @brief True if this token is a comment. getter=isComment
-*/
-@property (nonatomic, readonly, getter=isComment) BOOL comment;
-
-/*!
- @property delimitedString
- @brief True if this token is a delimited string. getter=isDelimitedString
-*/
-@property (nonatomic, readonly, getter=isDelimitedString) BOOL delimitedString;
-
-/*!
- @property URL
- @brief True if this token is a URL. getter=isURL
-*/
-@property (nonatomic, readonly, getter=isURL) BOOL URL;
-
-/*!
- @property email
- @brief True if this token is an email address. getter=isEmail
-*/
-@property (nonatomic, readonly, getter=isEmail) BOOL email;
-
-#if PLATFORM(TWITTER_STATE)
-/*!
- @property twitter
- @brief True if this token is an twitter handle. getter=isTwitter
-*/
-@property (nonatomic, readonly, getter=isTwitter) BOOL twitter;
-
-/*!
- @property hashtaag
- @brief True if this token is an twitter hashtag. getter=isHashtag
-*/
-@property (nonatomic, readonly, getter=isHashtag) BOOL hashtag;
-#endif
-
-/*!
- @property tokenType
- @brief The type of this token.
-*/
-@property (nonatomic, readonly) PKTokenType tokenType;
-
-/*!
- @property floatValue
- @brief The numeric value of this token.
-*/
-@property (nonatomic, readonly) PKFloat floatValue;
-
-/*!
- @property stringValue
- @brief The string value of this token.
-*/
-@property (nonatomic, readonly, copy) NSString *stringValue;
-
-/*!
- @property stringValue
- @brief If a QuotedString, the string value of this token minus the quotes. Otherwise the stringValue.
- */
-@property (nonatomic, readonly, copy) NSString *quotedStringValue;
-
-/*!
- @property value
- @brief Returns an object that represents the value of this token.
-*/
-@property (nonatomic, readonly, copy) id value;
-
-/*!
- @property offset
- @brief The character offset of this token in the original source string.
-*/
-@property (nonatomic, readonly) NSUInteger offset;
-@end
View
181 include/ParseKit/.svn/text-base/PKTokenizer.h.svn-base
@@ -1,181 +0,0 @@
-// Copyright 2010 Todd Ditchendorf
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#import <Foundation/Foundation.h>
-#import <ParseKit/PKTypes.h>
-
-@class PKToken;
-@class PKTokenizerState;
-@class PKNumberState;
-@class PKQuoteState;
-@class PKCommentState;
-@class PKSymbolState;
-@class PKWhitespaceState;
-@class PKWordState;
-@class PKDelimitState;
-@class PKURLState;
-#if PLATFORM(EMAIL_STATE)
-@class PKEmailState;
-#endif
-#if PLATFORM(TWITTER_STATE)
-@class PKTwitterState;
-@class PKHashtagState;
-#endif
-@class PKReader;
-
-/*!
- @class PKTokenizer
- @brief A tokenizer divides a string into tokens.
- @details <p>This class is highly customizable with regard to exactly how this division occurs, but it also has defaults that are suitable for many languages. This class assumes that the character values read from the string lie in the range <tt>0-MAXINT</tt>. For example, the Unicode value of a capital A is 65, so <tt>NSLog(@"%C", (unichar)65);</tt> prints out a capital A.</p>
- <p>The behavior of a tokenizer depends on its character state table. This table is an array of 256 <tt>PKTokenizerState</tt> states. The state table decides which state to enter upon reading a character from the input string.</p>
- <p>For example, by default, upon reading an 'A', a tokenizer will enter a "word" state. This means the tokenizer will ask a <tt>PKWordState</tt> object to consume the 'A', along with the characters after the 'A' that form a word. The state's responsibility is to consume characters and return a complete token.</p>
- <p>The default table sets a <tt>PKSymbolState</tt> for every character from 0 to 255, and then overrides this with:</p>
-@code
- From To State
- 0 ' ' whitespaceState
- 'a' 'z' URLState
- 'A' 'Z' URLState
- 160 255 wordState
- '0' '9' numberState
- '-' '-' numberState
- '.' '.' numberState
- '@' '@' twitterState
- '#' '#' hashtagState
- '"' '"' quoteState
- '\'' '\'' quoteState
- '/' '/' commentState
-@endcode
- <p>In addition to allowing modification of the state table, this class makes each of the states above available. Some of these states are customizable. For example, wordState allows customization of what characters can be part of a word, after the first character.</p>
-*/
-@interface PKTokenizer : NSObject {
- NSString *string;
- PKReader *reader;
-
- NSMutableArray *tokenizerStates;
-
- PKNumberState *numberState;
- PKQuoteState *quoteState;
- PKCommentState *commentState;
- PKSymbolState *symbolState;
- PKWhitespaceState *whitespaceState;
- PKWordState *wordState;
- PKDelimitState *delimitState;
- PKURLState *URLState;
-#if PLATFORM(EMAIL_STATE)
- PKEmailState *emailState;
-#endif
-#if PLATFORM(TWITTER_STATE)
- PKTwitterState *twitterState;
- PKHashtagState *hashtagState;
-#endif
-}
-
-/*!
- @brief Convenience factory method. Sets string from which to to read to <tt>nil</tt>.
- @result An initialized tokenizer.
-*/
-+ (PKTokenizer *)tokenizer;
-
-/*!
- @brief Convenience factory method.
- @param s string to read from.
- @result An autoreleased initialized tokenizer.
-*/
-+ (PKTokenizer *)tokenizerWithString:(NSString *)s;
-
-/*!
- @brief Designated Initializer. Constructs a tokenizer to read from the supplied string.
- @param s string to read from.
- @result An initialized tokenizer.
-*/
-- (id)initWithString:(NSString *)s;
-
-/*!
- @brief Returns the next token.
- @result the next token.
-*/
-- (PKToken *)nextToken;
-
-/*!
- @brief Enumerate tokens in this tokenizer using block
- @details repeatedly executes block by passing the token returned from calling <tt>-nextToken</tt> on this tokenizer
- @param block the code to execute with every token returned by calling <tt>-nextToken</tt> on this tokenizer
-*/
-- (void)enumerateTokensUsingBlock:(void (^)(PKToken *tok, BOOL *stop))block;
-
-/*!
- @brief Change the state the tokenizer will enter upon reading any character between "start" and "end".
- @param state the state for this character range
- @param start the "start" character. e.g. <tt>'a'</tt> or <tt>65</tt>.
- @param end the "end" character. <tt>'z'</tt> or <tt>90</tt>.
-*/
-- (void)setTokenizerState:(PKTokenizerState *)state from:(PKUniChar)start to:(PKUniChar)end;
-
-/*!
- @property string
- @brief The string to read from.
-*/
-@property (nonatomic, retain) NSString *string;
-
-/*!
- @property numberState
- @brief The state this tokenizer uses to build numbers.
-*/
-@property (nonatomic, retain) PKNumberState *numberState;
-
-/*!
- @property quoteState
- @brief The state this tokenizer uses to build quoted strings.
-*/
-@property (nonatomic, retain) PKQuoteState *quoteState;
-
-/*!
- @property commentState
- @brief The state this tokenizer uses to recognize (and possibly ignore) comments.
-*/
-@property (nonatomic, retain) PKCommentState *commentState;
-
-/*!
- @property symbolState
- @brief The state this tokenizer uses to recognize symbols.
-*/
-@property (nonatomic, retain) PKSymbolState *symbolState;
-
-/*!
- @property whitespaceState
- @brief The state this tokenizer uses to recognize (and possibly ignore) whitespace.
-*/
-@property (nonatomic, retain) PKWhitespaceState *whitespaceState;
-
-/*!
- @property wordState
- @brief The state this tokenizer uses to build words.
-*/
-@property (nonatomic, retain) PKWordState *wordState;
-
-/*!
- @property delimitState
- @brief The state this tokenizer uses to build delimited strings.
-*/
-@property (nonatomic, retain) PKDelimitState *delimitState;
-
-@property (nonatomic, retain) PKURLState *URLState;
-#if PLATFORM(EMAIL_STATE)
-@property (nonatomic, retain) PKEmailState *emailState;
-#endif
-#if PLATFORM(TWITTER_STATE)
-@property (nonatomic, retain) PKTwitterState *twitterState;
-@property (nonatomic, retain) PKHashtagState *hashtagState;
-#endif
-@end
View
23 include/ParseKit/.svn/text-base/PKTwitterState.h.svn-base
@@ -1,23 +0,0 @@
-//
-// PKTwitterState.h
-// ParseKit
-//
-// Created by Todd Ditchendorf on 4/1/10.
-// Copyright 2010 Todd Ditchendorf. All rights reserved.
-//
-
-#if PLATFORM(TWITTER_STATE)
-#import <Foundation/Foundation.h>
-#import <ParseKit/PKTokenizerState.h>
-
-/*!
- @class PKTwitterState
- @brief A twitter state returns a twitter handle from a reader.
- @details
-*/
-@interface PKTwitterState : PKTokenizerState {
-
-}
-
-@end
-#endif
View
94 include/ParseKit/.svn/text-base/ParseKit.h.svn-base
@@ -1,94 +0,0 @@
-// Copyright 2010 Todd Ditchendorf
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-/*!
- @mainpage ParseKit
- ParseKit is a Mac OS X Framework written by Todd Ditchendorf in Objective-C 2.0 and released under the MIT Open Source License.
- The framework is an Objective-C implementation of the tools described in <a href="http://www.amazon.com/Building-Parsers-Java-Steven-Metsker/dp/0201719622" title="Amazon.com: Building Parsers With Java(TM): Steven John Metsker: Books">"Building Parsers with Java" by Steven John Metsker</a>.
- ParseKit includes some significant additions beyond the designs from the book (many of them hinted at in the book itself) in order to enhance the framework's feature set, usefulness and ease-of-use. Other changes have been made to the designs in the book to match common Cocoa/Objective-C design patterns and conventions.
- However, these changes are relatively superficial, and Metsker's book is the best documentation available for this framework.
-
- Classes in the ParseKit Framework offer 2 basic services of general use to Cocoa developers:
- @li Tokenization via a tokenizer class
- @li Parsing via a high-level parser-building toolkit
- Learn more on the <a target="_top" href="http://parsekit.com">project site</a>
-*/
-
-#import <Foundation/Foundation.h>
-
-// io
-#import <ParseKit/PKTypes.h>
-#import <ParseKit/PKReader.h>
-
-// parse
-#import <ParseKit/PKParser.h>
-#import <ParseKit/PKAssembly.h>
-#import <ParseKit/PKSequence.h>
-#import <ParseKit/PKDifference.h>
-#import <ParseKit/PKNegation.h>
-#import <ParseKit/PKIntersection.h>
-#import <ParseKit/PKCollectionParser.h>
-#import <ParseKit/PKAlternation.h>
-#import <ParseKit/PKRepetition.h>
-#import <ParseKit/PKEmpty.h>
-#import <ParseKit/PKTerminal.h>
-#import <ParseKit/PKTrack.h>
-#import <ParseKit/PKTrackException.h>
-
-//chars
-#import <ParseKit/PKCharacterAssembly.h>
-#import <ParseKit/PKChar.h>
-#import <ParseKit/PKSpecificChar.h>
-#import <ParseKit/PKLetter.h>
-#import <ParseKit/PKDigit.h>
-
-// tokens
-#import <ParseKit/PKToken.h>
-#import <ParseKit/PKTokenizer.h>
-#import <ParseKit/PKTokenArraySource.h>
-#import <ParseKit/PKTokenAssembly.h>
-#import <ParseKit/PKTokenizerState.h>
-#import <ParseKit/PKNumberState.h>
-#import <ParseKit/PKQuoteState.h>
-#import <ParseKit/PKDelimitState.h>
-#import <ParseKit/PKURLState.h>
-#import <ParseKit/PKEmailState.h>
-#if PLATFORM(TWITTER_STATE)
-#import <ParseKit/PKTwitterState.h>
-#import <ParseKit/PKHashtagState.h>
-#endif
-#import <ParseKit/PKCommentState.h>
-#import <ParseKit/PKSingleLineCommentState.h>
-#import <ParseKit/PKMultiLineCommentState.h>
-#import <ParseKit/PKSymbolNode.h>
-#import <ParseKit/PKSymbolRootNode.h>
-#import <ParseKit/PKSymbolState.h>
-#import <ParseKit/PKWordState.h>
-#import <ParseKit/PKWhitespaceState.h>
-#import <ParseKit/PKWord.h>
-#import <ParseKit/PKUppercaseWord.h>
-#import <ParseKit/PKLowercaseWord.h>
-#import <ParseKit/PKNumber.h>
-#import <ParseKit/PKQuotedString.h>
-#import <ParseKit/PKWhitespace.h>
-#import <ParseKit/PKDelimitedString.h>
-#import <ParseKit/PKSymbol.h>
-#import <ParseKit/PKComment.h>
-#import <ParseKit/PKLiteral.h>
-#import <ParseKit/PKCaseInsensitiveLiteral.h>
-#import <ParseKit/PKAny.h>
-#import <ParseKit/PKPattern.h>
-
-// grammar
-#import <ParseKit/PKParserFactory.h>
View
2 include/ParseKit/PKHashtagState.h
@@ -6,7 +6,7 @@
// Copyright 2011 Todd Ditchendorf. All rights reserved.
//
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
#import <Foundation/Foundation.h>
#import <ParseKit/PKTokenizerState.h>
View
6 include/ParseKit/PKToken.h
@@ -39,7 +39,7 @@ typedef enum {
PKTokenTypeAny,
PKTokenTypeURL,
PKTokenTypeEmail,
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
PKTokenTypeTwitter,
PKTokenTypeHashtag,
#endif
@@ -64,7 +64,7 @@ typedef enum {
BOOL delimitedString;
BOOL URL;
BOOL email;
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
BOOL twitter;
BOOL hashtag;
#endif
@@ -165,7 +165,7 @@ typedef enum {
*/
@property (nonatomic, readonly, getter=isEmail) BOOL email;
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
/*!
@property twitter
@brief True if this token is an twitter handle. getter=isTwitter
View
12 include/ParseKit/PKTokenizer.h
@@ -25,10 +25,10 @@
@class PKWordState;
@class PKDelimitState;
@class PKURLState;
-#if PLATFORM(EMAIL_STATE)
+#if PK_PLATFORM_EMAIL_STATE
@class PKEmailState;
#endif
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
@class PKTwitterState;
@class PKHashtagState;
#endif
@@ -72,10 +72,10 @@
PKWordState *wordState;
PKDelimitState *delimitState;
PKURLState *URLState;
-#if PLATFORM(EMAIL_STATE)
+#if PK_PLATFORM_EMAIL_STATE
PKEmailState *emailState;
#endif
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
PKTwitterState *twitterState;
PKHashtagState *hashtagState;
#endif
@@ -171,10 +171,10 @@
@property (nonatomic, retain) PKDelimitState *delimitState;
@property (nonatomic, retain) PKURLState *URLState;
-#if PLATFORM(EMAIL_STATE)
+#if PK_PLATFORM_EMAIL_STATE
@property (nonatomic, retain) PKEmailState *emailState;
#endif
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
@property (nonatomic, retain) PKTwitterState *twitterState;
@property (nonatomic, retain) PKHashtagState *hashtagState;
#endif
View
2 include/ParseKit/PKTwitterState.h
@@ -6,7 +6,7 @@
// Copyright 2010 Todd Ditchendorf. All rights reserved.
//
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
#import <Foundation/Foundation.h>
#import <ParseKit/PKTokenizerState.h>
View
2 include/ParseKit/ParseKit.h
@@ -64,7 +64,7 @@
#import <ParseKit/PKDelimitState.h>
#import <ParseKit/PKURLState.h>
#import <ParseKit/PKEmailState.h>
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
#import <ParseKit/PKTwitterState.h>
#import <ParseKit/PKHashtagState.h>
#endif
View
2 src/PKHashtagState.m
@@ -6,7 +6,7 @@
// Copyright 2011 Todd Ditchendorf. All rights reserved.
//
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
#import <ParseKit/PKHashtagState.h>
#import <ParseKit/PKReader.h>
#import <ParseKit/PKTokenizer.h>
View
8 src/PKToken.m
@@ -62,7 +62,7 @@ - (BOOL)isEqual:(id)obj ignoringCase:(BOOL)ignoringCase;
@property (nonatomic, readwrite, getter=isDelimitedString) BOOL delimitedString;
@property (nonatomic, readwrite, getter=isURL) BOOL URL;
@property (nonatomic, readwrite, getter=isEmail) BOOL email;
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
@property (nonatomic, readwrite, getter=isTwitter) BOOL twitter;
@property (nonatomic, readwrite, getter=isHashtag) BOOL hashtag;
#endif
@@ -104,7 +104,7 @@ - (id)initWithTokenType:(PKTokenType)t stringValue:(NSString *)s floatValue:(PKF
self.delimitedString = (PKTokenTypeDelimitedString == t);
self.URL = (PKTokenTypeURL == t);
self.email = (PKTokenTypeEmail == t);
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
self.twitter = (PKTokenTypeTwitter == t);
self.hashtag = (PKTokenTypeHashtag == t);
#endif
@@ -201,7 +201,7 @@ - (NSString *)debugDescription {
typeString = @"URL";
} else if (self.isEmail) {
typeString = @"Email";
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
} else if (self.isTwitter) {
typeString = @"Twitter";
} else if (self.isHashtag) {
@@ -225,7 +225,7 @@ - (NSString *)description {
@synthesize delimitedString;
@synthesize URL;
@synthesize email;
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
@synthesize twitter;
@synthesize hashtag;
#endif
View
18 src/PKTokenizer.m
@@ -58,19 +58,19 @@ - (id)initWithString:(NSString *)s {
self.wordState = [[[PKWordState alloc] init] autorelease];
self.delimitState = [[[PKDelimitState alloc] init] autorelease];
self.URLState = [[[PKURLState alloc] init] autorelease];
-#if PLATFORM(EMAIL_STATE)
+#if PK_PLATFORM_EMAIL_STATE
self.emailState = [[[PKEmailState alloc] init] autorelease];
#endif
numberState.fallbackState = symbolState;
quoteState.fallbackState = symbolState;
-#if PLATFORM(EMAIL_STATE)
+#if PK_PLATFORM_EMAIL_STATE
URLState.fallbackState = emailState;
emailState.fallbackState = wordState;
#else
URLState.fallbackState = wordState;
#endif
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
self.twitterState = [[[PKTwitterState alloc] init] autorelease];
twitterState.fallbackState = symbolState;
@@ -124,10 +124,10 @@ - (void)dealloc {
self.wordState = nil;
self.delimitState = nil;
self.URLState = nil;
-#if PLATFORM(EMAIL_STATE)
+#if PK_PLATFORM_EMAIL_STATE
self.emailState = nil;
#endif
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
self.twitterState = nil;
self.hashtagState = nil;
#endif
@@ -217,7 +217,7 @@ - (PKTokenizerState *)defaultTokenizerStateFor:(PKUniChar)c {
} else if (c == '"') { // From: 34 to: 34 From:0x22 to:0x22
return quoteState;
} else if (c == '#') { // From: 35 to: 35 From:0x23 to:0x23
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
return hashtagState;
#else
return symbolState;
@@ -243,7 +243,7 @@ - (PKTokenizerState *)defaultTokenizerStateFor:(PKUniChar)c {
} else if (c >= 58 && c <= 63) {
return symbolState;
} else if (c == '@') { // From: 64 to: 64 From:0x40 to:0x40
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
return twitterState;
#else
return symbolState;
@@ -287,10 +287,10 @@ - (PKTokenizerState *)defaultTokenizerStateFor:(PKUniChar)c {
@synthesize wordState;
@synthesize delimitState;
@synthesize URLState;
-#if PLATFORM(EMAIL_STATE)
+#if PK_PLATFORM_EMAIL_STATE
@synthesize emailState;
#endif
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
@synthesize twitterState;
@synthesize hashtagState;
#endif
View
2 src/PKTwitterState.m
@@ -6,7 +6,7 @@
// Copyright 2010 Todd Ditchendorf. All rights reserved.
//
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
#import <ParseKit/PKTwitterState.h>
#import <ParseKit/PKReader.h>
#import <ParseKit/PKTokenizer.h>
View
6 test/SRGSParserTest.m
@@ -21,7 +21,7 @@ - (void)setUp {
}
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
#else
- (void)test {
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"example1" ofType:@"srgs"];
@@ -40,7 +40,7 @@ - (void)testSelfIdentHeader {
a = [p assemblyWithString:s];
result = [p.selfIdentHeader bestMatchFor:a];
TDNotNil(result);
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
TDEqualObjects(@"[#ABNF, 1.0, ;]#ABNF/1.0/;^", [result description]);
#else
TDEqualObjects(@"[#, ABNF, 1.0, ;]#/ABNF/1.0/;^", [result description]);
@@ -50,7 +50,7 @@ - (void)testSelfIdentHeader {
a = [p assemblyWithString:s];
result = [p.selfIdentHeader bestMatchFor:a];
TDNotNil(result);
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
TDEqualObjects(@"[#ABNF, 1.0, UTF, ;]#ABNF/1.0/UTF/;^", [result description]);
#else
TDEqualObjects(@"[#, ABNF, 1.0, UTF, ;]#/ABNF/1.0/UTF/;^", [result description]);
View
4 test/TDDelimitStateTest.m
@@ -246,7 +246,7 @@ - (void)testLtHashFooGtWithFAllowed {
TDEquals(tok.floatValue, (double)0.0);
tok = [t nextToken];
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
TDTrue(tok.isHashtag);
TDEqualObjects(tok.stringValue, @"#foo");
TDEquals(tok.floatValue, (double)0.0);
@@ -354,7 +354,7 @@ - (void)testLtHashFooHashGtWithFAllowed {
TDEquals(tok.floatValue, (double)0.0);
tok = [t nextToken];
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
TDTrue(tok.isHashtag);
TDEqualObjects(tok.stringValue, @"#foo");
TDEquals(tok.floatValue, (double)0.0);
View
2 test/TDEmailStateTest.m
@@ -6,7 +6,7 @@
// Copyright 2010 Todd Ditchendorf. All rights reserved.
//
-#if PLATFORM(EMAIL_STATE)
+#if PK_PLATFORM_EMAIL_STATE
#import "TDEmailStateTest.h"
@implementation TDEmailStateTest
View
2 test/TDTwitterStateTest.h
@@ -6,7 +6,7 @@
// Copyright 2010 Todd Ditchendorf. All rights reserved.
//
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
#import "TDTestScaffold.h"
@interface TDTwitterStateTest : SenTestCase {
View
2 test/TDTwitterStateTest.m
@@ -6,7 +6,7 @@
// Copyright 2010 Todd Ditchendorf. All rights reserved.
//
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
#import "TDTwitterStateTest.h"
@implementation TDTwitterStateTest
View
2 test/XPathParserGrammarTest.m
@@ -16,7 +16,7 @@
@implementation XPathParserGrammarTest
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
#else
- (void)setUp {
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"xpath1_0" ofType:@"grammar"];
View
2 test/XPathParserTest.m
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#if PLATFORM(TWITTER_STATE)
+#if PK_PLATFORM_TWITTER_STATE
#else
#import "XPathParserTest.h"
#import "TDNCName.h"
View
62 test/en.lproj/.svn/entries
@@ -1,62 +0,0 @@
-10
-
-dir
-114
-https://todd.ditchendorf@parsekit.googlecode.com/svn/trunk/test/en.lproj
-https://todd.ditchendorf@parsekit.googlecode.com/svn
-
-
-
-2012-08-10T21:07:06.508282Z
-114
-todd.ditchendorf
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-47a69902-6c80-45e3-bb3b-c8207f6fa097
-
-InfoPlist.strings
-file
-
-
-
-
-2012-07-16T17:49:51.000000Z
-b8f0b99a609bda18c49eed43bb052224
-2012-08-10T21:07:06.508282Z
-114
-todd.ditchendorf
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-45
-

0 comments on commit bf4a2bf

Please sign in to comment.