type Recognizer … type BaseRecognizer … func NewBaseRecognizer() *BaseRecognizer { … } var tokenTypeMapCache … var ruleIndexMapCache … func (b *BaseRecognizer) checkVersion(toolVersion string) { … } func (b *BaseRecognizer) SetError(err RecognitionException) { … } func (b *BaseRecognizer) HasError() bool { … } func (b *BaseRecognizer) GetError() RecognitionException { … } func (b *BaseRecognizer) Action(_ RuleContext, _, _ int) { … } func (b *BaseRecognizer) AddErrorListener(listener ErrorListener) { … } func (b *BaseRecognizer) RemoveErrorListeners() { … } func (b *BaseRecognizer) GetRuleNames() []string { … } func (b *BaseRecognizer) GetTokenNames() []string { … } func (b *BaseRecognizer) GetSymbolicNames() []string { … } func (b *BaseRecognizer) GetLiteralNames() []string { … } func (b *BaseRecognizer) GetState() int { … } func (b *BaseRecognizer) SetState(v int) { … } // GetRuleIndexMap Get a map from rule names to rule indexes. // // Used for XPath and tree pattern compilation. // // TODO: JI This is not yet implemented in the Go runtime. Maybe not needed. func (b *BaseRecognizer) GetRuleIndexMap() map[string]int { … } // GetTokenType get the token type based upon its name func (b *BaseRecognizer) GetTokenType(_ string) int { … } // GetErrorHeader returns the error header, normally line/character position information. // // Can be overridden in sub structs embedding BaseRecognizer. func (b *BaseRecognizer) GetErrorHeader(e RecognitionException) string { … } // GetTokenErrorDisplay shows how a token should be displayed in an error message. // // The default is to display just the text, but during development you might // want to have a lot of information spit out. Override in that case // to use t.String() (which, for CommonToken, dumps everything about // the token). This is better than forcing you to override a method in // your token objects because you don't have to go modify your lexer // so that it creates a NewJava type. // // Deprecated: This method is not called by the ANTLR 4 Runtime. Specific // implementations of [ANTLRErrorStrategy] may provide a similar // feature when necessary. For example, see [DefaultErrorStrategy].GetTokenErrorDisplay() func (b *BaseRecognizer) GetTokenErrorDisplay(t Token) string { … } func (b *BaseRecognizer) GetErrorListenerDispatch() ErrorListener { … } // Sempred embedding structs need to override this if there are sempreds or actions // that the ATN interpreter needs to execute func (b *BaseRecognizer) Sempred(_ RuleContext, _ int, _ int) bool { … } // Precpred embedding structs need to override this if there are preceding predicates // that the ATN interpreter needs to execute func (b *BaseRecognizer) Precpred(_ RuleContext, _ int) bool { … }