Exemplo n.º 1
0
 public AssignmentExpression(VariableExpression target, Expression expression) 
     : base(AstNodeType.AssignmentExpression, new AstNode[]{target, expression})
 {
 }
Exemplo n.º 2
0
        private static Expression Expand(VariableExpression vex, IVault vault, IVault repository, List<Expression> stack, Dictionary<String, IBranch> nodes)
        {
            var @ref = vault.GetBranch(vex.Name.FromElfIdentifier());
            if (@ref == null)
            {
                throw new ReferencedBranchDoesNotExistException(vex.Name);
            }

            if (@ref.IsFov())
            {
                if (@ref.GetOrCreateValue("declarationType", "source").ContentString == "source")
                {
                    String val;
                    if (repository == null)
                    {
                        val = @ref.GetValue("valueForTesting").ContentString;
                    }
                    else
                    {
                        var external = @ref.GetValue("repositoryValue").ContentString;
                        val = repository.GetValue(external).ContentString;
                    }

                    return new LiteralExpression(String.Format("[[{0}]]{1}", @ref.GetValue("type").ContentString, val));
                }
                else
                {
                    return ExpandRhs(@ref, repository, stack, nodes);
                }
            }
            else
            {
                var varName = @ref.VPath.ToElfIdentifier();
                nodes[varName] = @ref;
                return new VariableExpression(varName);
            }
        }
Exemplo n.º 3
0
 private IEnumerable<ElfVmInstruction> CompileVariable(VariableExpression ve)
 {
     yield return new PushRef(ve.Name);
 }