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

Use sub part of the parser #65

Open
dooxe opened this issue Feb 9, 2022 · 2 comments
Open

Use sub part of the parser #65

dooxe opened this issue Feb 9, 2022 · 2 comments

Comments

@dooxe
Copy link

dooxe commented Feb 9, 2022

Hello !

Let's say we have the following parser grammar :

element
  : mathExpr
  | STRING
  ;

mathExpr
  : NUMBER
  | mathExpr '+' NUMBER
  ;

I'm wondering whether it is possible, inside actions, to use kind of "parseMathExpr(myString)" ?

Thanks

@GerHobbelt
Copy link
Owner

GerHobbelt commented Feb 9, 2022 via email

@dooxe
Copy link
Author

dooxe commented Feb 22, 2022

Thanks a lot for your (very) extensive reply!

I ended up with the following solution inspired from your reply: I have a dedicated parser for mathematical expressions, that are surrounded by a specific character.

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