fork download
  1. %{
  2. #include<stdio.h>
  3. #include<string.h>
  4. int a = 0, b=0, c=0, d=0, l=0;
  5. %}
  6.  
  7.  
  8. %%
  9. [a-z] {a++;l++;}
  10. [A-Z] {b++;l++;}
  11. [0-9] {c++;l++;}
  12. [$&+, :;=?@#|'<>.-^*()%!] {d++;l++;}
  13. . ;
  14. %%
  15.  
  16. int yywrap(void){}
  17.  
  18. int main()
  19. {
  20. // The function that starts the analysis
  21. yylex();
  22. if(a>0 && b>0 && c>0 && d>0 && l>=8)
  23. printf("VALID\n");
  24. else
  25. printf("INVALID\n");
  26. return 0;
  27. }
  28.  
Success #stdin #stdout #stderr 0.03s 6896KB
stdin
hello world
stdout
Standard output is empty
stderr
ERROR: /home/vsen7O/prog:2:9: Syntax error: End of file in quoted atom
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? Options:
+:                  spy        -:              no spy
/c|e|r|f|u|a goal:  find       .:              repeat find
a:                  abort      A:              alternatives
b:                  break      c (ret, space): creep
[depth] d:          depth      e:              exit
f:                  fail       [ndepth] g:     goals (backtrace)
h (?):              help       i:              ignore
l:                  leap       L:              listing
n:                  no debug   p:              print
r:                  retry      s:              skip
u:                  up         w:              write
m:                  exception details
C:                  toggle show context
   Exception: (3) program ? EOF: exit