![Havokrush](https://meeco.kr/files/member_extra_info/profile_image/577/078/78577.png?20220427102908)
틀린 그림 찾기(feat. 과제).txt
- Havokrush
- 조회 수 144
- 2020.05.27. 11:17
1. 원본 소스 코드
%{
#include <stdio.h>
%}
L [a-zA-Z]
D [0-9]
%%
{L}({L}|{D})* printf("id: %s\n", yytext);
[a-zA-Z_][a-zA-Z0-9_]* printf("C id: %s\n", yytext);
[+-]?[0-9]+ printf("integer: %s\n", yytext);
[0-9]+"."[0-9]+(e[+-]?[0-9]+)? printf("real: %s\n", yytext);
\"([^\042\134]|"\"(.|[\n]))*\" printf("string: %s\n", yytext);
"/*"([^*]|"*"+[^*)])*"*"+"/" printf("text comment: /* ... */\n");
"//".* printf("line comment: // ...\n");
"\n"|
. ;
%%
int yywrap()
{ return 1; }
void main()
{ yylex(); }
2. 오류 발견 이후 수정한 소스 코드
%{
#include <stdio.h>
%}
L [a-zA-Z]
D [0-9]
%%
{L}({L}|{D})* printf("id: %s\n", yytext);
[a-zA-Z_][a-zA-Z0-9_]* printf("C id: %s\n", yytext);
[+-]?[0-9]+ printf("integer: %s\n", yytext);
[0-9]+"."[0-9]+(e[+-]?[0-9]+)? printf("real: %s\n", yytext);
\"([^\042\134]|"\\"(.|[\n]))*\" printf("string: %s\n", yytext);
"/*"([^*]|"*"+[^*)])*"*"+"/" printf("text comment: /* ... */\n");
"//".* printf("line comment: // ...\n");
"\n" |
. ;
%%
int yywrap()
{ return 1; }
void main()
{ yylex(); }
---
뭐가 틀린 건지 보이십니까 휴우-먼...?
후...
![Havokrush](https://meeco.kr/files/member_extra_info/profile_image/577/078/78577.png?20220427102908)
📱Samsung Galaxy Z Fold5
⌚️Samsung Galaxy Watch6 Classic 47mm
🎧Samsung Galaxy Buds3 Pro
🖱Logitech MX Master 3 / Logitech MX Master 3S
⌨Logitech MX Keys Mini / Logitech MX Mechanical Mini
![서린](https://meeco.kr/files/member_extra_info/profile_image/456/929/023/23929456.jpg?20190407143914)
![Havokrush](https://meeco.kr/files/member_extra_info/profile_image/577/078/78577.png?20220427102908)
![Havokrush](https://meeco.kr/files/member_extra_info/profile_image/577/078/78577.png?20220427102908)
![포인트봇](https://meeco.kr/files/member_extra_info/profile_image/702/885/026/26885702.png?20230823194523)
![Havokrush](https://meeco.kr/files/member_extra_info/profile_image/577/078/78577.png?20220427102908)
![Havokrush](https://meeco.kr/files/member_extra_info/profile_image/577/078/78577.png?20220427102908)
![Havokrush](https://meeco.kr/files/member_extra_info/profile_image/577/078/78577.png?20220427102908)
![포인트봇](https://meeco.kr/files/member_extra_info/profile_image/702/885/026/26885702.png?20230823194523)
![Havokrush](https://meeco.kr/files/member_extra_info/profile_image/577/078/78577.png?20220427102908)
![보거](https://meeco.kr/files/member_extra_info/profile_image/365/104/024/24104365.jpg?20240120022932)
![Havokrush](https://meeco.kr/files/member_extra_info/profile_image/577/078/78577.png?20220427102908)
![가하나다](https://meeco.kr/files/member_extra_info/profile_image/291/373/026/26373291.jpg?20191217181951)
![Havokrush](https://meeco.kr/files/member_extra_info/profile_image/577/078/78577.png?20220427102908)
![아삭](https://meeco.kr/files/member_extra_info/profile_image/861/926/023/23926861.jpg?20190407143934)
![Havokrush](https://meeco.kr/files/member_extra_info/profile_image/577/078/78577.png?20220427102908)
\?