/// <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> /// <returns></returns> public bool CanHandleLex(Token token) { _lastMatchedLex = null; var plugin = GetLex(token); if (plugin == null) { return(false); } _lastMatchedLex = plugin; return(true); }
/// <summary> /// Registers a lex 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 RegisterLexPlugin(ILexPlugin plugin, bool sort) { RegisterPlugin(_lexPlugins, plugin, plugin.Tokens, sort); }