Kittyrules
I'm your density
- Joined
- Mar 23, 2014
- Messages
- 534
- Gender
- Female
- HSC
- 2016
Hi guys,
Im getting quite confused about EBNF and railroad diagrams and how they define data structures.
So I understand that EBNF is a meta-language that describes the syntax of other languages and that:
= means defined as
<> is put around non terminal indicators
{} is for repetition
[] is for optional elements
and () for groups
I get how to define words, and boolean, identifiers and letters and stuff like that, but not really how to define a while statement or a for loop... also im not quite sure how that works in railroad diagrams either. Like how do i use the keywords 'if' and 'then' in the railroad diagram ahhhh
if anyone could explain i would be very grateful! and sorry for my bad explanation of my issue
Im getting quite confused about EBNF and railroad diagrams and how they define data structures.
So I understand that EBNF is a meta-language that describes the syntax of other languages and that:
= means defined as
<> is put around non terminal indicators
{} is for repetition
[] is for optional elements
and () for groups
I get how to define words, and boolean, identifiers and letters and stuff like that, but not really how to define a while statement or a for loop... also im not quite sure how that works in railroad diagrams either. Like how do i use the keywords 'if' and 'then' in the railroad diagram ahhhh
if anyone could explain i would be very grateful! and sorry for my bad explanation of my issue