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

Feedback on new support for more than one look-ahead tokens #8

Closed
wants to merge 1 commit into from
Closed

Feedback on new support for more than one look-ahead tokens #8

wants to merge 1 commit into from

Conversation

springcomp
Copy link

@atifaziz here is a quick PR on top of your multi-peek branch.

My question is what is the purpose of the default case in the Peek() method ?
It seems to me that support for more than two look-ahead tokens is guaranteed to throw an exception.

I added a simple test illustrate this.

I like the ITokenStream abstraction that as been introduced.

As a general question why limit the implementation to only two tokens?
I guess there should not be a grammar that needs more than two tokens of lookahead.

Also, it seems that maybe the design you chose is extensible to more than two tokens of lookahead in the future, maybe by introducing a future ThreeTokenStackOps, etc. But what lead you to this design, with two different StoreStackOps implementations? Is this for performance reason ? Is this in an attempt to prevent more upfront allocations for multiple tokens if not eventually necessary?

@springcomp springcomp changed the title Feedback on new support for more than one look-ahead tokes Feedback on new support for more than one look-ahead tokens Jul 12, 2022
@springcomp springcomp changed the base branch from master to multi-peek July 12, 2022 12:35
@atifaziz
Copy link
Owner

Looks like you beat me to opening the PR for this, but thanks for your review. Let's continue on PR #9 and I'll answer your comments there.

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.

2 participants