Ignore:
Timestamp:
Jun 3, 2013, 6:27:04 PM (6 years ago)
Author:
shermer
Message:

End-of-workday commit. More work towards semantic analyzer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/pabloj/trunk/src/toolchain/pabloS/lang/PabloSBuiltin.java

    r3245 r3259  
    55
    66import toolchain.pabloS.lang.signatures.FunctionSignature;
    7 import toolchain.pabloS.lang.type.PrimitiveType;
    8 import static toolchain.pabloS.lang.type.StreamType.STREAM;
    97import static toolchain.pabloS.transformer.visitors.carry.BuiltinTranslator.*;
     8import static toolchain.pabloS.lang.signatures.SignatureShorthand.*;
    109import toolchain.pabloS.transformer.visitors.carry.BuiltinTranslator;
    1110
     
    3736    private final InitialValue initialValue;
    3837        private final String name;
    39         @SuppressWarnings("unused")
    4038        private final FunctionSignature signature;
    4139        private final BuiltinTranslator translator;
     
    5553       
    5654       
    57         /////////////////////////////////////////////////////////////////
    58         // signature encoding:
    59         //      sig_S_S         (STREAM(1)) -> STREAM(1)
    60         //  sig_SS_S    (STREAM(1), STREAM(1)) -> STREAM(1)
    61         //  sig_SI_S    (STREAM(1), INTEGER) -> STREAM(1)
    62         //  sig_II_S    (INTEGER, INTEGER) -> STREAM(1)
    63         //  sig_ST_V    (STREAM(1), STRING) -> VOID
    64         //  sig_V_S             (VOID) -> STREAM(1)
    65         //  sig_V_V             (VOID) -> VOID
    66         /////////////////////////////////////////////////////////////////
    67         static private FunctionSignature sig_S_S() {
    68                 return new FunctionSignature(STREAM(1), STREAM(1));
    69         }
    70         static private FunctionSignature sig_SS_S() {
    71                 return new FunctionSignature(STREAM(1), STREAM(1), STREAM(1));
    72         }
    73         static private FunctionSignature sig_SI_S() {
    74                 return new FunctionSignature(STREAM(1), PrimitiveType.INTEGER, STREAM(1));
    75         }
    76         static private FunctionSignature sig_II_S() {
    77                 return new FunctionSignature(PrimitiveType.INTEGER, PrimitiveType.INTEGER, STREAM(1));
    78         }
    79         static private FunctionSignature sig_ST_V() {
    80                 return new FunctionSignature(STREAM(1), PrimitiveType.STRING, PrimitiveType.VOID);
    81         }
    82         static private FunctionSignature sig_V_S() {
    83                 return new FunctionSignature(PrimitiveType.VOID, STREAM(1));
    84         }
    85         static private FunctionSignature sig_V_V() {
    86                 return new FunctionSignature(PrimitiveType.VOID, PrimitiveType.VOID);
    87         }
     55
    8856       
    8957        /////////////////////////////////////////////////////////////////
     
    11381        public final InitialValue getInitialValue() { return initialValue; }
    11482        public final int intInitialValue() { return (initialValue == InitialValue.One) ? 1 : 0; }
    115        
     83
     84        public FunctionSignature getSignature() { return signature; }
     85
    11686}
Note: See TracChangeset for help on using the changeset viewer.