Visual Basic - EBNF and Railroad

 

Home

 

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:

Machine generated alternative text:
CustomEventMemberDeclaration 
Attributes? EventModifiers* Identifier TypeName ImplementsCIause? StatementTerminator EventAccessorDecIaration+ 
StatementTer minator 
(used in EventMemberDec/aration) 
oxOOA> 
Del g 
Never empty 
MayStartWith: 
MayaeFoIIowedBy: public 
Oxooo> 
Oxon 
oxaoaE> 
oxaoagy < 
-caly

Grammar vb10

https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/12/06/7120.vb10.html

Screen clipping taken: 11/10/2018 10:00 AM

 

 

DimStatement = <AccessModifier> <Identifier> As <DataType>                

                               {<AccessModifier> <Identifier> As <DataType>}

Machine generated alternative text:
—pub 
lic Class 
Forml 
Dim Tot As Integer 
Dim Nol As Integer 
Dim N02 As Integer 
Din* N03 As Integer 
Ii Class 
Forml 
Private 
Private 
Private 
Private 
Tot 
No I 
No 2 
No 3 
As 
As 
As 
As 
Integer 
Integer 
Integer 
Integer

 

Concatenation:

String = Character { Special character | Character | Digit }

 

Text block = " <string> "

Final statement =  [<Text block> ]  [& {<identifier> | <Text block>}]

 

Machine generated alternative text:

 

 

Message (print to screen) statements:

Text block = " <string> "

Message Box = MsgBox( [<Text block> ]  [& {<identifier> | <Text block>}] )

 

Machine generated alternative text:

 

Assignment:

 

<identifier> =  <Text block> | <identifier> {<Text block> | <identifier>}] ;

 

Machine generated alternative text:

 

Condition (evaluates to true or false):

 

(<identifier> ==|===|<|> <Text block> | <identifier> )

And you could have:

<condition> =(<condition> || <condition> AND <condition> )

( || means OR)

 

Machine generated alternative text:

 

Statement - block of code to be executed

Machine generated alternative text:
e ßlNT

 

 

 

 

"IF" statement: 

 

 

 

 

Railroad:

Definitions:

N 人 X ^ C ↓ 0 日 0 Z 1 ) 「 
く P 「 い C95 代 
′ ・ つ 物 当 っ ー 物 ・ つ ・ J 
ノ つ テ つ ′ つ 
X 9 ョ ョ 0 つ 日 > 
4 ! 6 ℃

 

String:

Machine generated alternative text:

 

 

Identifier                                                    (Identifiers are Variable names)

Machine generated alternative text:

letter 
letter 
( digit

 

Declaration of variables:

Data types:

Machine generated alternative text:
Tre

 

DimStatement=

Machine generated alternative text:
Cie

Machine generated alternative text:
—pub 
lic Class 
Forml 
Dim Tot As Integer 
Dim Nol As Integer 
Dim N02 As Integer 
Din* N03 As Integer 
Ii Class 
Forml 
Private 
Private 
Private 
Private 
Tot 
No I 
No 2 
No 3 
As 
As 
As 
As 
Integer 
Integer 
Integer 
Integer

Or

DimStatement =

Machine generated alternative text:
def 
cees$ 
Type

Machine generated alternative text:
public Class Forml 
Private Tot, TotP, Mol, N02, N03 As Integer 
private StrSu• AS String

 

 

 

Concatenation:

Machine generated alternative text:

 

Message (print to screen) statements:

Machine generated alternative text:
4

 

Machine generated alternative text:

 

Assignment:

 

 

 

Condition (evaluates to true or false):

 

(<identifier> ==|===|<|> <Text block> | <identifier> )

And you could have:

<condition> =(<condition> || <condition> AND <condition> )

( || means OR)

 

Machine generated alternative text:

 

Statement - block of code to be executed

Machine generated alternative text:
e ßlNT

 

 

 

 

 

"IF" statement: