Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F4819150
tests.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Aug 24, 12:02 AM
Size
1 KB
Mime Type
text/x-c++
Expires
Wed, Aug 26, 12:02 AM (11 h, 58 m)
Engine
blob
Format
Raw Data
Handle
284271
Attached To
rXR Xreate
tests.cpp
View Options
#include "Scanner.h"
#include "Parser.h"
#include "ast.h"
#include <memory>
#include <iostream>
#include "cfgpass.h"
#include "clasplayer.h"
#include "functiontagspass.h"
#include <sstream>
using namespace std;
void testParser_1()
{
shared_ptr<Scanner> scanner(new Scanner(L"scripts/input.xreate"));
shared_ptr<Parser> parser(new Parser(scanner.get()));
parser->Parse();
flush(cout);
AST& root = parser->root;
LLVMLayer l;
root.compile(l);
root.run(l);
}
void testClasp2()
{
shared_ptr<Scanner> scanner(new Scanner(L"scripts/input.xreate"));
shared_ptr<Parser> parser(new Parser(scanner.get()));
parser->Parse();
flush(cout);
if (parser->errors->count)
{
cout << "Found " << parser->errors->count << " errors. Stop" << endl;
exit(1);
}
AST& root = parser->root;
ClaspLayer clasp;
FunctionTagsPass(root).run(clasp);
CFGPass(root).run(clasp);
clasp.addRule(":- call(X, Y), tag(Y, unsafe), not tag(X, unsafe), function(X), function(Y).");
clasp.run();
}
void tests_ListsMultiply()
{
}
int main()
{
testClasp2();
return 0;
}
Event Timeline
Log In to Comment