[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Parser implementation question
From: |
Frolov Daniil |
Subject: |
Parser implementation question |
Date: |
Wed, 2 Mar 2022 23:40:55 +0500 |
Hello! I've not found anything about my theme on the internet so maybe I
can ask you for a help. I have a question about implementation for the next
feature in my LALR(1) parser on bison. I'm writing interpreter, so I have
to parse correct the following code using scopes in my own language:
Examples:
1) var = {return 1;} //Here you can put semicolon at the end of scope or
don't do that
2) var = {return 2;}; //if you don't want to
3) var = {return 1;} + 1; //These two have to contain
semicolon at the end of expression
4) var = {return 1;} + {return 2;};//cause it has plus operator
So when I try to implement this in Bison I get shift/reduce or
reduce/reduce conflicts and I really don't know how to fix it. Can you
suggest how I can implement this moment?
I've attached current reference on my project in github
https://github.com/Exactlywb/VladimirovsCourse/tree/master/ParaCL
All thanks
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Parser implementation question,
Frolov Daniil <=