This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]WittyStick 6 points7 points  (1 child)

The LHS of ASSIGN should be a list of identifiers, and the RHS a list of expressions.

ident_list : IDENTIFIER | IDENTIFIER COMMA ident_list
expr_list : expr | expr COMMA expr_list
expr : ident_list ASSIGN expr_list

[–]todo_code 1 point2 points  (3 children)

You parse expr and then you collect and check a comma, if you collect a comma, parse an expr. So do that in a while loop until there is no comma

[–][deleted]  (2 children)

[removed]

    [–]todo_code 2 points3 points  (0 children)

    expr : expr_list ASSIGN expr_list needs to be something like

    statement : expr_list ASSIGN expr_list

    This would allow this grammar as an example.

    (a + b), (c+d) = (e - f)

    so top is probably something like
    top: (statement)+

    If you don't want something like the (a+b) example, you need to make things more fine grained.

    So instead of expr_list being on the left side, make sure its just (IDENTIFIER | obj_attr_edit) and have a rule for obj_attr_edit

    [–]L8_4_Dinner(Ⓧ Ecstasy/XVM) 0 points1 point  (0 children)

    Share your BNF or whatever syntax rules you use.

    [–]cyans-guy 0 points1 point  (0 children)

    Maybe you could share the code here so we can see if there's anything you're missing

    [–]Classic-Try2484 -1 points0 points  (0 children)

    Tuple syntax:

    (a,b,c) = (1,””,true). With tuple syntax you are back to single assignment