Model Redesign: Added Reference Frames
Added Inverse Functions UI Redesign Cleaned Code
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
#import "MPTokenStream.h"
|
||||
|
||||
@implementation MPTokenStream {
|
||||
NSUInteger currentTokenIndex;
|
||||
NSUInteger eofLocation;
|
||||
}
|
||||
|
||||
@@ -32,37 +31,34 @@
|
||||
if (!self.isIgnoringWhitespaceTokens) {
|
||||
return;
|
||||
}
|
||||
while (currentTokenIndex < self.tokens.count) {
|
||||
MPToken *token = self.tokens[currentTokenIndex];
|
||||
while (self.currentTokenIndex < self.tokens.count) {
|
||||
MPToken *token = self.tokens[self.currentTokenIndex];
|
||||
if (token.tokenType != MPWhitespaceToken) {
|
||||
return;
|
||||
}
|
||||
self.currentLocation = NSMaxRange(token.range);
|
||||
++currentTokenIndex;
|
||||
++self.currentTokenIndex;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)reset
|
||||
{
|
||||
currentTokenIndex = 0;
|
||||
self.currentLocation = 0;
|
||||
self.currentTokenIndex = 0;
|
||||
[self skipWhitespaces];
|
||||
}
|
||||
|
||||
- (BOOL)hasMoreTokens
|
||||
{
|
||||
[self skipWhitespaces];
|
||||
return currentTokenIndex < self.tokens.count;
|
||||
return self.currentTokenIndex < self.tokens.count;
|
||||
}
|
||||
|
||||
- (MPToken *)nextToken
|
||||
{
|
||||
[self skipWhitespaces];
|
||||
if (currentTokenIndex >= self.tokens.count) {
|
||||
if (self.currentTokenIndex >= self.tokens.count) {
|
||||
return [[MPToken alloc] initEOFTokenAtLocation:eofLocation];
|
||||
} else {
|
||||
MPToken *token = self.tokens[currentTokenIndex++];
|
||||
self.currentLocation = NSMaxRange(token.range);
|
||||
MPToken *token = self.tokens[self.currentTokenIndex++];
|
||||
return token;
|
||||
}
|
||||
}
|
||||
@@ -70,15 +66,14 @@
|
||||
- (MPToken *)nextTokenOfType:(MPTokenType)type
|
||||
{
|
||||
[self skipWhitespaces];
|
||||
if (currentTokenIndex >= self.tokens.count) {
|
||||
if (self.currentTokenIndex >= self.tokens.count) {
|
||||
return nil;
|
||||
} else {
|
||||
MPToken *token = self.tokens[currentTokenIndex];
|
||||
MPToken *token = self.tokens[self.currentTokenIndex];
|
||||
if (token.tokenType != type) {
|
||||
return nil;
|
||||
}
|
||||
++currentTokenIndex;
|
||||
self.currentLocation = NSMaxRange(token.range);
|
||||
++self.currentTokenIndex;
|
||||
return token;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user