protected virtual void _Generate(AstNodeExprUnop item)
        {
            //var rightType = item.RightNode.Type;

            Generate(item.RightNode);

            switch (item.Operator)
            {
            case "~":
                Emit(OpCodes.Not);
                break;

            case "+": break;

            case "-":
                Emit(OpCodes.Neg);
                break;

            case "!":
                Emit(OpCodes.Ldc_I4_0);
                Emit(OpCodes.Ceq);
                break;

            default: throw new NotImplementedException($"Not implemented operator '{item.Operator}'");
            }
        }
Пример #2
0
        protected virtual void _Generate(AstNodeExprUnop Item)
        {
            var RightType = Item.RightNode.Type;

            this.Generate(Item.RightNode);

            switch (Item.Operator)
            {
            case "~": Emit(OpCodes.Not); break;

            case "+": break;

            case "-": Emit(OpCodes.Neg); break;

            case "!": Emit(OpCodes.Ldc_I4_0); Emit(OpCodes.Ceq); break;

            default: throw(new NotImplementedException(String.Format("Not implemented operator '{0}'", Item.Operator)));
            }
        }
Пример #3
0
 protected virtual void _Generate(AstNodeExprUnop item)
 {
     Output.Write("(" + item.Operator);
     Generate(item.RightNode);
     Output.Write(")");
 }
Пример #4
0
 protected virtual void _Generate(AstNodeExprUnop Item)
 {
     Output.Write("(" + Item.Operator);
     this.Generate(Item.RightNode);
     Output.Write(")");
 }