Changeset 3200

Show
Ignore:
Timestamp:
12/11/08 20:43:23 (12 months ago)
Author:
sukyoungryu
Message:

[ast refactoring] Removed optional fields of the rest of the Expr nodes.

Location:
trunk/ProjectFortress
Files:
17 modified

Legend:

Unmodified
Added
Removed
  • trunk/ProjectFortress/astgen/Fortress.ast

    r3199 r3200  
    443443             * expression 
    444444             */ 
    445             root abstract Expr(ignoreForEquals boolean parenthesized = false, 
    446                                ignoreForEquals Option<Type> exprType = Option.<Type>none()); 
     445            root abstract Expr(ignoreForEquals boolean parenthesized, 
     446                               ignoreForEquals Option<Type> exprType); 
    447447 
    448448                /** 
     
    888888                         * e.g.) x y 
    889889                         */ 
    890                         _RewriteFnApp(Expr function, Expr argument) implements InAfterTypeChecking; 
     890                        _RewriteFnApp(Expr function, Expr argument) 
     891                                     implements InAfterTypeChecking; 
    891892                        /** 
    892893                         * expression using operators 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeChecker.java

    r3199 r3200  
    928928                } 
    929929 
    930                 _RewriteFnApp new_node = new _RewriteFnApp(that.getSpan(), 
     930                _RewriteFnApp new_node = ExprFactory.make_RewriteFnApp(that.getSpan(), 
    931931                                that.isParenthesized(), 
    932932                                result_type, 
     
    16331633                                        errorMsg("A 'spawn' expression must not occur inside an 'atomic' expression.")); 
    16341634 
    1635                 AtomicExpr new_node = new AtomicExpr(that.getSpan(), 
     1635                AtomicExpr new_node = ExprFactory.makeAtomicExpr(that.getSpan(), 
    16361636                                that.isParenthesized(), 
    16371637                                expr_result.type(), 
     
    20052005                } 
    20062006 
    2007                 ChainExpr new_node = new ChainExpr(that.getSpan(), 
     2007                ChainExpr new_node = ExprFactory.makeChainExpr(that.getSpan(), 
    20082008                                that.isParenthesized(), 
    20092009                                Option.<Type>some(Types.BOOLEAN), 
     
    21452145 
    21462146                Type result_type = subtypeChecker.join(frontTypes); 
    2147                 Do new_node = new Do(that.getSpan(), 
     2147                Do new_node = ExprFactory.makeDo(that.getSpan(), 
    21482148                                that.isParenthesized(), 
    21492149                                some(result_type), 
     
    22792279                } 
    22802280 
    2281                 FieldRef new_node = new FieldRef(that.getSpan(), 
     2281                FieldRef new_node = ExprFactory.makeFieldRef(that.getSpan(), 
    22822282                                that.isParenthesized(), 
    22832283                                result_type, 
     
    26082608                TypeCheckerResult body_void = this.checkSubtype(body_result.type().unwrap(), Types.VOID, that.getBody(), err); 
    26092609 
    2610                 For for_ = new For(that.getSpan(), 
     2610                For for_ = ExprFactory.makeFor(that.getSpan(), 
    26112611                                that.isParenthesized(), 
    26122612                                Option.<Type>some(Types.VOID), 
     
    29262926                labelExitTypes.remove(that.getName()); 
    29272927 
    2928                 Label new_node = new Label(that.getSpan(), 
     2928                Label new_node = ExprFactory.makeLabel(that.getSpan(), 
    29292929                                that.isParenthesized(), 
    29302930                                labelType, 
     
    29532953                                        body_results.get(body_results.size()-1).type(); 
    29542954 
    2955                                 LetFn new_node = new LetFn(that.getSpan(), 
     2955                                LetFn new_node = ExprFactory.makeLetFn(that.getSpan(), 
    29562956                                                that.isParenthesized(), 
    29572957                                                body_type, 
     
    30293029                    } 
    30303030                    Expr arg = that.getExprs().get(1); 
    3031                     _RewriteFnApp fnApp = new _RewriteFnApp(new Span(front.getSpan(), arg.getSpan()), 
    3032                                                             front, arg); 
     3031                    _RewriteFnApp fnApp = ExprFactory.make_RewriteFnApp(front, arg); 
    30333032 
    30343033                    // Simulate a TypeCheckerResult for the front, giving it a fresh arrow type. 
     
    32103209                                } 
    32113210                                // Otherwise, make a new MathPrimary that is one element shorter, and recur 
    3212                                 _RewriteFnApp fn = new _RewriteFnApp(new Span(front.getSpan(), arg.getSpan()), 
    3213                                                 front, 
    3214                                                 ((ExprMI)arg).getExpr()); 
     3211                                _RewriteFnApp fn = ExprFactory.make_RewriteFnApp(front, 
     3212                                                                                 ((ExprMI)arg).getExpr()); 
    32153213                                MathPrimary new_primary = ExprFactory.makeMathPrimary(that.getSpan(), 
    32163214                                                                                      that.isParenthesized(), 
     
    32543252                                                item_iter.remove(); // remove fn from item list 
    32553253                                                // replace both with fn appication 
    3256                                                 _RewriteFnApp fn = new _RewriteFnApp(new Span(front.getSpan(),arg.getSpan()), front, ((ExprMI)arg).getExpr()); 
     3254                                                _RewriteFnApp fn = ExprFactory.make_RewriteFnApp(front, ((ExprMI)arg).getExpr()); 
    32573255                                                item_iter.add(new NonParenthesisDelimitedMI(fn.getSpan(),fn)); 
    32583256                                                // static error if the argument is immediately followed by a non-expression element. 
     
    39163914 
    39173915                Type expr_type = Types.makeThreadType(bodyResult.type().unwrap()); 
    3918                 Spawn new_node = new Spawn(that.getSpan(), 
     3916                Spawn new_node = ExprFactory.makeSpawn(that.getSpan(), 
    39193917                                that.isParenthesized(), 
    39203918                                Option.<Type>some(expr_type), 
     
    39283926        @Override 
    39293927        public TypeCheckerResult forStringLiteralExpr(StringLiteralExpr that) { 
    3930                 StringLiteralExpr new_node = new StringLiteralExpr(that.getSpan(), 
     3928                StringLiteralExpr new_node = ExprFactory.makeStringLiteralExpr(that.getSpan(), 
    39313929                                that.isParenthesized(), 
    39323930                                Option.<Type>some(Types.STRING), 
     
    39943992                                "This expression is of type " + expr_result.type().unwrap()); 
    39953993 
    3996                 Throw new_node = new Throw(that.getSpan(), 
     3994                Throw new_node = ExprFactory.makeThrow(that.getSpan(), 
    39973995                                that.isParenthesized(), 
    39983996                                Option.<Type>some(Types.BOTTOM), 
     
    41154113                                        errorMsg("A 'spawn' expression must not occur inside a 'try atomic' expression.")); 
    41164114 
    4117                 TryAtomicExpr new_node = new TryAtomicExpr(that.getSpan(), 
     4115                TryAtomicExpr new_node = ExprFactory.makeTryAtomicExpr(that.getSpan(), 
    41184116                                that.isParenthesized(), 
    41194117                                expr_result.type(), 
     
    42284226                                @Override 
    42294227                                public Node forAsExpr(AsExpr that) { 
    4230                                         return new AsExpr(that.getSpan(), that.isParenthesized(), some(annotatedType), 
    4231                                                         (Expr)expr_result.ast(), annotatedType); 
     4228                                        return ExprFactory.makeAsExpr(that.getSpan(), that.isParenthesized(), some(annotatedType), 
     4229                                                                      (Expr)expr_result.ast(), annotatedType); 
    42324230                                } 
    42334231 
    42344232                                @Override 
    42354233                                public Node forAsIfExpr(AsIfExpr that) { 
    4236                                         return new AsIfExpr(that.getSpan(), that.isParenthesized(), some(annotatedType), 
     4234                                        return ExprFactory.makeAsIfExpr(that.getSpan(), that.isParenthesized(), some(annotatedType), 
    42374235                                                        (Expr)expr_result.ast(), annotatedType); 
    42384236                                } 
     
    45044502                TypeCheckerResult void_result = this.checkSubtype(body_result.type().unwrap(), Types.VOID, that.getBody(), void_err); 
    45054503 
    4506                 While new_node = new While(that.getSpan(), 
     4504                While new_node = ExprFactory.makeWhile(that.getSpan(), 
    45074505                                that.isParenthesized(), 
    45084506                                Option.<Type>some(Types.VOID), 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/Evaluator.java

    r3189 r3200  
    364364            } 
    365365            if (f.isAtomicBlock()) 
    366                 return forAtomicExpr(new AtomicExpr(x.getSpan(), false, 
    367                                                     f)); 
     366                return forAtomicExpr(ExprFactory.makeAtomicExpr(x.getSpan(), f)); 
    368367            return f.accept(new Evaluator(this)); 
    369368       } 
     
    377376           } 
    378377           if (f.isAtomicBlock()) 
    379                tasks[i] = new TupleTask(new AtomicExpr(x.getSpan(), false, 
    380                                                        f), this); 
     378               tasks[i] = new TupleTask(ExprFactory.makeAtomicExpr(x.getSpan(), f), this); 
    381379           else 
    382380               tasks[i] = new TupleTask(f, new Evaluator(this)); 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/_WrappedFValue.java

    r3142 r3200  
    3939     */ 
    4040    public _WrappedFValue(Span in_span, boolean in_is_parenthesized, FValue in_fValue) { 
    41         super(in_span, in_is_parenthesized); 
     41        super(); 
    4242        if (in_fValue == null) { 
    4343            throw new java.lang.IllegalArgumentException("Parameter 'fValue' to the _WrappedFValue constructor was null"); 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/rewrite/DesugarerVisitor.java

    r3199 r3200  
    218218        @Override 
    219219        Expr replacement(VarRef original) { 
    220             return new FieldRef(original.getSpan(), false, 
     220            return ExprFactory.makeFieldRef(original.getSpan(), 
    221221                                // Use this constructor 
    222222                                // here because it is a 
     
    457457        } 
    458458        if (i > 0) { 
    459             return new FieldRef(s, false, dottedReference(s, i - 1), 
    460                                 new Id(s,WellKnownNames.secretParentName)); 
     459            return ExprFactory.makeFieldRef(s, dottedReference(s, i - 1), 
     460                                            new Id(s,WellKnownNames.secretParentName)); 
    461461        } else { 
    462462            throw new Error("Confusion in member reference numbering."); 
     
    920920                Option<Type> type = lv.getIdType(); 
    921921                newdecls.add(new VarDecl(at, Useful.list(lv), 
    922                                          Option.<Expr>some(new FieldRef(at, false, init, newName)))); 
     922                                         Option.<Expr>some(ExprFactory.makeFieldRef(at, init, newName)))); 
    923923                element_index++; 
    924924            } 
     
    960960        objectExprs.add(rwoe); 
    961961 
    962         return visitNode(new _RewriteObjectExprRef(rwoe.getSpan(), rwoe.isParenthesized(), rwoe.getExprType(), rwoe.getGenSymName(), rwoe.getStaticArgs())); 
     962        return visitNode(new _RewriteObjectExprRef(rwoe.getSpan(), 
     963                                                   rwoe.isParenthesized(), 
     964                                                   rwoe.getExprType(), 
     965                                                   rwoe.getGenSymName(), 
     966                                                   rwoe.getStaticArgs())); 
    963967   } 
    964968 
     
    10991103    public Node forFor(For f) { 
    11001104        Block df = f.getBody(); 
    1101         Do doBlock = new Do(df.getSpan(),Useful.list(df)); 
     1105        Do doBlock = ExprFactory.makeDo(df.getSpan(),Useful.list(df)); 
    11021106        return visitLoop(f.getSpan(), f.getGens(), doBlock); 
    11031107    } 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/ExprFactory.java

    r3199 r3200  
    977977    public static If makeIf(Span sp, IfClause _if) { 
    978978        List<IfClause> ifclauses = Collections.singletonList(_if); 
    979         return new If(sp, ifclauses, Option.<Block>none()); 
     979        return makeIf(sp, ifclauses, Option.<Block>none()); 
    980980    } 
    981981 
     
    10261026                            equalsOp, inOp, clauses, elseClause); 
    10271027    } 
     1028 
     1029    public static ChainExpr makeChainExpr(Expr e, Op _op, Expr _expr) { 
     1030        List<Link> links = new ArrayList<Link>(1); 
     1031        Link link = new Link(NodeFactory.makeSpan(_op, _expr), makeOpRef(NodeFactory.makeOpInfix(_op)), _expr); 
     1032        links.add(link); 
     1033        return makeChainExpr(NodeFactory.makeSpan(e, _expr), e, links); 
     1034    } 
     1035 
     1036    public static ChainExpr makeChainExpr(Span sp, Expr e, Op _op, Expr _expr) { 
     1037        List<Link> links = new ArrayList<Link>(1); 
     1038        Link link = new Link(NodeFactory.makeSpan(_op, _expr), 
     1039                             makeOpRef(NodeFactory.makeOpInfix(_op)), _expr); 
     1040        links.add(link); 
     1041        return makeChainExpr(sp, e, links); 
     1042    } 
     1043 
     1044    public static ChainExpr makeChainExpr(Span span, 
     1045                                          Expr first, List<Link> links) { 
     1046        return makeChainExpr(span, false, Option.<Type>none(), first, links); 
     1047    } 
     1048 
     1049    public static ChainExpr makeChainExpr(Span span, 
     1050                                          boolean parenthesized, 
     1051                                          Option<Type> exprType, 
     1052                                          Expr first, List<Link> links) { 
     1053        return new ChainExpr(span, parenthesized, exprType, first, links); 
     1054    } 
     1055 
     1056    public static _RewriteFnApp make_RewriteFnApp(Expr e_1, Expr e_2) { 
     1057        return make_RewriteFnApp(FortressUtil.spanTwo(e_1, e_2), false, 
     1058                                 Option.<Type>none(), e_1, e_2); 
     1059    } 
     1060 
     1061    public static _RewriteFnApp make_RewriteFnApp(Span span, 
     1062                                                  boolean parenthesized, 
     1063                                                  Option<Type> exprType, 
     1064                                                  Expr function, 
     1065                                                  Expr argument) { 
     1066        return new _RewriteFnApp(span, parenthesized, exprType, function, 
     1067                                 argument); 
     1068    } 
     1069 
     1070    public static FieldRef makeFieldRef(FieldRef expr, Span span) { 
     1071        return makeFieldRef(span, expr.isParenthesized(), 
     1072                            expr.getExprType(), expr.getObj(), expr.getField()); 
     1073    } 
     1074 
     1075    public static FieldRef makeFieldRef(FieldRef expr, Expr receiver, Id field) { 
     1076        return makeFieldRef(expr.getSpan(), expr.isParenthesized(), 
     1077                            expr.getExprType(), receiver, field); 
     1078    } 
     1079 
     1080    public static FieldRef make_RewriteFieldRef(FieldRef expr, 
     1081                                                Expr receiver, Id field) { 
     1082        return makeFieldRef(expr.getSpan(), expr.isParenthesized(), 
     1083                            expr.getExprType(), receiver, field); 
     1084    } 
     1085 
     1086    public static FieldRef makeFieldRef(Span span, Expr receiver, Id field) { 
     1087        return makeFieldRef(span, false, Option.<Type>none(), receiver, field); 
     1088    } 
     1089 
     1090    public static FieldRef makeFieldRef(Expr receiver, Id field) { 
     1091        return makeFieldRef(FortressUtil.spanTwo(receiver, field), receiver, field); 
     1092    } 
     1093 
     1094    public static FieldRef makeFieldRef(Span span, 
     1095                                        boolean parenthesized, 
     1096                                        Option<Type> exprType, 
     1097                                        Expr obj, Id field) { 
     1098        return new FieldRef(span, parenthesized, exprType, obj, field); 
     1099    } 
     1100 
     1101    public static AtomicExpr makeAtomicExpr(Span span, Expr expr) { 
     1102        return makeAtomicExpr(span, false, Option.<Type>none(), expr); 
     1103    } 
     1104 
     1105    public static AtomicExpr makeAtomicExpr(Span span, 
     1106                                            boolean parenthesized, 
     1107                                            Option<Type> exprType, 
     1108                                            Expr expr) { 
     1109        return new AtomicExpr(span, parenthesized, exprType, expr); 
     1110    } 
     1111 
     1112    public static For makeFor(Span span, 
     1113                              List<GeneratorClause> gens, 
     1114                              Block body) { 
     1115        return makeFor(span, false, Option.<Type>none(), gens, body); 
     1116    } 
     1117 
     1118    public static For makeFor(Span span, 
     1119                              boolean parenthesized, 
     1120                              Option<Type> exprType, 
     1121                              List<GeneratorClause> gens, 
     1122                              Block body) { 
     1123        return new For(span, parenthesized, exprType, gens, body); 
     1124    } 
     1125 
     1126    public static Spawn makeSpawn(Span span, 
     1127                                  Expr body) { 
     1128        return makeSpawn(span, false, Option.<Type>none(), body); 
     1129    } 
     1130 
     1131    public static Spawn makeSpawn(Span span, 
     1132                                  boolean parenthesized, 
     1133                                  Option<Type> exprType, 
     1134                                  Expr body) { 
     1135        return new Spawn(span, parenthesized, exprType, body); 
     1136    } 
     1137 
     1138 
     1139    public static TryAtomicExpr makeTryAtomicExpr(Span span, 
     1140                                                  Expr expr) { 
     1141        return makeTryAtomicExpr(span, false, Option.<Type>none(), expr); 
     1142    } 
     1143 
     1144    public static TryAtomicExpr makeTryAtomicExpr(Span span, 
     1145                                                  boolean parenthesized, 
     1146                                                  Option<Type> exprType, 
     1147                                                  Expr expr) { 
     1148        return new TryAtomicExpr(span, parenthesized, exprType, expr); 
     1149    } 
     1150 
     1151    public static LetFn makeLetFn(Span span, 
     1152                                  List<Expr> body, 
     1153                                  List<FnDecl> fns) { 
     1154        return makeLetFn(span, false, Option.<Type>none(), 
     1155                         body, fns); 
     1156    } 
     1157 
     1158    public static LetFn makeLetFn(Span span, 
     1159                                  boolean parenthesized, 
     1160                                  Option<Type> exprType, 
     1161                                  List<Expr> body, 
     1162                                  List<FnDecl> fns) { 
     1163        return new LetFn(span, parenthesized, exprType, body, fns); 
     1164    } 
     1165 
     1166    public static Throw makeThrow(Span sp, String st) { 
     1167        Id id = NodeFactory.makeId(sp, WellKnownNames.fortressLibrary, st); 
     1168        return makeThrow(sp, makeVarRef(sp, id)); 
     1169    } 
     1170 
     1171    public static Throw makeThrow(Span span, 
     1172                                  Expr expr) { 
     1173        return makeThrow(span, false, Option.<Type>none(), expr); 
     1174    } 
     1175 
     1176    public static Throw makeThrow(Span span, 
     1177                                  boolean parenthesized, 
     1178                                  Option<Type> exprType, 
     1179                                  Expr expr) { 
     1180        return new Throw(span, parenthesized, exprType, expr); 
     1181    } 
     1182 
     1183    public static StringLiteralExpr makeStringLiteralExpr(Span span, String s) { 
     1184        return makeStringLiteralExpr(span, false, Option.<Type>none(), s); 
     1185    } 
     1186 
     1187    public static StringLiteralExpr makeStringLiteralExpr(Span span, 
     1188                                                          boolean parenthesized, 
     1189                                                          Option<Type> exprType, 
     1190                                                          String text) { 
     1191        return new StringLiteralExpr(span, parenthesized, exprType, text); 
     1192    } 
     1193 
     1194    public static FloatLiteralExpr makeFloatLiteralExpr(Span span, 
     1195                                                        boolean parenthesized, 
     1196                                                        Option<Type> exprType, 
     1197                                                        String text, 
     1198                                                        BigInteger intPart, 
     1199                                                        BigInteger numerator, 
     1200                                                        int denomBase, 
     1201                                                        int denomPower) { 
     1202        return new FloatLiteralExpr(span, parenthesized, exprType, text, 
     1203                                    intPart, numerator, denomBase, denomPower); 
     1204    } 
     1205 
     1206    public static AsExpr makeAsExpr(Span span, 
     1207                                    Expr expr, Type annType) { 
     1208        return makeAsExpr(span, false, Option.<Type>none(), expr, annType); 
     1209    } 
     1210 
     1211    public static AsExpr makeAsExpr(Span span, 
     1212                                    boolean parenthesized, 
     1213                                    Option<Type> exprType, 
     1214                                    Expr expr, Type annType) { 
     1215        return new AsExpr(span, parenthesized, exprType, expr, annType); 
     1216    } 
     1217 
     1218    public static AsIfExpr makeAsIfExpr(Span span, 
     1219                                        Expr expr, Type annType) { 
     1220        return makeAsIfExpr(span, false, Option.<Type>none(), expr, annType); 
     1221    } 
     1222 
     1223    public static AsIfExpr makeAsIfExpr(Span span, 
     1224                                        boolean parenthesized, 
     1225                                        Option<Type> exprType, 
     1226                                        Expr expr, Type annType) { 
     1227        return new AsIfExpr(span, parenthesized, exprType, expr, annType); 
     1228    } 
     1229 
     1230    public static While makeWhile(Span sp, Expr cond) { 
     1231        // Might not work; empty Do may be naughty. 
     1232        return makeWhile(sp, makeGeneratorClause(cond.getSpan(), cond), 
     1233                         makeDo(sp, Collections.<Block>emptyList())); 
     1234    } 
     1235 
     1236    public static While makeWhile(Span span, 
     1237                                  GeneratorClause testExpr, 
     1238                                  Do body) { 
     1239        return makeWhile(span, false, Option.<Type>none(), 
     1240                         testExpr, body); 
     1241    } 
     1242 
     1243    public static While makeWhile(Span span, 
     1244                                  boolean parenthesized, 
     1245                                  Option<Type> exprType, 
     1246                                  GeneratorClause testExpr, 
     1247                                  Do body) { 
     1248        return new While(span, parenthesized, exprType, testExpr, body); 
     1249    } 
     1250 
     1251    public static Label makeLabel(Span span, 
     1252                                  Id name, Block body) { 
     1253        return makeLabel(span, false, Option.<Type>none(), name, body); 
     1254    } 
     1255 
     1256    public static Label makeLabel(Span span, 
     1257                                  boolean parenthesized, 
     1258                                  Option<Type> exprType, 
     1259                                  Id name, Block body) { 
     1260        return new Label(span, parenthesized, exprType, name, body); 
     1261    } 
     1262 
     1263    public static Do makeDo(Span sp, Option<Type> t, Expr e) { 
     1264        List<Expr> b = Collections.singletonList(e); 
     1265        List<Block> body = new ArrayList<Block>(1); 
     1266        body.add(makeBlock(sp, t, false, true, b)); 
     1267        return makeDo(sp, false, t, body); 
     1268    } 
     1269 
     1270    public static Do makeDo(Span sp, Option<Type> t, List<Expr> exprs) { 
     1271        List<Block> body = new ArrayList<Block>(1); 
     1272        body.add(makeBlock(sp, t, false, true, exprs)); 
     1273        return makeDo(sp, false, t, body); 
     1274    } 
     1275 
     1276    public static Do makeDo(Span span, 
     1277                            List<Block> fronts) { 
     1278        return makeDo(span, false, Option.<Type>none(), fronts); 
     1279    } 
     1280 
     1281    public static Do makeDo(Span span, 
     1282                            boolean parenthesized, 
     1283                            Option<Type> exprType, 
     1284                            List<Block> fronts) { 
     1285        return new Do(span, parenthesized, exprType, fronts); 
     1286    } 
     1287 
     1288 
    10281289 
    10291290                                          /* 
     
    11271388            } 
    11281389        } 
    1129         return new FloatLiteralExpr(span, false, s, 
    1130                 intPart, numerator, denomBase, denomPower); 
     1390        return makeFloatLiteralExpr(span, false, Option.<Type>none(), s, 
     1391                                    intPart, numerator, denomBase, denomPower); 
    11311392    } 
    11321393 
     
    11341395        return let_expr.accept(new NodeAbstractVisitor<LetExpr>() { 
    11351396            public LetExpr forLetFn(LetFn expr) { 
    1136                 return new LetFn(expr.getSpan(),false, body, expr.getFns()); 
     1397                return ExprFactory.makeLetFn(expr.getSpan(), body, expr.getFns()); 
    11371398            } 
    11381399            public LetExpr forLocalVarDecl(LocalVarDecl expr) { 
     
    11691430    } 
    11701431 
    1171     public static StringLiteralExpr makeStringLiteralExpr(Span span, String s) { 
    1172         return new StringLiteralExpr(span, s); 
    1173     } 
    1174  
    1175     public static FieldRef makeFieldRef(FieldRef expr, Span span) { 
    1176         return new FieldRef(span, expr.isParenthesized(), 
    1177                             expr.getExprType(), expr.getObj(), expr.getField()); 
    1178     } 
    1179  
    1180     public static FieldRef makeFieldRef(FieldRef expr, Expr receiver, Id field) { 
    1181         return new FieldRef(expr.getSpan(), expr.isParenthesized(), 
    1182                             expr.getExprType(), receiver, field); 
    1183     } 
    1184  
    1185     public static FieldRef make_RewriteFieldRef(FieldRef expr, 
    1186                                                 Expr receiver, Id field) { 
    1187         return new FieldRef(expr.getSpan(), expr.isParenthesized(), 
    1188                             expr.getExprType(), receiver, field); 
    1189     } 
    1190  
    1191     public static FieldRef makeFieldRef(Span span, Expr receiver, Id field) { 
    1192         return new FieldRef(span, receiver, field); 
    1193     } 
    1194  
    1195     public static FieldRef makeFieldRef(Expr receiver, Id field) { 
    1196         return new FieldRef(FortressUtil.spanTwo(receiver, field), false, 
    1197                             receiver, field); 
    1198     } 
    1199  
    12001432    public static Expr makeReceiver(Iterable<Id> ids) { 
    12011433        Expr expr = makeVarRef(IterUtil.first(ids)); 
     
    12061438    } 
    12071439 
    1208     public static While makeWhile(Span sp, Expr cond) { 
    1209         // Might not work; empty Do may be naughty. 
    1210         return new While(sp, makeGeneratorClause(cond.getSpan(), cond), 
    1211                 new Do(sp, Collections.<Block>emptyList())); 
    1212     } 
    1213  
    1214     public static Do makeDo(Span sp, Option<Type> t, Expr e) { 
    1215         List<Expr> b = Collections.singletonList(e); 
    1216         List<Block> body = new ArrayList<Block>(1); 
    1217         body.add(makeBlock(sp, t, false, true, b)); 
    1218         return new Do(sp, t, body); 
    1219     } 
    1220  
    1221     public static Do makeDo(Span sp, Option<Type> t, List<Expr> exprs) { 
    1222         List<Block> body = new ArrayList<Block>(1); 
    1223         body.add(makeBlock(sp, t, false, true, exprs)); 
    1224         return new Do(sp, t, body); 
    1225     } 
    1226  
    1227     public static ChainExpr makeChainExpr(Expr e, Op _op, Expr _expr) { 
    1228         List<Link> links = new ArrayList<Link>(1); 
    1229         Link link = new Link(NodeFactory.makeSpan(_op, _expr), makeOpRef(NodeFactory.makeOpInfix(_op)), _expr); 
    1230         links.add(link); 
    1231         return new ChainExpr(NodeFactory.makeSpan(e, _expr), e, links); 
    1232     } 
    1233  
    1234     public static ChainExpr makeChainExpr(Span sp, Expr e, Op _op, Expr _expr) { 
    1235      List<Link> links = new ArrayList<Link>(1); 
    1236         Link link = new Link(NodeFactory.makeSpan(_op, _expr), makeOpRef(NodeFactory.makeOpInfix(_op)), _expr); 
    1237         links.add(link); 
    1238         return new ChainExpr(sp, e, links); 
    1239     } 
    1240  
    1241     /** 
    1242      * Throws a standard (FortressLibrary) exception 
    1243      * @param sp 
    1244      * @param st 
    1245      * @return 
    1246      */ 
    1247     public static Throw makeThrow(Span sp, String st) { 
    1248         Id id = NodeFactory.makeId(sp, WellKnownNames.fortressLibrary, st); 
    1249         return new Throw(sp, makeVarRef(sp, id)); 
    1250     } 
    1251  
    1252     /** 
    1253      * Uses the Spans from e_1 and e_2. 
    1254      */ 
    1255     public static _RewriteFnApp make_RewriteFnApp(Expr e_1, Expr e_2) { 
    1256         return new _RewriteFnApp(FortressUtil.spanTwo(e_1, e_2), e_1, e_2); 
    1257     } 
    1258  
    12591440    public static Expr makeInParentheses(Expr expr) { 
    12601441        return expr.accept(new NodeAbstractVisitor<Expr>() { 
    12611442            @Override 
    12621443            public Expr for_RewriteFnApp(_RewriteFnApp that) { 
    1263                 return new _RewriteFnApp(that.getSpan(),true,that.getFunction(),that.getArgument()); 
     1444                return make_RewriteFnApp(that.getSpan(), true, that.getExprType(), 
     1445                                         that.getFunction(), that.getArgument()); 
    12641446            } 
    12651447        public Expr forAsExpr(AsExpr e) { 
    1266             return new AsExpr(e.getSpan(), true, e.getExpr(), e.getAnnType()); 
     1448            return makeAsExpr(e.getSpan(), true, e.getExprType(), 
     1449                              e.getExpr(), e.getAnnType()); 
    12671450        } 
    12681451        public Expr forAsIfExpr(AsIfExpr e) { 
    1269             return new AsIfExpr(e.getSpan(), true, e.getExpr(), e.getAnnType()); 
     1452            return makeAsIfExpr(e.getSpan(), true, e.getExprType(), 
     1453                                e.getExpr(), e.getAnnType()); 
    12701454        } 
    12711455 
     
    12851469        } 
    12861470        public Expr forDo(Do e) { 
    1287             return new Do(e.getSpan(), true, e.getFronts()); 
     1471            return makeDo(e.getSpan(), true, e.getExprType(), e.getFronts()); 
    12881472        } 
    12891473        public Expr forFor(For e) { 
    1290             return new For(e.getSpan(), true, e.getGens(), e.getBody()); 
     1474            return makeFor(e.getSpan(), true, e.getExprType(), e.getGens(), 
     1475                           e.getBody()); 
    12911476        } 
    12921477        public Expr forIf(If e) { 
    1293             return new If(e.getSpan(), true, e.getClauses(), 
    1294                     e.getElseClause()); 
     1478            return makeIf(e.getSpan(), true, e.getExprType(), 
     1479                          e.getClauses(), e.getElseClause()); 
    12951480        } 
    12961481        public Expr forLabel(Label e) { 
    1297             return new Label(e.getSpan(), true, e.getName(), e.getBody()); 
     1482            return makeLabel(e.getSpan(), true, e.getExprType(), 
     1483                             e.getName(), e.getBody()); 
    12981484        } 
    12991485        public Expr forMathPrimary(MathPrimary e) { 
     
    13081494        public Expr for_RewriteObjectExpr(_RewriteObjectExpr e) { 
    13091495            return new _RewriteObjectExpr(e.getSpan(), true, 
     1496                                          e.getExprType(), 
    13101497                    e.getExtendsClause(), e.getDecls(), 
    13111498                    e.getImplicitTypeParameters(), 
     
    13301517        } 
    13311518        public Expr forWhile(While e) { 
    1332             return new While(e.getSpan(), true, e.getTestExpr(), e.getBody()); 
     1519            return makeWhile(e.getSpan(), true, e.getExprType(), 
     1520                             e.getTestExpr(), e.getBody()); 
    13331521        } 
    13341522        public Expr forAccumulator(Accumulator e) { 
     
    13381526        } 
    13391527        public Expr forAtomicExpr(AtomicExpr e) { 
    1340             return new AtomicExpr(e.getSpan(), true, e.getExpr()); 
     1528            return makeAtomicExpr(e.getSpan(), true, e.getExprType(), e.getExpr()); 
    13411529        } 
    13421530        public Expr forExit(Exit e) { 
     
    13461534 
    13471535        public Expr forSpawn(Spawn e) { 
    1348             return new Spawn(e.getSpan(), true, e.getBody()); 
     1536            return makeSpawn(e.getSpan(), true, e.getExprType(), e.getBody()); 
    13491537        } 
    13501538        public Expr forThrow(Throw e) { 
    1351             return new Throw(e.getSpan(), true, e.getExpr()); 
     1539            return makeThrow(e.getSpan(), true, e.getExprType(), e.getExpr()); 
    13521540        } 
    13531541        public Expr forTryAtomicExpr(TryAtomicExpr e) { 
    1354             return new TryAtomicExpr(e.getSpan(), true, e.getExpr()); 
     1542            return makeTryAtomicExpr(e.getSpan(), true, e.getExprType(), 
     1543                                     e.getExpr()); 
    13551544        } 
    13561545        public Expr forFnExpr(FnExpr e) { 
     
    13611550        } 
    13621551        public Expr forLetFn(LetFn e) { 
    1363             return new LetFn(e.getSpan(), true, e.getBody(), e.getFns()); 
     1552            return makeLetFn(e.getSpan(), true, e.getExprType(), e.getBody(), e.getFns()); 
    13641553        } 
    13651554        public Expr forLocalVarDecl(LocalVarDecl e) { 
     
    13861575        } 
    13871576        public Expr forFloatLiteralExpr(FloatLiteralExpr e) { 
    1388             return new FloatLiteralExpr(e.getSpan(), true, e.getText(), 
     1577            return makeFloatLiteralExpr(e.getSpan(), true, e.getExprType(), 
     1578                                        e.getText(), 
    13891579                    e.getIntPart(), e.getNumerator(), 
    13901580                    e.getDenomBase(), e.getDenomPower()); 
     
    13991589        } 
    14001590        public Expr forStringLiteralExpr(StringLiteralExpr e) { 
    1401             return new StringLiteralExpr(e.getSpan(), true, e.getText()); 
     1591            return makeStringLiteralExpr(e.getSpan(), true, e.getExprType(), 
     1592                                         e.getText()); 
    14021593        } 
    14031594        public Expr forVoidLiteralExpr(VoidLiteralExpr e) { 
     
    14141605        } 
    14151606        public Expr forChainExpr(ChainExpr e) { 
    1416             return new ChainExpr(e.getSpan(), true, e.getFirst(), 
    1417                     e.getLinks()); 
     1607            return makeChainExpr(e.getSpan(), true, e.getExprType(), e.getFirst(), 
     1608                                 e.getLinks()); 
    14181609        } 
    14191610        public Expr forFieldRef(FieldRef e) { 
    1420             return new FieldRef(e.getSpan(), true, e.getObj(), 
    1421                     e.getField()); 
     1611            return makeFieldRef(e.getSpan(), true, e.getExprType(), 
     1612                                e.getObj(), e.getField()); 
    14221613        } 
    14231614        public Expr forMethodInvocation(MethodInvocation e) { 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/DelimitedExpr.rats

    r3199 r3200  
    6666                         a1 + "' at " + a1.getSpan() + " and\n'" + 
    6767                         a3 + "' at " + a3.getSpan()); 
    68        yyValue = new Label(createSpan(yyStart,yyCount), false, a1, a2); 
     68       yyValue = ExprFactory.makeLabel(createSpan(yyStart,yyCount), a1, a2); 
    6969     } 
    7070   / <ErrorProduction> 
     
    8282     } 
    8383   / while w a1:GeneratorClause w a2:Do 
    84      { yyValue = new While(createSpan(yyStart,yyCount), false, a1, a2); } 
     84     { yyValue = ExprFactory.makeWhile(createSpan(yyStart,yyCount), a1, a2); } 
    8585   / for w a1:GeneratorClauseList w a2:DoFront w end 
    86      { yyValue = new For(createSpan(yyStart,yyCount), false, a1, a2); } 
     86     { yyValue = ExprFactory.makeFor(createSpan(yyStart,yyCount), a1, a2); } 
    8787   / if w a1:GeneratorClause w then w a2:BlockElems a3:(w Elifs)? a4:(w Else)? w end 
    8888     { IfClause ic = new IfClause(FortressUtil.spanTwo(a1,a2), a1, a2); 
     
    164164/* Do ::= (DoFront w also w)* DoFront w end */ 
    165165Do Do = a1s:(DoFront w also w)* a2:DoFront w end 
    166      { yyValue = new Do(createSpan(yyStart, yyCount), false, 
    167                         FortressUtil.mkList(a1s.list(), a2)); 
     166     { yyValue = ExprFactory.makeDo(createSpan(yyStart, yyCount), 
     167                                    FortressUtil.mkList(a1s.list(), a2)); 
    168168     }; 
    169169 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/Expression.rats

    r3199 r3200  
    6868     { yyValue = new Action<Expr>() { 
    6969           public Expr run(Expr base) { 
    70                return new AsExpr(createSpan(yyStart,yyCount), false, (Expr)base, 
    71                                  a1); 
     70               return ExprFactory.makeAsExpr(createSpan(yyStart,yyCount), (Expr)base, 
     71                                             a1); 
    7272           }}; 
    7373     }; 
     
    7777     { yyValue = new Action<Expr>() { 
    7878           public Expr run(Expr base) { 
    79                return new AsIfExpr(createSpan(yyStart,yyCount), false, 
    80                                    (Expr)base, a1); 
     79               return ExprFactory.makeAsIfExpr(createSpan(yyStart,yyCount), 
     80                                               (Expr)base, a1); 
    8181           }}; 
    8282     }; 
     
    691691     } 
    692692   / atomic w a1:AtomicBack 
    693      { yyValue = new AtomicExpr(createSpan(yyStart,yyCount), false, a1); } 
     693     { yyValue = ExprFactory.makeAtomicExpr(createSpan(yyStart,yyCount), a1); } 
    694694   / tryatomic w a1:AtomicBack 
    695      { yyValue = new TryAtomicExpr(createSpan(yyStart,yyCount), false, a1); } 
     695     { yyValue = ExprFactory.makeTryAtomicExpr(createSpan(yyStart,yyCount), a1); } 
    696696   / spawn w a1:Expr 
    697      { yyValue = new Spawn(createSpan(yyStart,yyCount), false, a1); } 
     697     { yyValue = ExprFactory.makeSpawn(createSpan(yyStart,yyCount), a1); } 
    698698   / throw w a1:Expr 
    699      { yyValue = new Throw(createSpan(yyStart,yyCount), false, a1); }; 
     699     { yyValue = ExprFactory.makeThrow(createSpan(yyStart,yyCount), a1); }; 
    700700 
    701701/* AtomicBack ::= 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/Literal.rats

    r3187 r3200  
    175175           str = str.concat(c); 
    176176       } 
    177        yyValue = new StringLiteralExpr(createSpan(yyStart,yyCount), false, str); 
     177       yyValue = ExprFactory.makeStringLiteralExpr(createSpan(yyStart,yyCount), str); 
    178178     } 
    179179   / "\u201c" a1:StringLiteralContent* "\u201d" 
     
    182182           str = str.concat(c); 
    183183       } 
    184        yyValue = new StringLiteralExpr(createSpan(yyStart,yyCount), false, str); 
     184       yyValue = ExprFactory.makeStringLiteralExpr(createSpan(yyStart,yyCount), str); 
    185185     } 
    186186   / <ErrorProduction1> ["] a1:StringLiteralContent* "\u201d" 
    187187     { Span span = createSpan(yyStart,yyCount); 
    188188       log(span, "The opening and closing marks of a string literal must match."); 
    189        yyValue = new StringLiteralExpr(span, false, ""); 
     189       yyValue = ExprFactory.makeStringLiteralExpr(span, ""); 
    190190     } 
    191191   / <ErrorProduction2> "\u201c" a1:StringLiteralContent* ["] 
    192192     { Span span = createSpan(yyStart,yyCount); 
    193193       log(span, "The opening and closing marks of a string literal must match."); 
    194        yyValue = new StringLiteralExpr(span, false, ""); 
     194       yyValue = ExprFactory.makeStringLiteralExpr(span, ""); 
    195195     }; 
    196196private String StringLiteralContent = 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/LocalDecl.rats

    r3198 r3200  
    6565   / a1:NoNewlineExpr a2:(s comma w NoNewlineGeneratorClauseList)? 
    6666     { if (a2 == null) yyValue = a1; 
    67        else yyValue = new For(createSpan(yyStart,yyCount), false, 
    68                               a2, ExprFactory.makeBlock(a1)); 
     67       else yyValue = ExprFactory.makeFor(createSpan(yyStart,yyCount), 
     68                                          a2, ExprFactory.makeBlock(a1)); 
    6969     }; 
    7070 
     
    7676     a1:LocalFnDecl a2s:(br LocalFnDecl)* 
    7777     { List<FnDecl> fns = FortressUtil.mkList(a1, a2s.list()); 
    78        yyValue = new LetFn(createSpan(yyStart,yyCount), false, 
     78       yyValue = ExprFactory.makeLetFn(createSpan(yyStart,yyCount), 
    7979                           FortressUtil.emptyExprs(), fns); 
    8080     } 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/NoNewlineExpr.rats

    r3199 r3200  
    6969       yyValue = new Action<Expr>() { 
    7070           public Expr run(Expr base) { 
    71                return new AsExpr(createSpan(yyStart,yyCount), false, (Expr)base, 
    72                                  t); 
     71               return ExprFactory.makeAsExpr(createSpan(yyStart,yyCount), (Expr)base, 
     72                                             t); 
    7373           }}; 
    7474     }; 
     
    7979       yyValue = new Action<Expr>() { 
    8080           public Expr run(Expr base) { 
    81                return new AsIfExpr(createSpan(yyStart,yyCount), false, 
    82                                    (Expr)base, t); 
     81               return ExprFactory.makeAsIfExpr(createSpan(yyStart,yyCount), 
     82                                               (Expr)base, t); 
    8383           }}; 
    8484     }; 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/preparser/PreCompilation.rats

    r3184 r3200  
    149149           str = str.concat(c); 
    150150       } 
    151        yyValue = new StringLiteralExpr(createSpan(yyStart,yyCount), false, str); 
     151       yyValue = ExprFactory.makeStringLiteralExpr(createSpan(yyStart,yyCount), str); 
    152152     } 
    153153   / "\u201c" a1:StringLiteralContent* "\u201d" 
     
    156156           str = str.concat(c); 
    157157       } 
    158        yyValue = new StringLiteralExpr(createSpan(yyStart,yyCount), false, str); 
     158       yyValue = ExprFactory.makeStringLiteralExpr(createSpan(yyStart,yyCount), str); 
    159159     } 
    160160   / <ErrorProduction1> ["] a1:StringLiteralContent* "\u201d" 
    161161     { Span span = createSpan(yyStart,yyCount); 
    162162       log(span, "The opening and closing marks of a string literal must match."); 
    163        yyValue = new StringLiteralExpr(span, false, ""); 
     163       yyValue = ExprFactory.makeStringLiteralExpr(span, ""); 
    164164     } 
    165165   / <ErrorProduction2> "\u201c" a1:StringLiteralContent* ["] 
    166166     { Span span = createSpan(yyStart,yyCount); 
    167167       log(span, "The opening and closing marks of a string literal must match."); 
    168        yyValue = new StringLiteralExpr(span, false, ""); 
     168       yyValue = ExprFactory.makeStringLiteralExpr(span, ""); 
    169169     }; 
    170170private String StringLiteralContent = 
  • trunk/ProjectFortress/src/com/sun/fortress/parser_util/precedence_resolver/ASTUtil.java

    r3191 r3200  
    123123    //             chain_expr_links = links; })) 
    124124    static Expr chain(Span span, Expr first, List<Link> links) { 
    125         return new ChainExpr(span, false, first, links); 
     125        return ExprFactory.makeChainExpr(span, first, links); 
    126126    } 
    127127 
  • trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/phases/ComposingSyntaxDefTranslator.java

    r3142 r3200  
    588588        indents.add(3); 
    589589        code.add("StringLiteralExpr " + prefixJavaVariable(name) + 
    590                  " = new StringLiteralExpr(NodeFactory.makeSpan(\"blame ComposingSyntaxDefTranslater\"), \"\"+" + prefixJavaVariable(id) + ");"); 
     590                 " = ExprFactory.makeStringLiteralExpr(NodeFactory.makeSpan(\"blame ComposingSyntaxDefTranslater\"), \"\"+" + prefixJavaVariable(id) + ");"); 
    591591        return name; 
    592592    } 
  • trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/phases/EllipsesJUTest.java

    r3199 r3200  
    5757            original = ExprFactory.makeTightJuxt(new Span(), exprs); 
    5858            EllipsesEnvironment env = new EllipsesEnvironment(); 
    59             env.add( NodeFactory.makeId( "x" ), 1, mkList(new StringLiteralExpr(span,  "hello" )) ); 
     59            env.add( NodeFactory.makeId( "x" ), 1, mkList(ExprFactory.makeStringLiteralExpr(span,  "hello" )) ); 
    6060            actual = original.accept( new EllipsesVisitor( env ) ); 
    6161        } 
     
    6363        { 
    6464            List<Expr> exprs = new ArrayList<Expr>(); 
    65             exprs.add( new StringLiteralExpr(span,  "hello" ) ); 
     65            exprs.add( ExprFactory.makeStringLiteralExpr(span,  "hello" ) ); 
    6666            expected = ExprFactory.makeTightJuxt( new Span(), exprs ); 
    6767        } 
     
    7979            original = ExprFactory.makeTightJuxt(new Span(), exprs); 
    8080            EllipsesEnvironment env = new EllipsesEnvironment(); 
    81             env.add( NodeFactory.makeId( "x" ), 1, mkList(new StringLiteralExpr(span, "hello" ), new StringLiteralExpr(span, "goodbye" ) ) ); 
     81            env.add( NodeFactory.makeId( "x" ), 1, mkList(ExprFactory.makeStringLiteralExpr(span, "hello" ), ExprFactory.makeStringLiteralExpr(span, "goodbye" ) ) ); 
    8282            actual = original.accept( new EllipsesVisitor( env ) ); 
    8383        } 
     
    8585        { 
    8686            expected = ExprFactory.makeTightJuxt( new Span(), 
    87                                                   new StringLiteralExpr(span, "hello" ), 
    88                                                   new StringLiteralExpr(span, "goodbye" ) ); 
     87                                                  ExprFactory.makeStringLiteralExpr(span, "hello" ), 
     88                                                  ExprFactory.makeStringLiteralExpr(span, "goodbye" ) ); 
    8989        } 
    9090 
     
    9999        { 
    100100            List<Expr> blocks = new ArrayList<Expr>(); 
    101             blocks.add( new StringLiteralExpr(span, "hi" ) ); 
     101            blocks.add( ExprFactory.makeStringLiteralExpr(span, "hi" ) ); 
    102102            blocks.add( mkTemplate( "x" ) ); 
    103103            Expr extra = ExprFactory.makeBlock(span,  blocks ); 
     
    106106            original = ExprFactory.makeTightJuxt(new Span(), exprs ); 
    107107            EllipsesEnvironment env = new EllipsesEnvironment(); 
    108             env.add( NodeFactory.makeId( "x" ), 1, mkList( new StringLiteralExpr(span, "a"), new StringLiteralExpr(span, "b" ) ) ); 
     108            env.add( NodeFactory.makeId( "x" ), 1, mkList( ExprFactory.makeStringLiteralExpr(span, "a"), ExprFactory.makeStringLiteralExpr(span, "b" ) ) ); 
    109109            actual = original.accept( new EllipsesVisitor( env ) ); 
    110110        } 
     
    112112        { 
    113113            List<Expr> exprs = new ArrayList<Expr>(); 
    114             exprs.add( ExprFactory.makeBlock(span, mkExprList( new StringLiteralExpr(span, "hi" ), 
    115                                               new StringLiteralExpr(span, "a" ) ) ) ); 
    116             exprs.add( ExprFactory.makeBlock(span,  mkExprList( new StringLiteralExpr(span, "hi" ), 
    117                                               new StringLiteralExpr(span, "b" ) ) ) ); 
     114            exprs.add( ExprFactory.makeBlock(span, mkExprList( ExprFactory.makeStringLiteralExpr(span, "hi" ), 
     115                                              ExprFactory.makeStringLiteralExpr(span, "a" ) ) ) ); 
     116            exprs.add( ExprFactory.makeBlock(span,  mkExprList( ExprFactory.makeStringLiteralExpr(span, "hi" ), 
     117                                              ExprFactory.makeStringLiteralExpr(span, "b" ) ) ) ); 
    118118            expected = ExprFactory.makeTightJuxt(new Span(), exprs ); 
    119119        } 
     
    130130            List<Expr> extra = mkExprList(mkTemplate("i"), mkTemplate("j")); 
    131131            List<Expr> exprs = new ArrayList<Expr>(); 
    132             exprs.add( new StringLiteralExpr(span, "bar" ) ); 
     132            exprs.add( ExprFactory.makeStringLiteralExpr(span, "bar" ) ); 
    133133            exprs.add( new _EllipsesExpr(new Span(), ExprFactory.makeTightJuxt(new Span(), extra ) ) ); 
    134134            original = ExprFactory.makeTightJuxt(new Span(), exprs ); 
    135135            EllipsesEnvironment env = new EllipsesEnvironment(); 
    136             env.add( NodeFactory.makeId( "i" ), 0, new StringLiteralExpr(span, "a" ) ); 
    137             env.add( NodeFactory.makeId( "j" ), 1, mkList( new StringLiteralExpr(span, "1" ), 
    138                                                            new StringLiteralExpr(span, "2" ), 
    139                                                            new StringLiteralExpr(span, "3" ) ) ); 
     136            env.add( NodeFactory.makeId( "i" ), 0, ExprFactory.makeStringLiteralExpr(span, "a" ) ); 
     137            env.add( NodeFactory.makeId( "j" ), 1, mkList( ExprFactory.makeStringLiteralExpr(span, "1" ), 
     138                                                           ExprFactory.makeStringLiteralExpr(span, "2" ), 
     139                                                           ExprFactory.makeStringLiteralExpr(span, "3" ) ) ); 
    140140            actual = original.accept( new EllipsesVisitor( env ) ); 
    141141        } 
     
    143143        { 
    144144            expected = ExprFactory.makeTightJuxt(new Span(), 
    145                                      mkExprList( new StringLiteralExpr(span, "bar" ), 
     145                                     mkExprList( ExprFactory.makeStringLiteralExpr(span, "bar" ), 
    146146                                                 ExprFactory.makeTightJuxt(new Span(), 
    147                                                                            new StringLiteralExpr(span, "a"), 
    148                                                                            new StringLiteralExpr(span, "1")), 
     147                                                                           ExprFactory.makeStringLiteralExpr(span, "a"), 
     148                                                                           ExprFactory.makeStringLiteralExpr(span, "1")), 
    149149                                                 ExprFactory.makeTightJuxt(new Span(), 
    150                                                                            new StringLiteralExpr(span, "a"), 
    151                                                                            new StringLiteralExpr(span, "2")), 
     150                                                                           ExprFactory.makeStringLiteralExpr(span, "a"), 
     151                                                                           ExprFactory.makeStringLiteralExpr(span, "2")), 
    152152                                                 ExprFactory.makeTightJuxt(new Span(), 
    153                                                                            new StringLiteralExpr(span, "a"), 
    154                                                                            new StringLiteralExpr(span, "3")))); 
     153                                                                           ExprFactory.makeStringLiteralExpr(span, "a"), 
     154                                                                           ExprFactory.makeStringLiteralExpr(span, "3")))); 
    155155        } 
    156156 
  • trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/phases/Transform.java

    r3199 r3200  
    235235            Block body_result = (Block) recur(that.getBody()); 
    236236            setSyntaxEnvironment(save); 
    237             return new Label(NodeFactory.makeSpan(that), exprType_result, newId, body_result); 
     237            return ExprFactory.makeLabel(NodeFactory.makeSpan(that), that.isParenthesized(), 
     238                                         exprType_result, newId, body_result); 
    238239        } else { 
    239240            return super.forLabel(that); 
  • trunk/ProjectFortress/src/com/sun/fortress/tests/unit_tests/ConstructorsJUTest.java

    r3199 r3200  
    151151        Span span1 = newSpan("cat", 1, 2, 3); 
    152152        Span span2 = newSpan("cat", 1, 2, 3); 
    153         StringLiteralExpr sl1 = new StringLiteralExpr(span1, false, "123"); 
    154         StringLiteralExpr sl2 = new StringLiteralExpr(span2, false, "123"); 
    155         StringLiteralExpr sl3 = new StringLiteralExpr(span1, false, "124"); 
     153        StringLiteralExpr sl1 = ExprFactory.makeStringLiteralExpr(span1, "123"); 
     154        StringLiteralExpr sl2 = ExprFactory.makeStringLiteralExpr(span2, "123"); 
     155        StringLiteralExpr sl3 = ExprFactory.makeStringLiteralExpr(span1, "124"); 
    156156 
    157157        een(sl1, sl2, sl3); 
     
    181181    StringLiteralExpr newString(String s) { 
    182182        Span span1 = newSpan("cat", 1, 2, 3); 
    183         return new StringLiteralExpr(span1, false, s); 
     183        return ExprFactory.makeStringLiteralExpr(span1, s); 
    184184    } 
    185185    IntLiteralExpr newInt(String s) {