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

Escaping dollar sign in a rule action #100

Open
mrsuh opened this issue Mar 8, 2023 · 0 comments
Open

Escaping dollar sign in a rule action #100

mrsuh opened this issue Mar 8, 2023 · 0 comments

Comments

@mrsuh
Copy link

mrsuh commented Mar 8, 2023

Hi!
Is there a way to pass the dollar sign from the grammar.y file to the parser output file without modification?
I want to do something like this:

grammar.y

%%
rule { \$this->var = $1; }
...
%%

parser

...
switch (yyn) {
    case 2: { $this->var = yystack.valueAt(0)); }
break;
...

I spent several hours on this and I think it's impossible.
Can you help me?

@mrsuh mrsuh changed the title Escaping dollar sign in rule action Escaping dollar sign in a rule action Mar 31, 2023
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

1 participant