목차
없음
본문내용
#include<iostream.h>
#include<string.h>
#include<stdlib.h>
#include<ctype.h>
#include<fstream.h>
#define ID_LENGTH 12
#define NUMKEYWORD 15
enum tsymbol{
tnull =-1, tident, tnumber, tlparen, trparen, ttimes, tplus,
tcomma, tminus, tdot, tddot, tcolon, tassign, tsemicolon,
tless, tlesse, tnequal, tequal, tgreat, tgreate, tlbracket,
trbracket, teof, arraysym, beginsym, constsym, divsym, dosym,
endsym, ifsym, intsym, modsym, ofsym, procsym, progsym,
thensym, varsym, whilesym
}; // 토큰 번호
char *keyword[] =
{"array", "begin", "const", "div", "do", "end",
"if", "integer", "mod", "of", "procedure", "program",
"then", "var", "while"}; // 각 지정어의 스트링값
enum tsymbol tnum[] =
{arraysym, beginsym, constsym, divsym, dosym,
endsym, ifsym, intsym, modsym, ofsym, procsym, progsym, thensym,
varsym, whilesym}; // 지정어에 해당하는 토큰 번호
참고 자료
없음