예제 #1
0
 public void Visit(TypeInt type)
 {
     if (id >= 0)
     {
         sw.WriteLine(prefix + bufname + ".WriteInt(Zeze.ByteBuffer.INT | " + id + " << Zeze.ByteBuffer.TAG_SHIFT);");
     }
     sw.WriteLine(prefix + bufname + ".WriteInt(" + varname + ");");
 }
예제 #2
0
        protected override OpTypeInt VisitTypeInt(TypeInt node)
        {
            var visitTypeInt = base.VisitTypeInt(node);

            visitTypeInt.Signedness = node.Signed?1u:0;
            visitTypeInt.Width      = node.Width;
            return(Register(visitTypeInt, _typeInstructions));
        }
예제 #3
0
 public override Int32 GetHashCode()
 {
     if (TypeStr == null)
     {
         return(TypeInt.GetHashCode());
     }
     return(TypeStr.GetHashCode() ^ TypeInt.GetHashCode());
 }
예제 #4
0
        protected virtual bool WriteIntField(string fieldName, uint byteOffset, TypeInt intType)
        {
            string actualName = null;

            if (intType.Signed)
            {
                switch (intType.Width)
                {
                case 8:
                    actualName = "sbyte";
                    break;

                case 16:
                    actualName = "short";
                    break;

                case 32:
                    actualName = "int";
                    break;

                case 64:
                    actualName = "long";
                    break;
                }
            }
            else
            {
                switch (intType.Width)
                {
                case 8:
                    actualName = "byte";
                    break;

                case 16:
                    actualName = "ushort";
                    break;

                case 32:
                    actualName = "uint";
                    break;

                case 64:
                    actualName = "ulong";
                    break;
                }
            }
            if (actualName != null)
            {
                WriteLine($"    [FieldOffset({byteOffset})]");
                WriteLine($"    public {actualName} {fieldName};");
                return(true);
            }

            return(false);
        }
예제 #5
0
 void Visitor.Visit(TypeInt type)
 {
     if (id >= 0)
     {
         sw.WriteLine(prefix + "case (Zeze.ByteBuffer.INT | " + id + " << Zeze.ByteBuffer.TAG_SHIFT): ");
         sw.WriteLine(prefix + "    " + varname + " = " + bufname + ".ReadInt();");
         sw.WriteLine(prefix + "    break;");
     }
     else
     {
         sw.WriteLine(prefix + varname + " = " + bufname + ".ReadInt();");
     }
 }
예제 #6
0
 public void Visit(TypeInt type)
 {
     WriteProperty(type);
 }
예제 #7
0
파일: SecondPass.cs 프로젝트: goric/cflat
 public override void VisitTypeInt(ASTTypeInt n)
 {
     n.Type = _lastSeenType = new TypeInt();
 }
예제 #8
0
 void Visitor.Visit(TypeInt type)
 {
     text = var.NamePrivate + (isEquals ? " == " : " != ") + another + "." + var.NamePrivate;
 }
예제 #9
0
파일: ThirdPass.cs 프로젝트: goric/cflat
 /// <summary>
 /// Integer literal
 /// </summary>
 /// <param name="n"></param>
 public override void VisitInteger(ASTInteger n)
 {
     n.CFlatType = _lastSeenType = new TypeInt();
 }
예제 #10
0
 void Visitor.Visit(TypeInt type)
 {
     sw.WriteLine(prefix + "if (" + varname + " < 0) return true;");
 }
예제 #11
0
 void Visitor.Visit(TypeInt type)
 {
     Type = Zeze.Serialize.ByteBuffer.INT;
 }
예제 #12
0
 public void Visit(TypeInt type)
 {
     text = varname + ".GetHashCode()";
 }
예제 #13
0
파일: Define.cs 프로젝트: e2wugui/zeze
 public void Visit(TypeInt type)
 {
     DefineStack(type);
 }
예제 #14
0
 void Visitor.Visit(TypeInt type)
 {
     Name = "Zeze.ByteBuffer.INT";
 }
예제 #15
0
파일: TypeName.cs 프로젝트: e2wugui/zeze
 public void Visit(TypeInt type)
 {
     name = "int";
 }
예제 #16
0
파일: Construct.cs 프로젝트: e2wugui/zeze
 public void Visit(TypeInt type)
 {
     Initial();
 }
예제 #17
0
파일: Compare.cs 프로젝트: e2wugui/zeze
 public void Visit(TypeInt type)
 {
     text = variable.NamePrivate + ".CompareTo(" + another + "." + variable.NamePrivate + ")";
 }
예제 #18
0
 public void Visit(TypeInt type)
 {
     WriteLogValue(type);
 }
예제 #19
0
 public void Visit(TypeInt type)
 {
     name = "number";
 }
예제 #20
0
 void Visitor.Visit(TypeInt type)
 {
     ChangeVariableCollectorName = "Zeze.Transaction.ChangeVariableCollectorChanged()";
 }
예제 #21
0
파일: Tostring.cs 프로젝트: e2wugui/zeze
 void Visitor.Visit(TypeInt type)
 {
     sw.WriteLine(prefix + $"sb.Append(new string(' ', level * 4)).Append(\"{var}\").Append(\"=\").Append({var}).Append(\"{sep}\").Append(Environment.NewLine);");
 }
예제 #22
0
파일: Default.cs 프로젝트: e2wugui/zeze
 void Visitor.Visit(TypeInt type)
 {
     Value = "null";
 }