0

I am currently trying to parse a comma seperated list with at least two elements using bison. I know how to parse a list using this:

list : list "," element
     | element

but how can I make sure that the list has at least two elements?

Exagon
  • 4,798
  • 6
  • 25
  • 53

1 Answers1

2

At the risk of being two obvious:

list : list "," element
     | element "," element
Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315
rici
  • 234,347
  • 28
  • 237
  • 341