private static void ProcessLine(string [] words, StreamReader reader)
{
if (words[0].Length == 0)
return;
Console.WriteLine(words[0]);
if (words[0] == "class")
{
if (words.Length > 2)
cls = new BaseClass(words[1], (IClass) objects[words[2]], machine);
else
cls = new BaseClass(words[1], machine);
objects[words[1]]=cls;
}
else if (words[0] == "variables")
{
for (int k = 1; k < words.Length; k++)
cls.DefineInstanceVariable(words[k]);
}
else if (words[0] == "method")
{
string line;
string body = "";
line = reader.ReadLine();
while (line != null && line != "")
{
body += line;
body += " ";
line = reader.ReadLine();
}
Parser compiler = new Parser(body);
compiler.CompileInstanceMethod(cls);
}
else
Console.WriteLine("Unknown {0}", words[0]);
}