コード例 #1
0
ファイル: derpvm.cpp プロジェクト: ExpiredPopsicle/DerpScript
    DerpObject::Ref DerpVM::evalString(
        const std::string &str,
        DerpErrorState &errorState,
        const std::string &fileName,
        unsigned int stackDepth) {

        DerpObject::Ref fakeFunctionObject = compileString(
            str,
            errorState,
            fileName);

        if(!fakeFunctionObject) {
            return NULL;
        }

        DerpObject::Ref ret = fakeFunctionObject->evalFunction(
            &globalContext,
            NULL,
            NULL,
            errorState,
            true,
            stackDepth + 1);

        return ret;
    }
コード例 #2
0
HRESULT ShaderCompilerClass::compileFromFile(MutableString&& filename,
	const char* entryPoint,
	const char* shaderTarget,
	ID3DBlob** output)
{
	FileTracker ft;
	ft.LoadFile(filename);
	MutableString stringFromFile = ft.getContext();
	compileString(stringFromFile, entryPoint, shaderTarget, output);
	return S_OK;
}
コード例 #3
0
ファイル: compiler.cpp プロジェクト: renjipanicker/zenlang
void z::Compiler::initContext(z::Ast::Unit& unit, const bool& isprj) {
    // import core.ipp. This is a string constant
    {
        z::Ast::Module module(unit, "core.ipp", 1);
        Parser parser;
        Lexer lexer(parser);
        compileString(module, lexer, ifile, true);
    }

    // import zenlang.ipp. This is a generated file
    if(!isprj) {
        z::Ast::Module module(unit, "zenlang.ipp", 1);
        import(module);
    }
}
コード例 #4
0
HRESULT ShaderCompilerClass::compileFromFile(MutableString& filename,
	const char* entryPoint,
	const char* shaderTarget,
	ID3DBlob** output)
{
	FileTracker ft;
	if (false == ft.LoadFile(filename))
	{
		return E_FAIL;
	}
	MutableString stringFromFile = ft.getContext();
	HRESULT hr;
	hr = compileString(stringFromFile, entryPoint, shaderTarget, output);
	if (FAILED(hr))
	{
		return hr;
	}
	if (output == nullptr)
	{
		return E_FAIL;
	}
	return S_OK;
}
コード例 #5
0
bool GLSL_Shader::compileFile ( const char *fname, GLenum _type )
{
  return compileString ( readShaderText ( fname ), _type, fname ) ;
}