help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

about counting the times of 'recursion'


From: Max cs
Subject: about counting the times of 'recursion'
Date: Sun, 7 Jun 2009 13:31:02 +0100

hi,

I am writing a parser to support 'parallel assignment i.e. in syntax a,b,c =
1,2,3; and I write the grammar like:

vars : var | var comma vars
values : value | value comma values
assignment : vars assign values semicolon

they are working, but lack of checking if the lhs and rhs of '=' are in the
same number of elements, one solution would be I can do this check after
'parsing' but it would not be a very good idea if there are a lot of line of
parallel assignment.

So I would like to ask if there is any way I could make it checked during
parsing ? I mean how I could write the grammer to force the lhs and rhs of
'=' are in the same number of elements?

Thank you very much!

Best wishes,
Max


reply via email to

[Prev in Thread] Current Thread [Next in Thread]