I'm trying to get Antlr working using NuGet.
The current version of the Antlr.Runtime.dll that I'm trying to reference is 3.1.3.42154.
The issue is that when I try and build my Lexer and Parser .cs files I get a lot of build errors about missing types.
e.g. The class GrammarRuleAttribute cannot be found. I've looking in the Antlr.Runtime.dll and the class isn't there. However if you look at the Antlr project on GitHub then your can see the GrammarRuleAttribute should indeed be in the Antlr.Runtime.dll.
Is this a bug or am I missing something?
This is a somewhat time-sensitive Q/A because the C# targets for ANTLR (CSharp2 by Johannes Luber and CSharp3 by myself) change over time. I know the CSharp2 target has had some issues recently that are being worked on. As of this writing, the current version of the CSharp3 target is 3.3.1.
Here is a link to the CSharp3 target documentation, which includes several download links to the C# port of the ANTLR tool, the CSharp3 runtime, MSBuild support, and some tools for Visual Studio. I update this document periodically as new versions are released.
Edit: If you are experiencing display problems or exception messages when opening a grammar file, you should uninstall the ANTLR 3, StringTemplate, and Extensibility Framework extensions from the Extension Manager and reinstall them per the instructions in the linked documentation. I've updated the extensions to resolve the problem.
I had this problem when using CSharp2 or CSharp3. I'm building in ANTLRWorks 1.5rc1.
It turned out to be related to the ANTLR version. I installed the official package using NuGet, which was 3.1.x. After removing that and installing the unoffical 3.4.1 package, it worked.
There was still a minor issue relating to the HIDDEN channel in my test grammar. Changing it to Hidden (as defined in Antlr3.Runtime) resolved the issue
Related
I am relatively new to Visual Studio, C#, and using Github. I am trying to get the example for AncestralTrees working (Found here: https://github.com/fire-eggs/Ancestral-Tree). I cloned the repo and try to build, but I get a set of errors that do not make sense.
First is that AppSettings.cs and MruStripMenu.cs could not be found. Are these default config files I have to provide, or am I missing something?
And second is that .NET framework v4.5 wasn't found. For this I am a bit confused, because I thought it was backwards compatible, and I have v6.0.301 installed. To try and fix this error, I went to the website provided and downloaded it, but it wouldn't install as I already have a newer version. Again, am I missing something?
Any help would be greatly appreciated!
For the compatibility issue, .Net Core (6.0) and .Net Framework (4.5) are different animals, with .Net Core as more of a successor to Framework. They are very similar, but there are some breaking changes between Framework and Core, and if a project was intended for .Net Framework 4.5 you will want to have it installed on your system and set as the build target for the project in Visual Studio. You could probably also build for 4.7 or 4.8.
For the files, if they are part of the repo I would expect them to be there. I'd check your file system and see if the files are there, and then check the repo on github and see if they are included in the repo. If not, you may need an additional repo or you may need to manually add a NuGet package.
I did notice this at the bottom of the github page:
This program is both a demo of my GEDCOM library: YAGP, and a hopefully useful program in itself.
Where the "YAGP" text is a dead link. So I would expect to also need this project, which either no longer exists or is not public. This is probably the correct address:
https://github.com/fire-eggs/YAGP
(I submitted a change with the fixed link.)
Since the bitbucket repo. of GeckoFX turned private, I am unable to download the older version of
GeckoFX say 37.0.1 .
Is there any source or way to do it to get GeckoFX dlls from the Browser itself or I will stuck on this catch22 thing.
I really need to implement it an only with that version it is possible the thing
I need to achieve. I need to add a plugin built on XPCOM which i not a part of latest Firefox libs.
PS. I have searched zillions of articles and stckoverflow links but could not find any argument supporting my problem.
I don't think a 37.0.1 version ever existed but there was v33 + v45.
Softwareheritage has archived all the repos:
You can find the geckofx stuff here including the downloadable zip files.
The official source can be found here. Note this source contains tags for all the versions, so if you wanted to build v33, you would just update to the tag v33.0-0.10
Apart from Softwareheritage, you find some older pre-packed versions on nuget.
So, while you are able to fetch a earlier release of a specific package for your project using the package manager console in Visual Studio:
Install-Package GeckoFX -Version <press tab key for autocomplete> [*or a different package name]
you will probably not get far. Most of the GeckoFX releases on nuget are targeting more recent version (like v60, v45). But if you look a bit closer you will also find packages that are based on older releases like v33 (for winforms, and core).
I am in the process of porting a complex set of reports from iText5 to iText7 and need to rebuild the .Net community edition with Debug symbols to complete the port from 5 to 7. I am able to run the "possibly" correct CLI command this way:
dotnet pack iTextCore.netstandard.sln /p:Configuration=Debug
but that doesn't get me the same package structure you build for the official nuget package.
We will of course pay for the commercial license when we know our code runs, but in the meantime I'm trying to convert old code.
What is the official guidance from iText Software on how developers should accomplish the port from 5 to 7 with your existing resources? Is there a way to get a Debug build with symbols.
Best regards and congrats on building an excellent library.
TL; DR: use this repository and run
dotnet build iTextCore.netstandard.with.svg.sln /p:Configuration=Debug
nuget pack itext7.nuspec
There is no official guidance on how to migrate from iText5 from iText7. This is a major update of the library and almost all of the user-facing code was developed from scratch. Coming up with such a guide is absolutely infeasible because there is too much to cover. One source of information would be to compare samples from iText in Action book which covered a lot of use cases for iText5 library to their versions ported to iText7. The latter ones can be found here. But if you have specific questions feel free to post them on StackOverflow and you will probably get your answers (if those questions haven't been answered yet; many have been already).
The way the official NuGet package is assembled is more difficult than the one you guessed, but only a tiny bit.
If you look at the repository layout, you will find itext7.nuspec file which is a complete descriptor of the final package. To pack everything you need to call
nuget pack itext7.nuspec
However, you need to build the binaries to pack first. You are interested in iTextCore.netstandard.with.svg.sln solution file which integrates all the Core modules at the moment. The command would be similar to what you described:
dotnet build iTextCore.netstandard.with.svg.sln /p:Configuration=Debug
Please note, however, that an easier approach in order to enable debugging might be for you to download the source code and reference the projects directly, thus you would be easily able to walk through the source code, possibly do the modifications etc.
I got a problem with a project using language parser tool antlr. First when i created project and installed antlr4, then it had succesfully integrated with a grammar file ECMAScript.g4, but once i added antlr3 framework and under this yet one grammar file JSDeobfucs.g and after that i tried to integrate this in the existing project, then project stopped building and files of lexer, parser, listener e.t.c. also are not created anymore, what outputs the compilation errors:
[Error] File
'C:\Users\Dima\Desktop\Projects\C#\JsAstVisitor\JsAstVisitor\obj\Debug\ECMAScriptBaseListener.cs'
not found. [Error] File
'C:\Users\Dima\Desktop\Projects\C#\JsAstVisitor\JsAstVisitor\obj\Debug\ECMAScriptLexer.cs'
not found. [Error] File
'C:\Users\Dima\Desktop\Projects\C#\JsAstVisitor\JsAstVisitor\obj\Debug\ECMAScriptListener.cs'
not found. [Error] File
'C:\Users\Dima\Desktop\Projects\C#\JsAstVisitor\JsAstVisitor\obj\Debug\ECMAScriptParser.cs'
not found.
For integration antlr3 in the Visual Studio 2017 i followed next instruction.
Althought it is strangely what similar instruction isn't created for Visual Studio 2017, so as project antlr build by target differs not only from depending on the antlr framework version
, but on the Visual Studio version. As well as, what in latest version of Visual Studio antlr 3 and 4 not suppored over graphical nuget package manager, but only over nuget manager console i can install them. Here is link to my project( i can't attach archive with a project here because stackoverflow are not supported all file types as i think ).
Therefore please say me:
What is problem can be here in ?
How to resolve it ?
Is it really that in Visual Studio in one C#
project two different versions of antlr conflict and will conflict
with each other ???
If two version of antlr conflicts in single
project, then how to do now that antlr4 again works in my current
project at least and in the same time i wouldn't do project
initially, if this is possibly of course ???
p.s. I found the similar problem with antlr source code generation in C# target here:
Use ANTLR to parse C++ with C#
As i understand what i can use IKVM, but i don't understand: how it helps me in my common problem with antlr integration in C# project. Anyway help me, please.
I was facing the same issue, and this fixed it-
"You will need to right click the grammar file in Solution Explorer and select Properties. In the properties window, configure the following items.
Build Action: Antlr4
Custom Tool: MSBuild:Compile
Custom Tool Namespace: The complete name of the namespace you want the generated classes to be located within. The ANTLR Language Support extension configures this field according to the root namespace configured for the C# project combined with the subfolder within the project where the grammar is located."
Refer - https://github.com/tunnelvisionlabs/antlr4cs
I'm trying to get Saxon 9.7 HE up and running in C#, and failing miserably.
As per instructions, I am downloading and running https://sourceforge.net/projects/saxon/files/Saxon-HE/9.7/SaxonHE9-7-0-14N-setup.exe/download
This installs a bunch of files into C:\Program Files\Saxonica\SaxonHE9.7N.
In the bin folder inside this one, the following files are present:
No matter which DLLs I add as references to my project, the "using Saxon.Api;" reference fails to resolve.
Am I using the correct DLLs here? Is it some sort of .Net version mismatch? My class library project is set to .Net 3.5 currently.
Thanks for any help
The minimum supported version of .NET for Saxon is indeed 4.0.
The bug is in the documentation which will be updated shortly: See bug issue: https://saxonica.plan.io/issues/3085
Thanks for reporting the issue.
Some guess work here. But the dependency on .net 4 is most likley from the compiling of the C# wrapper over the saxon java library that was converted using IKVM. IKVM says it only requires .net 2.0, so I think the only place that dependancy can come from is the saxon9he-api.
You should be able to build this yourself, its quite thin.
https://dev.saxonica.com/repos/archive/opensource/latest9.7/hen/csource/api/Saxon.Api/
Otherwise if its a show stopper ask Michael Kay (the author), he's pretty active on stack overflow.
Updated
I was curious so I checked, the .Net 4 dependency seems to come from the saxon9he-api (which i'm fairly certain could be re-compiled under 3.5 with no/minimal changes), the same for the Query and Transform exe's.