代写 compiler program:

program:
Compiler Theory Syntax Summary for Atto-C
Tokens are in bold face.
external-definition external-definition program
external-definition: function-definition
data-definition function-definition:
type_specifieropt identifier ( parameter-listopt ) compound-statement parameter-list:
type-specifier identifier
type-specifier identifier , parameter-list
type-specifier:
int
data-definition:
type-specifier declarator-list ;
declarator-list: identifier
identifier , declarator-list compound-statement:
{ declaration-listopt statement-listopt }
declaration-list: data-definition
data-definition declaration-list
statement-list:
statement
statement statement-list

statement:
Atto-C syntax p. 2
compound-statement
expression ;
if ( expression ) statement
if ( expression ) statement else statement while ( expression ) statement
do statement while ( expression ) ; continue ;
break ;
return ;
return expression ;
;
expression:
identifier
integer
( expression )
– expression
! expression
expression binop expression lvalue assignop expression identifier ( expression-listopt )
expression-list: expression
expression , expression-list string
string , expression-list
*/
+-
< > <= >= == !=
&&
||
lvalue:
identifier
assignop:
=
binop:

integer: string: identifier:
digit-string
“character-string”
letter or _ optionally followed by arbitrary alphanumerics or _
whitespace:
blank
tab newline comment
/* anything */
// until end of line
comment:
Atto-C syntax p. 3
(newlines not allowed inside strings)
(newlines are allowed in this type comment)
*********************************************************************** Reserved keywords for compatibility with C:
auto double break else case enum char extern continue float default for
do goto
if
int
long register return short sizeof
static struct switch typedef union unsigned while