Meta Languages BNF/EBNFKelly Bauer
2 Basic Forms of metalanguageRailroad diagram (aka syntax structure diagrams)BNF/EBNF
Construct a railroad diagram of a legal if statement for Visual BasicHW
Railroad Diagrams
BNF/EBNFWere created to make it easier to represent syntax
Backus–Naur FormBNF is a text based metalanguage that is read right to left. This way, syntax can be represented by text, rather than diagrams
Extended Backus–Naur Form (EBNF)Invented to avoid the disadvantages of BNF. Easier to read, and less issues with things like repetition and optional elements
Is defined asBNFEBNF::=Boolean::=T|F=Boolean=T|F
Non-terminal ElementsBNFEBNF<   ><Digit>::-0|1|2|<Letter>::-a|b|c<   ><Digit>=0|1|2|<Letter>=a|b|c
Terminal Elements (eg, reserved words)BNFEBNFWritten as isDimIf01kWritten as isDimIf01k
SelectionBNFEBNFDefined as  |Boolen::-T|FDefined as |Boolen=T|F
Optional ElementsBNFEBNFNo Optional Elements, so each option must be repeatedInteger::- - {<digit>} |{<digit>}[ ]Integer=[-] {<digit>}
RepetitionBNFEBNFNo repetitionRepetition through recursionRecursion is repetition achieved through a process calling itselfText page 170Indicated by { } Word={Letter}Repeated zero or more timesIf it needs to be repeated one or more times, it is written asWord=Letter{Letter}
an example
In EBNFPublicDimVariableAsData TypePrivate
SingleShortBooleanByteCharDateTimeDecimalDoubleIntLong
Upper CaseLowerCaseUpperCaseDigit
0987654321
In Visual Basic	Construct an EBNF diagram to describe a best practice, legal if statement. Should follow the following structure: If condition Then statements Else elsestatements
Syllabus Sections?

Meta Languages Bnf Ebnf Student Version