コード例 #1
0
 public PreOpReference(PreOpDeclaration op, Expression oper, SourcePosition start, SourcePosition end)
     : base(ASTNodeType.InOpRef, start, end)
 {
     Operator = op;
     Operand  = oper;
 }
コード例 #2
0
ファイル: Expressions.cs プロジェクト: Mgamerz/ME3Libs
        public Expression DecompileNativeFunction(UInt16 index)
        {
            var parameters = new List<Expression>();
            while (!CurrentIs(StandardByteCodes.EndFunctionParms))
            {
                var param = DecompileExpression();
                if (param == null)
                    return null; // ERROR

                parameters.Add(param);
            }
            PopByte();

            var entry = NativeTable[index];
            Expression call = null;

            switch (entry.Type)
            {
                case NativeType.Function:
                    var func = new SymbolReference(null, null, null, entry.Name);
                    call = new FunctionCall(func, parameters, null, null);
                    break;

                case NativeType.Operator:   // TODO: table should hold precedence, currently all have 0 and it'll be a mess.
                    var op = new InOpDeclaration(entry.Name, entry.Precedence, false, null, null, null, null, null, null, null);
                    call = new InOpReference(op, parameters[0], parameters[1], null, null);
                    break;

                case NativeType.PreOperator:   // TODO: table should hold precedence, currently all have 0 and it'll be a mess.
                    var preOp = new PreOpDeclaration(entry.Name, false, null, null, null, null, null, null);
                    call = new PreOpReference(preOp, parameters[0], null, null);
                    break;

                case NativeType.PostOperator:   // TODO: table should hold precedence, currently all have 0 and it'll be a mess.
                    var postOp = new PostOpDeclaration(entry.Name, false, null, null, null, null, null, null);
                    call = new PostOpReference(postOp, parameters[0], null, null);
                    break;
            }

            StartPositions.Pop();
            return call;
        }
コード例 #3
0
ファイル: PreOpDeclaration.cs プロジェクト: Mgamerz/ME3Libs
 public bool IdenticalSignature(PreOpDeclaration other)
 {
     return base.IdenticalSignature(other)
         && this.Operand.VarType.Name.ToLower() == other.Operand.VarType.Name.ToLower();
 }
コード例 #4
0
ファイル: PreOpReference.cs プロジェクト: Mgamerz/ME3Libs
 public PreOpReference(PreOpDeclaration op, Expression oper, SourcePosition start, SourcePosition end)
     : base(ASTNodeType.InOpRef, start, end)
 {
     Operator = op;
     Operand = oper;
 }
コード例 #5
0
ファイル: PreOpDeclaration.cs プロジェクト: Mgamerz/ME3Libs
 public bool IdenticalSignature(PreOpDeclaration other)
 {
     return(base.IdenticalSignature(other) &&
            this.Operand.VarType.Name.ToLower() == other.Operand.VarType.Name.ToLower());
 }
コード例 #6
0
 public bool IdenticalSignature(PreOpDeclaration other)
 {
     return(base.IdenticalSignature(other) &&
            string.Equals(this.Operand.VarType.Name, other.Operand.VarType.Name, StringComparison.Ordinal));
 }