You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now I'm trying to implement a simple language parser for a toy language I made up.
Looks something like:
1 + 2; func test(a, b) { return a + b; }
I want to generate a list (aka a vector) of Expr's which is defined very similar to how json_value is defined in the json example.
So the first element in the parsed list would be the 1 + 2 and the second would be the function defintion.
Right now I have a dsl::list(dsl::p<top-level-production-type>, dsl::sep(dsl::newline / dsl::semicolon) as what the rule is for the final production in the grammar.
And the value field is lexy::as_list<ast::ExprList>
The result I am currently getting is only getting the first element parsed. So just 1 +2 or func test(...) if the that's what's first.
How can I modify it so that it collects each type of production/ast type into a list of them?
The text was updated successfully, but these errors were encountered:
Repository owner
locked and limited conversation to collaborators
Mar 11, 2022
Right now I'm trying to implement a simple language parser for a toy language I made up.
Looks something like:
1 + 2; func test(a, b) { return a + b; }
I want to generate a list (aka a vector) of
Expr
's which is defined very similar to howjson_value
is defined in the json example.So the first element in the parsed list would be the 1 + 2 and the second would be the function defintion.
Right now I have a
dsl::list(dsl::p<top-level-production-type>, dsl::sep(dsl::newline / dsl::semicolon)
as what the rule is for the final production in the grammar.And the value field is
lexy::as_list<ast::ExprList>
The result I am currently getting is only getting the first element parsed. So just 1 +2 or func test(...) if the that's what's first.
How can I modify it so that it collects each type of production/ast type into a list of them?
The text was updated successfully, but these errors were encountered: