reflow-oven-control-sw/temp-profile-checker/parser/tpr.ypp

48 lines
736 B
Plaintext

%language "c++"
%require "3.2"
%defines
%define api.namespace {tpr}
%define api.parser.class {TempProfileParser}
%define parse.error verbose
%code requires{
namespace tpr {
class TempProfileScanner;
}
}
%parse-param { TempProfileScanner &scanner }
%code {
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <utility>
#include <tuple>
#include <tpr/tpr-scanner.hpp>
#undef yylex
#define yylex scanner.yylex
}
%define api.value.type variant
%locations
%start tpr_file
%token foo
%%
tpr_file: foo
| tpr_file foo
;
%%
void tpr::TempProfileParser::error(const location_type &l, const std::string &err_message)
{
std::cerr << "Error " << err_message << " at " << l << std::endl;
std::abort();
}