예제 #1
0
파일: JSAstVisitor.cs 프로젝트: xen2/JSIL
            public NodeVisitor Get(JSNode node)
            {
                if (node == null)
                {
                    return(null);
                }

                var nodeType    = node.GetType();
                var currentType = nodeType;

                return(Cache.GetOrCreate(
                           nodeType, () => {
                    while (currentType != null)
                    {
                        NodeVisitor result;
                        if (Methods.TryGetValue(currentType, out result))
                        {
                            return result;
                        }

                        currentType = currentType.BaseType;
                    }

                    return null;
                }
                           ));
            }
예제 #2
0
파일: JSAstVisitor.cs 프로젝트: ilmsg/JSIL
            public NodeVisitor Get(JSNode node)
            {
                if (node == null)
                {
                    return(null);
                }

                var nodeType = node.GetType();

                return(Cache.GetOrCreate(
                           nodeType, FindNodeVisitor
                           ));
            }