Esempio n. 1
0
        private static IEnumerable <OperandType> ParseParameters(String[] tokens)
        {
            List <OperandType> list = new List <OperandType>();

            for (int i = 1; i < tokens.Count(); ++i)
            {
                list.Add(OperandTypeFactory.GetTypeForName(tokens[i]));
            }

            return(list);
        }
Esempio n. 2
0
 public void AddOperandType(String type)
 {
     operandTypes.Add(OperandTypeFactory.GetTypeForName(type));
 }
        public void TestTypeConstValue()
        {
            OperandType result = OperandTypeFactory.GetTypeForName("const");

            Assert.AreEqual(OperandType.CONST, result);
        }
        public void TestIgnoreCase()
        {
            OperandType result = OperandTypeFactory.GetTypeForName("|aDDr|");

            Assert.AreEqual(OperandType.INDIRECT_ADDRESS, result);
        }
        public void TestIsTrimmed()
        {
            OperandType result = OperandTypeFactory.GetTypeForName("         |reg|          ");

            Assert.AreEqual(OperandType.INDIRECT_REGISTER, result);
        }
 public void TestInvalidType()
 {
     OperandTypeFactory.GetTypeForName("|Invalid|");
 }
        public void TestTypeIndirectAddr()
        {
            OperandType result = OperandTypeFactory.GetTypeForName("|addr|");

            Assert.AreEqual(OperandType.INDIRECT_ADDRESS, result);
        }
        public void TestTypeReg()
        {
            OperandType result = OperandTypeFactory.GetTypeForName("reg");

            Assert.AreEqual(OperandType.REGISTER, result);
        }
        public void TestTypeAddr()
        {
            OperandType result = OperandTypeFactory.GetTypeForName("addr");

            Assert.AreEqual(OperandType.ADDRESS, result);
        }
        public void TestTypeOffsetValue()
        {
            OperandType result = OperandTypeFactory.GetTypeForName("offset");

            Assert.AreEqual(OperandType.OFFSET, result);
        }