%option noyywrap %{ /* * * * * * * * * * * * * * * DEFINITIONS * * * * * * * * * * * * * * */ %} %x error %x label %% %{ /* * * * * * * * * * * * RULES * * * * * * * * * * * */ %} [1-9][0-9]* { printf(" NUMBER: %s \n", yytext); } [ \t\n\f\r] ; // ignore white space direction { printf("direction\n"); } vertical { printf("vertical\n"); } horizontal { printf("horizontal\n"); } color { printf("color\n"); } shape { printf("shape\n"); } fontname { printf("fontname\n"); } fontsize { printf("fontsize\n"); } nodestyle { printf("nodestyle\n"); } edgestyle { printf("edgestyle\n"); } "=" { printf("=\n"); } "," { printf(",\n"); } ";" { printf(";\n"); } "[" { printf("[\n"); } "]" { printf("]\n"); } "->" { printf("->\n"); } \" { printf("%s\n", yytext); BEGIN(label); }