public void ParseFile(string file, Func<string> getContent) { lock (_padLock) { _builder.AddFile(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(); } }
public void AddNamespace(Namespace ns) { writeSignature("namespace", ns); }
public void AddNamespace(Namespace ns) { Namespaces.Add(ns); }
private void handleNamespace(Word word) { suggestLocation(Location.Namespace); var signature = _navigator.CollectSignature(); var ns = new Namespace( _file, signature.Text, signature.Offset, signature.Line, signature.Column + 1); _builder.AddNamespace(ns); _currentNamespace = ns; }