Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F4824496
latetranscend.h
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
Tue, Aug 25, 4:04 AM
Size
2 KB
Mime Type
text/x-c++
Expires
Thu, Aug 27, 4:04 AM (1 d, 5 h)
Engine
blob
Format
Raw Data
Handle
284912
Attached To
rXR Xreate
latetranscend.h
View Options
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* File: latereasoning.h
* Author: pgess <v.melnychenko@xreate.org>
*
* Created on May 26, 2018, 3:44 PM
*/
/**
* \file latetranscend.h
* \brief Late Transcend support
*/
#ifndef CMPLLATEREASONING_H
#define CMPLLATEREASONING_H
#include "ast.h"
#include "aux/latereasoning.h"
#include "pass/compilepass.h"
#include "llvmlayer.h"
#include "transcendlayer.h"
#include "targets.h"
namespace xreate{
namespace interpretation{
class InterpretationFunction;
}
}
namespace llvm{
class Value;
}
namespace xreate{
namespace latereasoning{
typedef std::function<llvm::Value*() > CompilerHandler;
typedef std::function<llvm::Value*(const Gringo::Symbol&) > Handler;
/** \brief [Late Transcend](d/transcend/late-transcend/) compilation support */
class LateReasoningCompiler{
public:
LateReasoningCompiler(interpretation::InterpretationFunction* fn,
compilation::Context ctx)
: __context(ctx), __fnI12n(fn){ }
llvm::Value* processSwitchLateStatement(const Expression& expr,
const std::string& identHint);
llvm::Value* compileAutoExpand(const LateAnnotation& annotation,
llvm::Type* resultT,
const std::string& hint,
Handler handler);
private:
compilation::Context __context;
interpretation::InterpretationFunction* __fnI12n;
static std::map<SymbolPacked, Expression> __dictGuardDefinitions;
llvm::Value* compileExpand(const Symbol& keyS,
llvm::Value* keyRaw,
const ExpandedType& domainT,
llvm::Type* resultT,
const std::string& hint,
CompilerHandler compilerBody);
std::list<Expression> findKeys(const std::list<SymbolPacked>& keys);
};
}
}
#endif /* CMPLLATEREASONING_H */
Event Timeline
Log In to Comment