Adela Vais - SAOC Milestone 4 Update 4 - Dlang GLR Parser for GNU Bison
Adela Vais
adela.vais99 at gmail.com
Fri Jan 29 21:13:13 UTC 2021
On Saturday, 16 January 2021 at 22:09:04 UTC, Adela Vais wrote:
>>>>>>>>[...]
Hello!
- I worked with Akim Demaille (one of my mentors, Bison
co-maintainer) on adding the '%define api.value.type union'. He
provided me with a WIP based on my work on the token
constructors, and I continued it with the D code needed. Unlike
C++, D allows structs, classes, etc. to be union members, so
there is no need for D to implement '%define api.value.type
variant'. [1]
- I worked on token-constructors. In C++, this directive works
only with '%define api.value.type variant'. In D, I managed to
add this feature for the default parser, which uses %union, too.
For this change, I had to rewrite the Symbol's constructors. I
wrote them in D, but they became too complex. In the near future,
I want to rewrite them in M4, which will also make them easier to
maintain. [1]
- I almost finished the push-parser. After this change, the
backend will support 3 different options for this directive: pull
(by default), push (which I implemented in the past month), and
both (which means that the user has access to both parse
functions, and the pull-parse method is a wrapper around the push
one). I integrated it into the backend and it is going to be
reviewed soon. [2]
Future plans:
- In the near future I will finish my work on the LALR1, which
means that I will add the token-constructors and push-parser
features to the backend. I also need to rewrite the Symbol's
constructors in M4 and to complete the documentation.
- During the next few months I will be working on the GLR. It
will not be a wrapper around the C's GLR, as initially planned,
but a stand-alone parser. The difference between a user's code of
a LALR1 and GLR parser is only the presence of the '%glr-parser'
declaration, otherwise, the user's code is identical. Given that
the user APIs are the same, a lot of my work on the LALR1 will be
used by the GLR, too.
[1]: https://github.com/adelavais/bison/tree/tok-constr
[2]: https://github.com/adelavais/bison/tree/push-parser
More information about the Digitalmars-d
mailing list