示例#1
0
 // Emits a reference that is to be used in an opcode that assigns/gets a value
 // May throw if this expression is unable to be referenced
 public virtual (DMReference Reference, bool Conditional) EmitReference(DMObject dmObject, DMProc proc)
 {
     throw new CompileErrorException(Location, $"attempt to reference r-value");
 }
示例#2
0
        public static bool TryConstant(DMObject dmObject, DMProc proc, DMASTExpression expression, out Expressions.Constant constant)
        {
            var expr = Create(dmObject, proc, expression, null);

            return(expr.TryAsConstant(out constant));
        }
示例#3
0
 // Emits code that pushes the result of this expression to the proc's stack
 // May throw if this expression is unable to be pushed to the stack
 public abstract void EmitPushValue(DMObject dmObject, DMProc proc);
示例#4
0
        public static void Emit(DMObject dmObject, DMProc proc, DMASTExpression expression, DreamPath?inferredPath = null)
        {
            var expr = Create(dmObject, proc, expression, inferredPath);

            expr.EmitPushValue(dmObject, proc);
        }