2025-01-07 14:08:17 -04:00
|
|
|
%option prefix="deviceSpecl"
|
2025-01-13 22:01:17 -04:00
|
|
|
%option nounput
|
2025-01-07 14:08:17 -04:00
|
|
|
%{
|
|
|
|
|
#include <vector>
|
2025-01-14 23:11:30 -04:00
|
|
|
#include <string>
|
|
|
|
|
#include <algorithm>
|
2025-01-07 14:08:17 -04:00
|
|
|
#include <deviceManager/deviceManager.h>
|
|
|
|
|
#include "deviceSpecp.hh"
|
|
|
|
|
%}
|
|
|
|
|
|
|
|
|
|
%%
|
2025-01-07 14:19:36 -04:00
|
|
|
"+adev" {
|
|
|
|
|
deviceSpecplval.chr = yytext[1];
|
2025-01-07 14:08:17 -04:00
|
|
|
return KEYWORD_SPECTYPE_ACTUATOR;
|
|
|
|
|
}
|
2025-01-07 14:19:36 -04:00
|
|
|
"+edev" {
|
|
|
|
|
deviceSpecplval.chr = yytext[1];
|
2025-01-07 14:08:17 -04:00
|
|
|
return KEYWORD_SPECTYPE_EXTROSPECTOR;
|
|
|
|
|
}
|
2025-01-07 14:19:36 -04:00
|
|
|
"+idev" {
|
|
|
|
|
deviceSpecplval.chr = yytext[1];
|
2025-01-07 14:08:17 -04:00
|
|
|
return KEYWORD_SPECTYPE_INTEROSPECTOR;
|
|
|
|
|
}
|
|
|
|
|
"||" { return DOUBLE_PIPE; }
|
|
|
|
|
"|" { return PIPE; }
|
|
|
|
|
"(" { return LPAREN; }
|
|
|
|
|
")" { return RPAREN; }
|
2025-01-14 14:09:35 -04:00
|
|
|
[ \t]*"="[ \t]* { return EQUALS; } // Allow optional whitespace around equals
|
2025-01-14 23:11:30 -04:00
|
|
|
([^=\|\(\) \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;
|
|
|
|
|
}
|
2025-01-07 14:08:17 -04:00
|
|
|
\r?\n { /* ignore newlines */ }
|
|
|
|
|
[ \t]+ { /* ignore whitespace */ }
|
|
|
|
|
. { return yytext[0]; }
|
|
|
|
|
%%
|
|
|
|
|
|
|
|
|
|
int deviceSpeclwrap(void)
|
|
|
|
|
{
|
|
|
|
|
return 1; // Indicate end of input
|
|
|
|
|
}
|