


















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



















































Analysis
of input program
front
-end)
character
stream
Lexical Analysis
Code Generation
Intermediate Optimization
Code Generation
Semantic Analysis
Syntactic Analysis
annotated
abstract
syntax tree
token stream
target
language
intermediate
form
intermediate
form
Synthesis
of output program
back
-end)
Stmt ::= Type ID
{Stmt}
if (
Expr
Stmt
else
Stmt
while (
Expr
Stmt
System.out.println (
Expr
Expr
Expr ::= Expr Op Expr
Expr
| Expr
[ Expr {
Expr } ]
this
| Integer |
true
false
Expr
Op
Program ::= (Token | Whitespace)*Token ::= ID | Integer | ReservedWord | Operator |
Delimiter
ID ::= Letter (Letter | Digit)*Letter ::=
a
z
Digit ::=
Integer ::= Digit
ReservedWord::=
class
public
static
extends
void
int
boolean
if
else
while
return
true
false
this
new
String
main
System.out.println
Operator ::=
Delimiter ::=
Stmt
::= MatchedStmt | UnmatchedStmt
MatchedStmt
if (
Expr
MatchedStmt
else
MatchedStmt
UnmatchedStmt ::=
if (
Expr
Stmt |
if (
Expr
MatchedStmt
else
UnmatchedStmt