Conforms to NSCoding
NSObject
Declared in CPTokenRecogniser.h

Overview

The CPTokenRecogniser protocol defines methods needed to recognise tokens in a string.

Tasks

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