Exemple #1
0
        protected override string TryConvertFromImpl(string text, ITextClass anotherClass)
        {
            if (anotherClass is StringTextClass)
            {
                return(text);
            }

            return(null);
        }
        protected override string TryConvertFromImpl(string text, ITextClass anotherClass)
        {
            if (
                anotherClass is WordTextClass &&
                !SQLiteParsingHelper.IsReservedWord(text))
            {
                return(text);
            }

            return(null);
        }
 protected TextNodeBase(
     ITextClass textClass,
     Action <ActionNode, IToken, IResultAccumulator> action,
     INodeFamily family,
     string name)
     : this(
         new[] { textClass },
         action,
         family,
         name)
 {
 }
Exemple #4
0
 public TextToken(
     ITextClass @class,
     ITextDecoration decoration,
     string text,
     Position position,
     int consumedLength)
     : base(position, consumedLength)
 {
     this.Class      = @class ?? throw new ArgumentNullException(nameof(@class));
     this.Decoration = decoration ?? throw new ArgumentNullException(nameof(decoration));
     this.Text       = text ?? throw new ArgumentNullException(nameof(text));
 }
Exemple #5
0
 public TextNode(
     ITextClass textClass,
     Action <ActionNode, IToken, IResultAccumulator> action,
     INodeFamily family,
     string name)
     : base(
         textClass,
         action,
         family,
         name)
 {
 }
Exemple #6
0
        protected override string TryConvertFromImpl(string text, ITextClass anotherClass)
        {
            if (anotherClass.IsIn(
                    TermTextClass.Instance,
                    KeyTextClass.Instance,
                    StringTextClass.Instance
                    ))
            {
                return(text);
            }

            return(null);
        }
 public ExactTextNode(
     string exactText,
     ITextClass textClass,
     bool isCaseSensitive,
     Action <ActionNode, IToken, IResultAccumulator> action,
     INodeFamily family,
     string name)
     : this(
         exactText,
         new[] { textClass },
         isCaseSensitive,
         action,
         family,
         name)
 {
 }
Exemple #8
0
 public MultiTextNode(
     IEnumerable <string> texts,
     ITextClass textClass,
     bool isCaseSensitive,
     Action <ActionNode, IToken, IResultAccumulator> action,
     INodeFamily family,
     string name)
     : this(
         texts,
         new[] { textClass },
         isCaseSensitive,
         action,
         family,
         name)
 {
 }
Exemple #9
0
        public string TryConvertFrom(string text, ITextClass anotherClass)
        {
            if (text == null)
            {
                throw new ArgumentNullException(nameof(text));
            }

            if (anotherClass == null)
            {
                throw new ArgumentNullException(nameof(anotherClass));
            }

            if (anotherClass.GetType() == this.GetType())
            {
                return(text);
            }

            return(this.TryConvertFromImpl(text, anotherClass));
        }
 protected override string TryConvertFromImpl(string text, ITextClass anotherClass) => null;
Exemple #11
0
 protected abstract string TryConvertFromImpl(string text, ITextClass anotherClass);
 protected override string TryConvertFromImpl(string text, ITextClass anotherClass)
 {
     return(null); // won't convert from anything.
 }