Пример #1
0
        /// <summary>
        /// Transforms a type qualifier to a Qualifier object.
        /// </summary>
        /// <param name="name">The identifier of the type</param>
        /// <returns>The full qualifier</returns>
        public Qualifier TypeQualifier(string name)
        {
            Qualifier ids = new Qualifier();

            ids.Add(name);
            return(ids);
        }
Пример #2
0
        /// <summary>
        /// Transforms a FQUALIFIER tree node into a full qualifier object.
        /// </summary>
        /// <param name="fullQualifier">The AST node</param>
        /// <returns>The full qualifier</returns>
        public static Qualifier GetFullQualifier(ITree fullQualifier)
        {
            Qualifier ids = new Qualifier();

            if (fullQualifier == null)
            {
                return(ids);
            }
            for (int i = 0; i < fullQualifier.ChildCount - 1; i++)
            {
                ids.Add(fullQualifier.GetChild(i).Text);
            }

            if (fullQualifier.GetChild(fullQualifier.ChildCount - 1).Text.Equals("ARRAY"))
            {
                ids[ids.Count - 1] = ids[ids.Count - 1] + "[]";
            }
            else
            {
                ids.Add(fullQualifier.GetChild(fullQualifier.ChildCount - 1).Text);
            }

            return(ids);
        }