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 some methods for Go runtime #4626

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft

Add some methods for Go runtime #4626

wants to merge 5 commits into from

Conversation

RobEin
Copy link
Contributor

@RobEin RobEin commented May 22, 2024

Added methods for CommonToken class:
SetChannel
SetStop
SetText // also exists in Token (Token.SetText may be unnecessary)
SetTokenType

Added constructor for CommonToken class:
CommonToken.NewCommonTokenFromToken

Removed method in CommonToken class:
Clone

Added methods for Lexer class:
GetModeStack
GetMode

The equivalent of the NewCommonTokenFromToken constructor can also be found in the Java CommonToken class.
The NewCommonTokenFromToken constructor is similar to the clone method, in that a cloned CommonToken instance is created in both.
NewCommonTokenFromToken accepts both Token and CommonToken parameters for cloning.
This made the clone method redundant.

Signed-off-by: Andreas Buhr <andreas@andreasbuhr.de>
Signed-off-by: Robert Einhorn <robert.einhorn.hu@gmail.com>
@RobEin RobEin force-pushed the dev branch 2 times, most recently from f852c9a to cfc911d Compare May 23, 2024 13:30
Added methods for CommonToken class:
SetChannel
SetStop
SetText    // also exists in Token (Token.SetText may be unnecessary)
SetTokenType

Modified CommonToken class method:
Clone

Added methods for Lexer class:
GetModeStack
GetMode

Signed-off-by: Robert Einhorn <robert.einhorn.hu@gmail.com>
Copy link
Collaborator

@jimidle jimidle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will take a look at these at the weekend and if all is good I will put it in with the generic tree walker

related issue: antlr#4625

Signed-off-by: Robert Einhorn <robert.einhorn.hu@gmail.com>
Signed-off-by: Robert Einhorn <robert.einhorn.hu@gmail.com>
Signed-off-by: Robert Einhorn <robert.einhorn.hu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants