kooBH / tiny

Compiler Construction Principles and Practice by Kenneth C. Louden
0 stars 0 forks source link

참고 #1

Open kooBH opened 5 years ago

kooBH commented 5 years ago

04.30

https://www.joinc.co.kr/w/Site/Development/Env/Yacc

https://github.com/geekinglcq/C-mini-Compiler-using-flex-bison/blob/master/cminus.y

C- 문법으로 .y 파일 작성해둔 리포 찾음. \<tnode> 같은걸 추가시킨거 같은데 제거해야함.
전체적인 token이름을 C- 맞게 바꿔야함.

https://github.com/llFreetimell/C-minus

https://github.com/isairz/cminus

이거 어디서 수업과정을 다 git에 올리게 시킨건가?

kooBH commented 5 years ago

geekinglcq 의 .Y 에서
selection-stmt 에서 그냥 if 문 부분에

selection_stmt      : IF LPAREN expression RPAREN statement %prec ELSE
      | IF LPAREN expression RPAREN statement ELSE statement

      ;

"%prec ELSE " 가 추가되어 있었으나 용도를 몰라서 제거함


TokenType을 어떻게 처리 할까. 토큰 선언이 bison 파일에서 이루어 지지만 노드 생성을 위해선 TokenType이 필요한거 같은데.필요가 없나? 필요가 없게 해야하나? 아니면 방식이 잘못된건가?