Created
October 22, 2011 19:20
-
-
Save ErisianArchitect/1306386 to your computer and use it in GitHub Desktop.
Read config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Also note, this is pseudo-code, when passing the index to a function, you want to pass it as a reference so that you can modify the index. | |
void Tokenize(string src) | |
{ | |
int ind = 0; | |
string configName = empty; | |
while(ind < src.Length) | |
{ | |
char c = src[ind]; | |
if(c == '#') | |
{ | |
configName = ReadIdentifier(src,ind); | |
} | |
else if(c == '"') | |
{ | |
ReadQuotes(src,ind); | |
} | |
else if(IsWhiteSpace(c)) | |
{ | |
SkipWhiteSpace(src,ind); | |
} | |
else | |
Error(); | |
} | |
} |
Oops, it's supposed to be "ind". I'll fix that right now.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
error: i undefined