mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-10 04:26:50 +03:00
added tokenizing of MW scripts
This commit is contained in:
parent
31e22186ef
commit
ddcbc8cd62
15 changed files with 1120 additions and 7 deletions
|
@ -1,8 +1,31 @@
|
|||
// Stand-alone MW-script compiler
|
||||
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include <components/compiler/streamerrorhandler.hpp>
|
||||
#include <components/compiler/scanner.hpp>
|
||||
#include <components/compiler/fileparser.hpp>
|
||||
#include <components/compiler/context.hpp>
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
Compiler::Context context;
|
||||
Compiler::StreamErrorHandler errorHandler (std::cout);
|
||||
Compiler::FileParser parser (errorHandler, context);
|
||||
|
||||
std::ifstream file ("test.mwscript");
|
||||
Compiler::Scanner scanner (errorHandler, file);
|
||||
|
||||
scanner.scan (parser);
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::cout << "\nERROR: " << e.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue