Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %{
- // Afisati doar listele care contin numere pare
- #include <stdio.h>
- %}
- nrpar ([1-9][0-9]*)?[02468]
- literal ({nrpar},)+
- lista \<{literal}{1,}{nrpar}\>
- %%
- \<{lista}\> {ECHO;}
- .|\n
- %%
- int main(int argc, char** argv){
- if(argc > 0)
- yyin = fopen(argv[1],"r");
- yylex();
- }
- /////////// fisier cu date
- <1,2,3,4>
- <2,4,6>
- <20, 22, 12, 2, 1112>
- <11, 12> <10> <01>
- <100> <101> <102> <112> <124> <120>
- <1111> <1234> <1220> <10001>
- (1,2,3,4)
- (2,4,6)
- (20, 22, 12, 2, 1112)
- (11, 12) (10) (01)
- (1000) (101) (102) (112) (124) (120)
- (1111) (1234) (1220) (10001)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement