%option prefix="deviceSpecl" %option nounput %{ #include #include #include #include #include "deviceSpecp.hh" %} %% "+adev" { deviceSpecplval.chr = yytext[1]; return KEYWORD_SPECTYPE_ACTUATOR; } "+edev" { deviceSpecplval.chr = yytext[1]; return KEYWORD_SPECTYPE_EXTROSPECTOR; } "+idev" { deviceSpecplval.chr = yytext[1]; return KEYWORD_SPECTYPE_INTEROSPECTOR; } "||" { return DOUBLE_PIPE; } "|" { return PIPE; } "(" { return LPAREN; } ")" { return RPAREN; } [ \t]*"="[ \t]* { return EQUALS; } // Allow optional whitespace around equals ([^=\|\(\) \t\r\n]|\\[ \t])+ { std::string token(yytext); token.erase(std::remove(token.begin(), token.end(), '\\'), token.end()); deviceSpecplval.str = strdup(token.c_str()); return STRING; } \r?\n { /* ignore newlines */ } [ \t]+ { /* ignore whitespace */ } . { return yytext[0]; } %% int deviceSpeclwrap(void) { return 1; // Indicate end of input }