e86a75e232
We can't use a plain single letter anymore, so now let's use some longer keywords instead. New keywords are: * +idev: interoceptors. * +adev: actuators. * +edev: extrospectors.
35 lines
976 B
LLVM
35 lines
976 B
LLVM
%option prefix="deviceSpecl"
|
|
%{
|
|
#include <vector>
|
|
#include <deviceManager/deviceManager.h>
|
|
#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\r\n]+ { deviceSpecplval.str = strdup(yytext); return STRING; }
|
|
\r?\n { /* ignore newlines */ }
|
|
[ \t]+ { /* ignore whitespace */ }
|
|
. { return yytext[0]; }
|
|
%%
|
|
|
|
int deviceSpeclwrap(void)
|
|
{
|
|
return 1; // Indicate end of input
|
|
}
|