Exemplo n.º 1
0
 public static AstNode CreateConstantLoad(object constant)
 {
     AstNode ret;
     if (constant is char)
         ret = new CharNode(ModuleBuilder.SourceLocation, (char)constant);
     else if (constant is int)
         ret = new IntegerNode(ModuleBuilder.SourceLocation, (int)constant);
     else if (constant is double)
         ret = new FloatNode(ModuleBuilder.SourceLocation, (double)constant);
     else
         ret = new StringNode(ModuleBuilder.SourceLocation, constant.ToString());
     return ret;
 }
Exemplo n.º 2
0
 public void Accept(FloatNode node)
 {
 }
Exemplo n.º 3
0
 public void Accept(FloatNode node)
 {
     var fl = new HassiumFloat(node.Number);
     if (!module.ObjectPool.ContainsKey(fl.GetHashCode()))
         module.ObjectPool.Add(fl.GetHashCode(), fl);
     method.Emit(node.SourceLocation, InstructionType.PushObject, fl.GetHashCode());
 }