예제 #1
0
        TokenType DecodeIdentifier(string value)
        {
            TokenType identifierType = TokenType.Symbol;

            if (Instructions.Contains("|" + value.ToUpper() + "|"))
            {
                identifierType |= TokenType.Opcode;
            }
            if (RegisterPairs.Contains("|" + value.ToUpper() + "|"))
            {
                identifierType |= TokenType.RegisterPair;
            }
            if (Registers.Contains("|" + value.ToUpper() + "|"))
            {
                identifierType |= TokenType.Register;
            }
            if (Conditions.Contains("|" + value.ToUpper() + "|"))
            {
                identifierType |= TokenType.Condition;
            }
            if (Directives.Contains("|" + value.ToUpper() + "|"))
            {
                identifierType |= TokenType.Directive;
            }
            if (Preprocessor.Contains("|" + value.ToUpper() + "|"))
            {
                identifierType |= TokenType.Preprocessor;
            }
            return(identifierType);
        }