Visual Basic - EBNF and Railroad
EBNF
Definitions:
Digit = 0|1|2|3|4|5|6|7|8|9
Character = a|b|c|d|e|f|g|h|i|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|A|B|C|
D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z
Special character (including "space")
space + - * / = < > [ ] . , ( ) : ^ @ { } $ # & %
Identifier = Character { Character | Digit } (Identifiers are Variable names)
String = Character { Special character | Character | Digit }
Declaration of variables:
Grammar vb10
Screen clipping taken: 11/10/2018 10:00 AM
DimStatement = <AccessModifier> <Identifier> As <DataType>
{<AccessModifier> <Identifier> As <DataType>}
Concatenation:
String = Character { Special character | Character | Digit }
Text block = " <string> "
Final statement = [<Text block> ] [& {<identifier> | <Text block>}]
Message (print to screen) statements:
Text block = " <string> "
Message Box = MsgBox( [<Text block> ] [& {<identifier> | <Text block>}] )
Assignment:
<identifier> = <Text block> | <identifier> {<Text block> | <identifier>}] ;
Condition (evaluates to true or false):
(<identifier> ==|===|<|> <Text block> | <identifier> )
And you could have:
<condition> =(<condition> || <condition> AND <condition> )
( || means OR)
Statement - block of code to be executed
"IF" statement:
Railroad:
Definitions:
String:
Identifier (Identifiers are Variable names)
Declaration of variables:
Data types:
DimStatement=
Or
DimStatement =
Concatenation:
Message (print to screen) statements:
Assignment:
Condition (evaluates to true or false):
(<identifier> ==|===|<|> <Text block> | <identifier> )
And you could have:
<condition> =(<condition> || <condition> AND <condition> )
( || means OR)
Statement - block of code to be executed
"IF" statement: