/// <summary> /// Whether or not there is a lex plugin that can handle the token supplied. /// </summary> /// <param name="token">The token to check against plugins.</param> /// <param name="isCurrentToken">Whether or not the token supplied is the current token.</param> /// <returns></returns> public bool CanHandleTok(Token token, bool isCurrentToken) { int tokenPos = isCurrentToken ? 0 : 1; var plugin = GetTok(token, tokenPos); _lastMatchedTok = plugin; if (plugin == null) { return(false); } return(true); }
/// <summary> /// Register token plugin. /// </summary> /// <param name="plugin"></param> /// <param name="sort">Whether or not to sort the plugin by precedence after adding it to the system.</param> public void RegisterTokenPlugin(ITokenPlugin plugin, bool sort) { RegisterPlugin(_tokPlugins, plugin, plugin.Tokens, sort); _hasTokenPlugins = true; }