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 support for semantic action for language parser #100

Open
stevefan1999-personal opened this issue Dec 6, 2018 · 1 comment
Open

Comments

@stevefan1999-personal
Copy link

I was trying to do inline type inference rather than to generate a parse tree then traverse it after PEG passes, this way we could avoid some potential backtracking issue by stopping ahead and hence sped up (or terminate) the parsing process.

I know Clang does parse tree scan too but they clearly had more information than what mpc currently have to deduce a sound combinations.

@orangeduck
Copy link
Owner

If you build up your own AST data type as you go using the combinator approach (rather than the grammar approach) you can insert as much functionality as you like in-between parsing. Yes it is a bit less user friendly than the grammar definition but it is the only sane way to do this sort of thing while still making use of mpc.

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

No branches or pull requests

2 participants