Closed renzosilv closed 1 year ago
First, remove the reference to Antlr4 v4.6.6 in the .csproj. You really should not use both. I thought I only allowed it in very special situations and with a flag set. I will check that, and fix the code if the check is not working.
Sorry - I copied the wrong state of my code.
The error above happens when that isn't there.
It might have something to do with the path names. I'll check it out.
Looks like that code that's generated is old 4.6.6 code. Antr4BuildTasks may not have cleaned the obj/bin out. Not sure why. Do an "rm -rf bin obj" and then "dotnet build". Also, make sure that every .g4 that you have mentioned in your .csproj is a top-level grammar. In other words, make sure it's not "import" in one of the other .g4 files. Make sure you don't have any old atpLexer.cs sitting around either.
That got me passed that error and I ended up with this one. Doing some online research says is because I'm referencing two assemblies that share types with the exact same name and namespace Should I just alias them to get passed it or is there an option I can pass to antlr ?
StilFileType.cs(20, 19): [CS0433] The type 'GZipStream' exists in both 'Antlr4BuildTasks, Version=11.1.0.0, Culture=neutral, PublicKeyToken=null' and 'SharpCompress, Version=0.32.2.0, Culture=neutral, PublicKeyToken=afb0a02973931d96'
``
I'm sort of surprised that "privateassets" isn't working. You could try adding an "alias" in one or the other packagereference in the .csproj, e.g., <Aliases>HideZip</Aliases>
Thank you - that worked. I added this to my csproj
<PackageReference Include="SharpCompress" Version="0.32.2" >
<Aliases>HideZip</Aliases>
</PackageReference>
And then used it on my code with
extern alias HideZip;
using HideZip.SharpCompress.Compressors;
using HideZip.SharpCompress.Compressors.Deflate;
using HideZip.SharpCompress.Compressors.Deflate.GZipStream zip = new(reader,HideZip.SharpCompress.Compressors.CompressionMode.Decompress);
I was able to compile and deploy - my program is running but my rules are not longer working. Is that to be expected? Has there been an update which would affect that?
I get a lot of things like this
line 6:76 missing '\t' at '\n'
or this
line 20:20 mismatched input '0' expecting {STRING, KEYWORD}
line 24:19 extraneous input ':' expecting KEYWORD
Start printing out the tokens in the program and verify they are what you expect. Compare to the old program if you can.
Tokens fixed and I'm now running
Hello -
Apologies in advance as this is not a bug but I was trying to switch from using antlrcs.
I made the changes listed on the info:
From:
To:
And:
to:
and I'm getting this error
Wondering if you are familiar with it ? The array which this error asks to convert to int is a string array which I didn't generate.