Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go target, ErrorStrategy, broken interface #2528

Open
dtgorski opened this issue Apr 8, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@dtgorski
Copy link

commented Apr 8, 2019

Hello,

while playing with Go and ANTLR, I stumbled across the ErrorStrategy interface in runtime/Go/antlr/error_strategy.go:

type ErrorStrategy interface {
        reset(Parser)                              // <--
        RecoverInline(Parser) Token
        Recover(Parser, RecognitionException)
        Sync(Parser)
        inErrorRecoveryMode(Parser) bool           // <--
        ReportError(Parser, RecognitionException)
        ReportMatch(Parser)
}

This "interface" defines two private (not package-exportable) methods. Hence it is impossible for any other Go package to satisfy this interface and provide an other implementation.

Is there any chance to rewrite the Go target that way, that either the "private" methods are dropped from the ErrorStrategy interface or made public by writing their names in uppercase letters?

regards dtg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.