Skip to content

Commit ce19d0a

Browse files
committed
revert commit 5c44833
Merge pull request nhibernate#551 from hazzik/NH-3945 NH-3945 - Update Antlr3 to v 3.5.1
1 parent 3e9d4b4 commit ce19d0a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+47565
-3
lines changed

ShowBuildMenu.bat

Lines changed: 78 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,20 @@ echo E. Build NHibernate (Debug)
2222
echo F. Build NHibernate (Release)
2323
echo G. Build Release Package (Also runs tests and creates documentation)
2424
echo.
25+
echo --- GRAMMAR ---
26+
echo H. Grammar operations (related to Hql.g and HqlSqlWalker.g)
27+
echo.
2528
echo --- TeamCity (CI) build options
2629
echo I. TeamCity build menu
2730
echo.
2831
echo --- Exit ---
2932
echo X. Make the beautiful build menu go away.
3033
echo.
3134

32-
%BUILDTOOL% prompt ABCDEFGIX
33-
if errorlevel 8 goto end
34-
if errorlevel 7 goto teamcity-menu
35+
%BUILDTOOL% prompt ABCDEFGHIX
36+
if errorlevel 9 goto end
37+
if errorlevel 8 goto teamcity-menu
38+
if errorlevel 7 goto grammar-menu
3539
if errorlevel 6 goto build-release-package
3640
if errorlevel 5 goto build-release
3741
if errorlevel 4 goto build-debug
@@ -191,6 +195,77 @@ echo including NuGet packages and tools to push them.
191195
echo.
192196
goto main-menu
193197

198+
:grammar-menu
199+
echo.
200+
echo --- GRAMMAR ---
201+
echo A. Regenerate all grammars.
202+
echo Hql.g to HqlLexer.cs
203+
echo Hql.g to HqlParser.cs
204+
echo HqlSqlWalker.g to HqlSqlWalker.cs
205+
echo SqlGenerator.g to SqlGenerator.cs
206+
echo B. Regenerate all grammars, with Hql.g in debug mode.
207+
echo C. Regenerate all grammars, with HqlSqlWalker.g in debug mode.
208+
echo D. Regenerate all grammars, with SqlGenerator.g in debug mode.
209+
echo E. Quick instructions on using debug mode.
210+
echo.
211+
echo X. Exit to main menu.
212+
echo.
213+
214+
%BUILDTOOL% prompt ABCDEX
215+
if errorlevel 5 goto main-menu
216+
if errorlevel 4 goto antlr-debug
217+
if errorlevel 3 goto antlr-sqlgenerator-debug
218+
if errorlevel 2 goto antlr-hqlsqlwalker-debug
219+
if errorlevel 1 goto antlr-hql-debug
220+
if errorlevel 0 goto antlr-all
221+
222+
:antlr-all
223+
echo *** Regenerating from Hql.g
224+
call src\NHibernate\Hql\Ast\ANTLR\AntlrHql.bat
225+
echo *** Regenerating from HqlSqlWalker.g
226+
call src\NHibernate\Hql\Ast\ANTLR\AntlrHqlSqlWalker.bat
227+
echo *** Regenerating from SqlGenerator.g
228+
call src\NHibernate\Hql\Ast\ANTLR\AntlrSqlGenerator.bat
229+
goto main-menu
230+
231+
:antlr-hql-debug
232+
echo *** Regenerating from Hql.g (Debug Enabled)
233+
call src\NHibernate\Hql\Ast\ANTLR\AntlrHqlDebug.bat
234+
echo *** Regenerating from HqlSqlWalker.g
235+
call src\NHibernate\Hql\Ast\ANTLR\AntlrHqlSqlWalker.bat
236+
echo *** Regenerating from SqlGenerator.g
237+
call src\NHibernate\Hql\Ast\ANTLR\AntlrSqlGenerator.bat
238+
goto main-menu
239+
240+
:antlr-hqlsqlwalker-debug
241+
echo *** Regenerating from Hql.g
242+
call src\NHibernate\Hql\Ast\ANTLR\AntlrHql.bat
243+
echo *** Regenerating from HqlSqlWalker.g (Debug Enabled)
244+
call src\NHibernate\Hql\Ast\ANTLR\AntlrHqlSqlWalkerDebug.bat
245+
echo *** Regenerating from SqlGenerator.g
246+
call src\NHibernate\Hql\Ast\ANTLR\AntlrSqlGenerator.bat
247+
goto main-menu
248+
249+
:antlr-sqlgenerator-debug
250+
echo *** Regenerating from Hql.g
251+
call src\NHibernate\Hql\Ast\ANTLR\AntlrHql.bat
252+
echo *** Regenerating from HqlSqlWalker.g
253+
call src\NHibernate\Hql\Ast\ANTLR\AntlrHqlSqlWalker.bat
254+
echo *** Regenerating from SqlGenerator.g (Debug Enabled)
255+
call src\NHibernate\Hql\Ast\ANTLR\AntlrSqlGeneratorDebug.bat
256+
goto main-menu
257+
258+
:antlr-debug
259+
echo To use the debug grammar:
260+
echo 1. Create a unit test that runs the hql parser on the input you're interested in.
261+
echo The one you want to debug must be the first grammar parsed.
262+
echo 2. Run the unit test. It will appear to stall.
263+
echo 3. Download and run AntlrWorks (java -jar AntlrWorks.jar).
264+
echo 4. Open the grammar you intend to debug in AntlrWorks.
265+
echo 5. Choose "Debug Remote" and accept the default port.
266+
echo 6. You should now be connected and able to step through your grammar.
267+
goto main-menu
268+
194269
:teamcity-menu
195270
echo.
196271
echo --- TeamCity (CI) build options

Tools/Antlr/Antlr3.Runtime.Debug.dll

45 KB
Binary file not shown.

Tools/Antlr/Antlr3.Runtime.dll

101 KB
Binary file not shown.

Tools/Antlr/Antlr3.exe

706 KB
Binary file not shown.

Tools/Antlr/Antlr3.exe.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
5+
<supportedRuntime version="v2.0.50727" sku="Client"/>
6+
</startup>
7+
</configuration>

Tools/Antlr/Antlr3.targets

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
<!--
2+
[The "BSD licence"]
3+
Copyright (c) 2011 Sam Harwell
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions
8+
are met:
9+
1. Redistributions of source code must retain the above copyright
10+
notice, this list of conditions and the following disclaimer.
11+
2. Redistributions in binary form must reproduce the above copyright
12+
notice, this list of conditions and the following disclaimer in the
13+
documentation and/or other materials provided with the distribution.
14+
3. The name of the author may not be used to endorse or promote products
15+
derived from this software without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19+
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20+
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22+
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
-->
28+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
29+
<PropertyGroup>
30+
<BuildSystem>MSBuild</BuildSystem>
31+
<TaskVersion>3.5.0.2</TaskVersion>
32+
<TaskKeyToken>eb42632606e9261f</TaskKeyToken>
33+
<AntlrBuildTaskAssemblyName Condition="'$(AntlrBuildTaskAssemblyName)'==''">AntlrBuildTask, Version=$(TaskVersion), Culture=neutral, PublicKeyToken=$(TaskKeyToken)</AntlrBuildTaskAssemblyName>
34+
</PropertyGroup>
35+
36+
<PropertyGroup>
37+
<LoadTimeSensitiveTargets>
38+
$(LoadTimeSensitiveTargets);
39+
AntlrCompile;
40+
</LoadTimeSensitiveTargets>
41+
<LoadTimeSensitiveProperties>
42+
$(LoadTimeSensitiveProperties);
43+
AntlrCompileDependsOn;
44+
</LoadTimeSensitiveProperties>
45+
</PropertyGroup>
46+
47+
<PropertyGroup>
48+
<AntlrBuildTaskLocation Condition="'$(AntlrBuildTaskPath)'==''">$(MSBuildBinPath)</AntlrBuildTaskLocation>
49+
<AntlrBuildTaskLocation Condition="'$(AntlrBuildTaskPath)'!=''">$(AntlrBuildTaskPath)</AntlrBuildTaskLocation>
50+
<AntlrToolLocation Condition="'$(AntlrToolPath)'==''">$(MSBuildBinPath)\Antlr3\Antlr3.exe</AntlrToolLocation>
51+
<AntlrToolLocation Condition="'$(AntlrToolPath)'!=''">$(AntlrToolPath)</AntlrToolLocation>
52+
</PropertyGroup>
53+
54+
<PropertyGroup>
55+
<AntlrGenCodeFileNames Condition="'$(AntlrGenCodeFileNames)'==''">$(MSBuildProjectFile).AntlrGeneratedCodeFileListAbsolute.txt</AntlrGenCodeFileNames>
56+
</PropertyGroup>
57+
58+
<UsingTask Condition="'$(AntlrBuildTaskPath)'==''" TaskName="Antlr3.Build.Tasks.AntlrClassGenerationTask" AssemblyName="$(AntlrBuildTaskAssemblyName)" />
59+
<UsingTask Condition="'$(AntlrBuildTaskPath)'!=''" TaskName="Antlr3.Build.Tasks.AntlrClassGenerationTask" AssemblyFile="$(AntlrBuildTaskPath)\AntlrBuildTask.dll" />
60+
61+
<PropertyGroup>
62+
<PrepareResourcesDependsOn>
63+
AntlrCompile;
64+
AntlrCompileAddFilesGenerated;
65+
$(PrepareResourcesDependsOn)
66+
</PrepareResourcesDependsOn>
67+
</PropertyGroup>
68+
69+
<PropertyGroup>
70+
<AntlrCompileDependsOn>
71+
AntlrCompileReadGeneratedFileList
72+
</AntlrCompileDependsOn>
73+
</PropertyGroup>
74+
75+
<ItemGroup Condition="'$(BuildingInsideVisualStudio)'=='true'">
76+
<AvailableItemName Include="Antlr3" />
77+
<AvailableItemName Include="AntlrTokens" />
78+
<AvailableItemName Include="AntlrAbstractGrammar" />
79+
</ItemGroup>
80+
81+
<ItemDefinitionGroup>
82+
<Antlr3>
83+
<Generator>MSBuild:Compile</Generator>
84+
<TargetLanguage/>
85+
<DebugGrammar>false</DebugGrammar>
86+
<ProfileGrammar>false</ProfileGrammar>
87+
</Antlr3>
88+
</ItemDefinitionGroup>
89+
90+
<Target Name="AntlrCompileReadGeneratedFileList">
91+
<ReadLinesFromFile File="$(IntermediateOutputPath)$(AntlrGenCodeFileNames)">
92+
<Output TaskParameter="Lines" ItemName="AntlrOutputCodeFilesList"/>
93+
</ReadLinesFromFile>
94+
</Target>
95+
96+
<PropertyGroup>
97+
<!-- Add grammar compilation to the CoreCompileDependsOn so that the IDE inproc compilers (particularly VB)
98+
can "see" the generated source files. -->
99+
<CoreCompileDependsOn Condition="'$(BuildingInsideVisualStudio)' == 'true' ">
100+
DesignTimeGrammarCompilation;
101+
$(CoreCompileDependsOn)
102+
</CoreCompileDependsOn>
103+
</PropertyGroup>
104+
105+
<Target Name="DesignTimeGrammarCompilation">
106+
<!-- Only if we are not actually performing a compile i.e. we are in design mode -->
107+
<CallTarget Condition="'$(BuildingProject)' != 'true'"
108+
Targets="AntlrCompile" />
109+
</Target>
110+
111+
<Target Name="AntlrCompile"
112+
DependsOnTargets="$(AntlrCompileDependsOn)"
113+
Condition="'@(Antlr3)' != ''"
114+
Inputs="@(Antlr3);@(AntlrTokens);@(AntlrAbstractGrammar)"
115+
Outputs="@(AntlrOutputCodeFilesList);
116+
$(IntermediateOutputPath)$(AntlrGenCodeFileNames);">
117+
118+
<ItemGroup>
119+
<AntlrGeneratedCodeFiles Remove="@(AntlrGeneratedCodeFiles)" />
120+
</ItemGroup>
121+
122+
<PropertyGroup>
123+
<_IntellisenseOnlyCompile>false</_IntellisenseOnlyCompile>
124+
<_IntellisenseOnlyCompile Condition="'$(BuildingProject)' != 'true'">true</_IntellisenseOnlyCompile>
125+
</PropertyGroup>
126+
<AntlrClassGenerationTask
127+
AntlrToolPath="$(AntlrToolLocation)"
128+
BuildTaskPath="$(AntlrBuildTaskLocation)"
129+
OutputPath="$(IntermediateOutputPath)"
130+
TargetLanguage="%(Antlr3.TargetLanguage)"
131+
SourceCodeFiles="@(Antlr3)"
132+
ContinueOnError="$(_IntellisenseOnlyCompile)"
133+
TokensFiles="@(AntlrTokens)"
134+
AbstractGrammarFiles="@(AntlrAbstractGrammar)"
135+
LanguageSourceExtensions="$(DefaultLanguageSourceExtension)"
136+
DebugGrammar="%(Antlr3.DebugGrammar)"
137+
ProfileGrammar="%(Antlr3.ProfileGrammar)">
138+
139+
<Output ItemName="AntlrGeneratedCodeFiles" TaskParameter="GeneratedCodeFiles" />
140+
</AntlrClassGenerationTask>
141+
142+
<WriteLinesToFile
143+
Condition="'$(_IntellisenseOnlyCompile)' != 'true'"
144+
File="$(IntermediateOutputPath)$(AntlrGenCodeFileNames)"
145+
Lines="@(AntlrGeneratedCodeFiles)"
146+
Overwrite="true"/>
147+
</Target>
148+
149+
<Target Name="AntlrCompileAddFilesGenerated"
150+
AfterTargets="AntlrCompile"
151+
Condition="'@(Antlr3)' != ''">
152+
153+
<ItemGroup>
154+
<AntlrGeneratedCodeFiles Condition="'@(AntlrGeneratedCodeFiles)' == ''" Include="@(AntlrOutputCodeFilesList)" />
155+
</ItemGroup>
156+
157+
<ItemGroup>
158+
<FileWrites Include="@(AntlrGeneratedCodeFiles);
159+
$(IntermediateOutputPath)$(AntlrGenCodeFileNames);" />
160+
</ItemGroup>
161+
162+
<ItemGroup>
163+
<Compile Include="@(AntlrGeneratedCodeFiles)" />
164+
<!-- The WinFX "GenerateTemporaryTargetAssembly" target requires generated code files be added here. -->
165+
<_GeneratedCodeFiles Include="@(AntlrGeneratedCodeFiles)" />
166+
</ItemGroup>
167+
168+
</Target>
169+
</Project>
37.5 KB
Binary file not shown.

Tools/Antlr/Antlr4.StringTemplate.dll

191 KB
Binary file not shown.

Tools/Antlr/AntlrBuildTask.dll

17 KB
Binary file not shown.

0 commit comments

Comments
 (0)