Python Forum
Need help with PEG Grammar
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with PEG Grammar
#2
For Python 3.8's grammar, I wrote a railroad diagram in this thread. You could perhaps try to write similar railroad diagrams for the PEG grammar and this would help converting to BNF.

To find something similar to the «slices» category above, look at the railroad diagram of «testlist_comp» in Python 3.8's grammar. It is very similar to the slices. In view of the railroad diagram, I would have written something like
Output:
slices: slice | slice comma_slice_list | slice comma_slice_list COMMA ; comma_slice_list: COMMA slice | comma_slice_list COMMA slice ;
Reply


Messages In This Thread
Need help with PEG Grammar - by pptx704 - Jun-02-2022, 06:45 PM
RE: Need help with PEG Grammar - by Gribouillis - Jun-02-2022, 09:53 PM
RE: Need help with PEG Grammar - by pptx704 - Jun-03-2022, 04:14 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020