Beispiel #1
0
 /// <summary>
 /// Standard constructor
 /// </summary>
 protected TokenDescription(int priority,
                            TokenDescriptionOptions options,
                            TokenClassification classification = TokenClassification.Unknown)
 {
     Priority       = priority;
     Options        = options;
     Classification = classification;
 }
Beispiel #2
0
 /// <summary>
 /// Create
 /// </summary>
 public static TokenDescription Create(TokenDescriptionFunc.Locator entireLocator,
                                       int priority = DefaultPriority,
                                       TokenDescriptionOptions options    = TokenDescriptionOptions.None,
                                       TokenClassification classification = TokenClassification.Unknown)
 {
     return(new TokenDescriptionFunc(entireLocator, priority, options)
     {
         Classification = classification
     });
 }
Beispiel #3
0
 /// <summary>
 /// Create
 /// </summary>
 public static TokenDescription Create(string entirePattern,
                                       int priority = DefaultPriority,
                                       TokenDescriptionOptions options    = TokenDescriptionOptions.None,
                                       TokenClassification classification = TokenClassification.Unknown)
 {
     return(new TokenDescriptionRegex(entirePattern, priority, options)
     {
         Classification = classification
     });
 }
        /// <summary>
        /// Standard constructor
        /// </summary>
        public TokenDescriptionRegex(string entirePattern, int priority, TokenDescriptionOptions options)
            : base(priority, options)
        {
            if (string.IsNullOrEmpty(entirePattern))
            {
                throw new ArgumentNullException("entirePattern", "Entire Pattern must not be null or empty.");
            }

            m_EntirePattern = entirePattern;

            CoreUpdate();
        }
Beispiel #5
0
        /// <summary>
        /// Create
        /// </summary>
        public static TokenDescription Create(IEnumerable <string> words,
                                              int priority = DefaultPriority,
                                              TokenDescriptionOptions options    = TokenDescriptionOptions.None,
                                              TokenClassification classification = TokenClassification.Unknown)
        {
            bool          caseSensitive = !((options & TokenDescriptionOptions.IgnoreCase) == TokenDescriptionOptions.IgnoreCase);
            TokenKeyWords keyWords      = new TokenKeyWords(caseSensitive, words);

            return(new TokenDescriptionKeyWords(keyWords, priority)
            {
                Classification = classification
            });
        }
Beispiel #6
0
 /// <summary>
 /// Standard constructor
 /// </summary>
 private RegexTokenDescription(int priority, TokenDescriptionOptions options)
     : base(priority, options)
 {
 }
 /// <summary>
 /// Standard constructor
 /// </summary>
 public TokenDescriptionFunc(Locator entireLocator, int priority, TokenDescriptionOptions options)
     : base(priority, options)
 {
     m_EntireMatch = entireLocator ?? throw new ArgumentNullException("entireLocator", "Entire locator must not be null.");
 }
 /// <summary>
 /// Standard constructor
 /// </summary>
 public TokenDescriptionFunc(Locator startLocator, LocatorStop stopLocator, int priority, TokenDescriptionOptions options)
     : base(priority, options)
 {
     m_StartMatch = startLocator ?? throw new ArgumentNullException("startLocator", "Start locator must not be null.");
     m_StopMatch  = stopLocator ?? throw new ArgumentNullException("stopLocator", "Stop locator must not be null.");
 }
        /// <summary>
        /// Standard constructor
        /// </summary>
        public TokenDescriptionRegex(string startPattern, string stopPattern, int priority, TokenDescriptionOptions options)
            : base(priority, options)
        {
            if (string.IsNullOrEmpty(startPattern))
            {
                throw new ArgumentNullException("startPattern", "Start Pattern must not be null or empty.");
            }
            else if (string.IsNullOrEmpty(stopPattern))
            {
                throw new ArgumentNullException("stopPattern", "Stop Pattern must not be null or empty.");
            }

            m_StartPattern = startPattern;
            m_StopPattern  = stopPattern;

            CoreUpdate();
        }