Example #1
0
 public AstProcessor(IModule module)
 {
     AllAstIndices      = new Dictionary <object, AstDescriptor>();
     AllAstObjects      = new Dictionary <AstDescriptor, object>();
     AllNodes           = new List <AstNode>();
     _traversedModule   = module;
     _currentDescriptor = new AstDescriptor(0);
 }
Example #2
0
 public void Process <T>(T obj)
 {
     _currentNode = new AstNode(CreateProcessingContext <T>(), obj);//new AstNode(new AstDescriptor(TreeObjectsCounter), obj);
     if (!AllAstIndices.ContainsKey(obj))
     {
         AllAstIndices.Add(obj, GetDescriptorForCurrent());
     }
     AllAstObjects.Add(GetDescriptorForCurrent(), obj);
     AllNodes.Add(_currentNode);
     _currentDescriptor = _currentDescriptor.Increment();
 }
Example #3
0
 public AstDescriptor MethodBodyExit(ISourceMethodBody method)
 {
     _currentBody       = null;
     _currentDescriptor = _currentDescriptor.GoUp();
     return(_currentDescriptor);
 }
Example #4
0
 public void MethodBodyEnter(ISourceMethodBody method)
 {
     _currentBody       = method;
     _currentDescriptor = _currentDescriptor.GoDown();
 }
Example #5
0
 public void MethodExit(IMethodDefinition method)
 {
     _currentMethodNode = null;
     _currentDescriptor = _currentDescriptor.GoUp();
 }
Example #6
0
 public void MethodEnter(IMethodDefinition method)
 {
     _currentDescriptor = _currentDescriptor.GoDown();
     //   _log.Debug("Going down on " + new MethodIdentifier(method) + " - " + _currentDescriptor);
     _currentMethodNode = new AstNode(_currentNode.Context, method);
 }
Example #7
0
 public void TypeExit(INamespaceTypeDefinition namespaceTypeDefinition)
 {
     _currentTypeNode   = null;
     _currentDescriptor = _currentDescriptor.GoUp();
 }
Example #8
0
 public void TypeEnter(INamespaceTypeDefinition namespaceTypeDefinition)
 {
     _currentDescriptor = _currentDescriptor.GoDown();
     //   _log.Debug("Going down on "+new TypeIdentifier(namespaceTypeDefinition)+" - "+_currentDescriptor);
     _currentTypeNode = new AstNode(_currentNode.Context, namespaceTypeDefinition);
 }
Example #9
0
 public bool IsContainedIn(AstDescriptor another)
 {
     return(another == this || _significant.IsContainedIn(another));
 }
Example #10
0
 public bool Equals(AstDescriptor other)
 {
     return(_significant.Equals(other._significant) && _index == other._index);
 }
Example #11
0
 public bool IsContainedIn(AstDescriptor another)
 {
     return(false);
 }