Udvidet Backus-Naur form: Forskelle mellem versioner

Content deleted Content added
m →‎Se også: linkændr
→‎Leksikalsk analyse: udvider med tokens og kommentarer fra ISO/IEC 14977
Linje 34:
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
 
symbol_no_quotessymbol_no_quotes_questionmark = "[" | "]" | "{" | "}" | "(" | ")" | "<" | ">"
| "=" | "|" | "." | "," | ";" ;
 
visible_characters_no_quotesvisible_characters_no_quotes_questionmark = letter | digit | symbol_no_quotes | " " | "_" ;
 
white_space = "\t" | "\n" | "\r" | " " ;
Linje 43:
identifier = letter , { letter | digit | "_" } ;
 
free-text-special-terminal = "'?" , ( visible_characters_no_quotessymbol_no_quotes_questionmark | "'" | '"' )
, { ( visible_characters_no_quotessymbol_no_quotes_questionmark | "'" | '"' ) } , "'?"
| '"' , ( visible_characters_no_quotes | "'" )
, { ( visible_characters_no_quotes | "'" ) } , '"' ;
 
terminal = "'" , ( symbol_no_quotes_questionmark | "?" | '"' )
token = symbol_no_quotes | identifier | terminal ;
, { ( symbol_no_quotes_questionmark | "?" | '"' ) } , "'"
| '"' , ( visible_characters_no_quotessymbol_no_quotes_questionmark | "?" | "'" )
, { ( visible_characters_no_quotessymbol_no_quotes_questionmark | "?" | "'" ) } , '"' ;
 
token = symbol_no_quotes | identifier | terminal | free-text-special-terminal ;
grammar = { white_space } , { token , { white_space } } ;
 
comment = "(*" , ( visible_characters_no_quotes_questionmark | "?" | "'" | "'" )
, { ( visible_characters_no_quotes_questionmark | "?" | "'" | "'" ) } , "*)" ;
 
comment_or_whitespace = white_space | comment ;
 
grammar = { white_spacecomment_or_whitespace } , { token , { white_spacecomment_or_whitespace } } ;
</syntaxhighlight>