Description
This article is from the FAQ, by with numerous contributions by
others.
L23) What is the BETA lexem syntax?
The different lexems in the BETA language grammar (names, strings, and
numbers) are not precisely defined in any of the available documents. We
will therefore here give the definition:
<NameAppl> = <NameDecl>
<NameDecl> = (<letter>|"_")+(<digit>|<letter>|"_")*
<String> = "'"<char>*"'"
where <char> can be any char except "'" and newline.
"'" are allowed in <String>, iff preceeded with "\".
"\n", "\t", etc. are allowed in <String> to
represent non-printable chars - see Compiler
manual (mia91-02) for details.
<Const> = (<int>|<based>|<real>) where
<int> = <digit>+
<based> = <int>("X"|"x")<basedNum>
<basedNum> = (<digit>|<letter>)+
<real> = <int>["."<int>][("E"|"e")[("+"|"-")]<int>]
<letter> = "a"|"b"|...|"z"|"A"|"B"|...|"Z"
<digit> = "1"|"2"|...|"9"|"0"
The usage of |, +, *, (...), and [...] conform to standard regular
expressions syntax.
 
Continue to:
Share and Enjoy
Bookmark this story so others can enjoy it:
Tags
programming