Esempio n. 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 + ");");
 }
Esempio n. 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));
        }
Esempio n. 3
0
 public override Int32 GetHashCode()
 {
     if (TypeStr == null)
     {
         return(TypeInt.GetHashCode());
     }
     return(TypeStr.GetHashCode() ^ TypeInt.GetHashCode());
 }
Esempio n. 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);
        }
Esempio n. 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();");
     }
 }
Esempio n. 6
0
 public void Visit(TypeInt type)
 {
     WriteProperty(type);
 }
Esempio n. 7
0
 public override void VisitTypeInt(ASTTypeInt n)
 {
     n.Type = _lastSeenType = new TypeInt();
 }
Esempio n. 8
0
 void Visitor.Visit(TypeInt type)
 {
     text = var.NamePrivate + (isEquals ? " == " : " != ") + another + "." + var.NamePrivate;
 }
Esempio n. 9
0
 /// <summary>
 /// Integer literal
 /// </summary>
 /// <param name="n"></param>
 public override void VisitInteger(ASTInteger n)
 {
     n.CFlatType = _lastSeenType = new TypeInt();
 }
Esempio n. 10
0
 void Visitor.Visit(TypeInt type)
 {
     sw.WriteLine(prefix + "if (" + varname + " < 0) return true;");
 }
Esempio n. 11
0
 void Visitor.Visit(TypeInt type)
 {
     Type = Zeze.Serialize.ByteBuffer.INT;
 }
Esempio n. 12
0
 public void Visit(TypeInt type)
 {
     text = varname + ".GetHashCode()";
 }
Esempio n. 13
0
 public void Visit(TypeInt type)
 {
     DefineStack(type);
 }
Esempio n. 14
0
 void Visitor.Visit(TypeInt type)
 {
     Name = "Zeze.ByteBuffer.INT";
 }
Esempio n. 15
0
 public void Visit(TypeInt type)
 {
     name = "int";
 }
Esempio n. 16
0
 public void Visit(TypeInt type)
 {
     Initial();
 }
Esempio n. 17
0
 public void Visit(TypeInt type)
 {
     text = variable.NamePrivate + ".CompareTo(" + another + "." + variable.NamePrivate + ")";
 }
Esempio n. 18
0
 public void Visit(TypeInt type)
 {
     WriteLogValue(type);
 }
Esempio n. 19
0
 public void Visit(TypeInt type)
 {
     name = "number";
 }
Esempio n. 20
0
 void Visitor.Visit(TypeInt type)
 {
     ChangeVariableCollectorName = "Zeze.Transaction.ChangeVariableCollectorChanged()";
 }
Esempio n. 21
0
 void Visitor.Visit(TypeInt type)
 {
     sw.WriteLine(prefix + $"sb.Append(new string(' ', level * 4)).Append(\"{var}\").Append(\"=\").Append({var}).Append(\"{sep}\").Append(Environment.NewLine);");
 }
Esempio n. 22
0
 void Visitor.Visit(TypeInt type)
 {
     Value = "null";
 }