Exemplo n.º 1
0
        //===========================================================
        //		追加
        //===========================================================
        private static void WriteStackAllocate(LanguageWriter w, IStackAllocateExpression exp)
        {
            TypeRef type = new TypeRef(exp.Type);

            w.Write("(");
            type.WriteNameWithRef(w);
            w.Write("*)::");
            w.WriteReference("_alloca", "Crt 関数 #include <malloc.h>", null);
            w.Write("(");
            w.WriteKeyword("sizeof");
            w.Write("(");
            type.WriteName(w);
            w.Write(")*");
            WriteExpression(w, exp.Expression, PREC_BI_MUL > GetExpressionPrecedence(exp.Expression));
            w.Write(")");
        }
Exemplo n.º 2
0
 public virtual void VisitStackAllocateExpression(IStackAllocateExpression value)
 {
     VisitType(value.Type);
     VisitExpression(value.Expression);
 }
 private void WriteStackAllocateExpression(IStackAllocateExpression expression, IFormatter formatter)
 {
     formatter.WriteKeyword("stackalloc");
     formatter.Write(" ");
     this.WriteType(expression.Type, formatter);
     formatter.Write("[");
     this.WriteExpression(expression.Expression, formatter);
     formatter.Write("]");
 }
Exemplo n.º 4
0
 public override void VisitStackAllocateExpression(IStackAllocateExpression value)
 {
     WriteUnsupported(value);
 }
Exemplo n.º 5
0
 public virtual void VisitStackAllocateExpression(IStackAllocateExpression value)
 {
     this.VisitType(value.Type);
     this.VisitExpression(value.Expression);
 }
 public virtual IExpression TransformStackAllocateExpression(IStackAllocateExpression value)
 {
     value.Expression = this.TransformExpression(value.Expression);
     return value;
 }