project

project - PL/0 Xª ¸ Êx 1¨•2´ L 1P P 2P P 3P P 4P P...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: PL/0 Xª ¸ Êx 1¨•2´ L 1P P 2P P 3P P 4P P 5P P 6P P 7P P 8P P o PªS ¸ 9à4 ( …¶… PL/0 Xª ¸ Êk PL/0 Xª ¸ Êk PL/0 o ®ß PL/0 o ®ß PL/0 o PL/0 o PL/0 o PL/0 o 2Ê Xk ¸ª ¸ C XªS Êk elseÊ XªS ¸k /∗ …… ∗/P exit P PL/0 Xª ¸ Êx Program Block ConstDecl ConstDef TypeDecl TypeDef TypeExp VarDecl VarDec Type FuncDecl FuncDec → ForParal Stmt IdentRef ActParal Exp RelOp SimpExp Term Factor → → Block . [ConstDecl][TypeDecl][VarDecl][FuncDecl] begin Stmt {; Stmt } end → const ConstDef {, ConstDef} ; → ident = number → type TypeDef ; {TypeDef ;} → ident = TypeExp → integer | real | Boolean | array ‘[’number .. number‘]’ of TypeExp → var VarDec ; {VarDec ;} → ident {, ident} : Type → integer | real | Boolean | ident → FuncDec { FuncDec } procedure ident [ ( ForParal ) ]; Block ; | function ident [ ( ForParal ) ] : Type ; Block ; → ident : Type {; ident : Type } → IdentRef := Exp | if Exp then Stmt | if Exp then Stmt else Stmt | begin Stmt {; Stmt } end | while Exp do Stmt | exit | ε | call ident [ ( ActParal ) ] | write ( Exp {, Exp } ) | read (IdentRef {, IdentRef } ) → ident [ ‘[’Exp‘]’ { ‘[’Exp‘]’ } ] → Exp {, Exp } → odd SimpExp | SimpExp RelOp SimpExp | SimpExp → = | <> | < | > | <= | >= → [+ | − ] Term {+ Term | − Term | or Term} → Factor {∗ Factor | / Factor | div Factor | mod Factor | and Factor} → IdentRef | number | ( Exp ) | not Factor | ident [ ( ActParal ) ] | 1 true | false ¸Â° L ´ 1ÀÂ*Ðv ª ° ¾E P P P|P[P]P{P ´ °}ÀÂ*Ðv ª ¾E {…}•¸*Ðv P × +¾E ª + @¾E%ƒPe+p+ b x h r […]h¸* Ê ªr 0P 1P 0P Ê r h¸* ª P 2h¸ Êr ª /∗ …… ∗+ •P ¸ × /•ª*Ðv ¾E ident ˆ+ •P ׸ • number + 3 : ¾EL m typeLarrayLofLintegerLrealLBooleanLfunctionLelseLwriteLreadLexitLor Sª ¸ •rh Ê L andL notL divL modL trueL falseL modL /P • divÊ h ª ¸B 3pÄ P while `À° • P exit hª ¸ Êr * •… áeËL+ •p f loat i nteger*P ª¸8 …¶ª*e àt C Êh ª¸ •u ¾E@h • @h 7s ¾E/ •u ¾E@h • @h 7s ¾E/ 4 P *¸h Ê ª ¸Â° P • exit P exit P wª hile À* ´ °  Ðv ¾E while p while pÄ •+ Pe+p + b ¾E'ƒxr @h áeËL+ … •+ Pe+p + b ¾E'ƒxr @h P ÀI׸ • pÄ sto u ¾E@ ª ¸ rh Ê • ++ Pe+p b ¾E'ƒxr @h •¸ w ª ¨*×Ðv ¾E •rhÊ ª¸ return @h 7s ¾E/ P ª o Pàt S 5…¶ª*e ( ¸ •… áeËL+ ª •Ê rh ¸ listcode a m ¾E+ ª ¸ Ê rh p Pe{r ¾EQƒk+ m + m + ¾Ea 2 1+ p Pe{ ƒk ¾EV m r m ¾E+ a 2èr ʸªS Windowsª XP è S¸r Ê C PSª C++è ¸ Êr 3 ...
View Full Document

Ask a homework question - tutors are online