1.출력문(ex. C언어printf) : (변수)를출력
2.입력문(ex.c언어scanf) : (변수)에입력값을저장
-
조건분기문(ex.c언어if) : 만약(조건문)이면(실행문)을, 아니면(실행문)을실행
-
무조건분기문(ex.c언어goto) : (함수이름)으로이동
-
반복문(ex.c언어for) : (횟수)만큼(실행문)을반복
-
함수선언문(ex.c언어void main()) : (함수이름)을선언
-
복귀문(ex.c언어return) : 복귀
-
종료문(메인함수의종료를뜻함): 종료
-
할당문(ex.c언어intI = 0;) : (변수이름)에(할당)을할당
1. program -> declaration-list
2. declaration-list -> declaration-list declaration | declaration
3. declaration -> fun-declaration
4. fun-declaration -> (Funtion_label) 을선언compound-stmt| (Function_label) 를선언compound-stmt
5. compound-stmt-> statement-list
6. statement-list -> statement-list statement | empty
7. statement -> print-stmt| input stmt| selection-stmt| goto-stmt| for-stmt| expression-stmt| 끝| 복귀
8.print-stmt -> (args) 를출력
9.input-stmt -> (var) 에입력값을저장
10. selection-stmt-> 만약(simple-expression) 이면(statement) 을, 아니면(statement) 을실행
11. goto-stmt-> (Funtion_label)으로이동
12. for-stmt-> (NUM) 만큼(statement)을반복
13. expression-stmt-> (var)에(simple-expression)을할당
14. simple-expression -> additive-expression relopadditive-expression | additive-expression
15. relop-> <= | < | > | >= | = | !=
16. addititve-expression -> addititve-expression addopterm | term
17. addop-> + | -
18. term -> term mulopfactor | factor
19. mulop-> * | /
20. factor -> var| NUM
21. args-> var| Quote | NUM
keywords : 를출력, 에입력값을저장, 만약이면을, 아니면을실행, 으로이동, 만큼을반복, 을선언, 에을할당, 복귀, 끝
NUM = digit
var= a | ... | z
Quote = "인용구"
Function_label= "함수이름"
같은 폴더에 test.txt란 파일을 생성하여 그안에 한글 명령어 작성 후 해당 인터프린터 실행