Exemplo n.º 1
0
        public static void Initialize()
        {
            Assembly asm = Assembly.GetExecutingAssembly();

            foreach (Type type in asm.GetTypes())
            {
                AddPrimitives(type);
            }

            Add1                     = (Primitive1)Find("1+", 1);
            Car                      = (Primitive1)Find("CAR", 1);
            Caar                     = (Primitive1)Find("CAAR", 1);
            Cdr                      = (Primitive1)Find("CDR", 1);
            CharToInteger            = (Primitive1)Find("CHAR->INTEGER", 1);
            ExitWithValue            = (Primitive1)Find("EXIT-WITH-VALUE", 1);
            FixnumAdd1               = (Primitive1)Find("ONE-PLUS-FIXNUM", 1);
            FixnumIsNegative         = (Primitive1)Find("NEGATIVE-FIXNUM?", 1);
            FixnumNegate             = (Primitive1)Find("FIXNUM-NEGATE", 1);
            FixnumNot                = (Primitive1)Find("FIXNUM-NOT", 1);
            FixnumSub1               = (Primitive1)Find("MINUS-ONE-PLUS-FIXNUM", 1);
            FloatingVectorCons       = (Primitive1)Find("FLOATING-VECTOR-CONS", 1);
            FlonumIsNegative         = (Primitive1)Find("FLONUM-NEGATIVE?", 1);
            FlonumIsPositive         = (Primitive1)Find("FLONUM-POSITIVE?", 1);
            InitializeCCompiledBlock = (Primitive1)Find("INITIALIZE-C-COMPILED-BLOCK", 1);
            IntegerAdd1              = (Primitive1)Find("INTEGER-ADD-1", 1);
            IntegerSub1              = (Primitive1)Find("INTEGER-SUBTRACT-1", 1);
            IntegerToChar            = (Primitive1)Find("INTEGER->CHAR", 1);
            IsBigFixnum              = (Primitive1)Find("BIG-FIXNUM?", 1);
            IsBigFlonum              = (Primitive1)Find("BIG-FLONUM?", 1);
            IsChar                   = (Primitive1)Find("CHAR?", 1);
            IsCompiledEntry          = (Primitive1)Find("COMPILED-ENTRY?", 1);
            IsComplex                = (Primitive1)Find("COMPLEX?", 1);
            IsEntity                 = (Primitive1)Find("ENTITY?", 1);
            //IsExtendedProcedure = (Primitive1) Find ("EXTENDED-PROCEDURE?", 1);
            IsFixnum             = (Primitive1)Find("FIXNUM?", 1);
            IsFixnumZero         = (Primitive1)Find("ZERO-FIXNUM?", 1);
            IsIntegerZero        = (Primitive1)Find("INTEGER-ZERO?", 1);
            IsNegative           = (Primitive1)Find("NEGATIVE?", 1);
            IsNull               = (Primitive1)Find("NULL?", 1);
            IsPair               = (Primitive1)Find("PAIR?", 1);
            IsPrimitiveProcedure = (Primitive1)Find("PRIMITIVE?", 1);
            //IsProcedure = (Primitive1) Find ("PROCEDURE?", 1);
            IsRatnum           = (Primitive1)Find("RATNUM?", 1);
            IsRecord           = (Primitive1)Find("%RECORD?", 1);
            IsSharpT           = (Primitive1)Find("OBJECT-IS-TRUE?", 1);
            IsString           = (Primitive1)Find("STRING?", 1);
            IsSymbol           = (Primitive1)Find("SYMBOL?", 1);
            IsUninternedSymbol = (Primitive1)Find("UNINTERNED-SYMBOL?", 1);
            IsVector           = (Primitive1)Find("VECTOR?", 1);
            IsWeakCons         = (Primitive1)Find("WEAK-CONS?", 1);
            Not                 = (Primitive1)Find("NOT", 1);
            ObjectDatum         = (Primitive1)Find("OBJECT-DATUM", 1);
            ObjectIsZero        = (Primitive1)Find("OBJECT-IS-ZERO?", 1);
            ObjectType          = (Primitive1)Find("OBJECT-TYPE", 1);
            PositiveFixnum      = (Primitive1)Find("POSITIVE-FIXNUM?", 1);
            RequestInterrupts   = (Primitive1)Find("REQUEST-INTERRUPTS!", 1);
            SetInterruptEnables = (Primitive1)Find("SET-INTERRUPT-ENABLES!", 1);
            StringAllocate      = (Primitive1)Find("STRING-ALLOCATE", 1);
            StringLength        = (Primitive1)Find("STRING-LENGTH", 1);
            SystemPairCar       = (Primitive1)Find("SYSTEM-PAIR-CAR", 1);
            SystemPairCdr       = (Primitive1)Find("SYSTEM-PAIR-CDR", 1);
            SystemVectorSize    = (Primitive1)Find("SYSTEM-VECTOR-SIZE", 1);
            VectorLength        = (Primitive1)Find("VECTOR-LENGTH", 1);

            BoolIsEq                = (Primitive2)Find("BOOL-EQ?", 2);
            CharIsEq                = (Primitive2)Find("CHAR-EQ?", 2);
            Cons                    = (Primitive2)Find("CONS", 2);
            FileAccess              = (Primitive2)Find("FILE-ACCESS", 2);
            FixnumAnd               = (Primitive2)Find("FIXNUM-AND", 2);
            FixnumIsGreaterThan     = (Primitive2)Find("GREATER-THAN-FIXNUM?", 2);
            FixnumLsh               = (Primitive2)Find("FIXNUM-LSH", 2);
            FixnumMultiply          = (Primitive2)Find("MULTIPLY-FIXNUM", 2);
            FixnumOr                = (Primitive2)Find("FIXNUM-OR", 2);
            FixnumQuotient          = (Primitive2)Find("FIXNUM-QUOTIENT", 2);
            FixnumRemainder         = (Primitive2)Find("FIXNUM-REMAINDER", 2);
            FixnumSubtract          = (Primitive2)Find("MINUS-FIXNUM", 2);
            FixnumXor               = (Primitive2)Find("FIXNUM-XOR", 2);
            FloatingVectorRef       = (Primitive2)Find("FLOATING-VECTOR-REF", 2);
            FlonumAdd               = (Primitive2)Find("FLONUM-ADD", 2);
            FlonumDivide            = (Primitive2)Find("FLONUM-DIVIDE", 2);
            FlonumIsEqual           = (Primitive2)Find("FLONUM-EQUAL?", 2);
            FlonumIsGreaterThan     = (Primitive2)Find("FLONUM-GREATER?", 2);
            FlonumIsLessThan        = (Primitive2)Find("FLONUM-LESS?", 2);
            FlonumMultiply          = (Primitive2)Find("FLONUM-MULTIPLY", 2);
            FlonumSubtract          = (Primitive2)Find("FLONUM-SUBTRACT", 2);
            GeneralCarCdr           = (Primitive2)Find("GENERAL-CAR-CDR", 2);
            GenericAdd              = (Primitive2)Find("&+", 2);
            GenericDivide           = (Primitive2)Find("&/", 2);
            GenericIsEqual          = (Primitive2)Find("&=", 2);
            GenericIsGreaterThan    = (Primitive2)Find("&>", 2);
            GenericIsLessThan       = (Primitive2)Find("&<", 2);
            GenericMultiply         = (Primitive2)Find("&*", 2);
            GenericSubtract         = (Primitive2)Find("&-", 2);
            GreaterThanFixnum       = (Primitive2)Find("GREATER-THAN-FIXNUM?", 2);
            IntIsEq                 = (Primitive2)Find("INT-EQ?", 2);
            IntegerAdd              = (Primitive2)Find("INTEGER-ADD", 2);
            IntegerDivide           = (Primitive2)Find("INTEGER-DIVIDE", 2);
            IntegerIsEqual          = (Primitive2)Find("INTEGER-EQUAL?", 2);
            IntegerIsGreater        = (Primitive2)Find("INTEGER-GREATER?", 2);
            IntegerIsPositive       = (Primitive1)Find("INTEGER-POSITIVE?", 1);
            IntegerMultiply         = (Primitive2)Find("INTEGER-MULTIPLY", 2);
            IntegerQuotient         = (Primitive2)Find("INTEGER-QUOTIENT", 2);
            IntegerRemainder        = (Primitive2)Find("INTEGER-REMAINDER", 2);
            IntegerShiftLeft        = (Primitive2)Find("INTEGER-SHIFT-LEFT", 2);
            IntegerSubtract         = (Primitive2)Find("INTEGER-SUBTRACT", 2);
            IntegerToFlonum         = (Primitive2)Find("INTEGER->FLONUM", 2);
            IsEq                    = (Primitive2)Find("EQ?", 2);
            IsFixnumEqual           = (Primitive2)Find("EQUAL-FIXNUM?", 2);
            IsSameType              = (Primitive2)Find("IS-SAME-TYPE?", 2);
            IsObjectType            = (Primitive2)Find("OBJECT-TYPE?", 2);
            LessThanFixnum          = (Primitive2)Find("LESS-THAN-FIXNUM?", 2);
            LexicalReference        = (Primitive2)Find("LEXICAL-REFERENCE", 2);
            LexicalUnreferenceable  = (Primitive2)Find("LEXICAL-UNREFERENCEABLE?", 2);
            MakeBitString           = (Primitive2)Find("MAKE-BIT-STRING", 2);
            MapCodeToMachineAddress = (Primitive2)Find("MAP-CODE-TO-MACHINE-ADDRESS", 2);
            MapMachineAddressToCode = (Primitive2)Find("MAP-MACHINE-ADDRESS-TO-CODE", 2);
            ObjectIsEq              = (Primitive2)Find("OBJECT-EQ?", 2);
            ObjectSetType           = (Primitive2)Find("OBJECT-SET-TYPE", 2);
            PlusFixnum              = (Primitive2)Find("PLUS-FIXNUM", 2);
            PrimitiveAddress        = (Primitive2)Find("GET-PRIMITIVE-ADDRESS", 2);
            PrimitiveIsObjectType   = (Primitive2)Find("PRIMITIVE-OBJECT-TYPE?", 2);
            PrimitiveObjectEq       = (Primitive2)Find("PRIMITIVE-OBJECT-EQ?", 2);
            PrimitiveObjectRef      = (Primitive2)Find("PRIMITIVE-OBJECT-REF", 2);
            PrimitiveObjectSetType  = (Primitive2)Find("PRIMITIVE-OBJECT-SET-TYPE", 2);
            Quotient                = (Primitive2)Find("QUOTIENT", 2);
            RecordRef               = (Primitive2)Find("%RECORD-REF", 2);
            Remainder               = (Primitive2)Find("REMAINDER", 2);
            SetCar                  = (Primitive2)Find("SET-CAR!", 2);
            SetCdr                  = (Primitive2)Find("SET-CDR!", 2);
            StringRef               = (Primitive2)Find("STRING-REF", 2);
            SystemListToVector      = (Primitive2)Find("SYSTEM-LIST-TO-VECTOR", 2);
            SystemPairSetCar        = (Primitive2)Find("SYSTEM-PAIR-SET-CAR!", 2);
            SystemVectorRef         = (Primitive2)Find("SYSTEM-VECTOR-REF", 2);
            Vector8BRef             = (Primitive2)Find("VECTOR-8B-REF", 2);
            VectorCons              = (Primitive2)Find("VECTOR-CONS", 2);
            VectorRef               = (Primitive2)Find("VECTOR-REF", 2);
            WithInterruptMask       = (Primitive2)Find("WITH-INTERRUPT-MASK", 2);

            Hunk3Cons      = (Primitive3)Find("HUNK3-CONS", 3);
            RecordSet      = (Primitive3)Find("%RECORD-SET!", 3);
            StringSet      = (Primitive3)Find("STRING-SET!", 3);
            SystemPairCons = (Primitive3)Find("SYSTEM-PAIR-CONS", 3);
            VectorSet      = (Primitive3)Find("VECTOR-SET!", 3);
            Vector8BSet    = (Primitive3)Find("VECTOR-8B-SET!", 3);
        }
Exemplo n.º 2
0
        public static void Initialize()
        {
            Assembly asm = Assembly.GetExecutingAssembly ();
            foreach (Type type in asm.GetTypes ())
                AddPrimitives (type);

            Add1 = (Primitive1) Find ("1+", 1);
            Car = (Primitive1) Find ("CAR", 1);
            Caar = (Primitive1) Find ("CAAR", 1);
            Cdr = (Primitive1) Find ("CDR", 1);
            CharToInteger = (Primitive1) Find ("CHAR->INTEGER", 1);
            ExitWithValue = (Primitive1) Find ("EXIT-WITH-VALUE", 1);
            FixnumAdd1 = (Primitive1) Find ("ONE-PLUS-FIXNUM", 1);
            FixnumIsNegative = (Primitive1) Find ("NEGATIVE-FIXNUM?", 1);
            FixnumNegate = (Primitive1) Find ("FIXNUM-NEGATE", 1);
            FixnumNot = (Primitive1) Find ("FIXNUM-NOT", 1);
            FixnumSub1 = (Primitive1) Find ("MINUS-ONE-PLUS-FIXNUM", 1);
            FloatingVectorCons = (Primitive1) Find ("FLOATING-VECTOR-CONS", 1);
            FlonumIsNegative = (Primitive1) Find ("FLONUM-NEGATIVE?", 1);
            FlonumIsPositive = (Primitive1) Find ("FLONUM-POSITIVE?", 1);
            InitializeCCompiledBlock = (Primitive1) Find ("INITIALIZE-C-COMPILED-BLOCK", 1);
            IntegerAdd1 = (Primitive1) Find ("INTEGER-ADD-1", 1);
            IntegerSub1 = (Primitive1) Find ("INTEGER-SUBTRACT-1", 1);
            IntegerToChar = (Primitive1) Find ("INTEGER->CHAR", 1);
            IsBigFixnum = (Primitive1) Find ("BIG-FIXNUM?", 1);
            IsBigFlonum = (Primitive1) Find ("BIG-FLONUM?", 1);
            IsChar = (Primitive1) Find ("CHAR?", 1);
            IsCompiledEntry = (Primitive1) Find ("COMPILED-ENTRY?", 1);
            IsComplex = (Primitive1) Find ("COMPLEX?", 1);
            IsEntity = (Primitive1) Find ("ENTITY?", 1);
            //IsExtendedProcedure = (Primitive1) Find ("EXTENDED-PROCEDURE?", 1);
            IsFixnum = (Primitive1) Find ("FIXNUM?", 1);
            IsFixnumZero = (Primitive1) Find ("ZERO-FIXNUM?", 1);
            IsIntegerZero = (Primitive1) Find ("INTEGER-ZERO?", 1);
            IsNegative = (Primitive1) Find ("NEGATIVE?", 1);
            IsNull = (Primitive1) Find ("NULL?", 1);
            IsPair = (Primitive1) Find ("PAIR?", 1);
            IsPrimitiveProcedure = (Primitive1) Find ("PRIMITIVE?", 1);
            //IsProcedure = (Primitive1) Find ("PROCEDURE?", 1);
            IsRatnum = (Primitive1) Find ("RATNUM?", 1);
            IsRecord = (Primitive1) Find ("%RECORD?", 1);
            IsSharpT = (Primitive1) Find ("OBJECT-IS-TRUE?", 1);
            IsString = (Primitive1) Find ("STRING?", 1);
            IsSymbol = (Primitive1) Find ("SYMBOL?", 1);
            IsUninternedSymbol = (Primitive1) Find ("UNINTERNED-SYMBOL?", 1);
            IsVector = (Primitive1) Find ("VECTOR?", 1);
            IsWeakCons = (Primitive1) Find ("WEAK-CONS?", 1);
            Not = (Primitive1) Find ("NOT", 1);
            ObjectDatum = (Primitive1) Find ("OBJECT-DATUM", 1);
            ObjectIsZero = (Primitive1) Find ("OBJECT-IS-ZERO?", 1);
            ObjectType = (Primitive1) Find ("OBJECT-TYPE", 1);
            PositiveFixnum = (Primitive1) Find ("POSITIVE-FIXNUM?", 1);
            RequestInterrupts = (Primitive1) Find ("REQUEST-INTERRUPTS!", 1);
            SetInterruptEnables = (Primitive1) Find ("SET-INTERRUPT-ENABLES!", 1);
            StringAllocate = (Primitive1) Find ("STRING-ALLOCATE", 1);
            StringLength = (Primitive1) Find ("STRING-LENGTH", 1);
            SystemPairCar = (Primitive1) Find ("SYSTEM-PAIR-CAR", 1);
            SystemPairCdr = (Primitive1) Find ("SYSTEM-PAIR-CDR", 1);
            SystemVectorSize = (Primitive1) Find ("SYSTEM-VECTOR-SIZE", 1);
            VectorLength = (Primitive1) Find ("VECTOR-LENGTH", 1);

            BoolIsEq = (Primitive2) Find ("BOOL-EQ?", 2);
            CharIsEq = (Primitive2) Find ("CHAR-EQ?", 2);
            Cons = (Primitive2) Find ("CONS", 2);
            FileAccess = (Primitive2) Find ("FILE-ACCESS", 2);
            FixnumAnd = (Primitive2) Find ("FIXNUM-AND", 2);
            FixnumIsGreaterThan = (Primitive2) Find ("GREATER-THAN-FIXNUM?", 2);
            FixnumLsh = (Primitive2) Find ("FIXNUM-LSH", 2);
            FixnumMultiply = (Primitive2) Find ("MULTIPLY-FIXNUM", 2);
            FixnumOr = (Primitive2) Find ("FIXNUM-OR", 2);
            FixnumQuotient = (Primitive2) Find ("FIXNUM-QUOTIENT", 2);
            FixnumRemainder = (Primitive2) Find ("FIXNUM-REMAINDER", 2);
            FixnumSubtract = (Primitive2) Find ("MINUS-FIXNUM", 2);
            FixnumXor = (Primitive2) Find ("FIXNUM-XOR", 2);
            FloatingVectorRef = (Primitive2) Find ("FLOATING-VECTOR-REF", 2);
            FlonumAdd = (Primitive2) Find ("FLONUM-ADD", 2);
            FlonumDivide = (Primitive2) Find ("FLONUM-DIVIDE", 2);
            FlonumIsEqual = (Primitive2) Find ("FLONUM-EQUAL?", 2);
            FlonumIsGreaterThan = (Primitive2) Find ("FLONUM-GREATER?", 2);
            FlonumIsLessThan = (Primitive2) Find ("FLONUM-LESS?", 2);
            FlonumMultiply = (Primitive2) Find ("FLONUM-MULTIPLY", 2);
            FlonumSubtract = (Primitive2) Find ("FLONUM-SUBTRACT", 2);
            GeneralCarCdr = (Primitive2) Find ("GENERAL-CAR-CDR", 2);
            GenericAdd = (Primitive2) Find ("&+", 2);
            GenericDivide = (Primitive2) Find ("&/", 2);
            GenericIsEqual = (Primitive2) Find ("&=", 2);
            GenericIsGreaterThan = (Primitive2) Find ("&>", 2);
            GenericIsLessThan = (Primitive2) Find ("&<", 2);
            GenericMultiply = (Primitive2) Find ("&*", 2);
            GenericSubtract = (Primitive2) Find ("&-", 2);
            GreaterThanFixnum = (Primitive2) Find ("GREATER-THAN-FIXNUM?", 2);
            IntIsEq = (Primitive2) Find ("INT-EQ?", 2);
            IntegerAdd = (Primitive2) Find ("INTEGER-ADD", 2);
            IntegerDivide = (Primitive2) Find ("INTEGER-DIVIDE", 2);
            IntegerIsEqual = (Primitive2) Find ("INTEGER-EQUAL?", 2);
            IntegerIsGreater = (Primitive2) Find ("INTEGER-GREATER?", 2);
            IntegerIsPositive = (Primitive1) Find ("INTEGER-POSITIVE?", 1);
            IntegerMultiply = (Primitive2) Find ("INTEGER-MULTIPLY", 2);
            IntegerQuotient = (Primitive2) Find ("INTEGER-QUOTIENT", 2);
            IntegerRemainder = (Primitive2) Find ("INTEGER-REMAINDER", 2);
            IntegerShiftLeft = (Primitive2) Find ("INTEGER-SHIFT-LEFT", 2);
            IntegerSubtract = (Primitive2) Find ("INTEGER-SUBTRACT", 2);
            IntegerToFlonum = (Primitive2) Find ("INTEGER->FLONUM", 2);
            IsEq = (Primitive2) Find ("EQ?", 2);
            IsFixnumEqual = (Primitive2) Find ("EQUAL-FIXNUM?", 2);
            IsSameType = (Primitive2) Find ("IS-SAME-TYPE?", 2);
            IsObjectType = (Primitive2) Find ("OBJECT-TYPE?", 2);
            LessThanFixnum = (Primitive2) Find ("LESS-THAN-FIXNUM?", 2);
            LexicalReference = (Primitive2) Find ("LEXICAL-REFERENCE", 2);
            LexicalUnreferenceable = (Primitive2) Find ("LEXICAL-UNREFERENCEABLE?", 2);
            MakeBitString = (Primitive2) Find ("MAKE-BIT-STRING", 2);
            MapCodeToMachineAddress = (Primitive2) Find ("MAP-CODE-TO-MACHINE-ADDRESS", 2);
            MapMachineAddressToCode = (Primitive2) Find ("MAP-MACHINE-ADDRESS-TO-CODE", 2);
            ObjectIsEq = (Primitive2) Find ("OBJECT-EQ?", 2);
            ObjectSetType = (Primitive2) Find ("OBJECT-SET-TYPE", 2);
            PlusFixnum = (Primitive2) Find ("PLUS-FIXNUM", 2);
            PrimitiveAddress = (Primitive2) Find ("GET-PRIMITIVE-ADDRESS", 2);
            PrimitiveIsObjectType = (Primitive2) Find ("PRIMITIVE-OBJECT-TYPE?", 2);
            PrimitiveObjectEq = (Primitive2) Find ("PRIMITIVE-OBJECT-EQ?", 2);
            PrimitiveObjectRef = (Primitive2) Find ("PRIMITIVE-OBJECT-REF", 2);
            PrimitiveObjectSetType = (Primitive2) Find ("PRIMITIVE-OBJECT-SET-TYPE", 2);
            Quotient = (Primitive2) Find ("QUOTIENT", 2);
            RecordRef = (Primitive2) Find ("%RECORD-REF", 2);
            Remainder = (Primitive2) Find ("REMAINDER", 2);
            SetCar = (Primitive2) Find ("SET-CAR!", 2);
            SetCdr = (Primitive2) Find ("SET-CDR!", 2);
            StringRef = (Primitive2) Find ("STRING-REF", 2);
            SystemListToVector = (Primitive2) Find ("SYSTEM-LIST-TO-VECTOR", 2);
            SystemPairSetCar = (Primitive2) Find ("SYSTEM-PAIR-SET-CAR!", 2);
            SystemVectorRef = (Primitive2) Find ("SYSTEM-VECTOR-REF", 2);
            Vector8BRef = (Primitive2) Find ("VECTOR-8B-REF", 2);
            VectorCons = (Primitive2) Find ("VECTOR-CONS", 2);
            VectorRef = (Primitive2) Find ("VECTOR-REF", 2);
            WithInterruptMask = (Primitive2) Find ("WITH-INTERRUPT-MASK", 2);

            Hunk3Cons = (Primitive3) Find ("HUNK3-CONS", 3);
            RecordSet = (Primitive3) Find ("%RECORD-SET!", 3);
            StringSet = (Primitive3) Find ("STRING-SET!", 3);
            SystemPairCons = (Primitive3) Find ("SYSTEM-PAIR-CONS", 3);
            VectorSet = (Primitive3) Find ("VECTOR-SET!", 3);
            Vector8BSet = (Primitive3) Find ("VECTOR-8B-SET!", 3);
        }