Exemple #1
0
 public void ParseFile(FileRef file, Func<string> getContent)
 {
     lock (_padLock)
     {
         _builder.WriteFile(file);
         _file = file;
         _content = getContent();
         _currentLocation = Location.Root;
         _currentNamespace = null;
         _navigator = new CSharpCodeNavigator(
             _content.ToCharArray(),
             () =>
             {
                 _locationHierarchy.Push(_currentLocation);
                 _locationHierarchyActivity.Add(
                     new LocationHierarchyActivity() { Push = true, Location = _currentLocation });
                 _currentLocation = _suggestedLocation;
                 _suggestedLocation = Location.Unknown;
             },
             () =>
             {
                 _currentLocation = _locationHierarchy.Pop();
                 _locationHierarchyActivity.Add(
                     new LocationHierarchyActivity() { Push = false, Location = _currentLocation });
             },
             (ifdef) =>
                 positionForIfDef(ifdef));
         parse();
     }
 }
Exemple #2
0
        private void handleNamespace(Word word)
        {
            suggestLocation(Location.Namespace);
            var signature = _navigator.CollectSignature();
            var ns        = new Namespce(
                _file,
                signature.Text,
                signature.Line,
                signature.Column + 1);

            _builder.WriteNamespace(ns);
            _currentNamespace = ns;
        }
Exemple #3
0
 public void ParseFile(FileRef file, Func <string> getContent)
 {
     lock (_padLock)
     {
         _builder.WriteFile(file);
         _file             = file;
         _content          = getContent();
         _currentLocation  = Location.Root;
         _currentNamespace = null;
         _navigator        = new CSharpCodeNavigator(
             _content.ToCharArray(),
             () =>
         {
             _locationHierarchy.Push(_currentLocation);
             _locationHierarchyActivity.Add(
                 new LocationHierarchyActivity()
             {
                 Push = true, Location = _currentLocation
             });
             _currentLocation   = _suggestedLocation;
             _suggestedLocation = Location.Unknown;
         },
             () =>
         {
             _currentLocation = _locationHierarchy.Pop();
             _locationHierarchyActivity.Add(
                 new LocationHierarchyActivity()
             {
                 Push = false, Location = _currentLocation
             });
         },
             (ifdef) =>
             positionForIfDef(ifdef));
         parse();
     }
 }
Exemple #4
0
 private void handleNamespace(Word word)
 {
     suggestLocation(Location.Namespace);
     var signature = _navigator.CollectSignature();
     var ns = new Namespce(
         _file,
         signature.Text,
         signature.Line,
         signature.Column + 1);
     _builder.WriteNamespace(ns);
     _currentNamespace = ns;
 }
 public long AddNamespace(Namespce ns)
 {
     return(add(ns, _namespaces));
 }