示例#1
0
 public override void CodeGen(StreamWriter stream)
 {
     stream.Write(".method ");
     foreach (var child in modifiers)
     {
         if (child == Modifier.Public)
         {
             stream.Write("public ");
         }
         if (child == Modifier.Static)
         {
             stream.Write("static ");
         }
     }
     stream.Write("{0} {1}", type.GetTypeName(), methodname);
     foreach (var child in parameters)
     {
         child.CodeGen(stream);
     }
     stream.WriteLine();
     stream.WriteLine("{");
     stream.WriteLine(".entrypoint");
     foreach (var child in statements)
     {
         child.CodeGen(stream);
     }
     stream.WriteLine("}");
 }
示例#2
0
 public override void CodeGen(StreamWriter stream)
 {
     stream.BaseStream.Seek(0, SeekOrigin.End);
     stream.WriteLine(".locals init ([{0}] {1} {2})", num, type.GetTypeName(), varName);
 }
示例#3
0
 public ArrayType(JavaType innerType)
 {
     this.innerType = innerType;
     this.name      = innerType.GetTypeName() + "[]";
 }
示例#4
0
 public bool Equal(JavaType other)
 {
     return(name.Equals(other.GetTypeName()));
 }