コード例 #1
0
ファイル: Tokenizer.cs プロジェクト: nkchinh/grammatica
        /**
         * Returns a description of the token pattern with the
         * specified id.
         *
         * @param id             the token pattern id
         *
         * @return the token pattern description, or
         *         null if not present
         */
        public string GetPatternDescription(int id)
        {
            TokenPattern pattern;

            pattern = stringDfaMatcher.GetPattern(id);
            if (pattern == null)
            {
                pattern = nfaMatcher.GetPattern(id);
            }
            if (pattern == null)
            {
                pattern = regExpMatcher.GetPattern(id);
            }
            return((pattern == null) ? null : pattern.ToShortString());
        }