Changeset 4104 for proto


Ignore:
Timestamp:
Aug 30, 2014, 10:45:41 PM (4 years ago)
Author:
ksherdy
Message:

AST translations are performed after translation to b2k.

Location:
proto/s2k/trunk/framework/src/toolchain/s2k/lang/builtin
Files:
1 deleted
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • proto/s2k/trunk/framework/src/toolchain/s2k/lang/builtin/AbstractS2KBuiltinsEncoder.java

    r4027 r4104  
    1 package toolchain.s2k.lang;
     1package toolchain.s2k.lang.builtin;
     2
    23
    34public abstract class AbstractS2KBuiltinsEncoder {
  • proto/s2k/trunk/framework/src/toolchain/s2k/lang/builtin/S2KBuiltins.java

    r4021 r4104  
    55
    66import toolchain.s2k.lang.signatures.FunctionSignature;
    7 import static toolchain.s2k.lang.builtin.S2KBuiltinsTranslator.*;
    87import static toolchain.s2k.lang.signatures.SignatureShorthand.*;
    98
    109public enum S2KBuiltins implements S2KBuiltin {
    11     FLOW_ADVANCE(               "Advance",              CarryType.SingleBit, IDENTITY_TRANSLATION,   sig_S_S()  ),      // BuiltinCallUtil, CombineAdvances
    12     FLOW_SCAN_TO_FIRST(         "ScanToFirst",          CarryType.SingleBit, IDENTITY_TRANSLATION,   sig_S_S(), InitialValue.One ),
    13     FLOW_SCAN_THRU(             "ScanThru",             CarryType.SingleBit, IDENTITY_TRANSLATION,   sig_SS_S() ),      // BuiltinTranslator
    14     FLOW_SCAN_TO(               "ScanTo",               CarryType.SingleBit, IDENTITY_TRANSLATION,   sig_SS_S() ),
    15     FLOW_SPAN_UP_TO(            "SpanUpTo",             CarryType.SingleBit, IDENTITY_TRANSLATION,   sig_SS_S() ),
    16     FLOW_INCLUSIVE_SPAN(        "InclusiveSpan",        CarryType.SingleBit, IDENTITY_TRANSLATION,   sig_SS_S() ),
    17     FLOW_EXCLUSIVE_SPAN(        "ExclusiveSpan",        CarryType.SingleBit, IDENTITY_TRANSLATION,   sig_SS_S() ),
    18     FLOW_ADVANCE_THEN_SCAN_THRU("AdvanceThenScanThru",  CarryType.SingleBit, IDENTITY_TRANSLATION,   sig_SS_S() ),
    19     FLOW_ADVANCE_THEN_SCAN_TO(  "AdvanceThenScanTo",    CarryType.SingleBit, IDENTITY_TRANSLATION,   sig_SS_S() ),      // BuiltinTranslator
    20     FLOW_ADVANCE_N(                     "AdvanceN",                     CarryType.NBits,         IDENTITY_TRANSLATION,   sig_SI_S() ),  // AdvNCounterVisitor   
     10    FLOW_ADVANCE(               "Advance",              CarryType.SingleBit,    sig_S_S()  ),   // BuiltinCallUtil, CombineAdvances
     11    FLOW_SCAN_TO_FIRST(         "ScanToFirst",          CarryType.SingleBit,    sig_S_S(), InitialValue.One ),
     12    FLOW_SCAN_THRU(             "ScanThru",             CarryType.SingleBit,    sig_SS_S() ),   // BuiltinTranslator
     13    FLOW_SCAN_TO(               "ScanTo",               CarryType.SingleBit,    sig_SS_S() ),
     14    FLOW_SPAN_UP_TO(            "SpanUpTo",             CarryType.SingleBit,    sig_SS_S() ),
     15    FLOW_INCLUSIVE_SPAN(        "InclusiveSpan",        CarryType.SingleBit,    sig_SS_S() ),
     16    FLOW_EXCLUSIVE_SPAN(        "ExclusiveSpan",        CarryType.SingleBit,    sig_SS_S() ),
     17    FLOW_ADVANCE_THEN_SCAN_THRU("AdvanceThenScanThru",  CarryType.SingleBit,    sig_SS_S() ),
     18    FLOW_ADVANCE_THEN_SCAN_TO(  "AdvanceThenScanTo",    CarryType.SingleBit,    sig_SS_S() ),   // BuiltinTranslator
     19    FLOW_ADVANCE_N(                     "AdvanceN",                     CarryType.NBits,            sig_SI_S() ),       // AdvNCounterVisitor   
    2120
    22     FLOW_MASK(                          "Mask",      CarryType.None, IDENTITY_TRANSLATION,      sig_II_S() ), // visitors.carry.Counter   
    23     FLOW_AT_EOF(                        "atEOF",     CarryType.None, IDENTITY_TRANSLATION,    sig_S_S()  ),
    24     FLOW_IN_FILE(                       "inFile",    CarryType.None, IDENTITY_TRANSLATION,    sig_S_S()  ),
    25     FLOW_ASSERT_ZERO(                   "assert_0",  CarryType.None, IDENTITY_TRANSLATION,    sig_ST_V() ), // surroundAssert0sWithIfs 
    26     NULL_BUILTIN(                               "NULL",      CarryType.None, IDENTITY_TRANSLATION,    sig_V_V()  );
     21    FLOW_MASK(                          "Mask",      CarryType.None,     sig_II_S() ), // visitors.carry.Counter   
     22    FLOW_AT_EOF(                        "atEOF",     CarryType.None,     sig_S_S()  ),
     23    FLOW_IN_FILE(                       "inFile",    CarryType.None,     sig_S_S()  ),
     24    FLOW_ASSERT_ZERO(                   "assert_0",  CarryType.None,     sig_ST_V() ), // surroundAssert0sWithIfs       
     25    NULL_BUILTIN(                               "NULL",      CarryType.None,     sig_V_V()  );
    2726
    2827    public enum CarryType{      SingleBit,     
     
    3736        private final String name;
    3837        private final FunctionSignature signature;
    39         private final S2KBuiltinsTranslator translator;
    4038
    41         private S2KBuiltins(String name, CarryType carryType, S2KBuiltinsTranslator translator, FunctionSignature signature, InitialValue initialValue) {
     39        private S2KBuiltins(String name, CarryType carryType, FunctionSignature signature, InitialValue initialValue) {
    4240                this.name = name;
    4341                this.carryType = carryType;
    44                 this.translator = translator;
    4542                this.signature = signature;
    4643                this.initialValue = initialValue;
    4744        }
    4845
    49         private S2KBuiltins(String name, CarryType carryType, S2KBuiltinsTranslator translator, FunctionSignature signature) {
    50                 this(name, carryType, translator, signature, InitialValue.Zero);
     46        private S2KBuiltins(String name, CarryType carryType, FunctionSignature signature) {
     47                this(name, carryType, signature, InitialValue.Zero);
    5148        }
    5249       
     
    8380        public final boolean isCarryN() { return carryType == CarryType.NBits; }
    8481        public final boolean isCarryIntValue() { return carryType == CarryType.IntValue; }
    85         public final S2KBuiltinsTranslator getTranslator() { return translator; }
    8682        public final InitialValue getInitialValue() { return initialValue; }
    8783        public final int intInitialValue() { return (initialValue == InitialValue.One) ? 1 : 0; }
Note: See TracChangeset for help on using the changeset viewer.