projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
corrected supertux tile definition file extension (was by mistake ".stwm" instead...
[supertux.git]
/
tools
/
tilemanager
/
Parser.cs
diff --git
a/tools/tilemanager/Parser.cs
b/tools/tilemanager/Parser.cs
index
daa0ade
..
22d7701
100644
(file)
--- a/
tools/tilemanager/Parser.cs
+++ b/
tools/tilemanager/Parser.cs
@@
-1,3
+1,4
@@
+// $Id$
using System;
using System.IO;
using System;
using System.IO;
@@
-9,14
+10,14
@@
public class Parser {
START_LIST,
END_LIST,
SYMBOL,
START_LIST,
END_LIST,
SYMBOL,
- INTEGER,
+ INTEGER,
STRING,
REAL,
BOOLEAN
};
private Lexer lexer;
private Lexer.TokenType token;
STRING,
REAL,
BOOLEAN
};
private Lexer lexer;
private Lexer.TokenType token;
-
+
public Parser(StreamReader stream) {
lexer = new Lexer(stream);
}
public Parser(StreamReader stream) {
lexer = new Lexer(stream);
}
@@
-31,7
+32,7
@@
public class Parser {
depth = 0;
return false;
}
depth = 0;
return false;
}
-
+
/*
Console.WriteLine("Token: " + token.ToString() + " - " +
lexer.TokenString);
/*
Console.WriteLine("Token: " + token.ToString() + " - " +
lexer.TokenString);
@@
-63,6
+64,14
@@
public class Parser {
return true;
}
return true;
}
+ public static void ParseIntList(Parser parser, System.Collections.Generic.List<int> intList) {
+ int d = parser.Depth;
+ while(parser.Depth >= d) {
+ intList.Add(parser.IntegerValue);
+ parser.Parse();
+ }
+ }
+
private LispType type;
public LispType Type {
get { return type; }
private LispType type;
public LispType Type {
get { return type; }
@@
-83,7
+92,7
@@
public class Parser {
get { return Int32.Parse(lexer.TokenString); }
}
public bool BoolValue {
get { return Int32.Parse(lexer.TokenString); }
}
public bool BoolValue {
- get { return StringValue == "t"
? true : false
; }
+ get { return StringValue == "t"; }
}
public float FloatValue {
get { return Single.Parse(lexer.TokenString); }
}
public float FloatValue {
get { return Single.Parse(lexer.TokenString); }