/// <summary>
        /// "Base Layer.Alpaca" や、"Base Layer.Alpaca.Bear" などがOK。
        ///
        /// ステートマシン名は無いこともある。
        /// </summary>
        /// <param name="query"></param>
        /// <param name="ref_caret"></param>
        /// <param name="maxFt"></param>
        /// <returns></returns>
        public static bool Fixed_LayerName_And_StatemachineNames_And_StateName(string query, ref int ref_caret, ref FullpathTokens maxFt)
        {
            FullpathTokens ft    = new FullpathTokens("LayerName_And_StatemachineNames_And_StateName");
            int            caret = ref_caret;
            string         layerNameEndsWithoutDot;
            List <string>  statemachineNamesEndsWithoutDot;
            string         stateName;

            if (!FullpathLexcalP.VarLayerName(query, ref caret, out layerNameEndsWithoutDot))
            {
                return(NotMatched(maxFt, caret, ref maxFt));
            }
            ft.LayerNameEndsWithoutDot = layerNameEndsWithoutDot;

            // ステートマシン名はオプション。
            if (FullpathLexcalP.VarStatemachineNames(query, ref caret, out statemachineNamesEndsWithoutDot))
            {
                ft.StatemachineNamesEndsWithoutDot = statemachineNamesEndsWithoutDot;
            }

            if (!FullpathLexcalP.VarStateName(query, ref caret, out stateName))
            {
                return(NotMatched(maxFt, caret, ref maxFt));
            }
            ft.StateName = stateName;

            maxFt = ft; ref_caret = caret; return(true);
        }
        public void N80_Lexical_VarLayerName()
        {
            string query = "Base Layer.Alpaca.Bear.Cat";
            int    caret = 0;
            string layerNameEndsWithoutDot;

            bool successful = FullpathLexcalP.VarLayerName(query, ref caret, out layerNameEndsWithoutDot);

            Assert.IsTrue(successful);
            Assert.AreEqual(11, caret);
            Assert.AreEqual("Base Layer", layerNameEndsWithoutDot);
        }
        /// <summary>
        /// ドット(.) または文末までがレイヤー名。
        ///
        /// (FIXME: 実際はレイヤー名にはドットを含むことができるが、運用で避けるものとする)
        /// </summary>
        /// <param name="query"></param>
        /// <param name="caret"></param>
        /// <returns></returns>
        public static bool Fixed_LayerName(string query, ref int ref_caret, ref FullpathTokens maxFt)
        {
            FullpathTokens ft    = new FullpathTokens("LayerName");
            int            caret = ref_caret;
            string         layerNameEndsWithoutDot;

            if (!FullpathLexcalP.VarLayerName(query, ref caret, out layerNameEndsWithoutDot))
            {
                return(NotMatched(maxFt, caret, ref maxFt));
            }
            ft.LayerNameEndsWithoutDot = layerNameEndsWithoutDot;

            maxFt = ft; ref_caret = caret; return(true);
        }