Skip to content

Commit de2a406

Browse files
authored
Made IJmesPathGenerator independant from the parser. (#59)
1 parent 26d3244 commit de2a406

File tree

5 files changed

+74
-51
lines changed

5 files changed

+74
-51
lines changed

jmespath.net.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".config", ".config", "{7D92
2929
.config\dotnet-tools.json = .config\dotnet-tools.json
3030
EndProjectSection
3131
EndProject
32+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "jmespath.net.interop", "src\jmespath.net.interop\jmespath.net.interop.csproj", "{2DDBA93E-7988-4C23-93FE-4E8485BA0BCD}"
33+
EndProject
3234
Global
3335
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3436
Debug|Any CPU = Debug|Any CPU
@@ -51,6 +53,10 @@ Global
5153
{A3301284-F70F-45E2-ABC9-A19D66A10712}.Debug|Any CPU.Build.0 = Debug|Any CPU
5254
{A3301284-F70F-45E2-ABC9-A19D66A10712}.Release|Any CPU.ActiveCfg = Release|Any CPU
5355
{A3301284-F70F-45E2-ABC9-A19D66A10712}.Release|Any CPU.Build.0 = Release|Any CPU
56+
{2DDBA93E-7988-4C23-93FE-4E8485BA0BCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57+
{2DDBA93E-7988-4C23-93FE-4E8485BA0BCD}.Debug|Any CPU.Build.0 = Debug|Any CPU
58+
{2DDBA93E-7988-4C23-93FE-4E8485BA0BCD}.Release|Any CPU.ActiveCfg = Release|Any CPU
59+
{2DDBA93E-7988-4C23-93FE-4E8485BA0BCD}.Release|Any CPU.Build.0 = Release|Any CPU
5460
EndGlobalSection
5561
GlobalSection(SolutionProperties) = preSolution
5662
HideSolutionNode = FALSE
@@ -60,6 +66,7 @@ Global
6066
{63368C99-13F3-49F6-B221-2AD3595486E7} = {CF8C1543-B634-47F5-BF43-4508F64E0554}
6167
{43EC8A0D-27A8-476C-8806-ED18FCC8B2F2} = {17EC0D83-06FD-45A9-87CE-5A6901204774}
6268
{A3301284-F70F-45E2-ABC9-A19D66A10712} = {6D7773F3-76FA-4E25-A85C-7AA1AD5668D8}
69+
{2DDBA93E-7988-4C23-93FE-4E8485BA0BCD} = {6D7773F3-76FA-4E25-A85C-7AA1AD5668D8}
6370
EndGlobalSection
6471
GlobalSection(ExtensibilityGlobals) = postSolution
6572
SolutionGuid = {759AACA1-7B3D-4EA9-AAC6-CA9150656A98}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
namespace DevLab.JmesPath
2+
{
3+
public interface IJmesPathGenerator
4+
{
5+
bool IsProjection();
6+
7+
void OnExpression();
8+
9+
void OnIdentifier(string name);
10+
void OnLiteralString(string literal);
11+
void OnRawString(string value);
12+
13+
void OnAndExpression();
14+
void OnNotExpression();
15+
void OnOrExpression();
16+
17+
void OnComparisonEqual();
18+
void OnComparisonGreater();
19+
void OnComparisonGreaterOrEqual();
20+
void OnComparisonLesser();
21+
void OnComparisonLesserOrEqual();
22+
void OnComparisonNotEqual();
23+
24+
void OnCurrentNode();
25+
26+
void OnSubExpression();
27+
28+
void OnFilterProjection();
29+
void OnFlattenProjection();
30+
void OnHashWildcardProjection();
31+
void OnListWildcardProjection();
32+
33+
void OnIndex(int index);
34+
void OnIndexExpression();
35+
void OnSliceExpression(int? start, int? stop, int? step);
36+
37+
void PushMultiSelectHash();
38+
void AddMultiSelectHashExpression();
39+
void PopMultiSelectHash();
40+
41+
void PushMultiSelectList();
42+
void AddMultiSelectListExpression();
43+
void PopMultiSelectList();
44+
45+
void PushFunction();
46+
void AddFunctionArg();
47+
void PopFunction(string name);
48+
void OnExpressionType();
49+
50+
void OnPipeExpression();
51+
}
52+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard1.3;net45</TargetFrameworks>
5+
<AssemblyOriginatorKeyFile>../jmespath.net.snk</AssemblyOriginatorKeyFile>
6+
<SignAssembly>True</SignAssembly>
7+
</PropertyGroup>
8+
9+
</Project>
Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,4 @@
1-
namespace DevLab.JmesPath
2-
{
3-
public interface IJmesPathGenerator
4-
{
5-
bool IsProjection();
1+
using DevLab.JmesPath;
2+
using System.Runtime.CompilerServices;
63

7-
void OnExpression();
8-
9-
void OnIdentifier(string name);
10-
void OnLiteralString(string literal);
11-
void OnRawString(string value);
12-
13-
void OnAndExpression();
14-
void OnNotExpression();
15-
void OnOrExpression();
16-
17-
void OnComparisonEqual();
18-
void OnComparisonGreater();
19-
void OnComparisonGreaterOrEqual();
20-
void OnComparisonLesser();
21-
void OnComparisonLesserOrEqual();
22-
void OnComparisonNotEqual();
23-
24-
void OnCurrentNode();
25-
26-
void OnSubExpression();
27-
28-
void OnFilterProjection();
29-
void OnFlattenProjection();
30-
void OnHashWildcardProjection();
31-
void OnListWildcardProjection();
32-
33-
void OnIndex(int index);
34-
void OnIndexExpression();
35-
void OnSliceExpression(int? start, int? stop, int? step);
36-
37-
void PushMultiSelectHash();
38-
void AddMultiSelectHashExpression();
39-
void PopMultiSelectHash();
40-
41-
void PushMultiSelectList();
42-
void AddMultiSelectListExpression();
43-
void PopMultiSelectList();
44-
45-
void PushFunction();
46-
void AddFunctionArg();
47-
void PopFunction(string name);
48-
void OnExpressionType();
49-
50-
void OnPipeExpression();
51-
}
52-
}
4+
[assembly:TypeForwardedTo(typeof(IJmesPathGenerator))]

src/jmespath.net.parser/jmespath.net.parser.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
<Compile Include="JmesPathScanner.g.cs" Condition="!Exists( 'JmesPathScanner.g.cs' )" />
2424
<Compile Include="JmesPathParser.g.cs" Condition="!Exists( 'JmesPathParser.g.cs' )" />
2525
</ItemGroup>
26+
<ItemGroup>
27+
<ProjectReference Include="..\jmespath.net.interop\jmespath.net.interop.csproj" />
28+
</ItemGroup>
2629

2730
<Target Name="_RestoreDotnetCliTool" Inputs="JmesPathScanner.lex;JmesPathParser.y" Outputs="JmesPathScanner.g.cs;JmesPathParser.g.cs">
2831
<Exec Command="dotnet tool restore" />

0 commit comments

Comments
 (0)