Changeset 3830


Ignore:
Timestamp:
Apr 18, 2014, 2:24:07 AM (4 years ago)
Author:
ksherdy
Message:

Added RuntimeInfoSet?. Added support for foreach to while translation.

Location:
proto/s2k/trunk/framework/src/toolchain/s2k/transformer/visitors
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • proto/s2k/trunk/framework/src/toolchain/s2k/transformer/visitors/S2K2B2K/Context.java

    r3822 r3830  
    11package toolchain.s2k.transformer.visitors.S2K2B2K;
    22
    3 import toolchain.b2k.lang.carrySet.CarrySetBuiltins;
    4 import toolchain.b2k.lang.carrySet.CarrySetEncoder;
     3import toolchain.b2k.lang.runtimeInfoSet.RuntimeInfoSetBuiltins;
     4import toolchain.b2k.lang.runtimeInfoSet.RuntimeInfoSetEncoder;
    55import toolchain.b2k.lang.B2KBuiltin;
    66import toolchain.b2k.lang.AbstractB2KBuiltinsEncoder;
     
    1111        final private boolean finalBlockMode;
    1212        final private AbstractB2KBuiltinsEncoder builtinEncoder;
    13         final private CarrySetEncoder carrySetEncoder;
     13        final private RuntimeInfoSetEncoder runtimeInfoSetEncoder;
    1414        final private int carrySetDepth;
    1515       
    16         public Context(AbstractB2KBuiltinsEncoder builtinEncoder, CarrySetEncoder carrySetEncoder) {
    17             this(builtinEncoder, carrySetEncoder, true, false, 0);
     16        public Context(AbstractB2KBuiltinsEncoder builtinEncoder, RuntimeInfoSetEncoder runtimeInfoSetEncoder) {
     17            this(builtinEncoder, runtimeInfoSetEncoder, true, false, 0);
    1818        }
    1919       
    20         public Context(AbstractB2KBuiltinsEncoder builtinEncoder, CarrySetEncoder carrySetEncoder,
     20        public Context(AbstractB2KBuiltinsEncoder builtinEncoder, RuntimeInfoSetEncoder runtimeInfoSetEncoder,
    2121                        boolean carryInMode, boolean finalBlockMode,
    2222                        int carrySetDepth) {
     
    2525                this.finalBlockMode = finalBlockMode;
    2626                this.builtinEncoder = builtinEncoder;
    27                 this.carrySetEncoder = carrySetEncoder;
     27                this.runtimeInfoSetEncoder = runtimeInfoSetEncoder;
    2828                this.carrySetDepth = carrySetDepth;
    2929        }
     
    3939                return builtinEncoder;
    4040        }
    41         public final CarrySetEncoder getCarrySetEncoder() {
    42                 return carrySetEncoder;
     41        public final RuntimeInfoSetEncoder getCarrySetEncoder() {
     42                return runtimeInfoSetEncoder;
    4343        }
    4444        public final int getCarrySetDepth() {
     
    4848        // getters - directly computed from fields
    4949        public final String getCarrySetIdentifier() {
    50                 return CarrySetEncoder.CARRYSET_NAME_PREFIX + carrySetDepth;
     50                return RuntimeInfoSetEncoder.CARRYSET_NAME_PREFIX + carrySetDepth;
    5151        }
    5252       
    5353        // compound operations
    54         public final String getCode(CarrySetBuiltins carrySetBuiltin) {
     54        public final String getCode(RuntimeInfoSetBuiltins carrySetBuiltin) {
    5555                return getCarrySetEncoder().baseName(carrySetBuiltin);
    5656        }
     
    6161        // create new Contexts
    6262        public final Context incrementDepth() {
    63                 return new Context(builtinEncoder, carrySetEncoder,
     63                return new Context(builtinEncoder, runtimeInfoSetEncoder,
    6464                                carryInMode, finalBlockMode,
    6565                                carrySetDepth + 1);
    6666        }
    6767        public final Context clearCarryIn() {
    68                 return new Context(builtinEncoder, carrySetEncoder,
     68                return new Context(builtinEncoder, runtimeInfoSetEncoder,
    6969                                false, finalBlockMode,
    7070                                carrySetDepth);
  • proto/s2k/trunk/framework/src/toolchain/s2k/transformer/visitors/S2K2B2K/S2K2B2KTransformer.java

    r3824 r3830  
    2727import toolchain.b2k.lang.B2KBuiltins;
    2828import toolchain.b2k.lang.AbstractB2KBuiltinsEncoder;
    29 import toolchain.b2k.lang.carrySet.CarrySetEncoder;
    30 import toolchain.b2k.transformer.visitors.InfoSet.Carry1Count;
     29import toolchain.b2k.lang.runtimeInfoSet.RuntimeInfoSetEncoder;
    3130import static toolchain.b2k.lang.idisa.IDISABuiltin.*;
    3231import static toolchain.b2k.lang.type.PrimitiveType.BITBLOCK_SIZE;
     
    3938public class S2K2B2KTransformer {
    4039
    41     public static ASTNode apply(AbstractB2KBuiltinsEncoder builtinEncoder, CarrySetEncoder carrySetEncoder, s2k.ast.ASTNode s2kASTree, s2k.ast.ASTNode s2kFinalBlockASTree) {
     40    public static ASTNode apply(AbstractB2KBuiltinsEncoder builtinEncoder, RuntimeInfoSetEncoder carrySetEncoder, s2k.ast.ASTNode s2kASTree, s2k.ast.ASTNode s2kFinalBlockASTree) {
    4241
    4342        // S2B
     
    686685            if(tokenS.isLextant(s2k.lexicalAnalyzer.Lextant.AND, s2k.lexicalAnalyzer.Lextant.OR, s2k.lexicalAnalyzer.Lextant.XOR)) {
    687686
    688                 TextLocation locator = Generators.makeTextLocation(tokenS.getLocation());
     687                Locator locator = Generators.makeTextLocation(tokenS.getLocation());
    689688                ASTNode lhs = childResults.get(0);
    690689                ASTNode rhs = childResults.get(1);
  • proto/s2k/trunk/framework/src/toolchain/s2k/transformer/visitors/S2K2S2K/S2K2S2kController.java

    r3708 r3830  
    1515        decoratedTree = ExpandAugmentedAssignments.apply(decoratedTree);
    1616        decoratedTree = CombineAdvances.apply(decoratedTree);
     17        decoratedTree = TranslateForeachStmtsToWhileStmts.apply(decoratedTree);
    1718        decoratedTree = TempifyCarrySetBuiltinCalls.apply(decoratedTree);
    1819        return decoratedTree;
Note: See TracChangeset for help on using the changeset viewer.