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