本文整理汇总了C#中Tree.Node.getStringVal方法的典型用法代码示例。如果您正苦于以下问题:C# Node.getStringVal方法的具体用法?C# Node.getStringVal怎么用?C# Node.getStringVal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tree.Node
的用法示例。
在下文中一共展示了Node.getStringVal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: apply1
//if arg's length = 1
private Node apply1(Node arg1)
{
string name = this.symbol.getName();
bool flag = name.Equals("car");
Node result;
if (flag)
{
result = arg1.getCar();
}//end if
else
{
bool flag2 = name.Equals("cdr");
if (flag2)
{
result = arg1.getCdr();
}//end if
else
{
bool flag3 = name.Equals("number?");
if (flag3)
{
result = BoolLit.getInstance(arg1.isNumber());
}//end if
else
{
bool flag4 = name.Equals("symbol?");
if (flag4)
{
result = BoolLit.getInstance(arg1.isSymbol());
}//end if
else
{
bool flag5 = name.Equals("null?");
if (flag5)
{
result = BoolLit.getInstance(arg1.isNull());
}//end if
else
{
bool flag6 = name.Equals("pair?");
if (flag6)
{
result = BoolLit.getInstance(arg1.isPair());
}//end if
else
{
bool flag7 = name.Equals("procedure?");
if (flag7)
{
result = BoolLit.getInstance(arg1.isProcedure());
}//end if
else
{
bool flag8 = name.Equals("write");// i am not sure if im handling this correctly
if (flag8)
{
arg1.print(-1);
result = Unspecific.getInstance();
}//end if
else
{
bool flag9 = name.Equals("display"); // i am not sure if im handling this correctly
if (flag9)
{
StringLit.printDoubleQuotes = false;
arg1.print(-1);
StringLit.printDoubleQuotes = true;
result = Unspecific.getInstance();
}//end if
else
{
bool flag10 = name.Equals("load");
if (flag10)
{
bool flag11 = !arg1.isString();
if (flag11)
{
Console.Error.WriteLine("Error: wrong type of argument");
result = Nil.getInstance();
}
else
{
string stringVal = arg1.getStringVal();
try
{
//not sure why it has to be Parse.Scanner to call this
Parse.Scanner s = new Parse.Scanner(File.OpenText(stringVal));
TreeBuilder b = new TreeBuilder();
Parse.Parser parser = new Parse.Parser(s, b);
for (Node node = (Node)parser.parseExp(); node != null; node = (Node)parser.parseExp())
{
node.eval(Scheme4101.env);
}
}
catch (SystemException)
{
Console.Error.WriteLine("Could not find file " + stringVal);
}
result = Unspecific.getInstance();
//.........这里部分代码省略.........