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

Add RuleContext interface methods to reserved words #2098

Merged
merged 2 commits into from
Nov 4, 2017

Conversation

jasonmoo
Copy link
Contributor

@jasonmoo jasonmoo commented Nov 2, 2017

This fixes #2080 by adding all method names from the RuleContext interface definition to the reserved words list. Arguably this is a quick fix and not a full solution, but should help avoid some headaches in the mean time.

type Tree interface {
	GetParent() Tree
	SetParent(Tree)
	GetPayload() interface{}
	GetChild(i int) Tree
	GetChildCount() int
	GetChildren() []Tree
}

type SyntaxTree interface {
	Tree

	GetSourceInterval() *Interval
}

type ParseTree interface {
	SyntaxTree

	Accept(Visitor ParseTreeVisitor) interface{}
	GetText() string

	ToStringTree([]string, Recognizer) string
}

type RuleNode interface {
	ParseTree

	GetRuleContext() RuleContext
	GetBaseRuleContext() *BaseRuleContext
}

type RuleContext interface {
	RuleNode

	GetInvokingState() int
	SetInvokingState(int)

	GetRuleIndex() int
	IsEmpty() bool

	GetAltNumber() int
	SetAltNumber(altNumber int)

	String([]string, RuleContext) string
}

@parrt parrt added the target:go label Nov 4, 2017
@parrt parrt added this to the 4.7.1 milestone Nov 4, 2017
@parrt
Copy link
Member

parrt commented Nov 4, 2017

This only changes the keywords but it does look like one of the test is failing. I will wait to see if the latest build is clean before checking this again.

@ewanmellor
Copy link
Contributor

The test failure was in the .NET tests (#2078). I've re-run it; it will probably pass the second time.

@parrt parrt merged commit c1b7bf9 into antlr:master Nov 4, 2017
@jasonmoo
Copy link
Contributor Author

jasonmoo commented Nov 5, 2017

Thanks1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grammar rule name conflicts with golang interface
3 participants