Removed lingering bits of OOS code.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1093 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
83c614dce2
commit
9aa1e3947e
@ -26,7 +26,7 @@ endif
|
||||
OBJC_PROGRAM_NAME = oolite
|
||||
|
||||
oolite_C_FILES = legacy_random.c strlcpy.c
|
||||
oolite_OBJC_FILES = Comparison.m AI.m DustEntity.m Entity.m GameController.m GuiDisplayGen.m HeadUpDisplay.m main.m MyOpenGLView.m OpenGLSprite.m ParticleEntity.m PlanetEntity.m PlayerEntityLegacyScriptEngine.m PlayerEntityContracts.m PlayerEntityControls.m PlayerEntityLoadSave.m PlayerEntitySound.m PlayerEntity.m ResourceManager.m RingEntity.m ShipEntityAI.m ShipEntity.m SkyEntity.m StationEntity.m Universe.m OOSound.m SDLMusic.m NSFileManagerOOExtensions.m JoystickHandler.m PlayerEntityStickMapper.m OOBasicSoundReferencePoint.m OOBasicSoundSource.m OOCharacter.m OOTrumble.m WormholeEntity.m NSScannerOOExtensions.m OOXMLExtensions.m NSMutableDictionaryOOExtensions.m Geometry.m Octree.m CollisionRegion.m OOColor.m OOLogging.m OOCacheManager.m OOCache.m OOStringParsing.m OOCollectionExtractors.m OOVector.m OOMatrix.m OOQuaternion.m OOVoxel.m OOTriangle.m OOPListParsing.m OOFastArithmetic.m OOTextureScaling.m OOConstToString.m OOScript.m OOJSScript.m OOJavaScriptEngine.m OOPListScript.m OOSTokenizer.m NSStringOOExtensions.m PlayerEntityScriptMethods.m OOWeakReference.m OOJSEntity.m EntityOOJavaScriptExtensions.m OOJSQuaternion.m OOMaterial.m OOShaderMaterial.m OOShaderProgram.m OOShaderUniform.m OOTexture.m OOTextureLoader.m OOPNGTextureLoader.m OOOpenGLExtensionManager.m OOBasicMaterial.m OOSingleTextureMaterial.m OOCPUInfo.m OOSelfDrawingEntity.m OOEntityWithDrawable.m OODrawable.m OOJSVector.m OOMesh.m OOOpenGL.m OOGraphicsResetManager.m OOProbabilisticTextureManager.m OODebugGLDrawing.m OOShaderUniformMethodType.m OOAsyncQueue.m TextureStore.m OOOXPVerifier.m OOOXPVerifierStage.m
|
||||
oolite_OBJC_FILES = Comparison.m AI.m DustEntity.m Entity.m GameController.m GuiDisplayGen.m HeadUpDisplay.m main.m MyOpenGLView.m OpenGLSprite.m ParticleEntity.m PlanetEntity.m PlayerEntityLegacyScriptEngine.m PlayerEntityContracts.m PlayerEntityControls.m PlayerEntityLoadSave.m PlayerEntitySound.m PlayerEntity.m ResourceManager.m RingEntity.m ShipEntityAI.m ShipEntity.m SkyEntity.m StationEntity.m Universe.m OOSound.m SDLMusic.m NSFileManagerOOExtensions.m JoystickHandler.m PlayerEntityStickMapper.m OOBasicSoundReferencePoint.m OOBasicSoundSource.m OOCharacter.m OOTrumble.m WormholeEntity.m NSScannerOOExtensions.m OOXMLExtensions.m NSMutableDictionaryOOExtensions.m Geometry.m Octree.m CollisionRegion.m OOColor.m OOLogging.m OOCacheManager.m OOCache.m OOStringParsing.m OOCollectionExtractors.m OOVector.m OOMatrix.m OOQuaternion.m OOVoxel.m OOTriangle.m OOPListParsing.m OOFastArithmetic.m OOTextureScaling.m OOConstToString.m OOScript.m OOJSScript.m OOJavaScriptEngine.m OOPListScript.m NSStringOOExtensions.m PlayerEntityScriptMethods.m OOWeakReference.m OOJSEntity.m EntityOOJavaScriptExtensions.m OOJSQuaternion.m OOMaterial.m OOShaderMaterial.m OOShaderProgram.m OOShaderUniform.m OOTexture.m OOTextureLoader.m OOPNGTextureLoader.m OOOpenGLExtensionManager.m OOBasicMaterial.m OOSingleTextureMaterial.m OOCPUInfo.m OOSelfDrawingEntity.m OOEntityWithDrawable.m OODrawable.m OOJSVector.m OOMesh.m OOOpenGL.m OOGraphicsResetManager.m OOProbabilisticTextureManager.m OODebugGLDrawing.m OOShaderUniformMethodType.m OOAsyncQueue.m TextureStore.m OOOXPVerifier.m OOOXPVerifierStage.m
|
||||
|
||||
include $(GNUSTEP_MAKEFILES)/objc.make
|
||||
include GNUmakefile.postamble
|
||||
|
@ -331,8 +331,6 @@
|
||||
1A5DBAAB0BC000DC00D57389 /* OOPListScript.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A5DBA9F0BC000DC00D57389 /* OOPListScript.m */; };
|
||||
1A5DBAAD0BC000DC00D57389 /* OOScript.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5DBAA10BC000DC00D57389 /* OOScript.h */; };
|
||||
1A5DBAAE0BC000DC00D57389 /* OOScript.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A5DBAA20BC000DC00D57389 /* OOScript.m */; };
|
||||
1A5DBAAF0BC000DC00D57389 /* OOSTokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5DBAA30BC000DC00D57389 /* OOSTokenizer.h */; };
|
||||
1A5DBAB00BC000DC00D57389 /* OOSTokenizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A5DBAA40BC000DC00D57389 /* OOSTokenizer.m */; };
|
||||
1A5DBD580BC17F0900D57389 /* NSStringOOExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5DBD560BC17F0900D57389 /* NSStringOOExtensions.h */; };
|
||||
1A5DBD590BC17F0900D57389 /* NSStringOOExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A5DBD570BC17F0900D57389 /* NSStringOOExtensions.m */; };
|
||||
1A5E462F0C32DACE008104B4 /* OOShaderUniformMethodType.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A5E462D0C32DACE008104B4 /* OOShaderUniformMethodType.m */; };
|
||||
@ -1204,8 +1202,6 @@
|
||||
1A5DBA9F0BC000DC00D57389 /* OOPListScript.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OOPListScript.m; sourceTree = "<group>"; };
|
||||
1A5DBAA10BC000DC00D57389 /* OOScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOScript.h; sourceTree = "<group>"; };
|
||||
1A5DBAA20BC000DC00D57389 /* OOScript.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OOScript.m; sourceTree = "<group>"; };
|
||||
1A5DBAA30BC000DC00D57389 /* OOSTokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOSTokenizer.h; sourceTree = "<group>"; };
|
||||
1A5DBAA40BC000DC00D57389 /* OOSTokenizer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OOSTokenizer.m; sourceTree = "<group>"; };
|
||||
1A5DBD560BC17F0900D57389 /* NSStringOOExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSStringOOExtensions.h; sourceTree = "<group>"; };
|
||||
1A5DBD570BC17F0900D57389 /* NSStringOOExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSStringOOExtensions.m; sourceTree = "<group>"; };
|
||||
1A5E462D0C32DACE008104B4 /* OOShaderUniformMethodType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OOShaderUniformMethodType.m; sourceTree = "<group>"; };
|
||||
@ -1875,8 +1871,6 @@
|
||||
children = (
|
||||
1A5DBA9E0BC000DC00D57389 /* OOPListScript.h */,
|
||||
1A5DBA9F0BC000DC00D57389 /* OOPListScript.m */,
|
||||
1A5DBAA30BC000DC00D57389 /* OOSTokenizer.h */,
|
||||
1A5DBAA40BC000DC00D57389 /* OOSTokenizer.m */,
|
||||
);
|
||||
name = "PList & OOS scripting";
|
||||
sourceTree = "<group>";
|
||||
@ -2450,7 +2444,6 @@
|
||||
1A5DBAA80BC000DC00D57389 /* OOJSScript.h in Headers */,
|
||||
1A5DBAAA0BC000DC00D57389 /* OOPListScript.h in Headers */,
|
||||
1A5DBAAD0BC000DC00D57389 /* OOScript.h in Headers */,
|
||||
1A5DBAAF0BC000DC00D57389 /* OOSTokenizer.h in Headers */,
|
||||
1A5DBD580BC17F0900D57389 /* NSStringOOExtensions.h in Headers */,
|
||||
1A3AFF1F0BC4462200B5E2D9 /* OOJSVector.h in Headers */,
|
||||
1A3A04620BC547DC00B5E2D9 /* OOTypes.h in Headers */,
|
||||
@ -2731,7 +2724,6 @@
|
||||
1A5DBAA90BC000DC00D57389 /* OOJSScript.m in Sources */,
|
||||
1A5DBAAB0BC000DC00D57389 /* OOPListScript.m in Sources */,
|
||||
1A5DBAAE0BC000DC00D57389 /* OOScript.m in Sources */,
|
||||
1A5DBAB00BC000DC00D57389 /* OOSTokenizer.m in Sources */,
|
||||
1A5DBD590BC17F0900D57389 /* NSStringOOExtensions.m in Sources */,
|
||||
1A3AFF200BC4462200B5E2D9 /* OOJSVector.m in Sources */,
|
||||
1A2A8C160BC65FFD001E00FB /* OOJSEntity.m in Sources */,
|
||||
|
@ -1,69 +0,0 @@
|
||||
/*
|
||||
|
||||
OOSTokenizer.h
|
||||
|
||||
Script Compiler for Oolite
|
||||
Copyright (C) 2006 David Taylor
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA.
|
||||
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#define TT_WORD 1
|
||||
#define TT_EOL 2
|
||||
#define TT_EOS 3
|
||||
|
||||
@interface OOSTokenizer : NSObject
|
||||
{
|
||||
@public
|
||||
// A local copy of the string to be parsed
|
||||
NSString* stringToParse;
|
||||
char* cString;
|
||||
|
||||
// The zero based index of the next character to be parsed. 0 <= nextcharIdx < [stringToParse length]
|
||||
unsigned nextCharIdx;
|
||||
|
||||
// The index to go back to when a pushBack is issued
|
||||
unsigned pushBackIdx;
|
||||
|
||||
// Set to one of the TT_* constants after a call to nextToken
|
||||
int tokenType;
|
||||
|
||||
// The line number currently being parsed
|
||||
unsigned lineNo;
|
||||
|
||||
// If tokenType is TT_WORD this contains a reference to the parsed word
|
||||
NSString* tokenWord;
|
||||
char* tokenPtr;
|
||||
}
|
||||
|
||||
// Initialise an instance of the string tokeniser to parse the given string
|
||||
- (id)initWithString:(NSString*)string;
|
||||
- (void) dealloc;
|
||||
|
||||
// Parse the next token and set the tokenType property appropriately
|
||||
- (void)nextToken;
|
||||
|
||||
// Push back the current token so the next call to nextToken returns
|
||||
// the same one
|
||||
- (void)pushBack;
|
||||
|
||||
// Returns true once the entire string has been parsed
|
||||
- (BOOL)reachedEOS;
|
||||
|
||||
@end
|
@ -1,118 +0,0 @@
|
||||
/*
|
||||
|
||||
OOSTokenizer.m
|
||||
|
||||
Script Compiler for Oolite
|
||||
Copyright (C) 2006 David Taylor
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA.
|
||||
|
||||
*/
|
||||
|
||||
#import "OOSTokenizer.h"
|
||||
|
||||
|
||||
@implementation OOSTokenizer : NSObject
|
||||
|
||||
// Initialise an instance of the string tokeniser to parse the given string
|
||||
- (id)initWithString:(NSString*)string {
|
||||
const char* strPtr;
|
||||
self = [super init];
|
||||
stringToParse = [NSString stringWithString:string];
|
||||
strPtr = [stringToParse cString];
|
||||
cString = (char*)calloc(strlen(strPtr)+1, sizeof(char));
|
||||
strcpy(cString, strPtr);
|
||||
nextCharIdx = 0;
|
||||
lineNo = 1;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc {
|
||||
if (cString != 0x00)
|
||||
free(cString);
|
||||
|
||||
if (tokenPtr != 0x00)
|
||||
free(tokenPtr);
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
// Parse the next token and set the tokenType property appropriately
|
||||
- (void)nextToken {
|
||||
int startWordIdx;
|
||||
int len;
|
||||
|
||||
// Incrementing lineNo here so that errors caused by new lines don't get
|
||||
// reported on the line after the error, as would happen if lineNo was
|
||||
// incremented when the TT_EOL token is returned.
|
||||
if (tokenType == TT_EOL)
|
||||
lineNo++;
|
||||
|
||||
if (nextCharIdx >= [stringToParse length]) {
|
||||
tokenType = TT_EOS;
|
||||
return;
|
||||
}
|
||||
|
||||
// skip whitespace before next word or EOL
|
||||
while (cString[nextCharIdx] == 0x20 || cString[nextCharIdx] == 0x09) {
|
||||
nextCharIdx++;
|
||||
pushBackIdx = nextCharIdx;
|
||||
if (nextCharIdx >= [stringToParse length]) {
|
||||
tokenType = TT_EOS;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (cString[nextCharIdx] == 0x0A) {
|
||||
tokenType = TT_EOL;
|
||||
nextCharIdx++;
|
||||
pushBackIdx = nextCharIdx;
|
||||
return;
|
||||
}
|
||||
|
||||
startWordIdx = nextCharIdx;
|
||||
pushBackIdx = nextCharIdx;
|
||||
while (cString[nextCharIdx] != 0x20 && cString[nextCharIdx] != 0x09 && cString[nextCharIdx] != 0x0A) {
|
||||
nextCharIdx++;
|
||||
if (nextCharIdx >= [stringToParse length]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
len = nextCharIdx - startWordIdx+1;
|
||||
tokenPtr = calloc(len, sizeof(char));
|
||||
strncpy(tokenPtr, &cString[startWordIdx], len-1);
|
||||
tokenWord = [NSString stringWithCString:tokenPtr];
|
||||
free(tokenPtr);
|
||||
tokenPtr = 0x00;
|
||||
tokenType = TT_WORD;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
- (void)pushBack {
|
||||
nextCharIdx = pushBackIdx;
|
||||
}
|
||||
|
||||
// Returns true once the entire string has been parsed
|
||||
- (BOOL)reachedEOS {
|
||||
if (nextCharIdx >= [stringToParse length])
|
||||
return YES;
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
Loading…
x
Reference in New Issue
Block a user