正在加载图片...
Decllist - DeclList Decl Here is another simple program with a bit more complex expression t1 t0+a; LCall PrintInt(a)i Endell Here is the derivation. again, consider where the instructions above must be emitted relative to the parsing stmtlist -> optReceiver - OptReceiver identifier Constant - incOnstant OptReceiver LValue - OptReceiver identifier E simpl Stmt - Simplestmt stmtlist ->stmtlist stmtDeclList -> DeclList Decl Program -> DeclList Here is another simple program with a bit more complex expression: void main() { int a; a = 2 + a; Print(a); } main: BeginFuncWithParams; Var a; Var _t0; _t0 = 2; Var _t1; _t1 = _t0 + a; a = _t1; LCall _PrintInt(a); EndFunc; Here is the derivation. Again, consider where the instructions above must be emitted relative to the parsing activity: DeclList -> Type -> void Formals -> StmtList -> Type -> int Variable -> Type identifier VariableDecl -> Variable ; Stmt -> VariableDecl StmtList -> StmtList Stmt OptReceiver -> LValue -> OptReceiver identifier Constant -> intConstant Expr -> Constant OptReceiver -> LValue -> OptReceiver identifier Expr -> LValue Expr -> Expr + Expr SimpleStmt -> LValue = Expr Stmt -> SimpleStmt ; StmtList -> StmtList Stmt OptReceiver -> LValue -> OptReceiver identifier Expr -> LValue
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有