Inherits from NSObject
Conforms to CPTokenRecogniser
Declared in CPWhiteSpaceRecogniser.h
CPWhiteSpaceRecogniser.m

Overview

The CPWhiteSpaceRecogniser class attempts to recognise white space on the input string.

This recogniser produces CPWhiteSpaceTokens.

Tasks

Creating and Initialising a WhiteSpace Recogniser

Other Methods

Class Methods

whiteSpaceRecogniser

Creates a whitespace recogniser.

+ (id)whiteSpaceRecogniser

Return Value

Returns a CPWhiteSpaceRecogniser.

Discussion

Creates a whitespace recogniser.

Declared In

CPWhiteSpaceRecogniser.h

Instance Methods

recogniseTokenInString:currentTokenPosition:

Attempts to recognise a token at tokenPosition in tokenString.

- (CPToken *)recogniseTokenInString:(NSString *)tokenString currentTokenPosition:(NSUInteger *)tokenPosition

Parameters

tokenString

The string in which to recognise tokens.

tokenPosition

The position at which to try to find the token. On output, the position after the recognised token.

Return Value

Returns the token recognised.

Discussion

Attempts to recognise a token at tokenPosition in tokenString.

If a token is successfully recognised, it should be returned, and tokenPosition advanced to after the consumed characters. If no valid token is found nil must be returned instead, and tokenPosition left unchanged.

Declared In

CPTokenRecogniser.h