Example #1
0
        public override string GetValueInContext(
            CollatingSequence usedCollatingSequence, bool apostCompilerOption,
            IDictionary <string, string> symbolicCharactersMap,
            int charactersCountContext)
        {
            char repeatedChar = base.GetCharValueInContext(usedCollatingSequence, apostCompilerOption, symbolicCharactersMap);

            return(new string(repeatedChar, charactersCountContext));
        }
Example #2
0
        public char GetCharValueInContext(
            CollatingSequence usedCollatingSequence, bool apostCompilerOption,
            IDictionary <string, string> symbolicCharactersMap)
        {
            string strValue = base.GetValueInContext(usedCollatingSequence, apostCompilerOption, symbolicCharactersMap, 1);

            if (!String.IsNullOrEmpty(strValue))
            {
                return(strValue[0]);
            }
            else
            {
                throw new InvalidOperationException("Unexpected literal token type");
            }
        }
Example #3
0
        public virtual string GetValueInContext(
            CollatingSequence usedCollatingSequence, bool apostCompilerOption,
            IDictionary <string, string> symbolicCharactersMap,
            int charactersCountContext)
        {
            if (IsSymbolicCharacterReference)
            {
                string symbolicCharacterValue = null;
                if (symbolicCharactersMap.TryGetValue(Token.Text, out symbolicCharacterValue))
                {
                    return(symbolicCharacterValue);
                }
                else
                {
                    throw new InvalidOperationException("Undefined symbolic character reference");
                }
            }
            switch (Token.TokenType)
            {
            case TokenType.HIGH_VALUE:
            case TokenType.HIGH_VALUES:
                // Represents one or more occurrences of the character that has
                // the highest/lowest ordinal position in the collating sequence used.
                return(usedCollatingSequence.GetHighValueChar().ToString());

            case TokenType.LOW_VALUE:
            case TokenType.LOW_VALUES:
                // Represents one or more occurrences of the character that has
                // the highest/lowest ordinal position in the collating sequence used.
                return(usedCollatingSequence.GetLowValueChar().ToString());

            case TokenType.QUOTE:
            case TokenType.QUOTES:
                // The quotation mark character ("), if the QUOTE compiler option is in effect
                // The apostrophe character (’), if the APOST compiler option is in effect
                if (apostCompilerOption)
                {
                    return("'");
                }
                else
                {
                    return("\"");
                }

            default:
                return(Value);
            }
        }
Example #4
0
 public override string GetValueInContext(CollatingSequence sequence, bool option, IDictionary <string, string> map, int count)
 {
     return(value);
 }