-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Should Go runtime ATN export some fields? #4702
Comments
Why do you want to access this? |
I am trying to understand the code, the repo implements autocompletion. |
type Transition interface {
getTarget() ATNState
setTarget(ATNState)
getIsEpsilon() bool
getLabel() *IntervalSet
getSerializationType() int
Matches(int, int, int) bool
} only |
Some of this is left over from the code I took over and probably could still do with some clean up. But I don't see why Matches has been made public. I would have to look at the code. |
Thanks. |
public abstract int getSerializationType();
/**
* Determines if the transition is an "epsilon" transition.
*
* <p>The default implementation returns {@code false}.</p>
*
* @return {@code true} if traversing this transition in the ATN does not
* consume an input symbol; otherwise, {@code false} if traversing this
* transition consumes (matches) an input symbol.
*/
public boolean isEpsilon() {
return false;
}
public IntervalSet label() { return null; }
public abstract boolean matches(int symbol, int minVocabSymbol, int maxVocabSymbol); |
No - only results. Go is not an OOP language |
Yes, but public method should conform. |
Says who? ;) The go runtime is completely different thing to Java and as such while the same functionality and indeed more functionality may well be available, it may operate completely differently. No obligations are placed upon target authors. The java target is the reference point, but it isn't a requirem,ent to copy it. |
Well, thank you for your reply, I will try other methods. |
For example, I want access
ruleToStartState
field, but it is not exported.Go can't
antlr4/runtime/Go/antlr/v4/atn.go
Line 42 in 2a7904a
But javascript can.
antlr4/runtime/JavaScript/src/antlr4/atn/ATN.d.ts
Line 11 in 2a7904a
The text was updated successfully, but these errors were encountered: