Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions getasm/asm-nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="DynamoPackages" value="https://art-bobcat.autodesk.com/artifactory/api/nuget/team-dynamo-nuget" />
<add key="Autodesk-3p" value="https://art-bobcat.autodesk.com/artifactory/api/nuget/autodesk-3p-nuget" />
</packageSources>
<config>
<add key="dependencyversion" value="Lowest" />
</config>
</configuration>
48 changes: 48 additions & 0 deletions getasm/getasm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<Project
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="4.0"
DefaultTargets="GetASM">
<PropertyGroup>
<Configuration>Release</Configuration>
<ASMBranch>231_0_0</ASMBranch>
<ASM>asm-a-lib_win_release_intel64_v140</ASM>
<ASMVer>231.0.0</ASMVer>
<ASMBinPackageName>asm-a_win_release_intel64_v140</ASMBinPackageName>
<ASMBin>$(ASMBinPackagename).$(ASMVer)</ASMBin>
<ASMLib>$(ASM).$(ASMVer)</ASMLib>

<TBB>onetbb_win_release_intel64_v140</TBB>
<TBBVer>7.0.120</TBBVer>
<TBBBin>$(TBB).$(TBBVer)</TBBBin>

<TSPLINESVer>13.0.0</TSPLINESVer>
<TSPLINESBin>tsplines_win_release_intel64_v140.$(TSPLINESVer)</TSPLINESBin>

<AMT>amt_win_release_intel64_v140</AMT>
<AMTVer>9.0.0</AMTVer>
<AMTBin>$(AMT).$(AMTVer)</AMTBin>

<DynamoBinPath>$(MSBuildProjectDirectory)\..\bin\AnyCPU\$(Configuration)</DynamoBinPath>
<PackageDirectory>$(MSBuildProjectDirectory)\asm\asm_sdk_$(ASMBranch)\packages</PackageDirectory>
<NuGetConfig>$(MSBuildProjectDirectory)\asm-nuget.config</NuGetConfig>
<NuGetPath>$(MSBuildProjectDirectory)\nuget.exe</NuGetPath>
</PropertyGroup>


<Target Name="GetASM">
<MakeDir Directories="$(PackageDirectory)"/>
<!--Getting ASM"/>-->
<Exec WorkingDirectory="$(PackageDirectory)" Command="$(NuGetPath) install -configFile $(NugetConfig) $(ASM) -version $(ASMVer)"/>
<!--Copy Binaries"/>-->
<Exec Command="robocopy /MT:4 $(PackageDirectory)\$(ASMBin)\bin $(DynamoBinPath)\LibG_$(ASMBranch)
if %ERRORLEVEL% GTR 3 ( exit 1 ) else ( exit 0 )"/>
<Exec Command="robocopy /MT:4 $(PackageDirectory)\$(TSPLINESBin)\bin\ $(DynamoBinPath)\LibG_$(ASMBranch) *.dll
if %ERRORLEVEL% GTR 3 ( exit 1 ) else ( exit 0 )"/>
<Exec Command="robocopy /MT:4 $(PackageDirectory)\$(TBBBin)\bin\ $(DynamoBinPath)\LibG_$(ASMBranch) *.dll
if %ERRORLEVEL% GTR 3 ( exit 1 ) else ( exit 0 )"/>
<Exec Command="if exist $(PackageDirectory)\$(AMTBin)\bin\*.dll robocopy /MT:4 $(PackageDirectory)\$(AMTBin)\bin\ $(DynamoBinPath)\LibG_$(ASMBranch) *.dll
if %ERRORLEVEL% GTR 3 ( exit 1 ) else ( exit 0 )"/>
</Target>


</Project>
305 changes: 57 additions & 248 deletions src/Engine/ProtoAssociative/CodeGen.cs

Large diffs are not rendered by default.

44 changes: 11 additions & 33 deletions src/Engine/ProtoAssociative/Compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,21 @@ public override bool Compile(out int blockId, ProtoCore.DSASM.CodeBlock parentBl
{
ProtoCore.CodeGen oldCodegen = core.assocCodegen;

if (ProtoCore.DSASM.InterpreterMode.Normal == core.Options.RunMode)
if ((core.IsParsingPreloadedAssembly || core.IsParsingCodeBlockNode) && parentBlock == null)
{
if ((core.IsParsingPreloadedAssembly || core.IsParsingCodeBlockNode) && parentBlock == null)
if (core.CodeBlockList.Count == 0)
{
if (core.CodeBlockList.Count == 0)
{
core.assocCodegen = new ProtoAssociative.CodeGen(core, callContext, parentBlock);
}
else
{
// We reuse the existing toplevel CodeBlockList's for the procedureTable's
// by calling this overloaded constructor - pratapa
core.assocCodegen = new ProtoAssociative.CodeGen(core);
}
core.assocCodegen = new ProtoAssociative.CodeGen(core, callContext, parentBlock);
}
else
core.assocCodegen = new ProtoAssociative.CodeGen(core, callContext, parentBlock);
{
// We reuse the existing toplevel CodeBlockList's for the procedureTable's
// by calling this overloaded constructor - pratapa
core.assocCodegen = new ProtoAssociative.CodeGen(core);
}
}
else
core.assocCodegen = new ProtoAssociative.CodeGen(core, callContext, parentBlock);

if (null != core.AssocNode)
{
Expand Down Expand Up @@ -76,31 +73,12 @@ public override bool Compile(out int blockId, ProtoCore.DSASM.CodeBlock parentBl
}

core.assocCodegen.context = callContext;

//Temporarily change the code block for code gen to the current block, in the case it is an imperative block
//CodeGen for ProtoImperative is modified to passing in the core object.
ProtoCore.DSASM.CodeBlock oldCodeBlock = core.assocCodegen.codeBlock;
if (core.Options.RunMode == ProtoCore.DSASM.InterpreterMode.Expression)
{
int tempBlockId = callContext.CurrentBlockId;
ProtoCore.DSASM.CodeBlock tempCodeBlock = ProtoCore.Utils.CoreUtils.GetCodeBlock(core.CodeBlockList, tempBlockId);
while (null != tempCodeBlock && tempCodeBlock.blockType != ProtoCore.DSASM.CodeBlockType.Language)
{
tempCodeBlock = tempCodeBlock.parent;
}
core.assocCodegen.codeBlock = tempCodeBlock;
}
core.assocCodegen.codeBlock.EventSink = sink;

if (core.BuildStatus.ErrorCount == 0) //if there is syntax error, no build needed
{
blockId = core.assocCodegen.Emit((codeBlockNode as ProtoCore.AST.AssociativeAST.CodeBlockNode), graphNode);
}
if (core.Options.RunMode == ProtoCore.DSASM.InterpreterMode.Expression)
{
blockId = core.assocCodegen.codeBlock.codeBlockId;
//Restore the code block.
core.assocCodegen.codeBlock = oldCodeBlock;
}
}

// @keyu: we have to restore asscoCodegen here. It may be
Expand Down
Loading
Loading