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) { }
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)); }
public TextNode( ITextClass textClass, Action <ActionNode, IToken, IResultAccumulator> action, INodeFamily family, string name) : base( textClass, action, family, name) { }
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) { }
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) { }
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;
protected abstract string TryConvertFromImpl(string text, ITextClass anotherClass);
protected override string TryConvertFromImpl(string text, ITextClass anotherClass) { return(null); // won't convert from anything. }