%{ #include "LLP_Support.h" #include "LowLevelParser.tab.h" #include #include #define YY_INPUT(buf, result, max_size) \ (result) = LLP_GetMoreChars((buf), (max_size)); \ (result) = ((result)?(result):(YY_NULL)) static void Count(const char *s) { LLPlloc.first_column = LLPlloc.last_column; LLPlloc.last_column += strlen(s); fprintf(stderr, "\nCOUNTING CHARS: \"%s\" : %d - %d\n", s, LLPlloc.first_column, LLPlloc.last_column); } #define LLPwrap() 1 %} DIGIT [0-9] LETTER [A-Za-z] NAME_LETTER ({LETTER}|"_") WHITE [ \t\n] %% \"([^\"]|"\\\"")*\" { Count(yytext); return STRING; } {NAME_LETTER}({NAME_LETTER}|{DIGIT})* { Count(yytext); return NAME; } "=" { Count(yytext); return '='; } "," { Count(yytext); return ','; } "{" { Count(yytext); return '{'; } "}" { Count(yytext); return '}'; } "[" { Count(yytext); return '['; } "]" { Count(yytext); return ']'; } {WHITE}+ { Count(yytext); } . { Count(yytext); return BAD_CHARACTER; } %%