-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1341 from retailcoder/next
Stabilized parser
- Loading branch information
Showing
7 changed files
with
108 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,9 @@ | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Antlr4.Runtime; | ||
using Microsoft.Vbe.Interop; | ||
using Rubberduck.Parsing.VBA; | ||
|
||
namespace Rubberduck.Parsing | ||
{ | ||
public interface IRubberduckParser | ||
{ | ||
RubberduckParserState State { get; } | ||
void LoadComReference(Reference item); | ||
void UnloadComReference(Reference reference); | ||
void ParseComponent(VBComponent component, TokenStreamRewriter rewriter = null); | ||
Task ParseAsync(VBComponent component, CancellationToken token, TokenStreamRewriter rewriter = null); | ||
void Cancel(VBComponent component = null); | ||
void Resolve(CancellationToken token); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.Collections.Generic; | ||
using Microsoft.Vbe.Interop; | ||
|
||
namespace Rubberduck.Parsing.VBA | ||
{ | ||
/// <summary> | ||
/// A <c>Dictionary</c> keyed with a <see cref="VBProject"/>'s ID and valued with an <see cref="int"/> representing a <see cref="Reference"/>'s priority for that project. | ||
/// </summary> | ||
public class ReferencePriorityMap : Dictionary<string, int> | ||
{ | ||
private readonly string _referenceId; | ||
|
||
public ReferencePriorityMap(string referenceId) | ||
{ | ||
_referenceId = referenceId; | ||
} | ||
|
||
public string ReferenceId | ||
{ | ||
get { return _referenceId; } | ||
} | ||
|
||
public bool IsLoaded { get; set; } | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
var other = obj as ReferencePriorityMap; | ||
if (other == null) return false; | ||
|
||
return other.ReferenceId == ReferenceId; | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return _referenceId.GetHashCode(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters