reflow-oven-control-sw/temp-profile-checker/parser/lang.lex

46 lines
1.1 KiB
Plaintext

%{
#include <stdio.h>
#include "y.tab.h"
%}
/*
static const struct pl_command_list_map cmd_list_map[_PL_NUM_CMDS] = {
{PL_PID_CONF, "pid_conf", 6u},
{PL_SET_TEMP, "temp_set", 1u},
{PL_WAIT_FOR_TEMP, "wait_temp", 1u},
{PL_WAIT_FOR_TIME, "wait_time", 1u},
{PL_SET_RAMP, "temp_ramp", 2u},
{PL_LOUDSPEAKER_SET, "beep", 1u},
{PL_OFF, "temp_off", 0u},
{PL_CLEAR_FLAGS, "clear_flags", 0u},
{PL_DIGIO_CONF, "digio_conf", 2u},
{PL_DIGIO_SET, "digio_set", 2u},
{PL_DIGIO_WAIT, "digio_wait", 2u},
};
*/
%option yylineno
%%
#[^\n]* return COMMENT;
pid_conf return PL_PID_CONF;
temp_set return PL_SET_TEMP;
wait_temp return PL_WAIT_FOR_TEMP;
wait_time return PL_WAIT_FOR_TIME;
temp_ramp return PL_SET_RAMP;
beep return PL_LOUDSPEAKER_SET;
temp_off return PL_OFF;
clear_flags return PL_CLEAR_FLAGS;
digio_conf return PL_DIGIO_CONF;
digio_set return PL_DIGIO_SET;
digio_wait return PL_DIGIO_WAIT;
[+-]?[0-9]+ yylval.int_value=atoi(yytext); return INT_NUMBER;
[+-]?[0-9]+[.]?[0-9]* yylval.float_value=atof(yytext); return NUMBER;
[ \t]+ /* Ignore whitespaces */;
[\r]?\n return NEWLINE;
[^\t\n #]+ return LITERAL;
%%