Beispiel #1
0
        public override string ToString()
        {
            switch (OpCode)
            {
            case OpCode.Get:
                return(string.Format("{0}?", DataName));

            case OpCode.Literal:
                return(Datum.ToString());

            case OpCode.Add:
                return("+");

            case OpCode.Subtract:
                return("-");

            case OpCode.Multiply:
                return("*");

            case OpCode.Divide:
                return("/");

            case OpCode.Modulo:
                return("%");

            case OpCode.Equal:
                return("=");

            case OpCode.NotEqual:
                return("!=");

            case OpCode.And:
                return("&");

            case OpCode.Or:
                return("|");

            case OpCode.Not:
                return("!");

            case OpCode.LessThan:
                return("<");

            case OpCode.GreaterThan:
                return(">");

            case OpCode.LessThanOrEquals:
                return("<=");

            case OpCode.GreaterThanOrEquals:
                return(">=");

            case OpCode.Maximum:
                return(">>");

            case OpCode.Minimum:
                return("<<");
            }
            throw new ArgumentException("Unknown opcode in instruction.");
        }
Beispiel #2
0
        public override string GenerateContent(Namespace data)
        {
            Datum datum = data.Get(DataName);

            if (datum != null)
            {
                return(datum.ToString());
            }
            else
            {
                return(ToString());
            }
        }