コード例 #1
0
            public override string ToString(int indent)
            {
                StringBuilder builder = new StringBuilder();

                builder.Indent(indent).AppendLine("UnaryOperator:");
                builder.Indent(indent + 1).AppendLine("Operator:");
                builder.Indent(indent + 2).AppendLine(UnaryOperatorType.ToString());
                builder.Indent(indent + 1).AppendLine("Operand:");
                builder.AppendLine(operand.ToString(indent + 2));
                return(builder.ToString());
            }
コード例 #2
0
        public static string OperName(UnaryOperatorType oper)
        {
            switch (oper)
            {
            case UnaryOperatorType.UnaryPlus:
                return("+");

            case UnaryOperatorType.UnaryNegation:
                return("-");

            case UnaryOperatorType.LogicalNot:
                return("!");

            case UnaryOperatorType.OnesComplement:
                return("~");

            case UnaryOperatorType.AddressOf:
                return("&");
            }

            throw new NotImplementedException(oper.ToString());
        }
コード例 #3
0
ファイル: AstUtil.cs プロジェクト: codehaus/boo
 public static string GetMethodNameForOperator(UnaryOperatorType op)
 {
     return("op_" + op.ToString());
 }
コード例 #4
0
ファイル: AstUtil.cs プロジェクト: w4x/boolangstudio
 public static string GetMethodNameForOperator(UnaryOperatorType op)
 {
     return "op_" + op.ToString();
 }