%{
#include <stdio.h>
#include <ctype.h>

#define YYSTYPE float
    int yylex(void);
    int yyerror(char* s);
%}

%token NUMBER

%%

number 
    : NUMBER
    ;

%%

int main(void) {
    return yyparse();
}

/* lexical analyser */
int yylex(void) {
    int c;
    /* skip blanks */
    while ((c = getchar()) == ' ');
    /* get number */
    if (isdigit(c)) {
        ungetc(c, stdin);
    scanf("%f", &yylval);
        return NUMBER;
    }
    /* else return character */
    return c;
}

int yyerror(char* s)
{
    fprintf(stderr, "%s\n", s);
    return 1;
}

