Buffer Class Visibility
Section 3.3 of the GPLEX docs call out ScanBuff as "an abstract, public class." I see you overrode that in commit 647ef58. This is causing CS0053 build errors when the .lex file contains the "%visibility public" flag. The .lex file in question works fine with manual builds of GPLEX. Do you have a suggestions for a work around? I tired setting the /noEmbedBuffers flag and adjusting GplexBuffers.cs manually, but it seems gets overridden on build by YaccLexTools.Gplex
Hi @Capranaut, thank you for reporting this issue. I have identified how to fix it, but is needs a patch to the package. In the meanwhile you can patch manually the file GplexBuffers.cs by replacing line 29 with
#if EXPORT_GPPG
public abstract class ScanBuff
#else
internal abstract class ScanBuff
#endif
Then build with defining the constant EXPORT_GPPG
dotnet build /p:DefineConstants=EXPORT_GPPG
@ernstc Thanks so much! That's certainly a more elegant solution than what I had come up with
<PropertyGroup>
<BuffFile>GplexBuffers.cs</BuffFile>
</PropertyGroup>
<!-- Patches https://github.com/ernstc/YaccLexTools/issues/8 -->
<Target Name="PatchYaccLexBuild" AfterTargets="YaccLexToolsGplexSingleTarget" BeforeTargets="CoreCompile">
<CallTarget Targets="YaccLexToolsGplexSingleTarget"/>
<Message Text="Diagnostic Message: $(BuffFile) not found" Importance="high" Condition="!Exists('$(BuffFile)')"/>
<Message Text="Patching $(BuffFile) visibility mismatch. Remove once https://github.com/ernstc/YaccLexTools/issues/8 has been resolved." Importance="high" Condition="Exists('$(BuffFile)')"/>
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -Command "(Get-Content -Path '$(BuffFile)' -Raw) -replace 'internal abstract class ScanBuff', 'public abstract class ScanBuff' | Set-Content -Path '$(BuffFile)'"" Condition="Exists('$(BuffFile)')"/>
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -Command "(Get-Content -Path '$(BuffFile)' -Raw) -replace 'internal class BufferException', 'public class BufferException' | Set-Content -Path '$(BuffFile)'"" Condition="Exists('$(BuffFile)')"/>
</Target>