프로그래밍 언어론 3장 4장 문제
- 최초 등록일
- 2013.01.01
- 최종 저작일
- 2012.12
- 7페이지/ 한컴오피스
- 가격 4,000원
* 본 문서는 한글 2005 이상 버전에서 작성된 문서입니다.
한글 2002 이하 프로그램에서는 열어볼 수 없으니, 한글 뷰어프로그램(한글 2005 이상)을 설치하신 후 확인해주시기 바랍니다.
소개글
Robert W. Sebesta의 프로그래밍언어론(concepts of programming languages) 연습문제 3장, 4장 풀이입니다.
3장에선 2번, 3번, 5번, 6번, 8번, 13번, 16번을 풀었고 4장 에선 9번을 풀었습니다.
목차
없음
본문내용
< Chapter 3 : Problem Set >
02. Write EBNF descriptions for the following:
(다음을 EBNF로 나타내어라.)
a. A Java class definition header statement
b. A Java method call statement
c. a given Statement => 8판 Switch문으로 대체
d. A C union definition
e. C float literals
A : a. < class_head > -> { < modifier > } class class_name [ extends extendsclass_name ] [ implements interface_name { , interface_name }* ] [throw exception_name
{ , exception_name }*
< modifier > -> public | abstract | flnal
b. < Java method Call > -> { Class_name }* . Method_name ( { < parameter > }* ) ;
c. < Switch > -> Switch ( < var > ) {
<중 략>
void whilestmt(){
/* Be sure the first token is `while` */
if (nextToken != WHILE_CODE){
error();
} else {
/* Call lex to get to the next token */
lex();
/* Check for the left parenthesis */
if (nextToken != LEFT_PAREN){
error();
} else {
/* Call condition to parse the Boolean expression */
condition();
/* Check for the right parenthesis */
if (nextToken != RIGHT_PAREN){
error();
} else {
/* Call statement to parse the then clause */
참고 자료
없음