{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

chpt7-2&aring;&plusmn;ž&aelig;€&sect;&aelig;–‡&aelig;&sup3;•&aring;’Œ&egrave;&macr;&shy;&aelig;&sup3

Chpt7-2å±žæ€§æ–‡æ³•å’Œè¯­æ³

This preview shows pages 1–8. Sign up to view the full content.

7.2 属属属属属属属属属属属 属属属属 属属属属属 静静静静 属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属属 / 属属属属属属属 属属属属属属属 属属属属属属属属 属属属属属属 静静静静 属属属属属属属属属 属属属属属属属属属属属 静静静静静静 静静静静静静 属属属属属属属属 ... 静静静静

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
7.2.1 静静静静静静 静静静静静 E—>T+T| T or T T—>n | b E T 1 + T 2 { T 1 .type = int T 2 .type = T 1 .type E.type :=int} E T 1 or T 2 { T 1 .type = bool T 2 .type = T 1 .type E.type :=bool} T n { T.type := int} T b { T.type := bool}
input : /* empty string */ | input line ; line : '\n' | exp '\n' { printf ("\t%.10g\n", \$1); } | error ‘\n’ ; exp : NUM { \$\$ = \$1; } | exp '+' exp { \$\$ = \$1 + \$3; } | exp '-' exp { \$\$ = \$1 - \$3; } | exp '*' exp { \$\$ = \$1 * \$3; } | exp '/' exp { \$\$ = \$1 / \$3; } | '-' exp %prec NEG { \$\$ = -\$2; } | exp '^' exp { \$\$ = pow (\$1, \$3); } | '(' exp ')' { \$\$ = \$2; } ;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

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

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern