[Recursive Descent Parsing] Recursive Descent Parsing
- 최초 등록일
- 2003.04.22
- 최종 저작일
- 2003.04
- 14페이지/ 한컴오피스
- 가격 1,000원
목차
없음
본문내용
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
FILE *pfile; // 파일의 포인터
typedef struct char_node *char_pointer; // linked-list의 포인터
char_pointer token_string,last_pointer; // token_string은 lexm의 처음위치를 기억함
// last_pointer는 가장 마직막 노드를 가리킴
typedef struct char_node // linked-list 설정
{
char string;
char_pointer next_pointer;
};
enum token
{ identifier, semi_colon, assignment_operator, plus_operator,
minus_operator, star_operator, slash_operator, left_parenthesis,
right_parenthesis, constant, condition, compare_value, question_operator,
less_keyword, greater_keyword, equal_keyword, colon, eof, null }; // token값들
enum bool
{ TRUE, FALSE };
token next_token; // 현재의 토큰
bool is_use; // 이 토큰이 사용되였는지의 여부를 판별
bool end; // 이 토큰이 마지막 토큰인지를 판별
bool correct=TRUE; // 에러 검출시 사용하는 프레그
bool id_correct=TRUE; // 에러 검출시 사용하는 프레그2 (identifier 에러시)
void error();
void start();
void statements();
void statement();
void Semi_colon();
void Identifier();
void Assignment_operator();
void expression();
void Plus_operator();
void Minus_operator();
void term();
void Star_operator();
void Slash_operator();
void factor();
참고 자료
없음