Add multiple of the pointer target size
This commit is contained in:
41
tools/main.cc
Normal file
41
tools/main.cc
Normal file
@ -0,0 +1,41 @@
|
||||
#include <elna/source/driver.h>
|
||||
#include "parser.hh"
|
||||
#include <sstream>
|
||||
|
||||
constexpr std::size_t pointer_size = 4;
|
||||
|
||||
int main()
|
||||
{
|
||||
elna::source::driver driver{ "-" };
|
||||
std::istringstream inp(R"(
|
||||
proc f();
|
||||
begin
|
||||
end;
|
||||
|
||||
var x: Int;
|
||||
|
||||
begin
|
||||
x := 4 + 2
|
||||
end.
|
||||
)");
|
||||
|
||||
elna::source::lexer lexer(inp);
|
||||
yy::parser parser(lexer, driver);
|
||||
|
||||
if (auto result = parser())
|
||||
{
|
||||
for (const auto& error : driver.errors())
|
||||
{
|
||||
std::cerr << error->path << ':'
|
||||
<< error->line() << ':' << error->column()
|
||||
<< ": error: " << error->what()
|
||||
<< '.' << std::endl;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
for (auto& definition : driver.tree->definitions())
|
||||
{
|
||||
std::cout << "Definition identifier: " << definition->identifier() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user