Пример #1
0
        public static CILTypeSpecification GetValue(ParseTreeNode node)
        {
            CILClassName className = null;
            CILType      type      = null;

            var classNameParseTreeNode = node.GetFirstChildWithGrammarName(GrammarNames.className);

            if (classNameParseTreeNode != null)
            {
                className = ClassNameParseTreeNodeHelper.GetClassName(classNameParseTreeNode);
            }

            var typeParseTreeNode = node.GetFirstChildWithGrammarName(GrammarNames.type);

            if (typeParseTreeNode != null)
            {
                type = TypeParseTreeNodeHelper.GetType(typeParseTreeNode);
            }

            return(new CILTypeSpecification
            {
                ClassName = className,
                Type = type
            });
        }
Пример #2
0
        public static CILType GetClassType(ParseTreeNode node)
        {
            var classNameParseTreeNode = node.GetFirstChildWithGrammarName(GrammarNames.className);
            var className = ClassNameParseTreeNodeHelper.GetClassName(classNameParseTreeNode);

            return(new CILType
            {
                ClassName = className
            });
        }