This repository has been archived on 2024-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
pacciani/main.cpp
Stefano Sanfilippo 40845c011b Cleanups.
1. move emit() to separate file.
2. move main to .cpp
3. use "namespace" for parser and lexer.
4. remove Type.h
2014-11-27 19:59:48 +01:00

37 lines
586 B
C++

#include "Monicelli.tab.h"
#include <iostream>
#include <cstdlib>
using namespace monicelli;
int lineNumber = 1;
Program *program;
void monicelli_error(const char *message) {
std::cerr << "At line " << lineNumber << ": " << message << std::endl;
std::exit(1);
}
void monicelli_meta(const char *text) {
while (text != '\0' && *text == ' ') {
text += 1;
}
std::cerr << "META: " << text << std::endl;
}
int main() {
#if YYDEBUG
yydebug = 1;
#endif
program = new Program();
monicelli_parse();
program->emit(std::cout);
return 0;
}