Changeset 3210

Show
Ignore:
Timestamp:
12/12/08 16:56:30 (12 months ago)
Author:
sukyoungryu
Message:

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

Location:
trunk/ProjectFortress
Files:
35 modified

Legend:

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

    r3206 r3210  
    415415                             Option<Type> idType) implements Lhs; 
    416416                /** 
    417                  * left-hand side of variable declaration 
     417                 * left-hand side of top-level variable declaration, 
     418                 * local variable declaration, or field declaration 
    418419                 * e.g.) var x: ZZ32 
    419420                 * Name must be unqualified. 
     
    11531154             * e.g.) throws FailCalled 
    11541155             */ 
    1155             Effect(Option<List<BaseType>> throwsClause = Option.<List<BaseType>>none(), 
    1156                    boolean ioEffect = false); 
     1156            Effect(Option<List<BaseType>> throwsClause, boolean ioEffect); 
    11571157            /** 
    11581158             * static argument 
     
    11981198             * static expression 
    11991199             */ 
    1200             abstract StaticExpr(ignoreForEquals boolean parenthesized = false); 
     1200            abstract StaticExpr(ignoreForEquals boolean parenthesized); 
    12011201                /** 
    12021202                 * integer expression 
     
    12161216                     * e.g.) m 
    12171217                     */ 
    1218                     IntRef(Id name, int lexicalDepth=-2147483648); 
     1218                    IntRef(Id name, int lexicalDepth); 
    12191219                    /** 
    12201220                     * integer expression with an operator 
     
    12551255                     * e.g.) ninf 
    12561256                     */ 
    1257                     BoolRef(Id name, int lexicalDepth=-2147483648); 
     1257                    BoolRef(Id name, int lexicalDepth); 
    12581258                    /** 
    12591259                     * boolean constraint 
     
    13061306             * e.g.) where { ninf AND NOT nan } 
    13071307             */ 
    1308             WhereClause(List<WhereBinding> bindings 
    1309                             = Collections.<WhereBinding>emptyList(), 
    1310                         List<WhereConstraint> constraints 
    1311                             = Collections.<WhereConstraint>emptyList()); 
     1308            WhereClause(List<WhereBinding> bindings, 
     1309                        List<WhereConstraint> constraints); 
    13121310            /** 
    13131311             * hidden type variable binding declared in where clauses 
     
    14241422             * e.g.) requires { n GE 0 } ensures { outcome GE 0 } 
    14251423             */ 
    1426             Contract(Option<List<Expr>> requiresClause = Option.<List<Expr>>none(), 
    1427                      Option<List<EnsuresClause>> ensuresClause = 
    1428                          Option.<List<EnsuresClause>>none(), 
    1429                      Option<List<Expr>> invariantsClause = Option.<List<Expr>>none()); 
     1424            Contract(Option<List<Expr>> requiresClause, 
     1425                     Option<List<EnsuresClause>> ensuresClause, 
     1426                     Option<List<Expr>> invariantsClause); 
    14301427            /** 
    14311428             * ensures clause used in contracts 
     
    14331430             * e.g.) sorted(outcome) provided sorted(input) 
    14341431             */ 
    1435             EnsuresClause(Expr post, Option<Expr> pre = Option.<Expr>none()); 
     1432            EnsuresClause(Expr post, Option<Expr> pre); 
    14361433            /** 
    14371434             * static parameter 
     
    14681465                 * 
    14691466                 */ 
    1470                 APIName(List<Id> ids, 
    1471                         ignoreForEquals String text = com.sun.fortress.useful.Useful.<Id>dottedList(in_ids).intern()); 
     1467                APIName(List<Id> ids, ignoreForEquals String text); 
    14721468                /** 
    14731469                 * non-API name 
     
    14761472                 *              | opr EncloserPair 
    14771473                 */ 
    1478                 abstract IdOrOpOrAnonymousName(Option<APIName> apiName 
    1479                                                    = Option.<APIName>none()); 
     1474                abstract IdOrOpOrAnonymousName(Option<APIName> apiName); 
    14801475                    /** 
    14811476                     * identifier or operator name 
     
    15421537             * because different ops can be chosen for different clauses. 
    15431538             */ 
    1544             CaseClause(Expr matchClause, Block body, 
    1545                        Option<FunctionalRef> op = Option.<FunctionalRef>none()); 
     1539            CaseClause(Expr matchClause, Block body, Option<FunctionalRef> op); 
    15461540            /** 
    15471541             * catch clause used in try expressions 
     
    16041598             * e.g.) T[\ninf, nan\] where { ninf AND NOT nan } 
    16051599             */ 
    1606             TraitTypeWhere(BaseType baseType, 
    1607                            Option<WhereClause> whereClause 
    1608                                = Option.<WhereClause>none()); 
     1600            TraitTypeWhere(BaseType baseType, Option<WhereClause> whereClause); 
    16091601            /** 
    16101602             * array dimensionality 
     
    16581650             * nonterminal header 
    16591651             */ 
    1660             NonterminalHeader(Modifiers mods = Modifiers.None,  /* Only Modifiers.Private is allowed */ 
     1652            NonterminalHeader(Modifiers mods, /* Only Modifiers.Private is allowed */ 
    16611653                              Id name, 
    16621654                              List<NonterminalParameter> params, 
    1663                               List<StaticParam> staticParams 
    1664                                 = Collections.<StaticParam>emptyList(), 
     1655                              List<StaticParam> staticParams, 
    16651656                              Option<Type> paramType, 
    1666                               Option<WhereClause> whereClause 
    1667                                 = Option.<WhereClause>none()); 
     1657                              Option<WhereClause> whereClause); 
    16681658 
    16691659            /** 
  • trunk/ProjectFortress/build.xml

    r3151 r3210  
    304304    <delete file="FortressLibrary.ast"/> 
    305305    <delete file="FortressLibrary.tfs"/> 
     306    <delete file="${basedir}/tests/printing/test_output.txt" /> 
    306307    <delete file="testFile.txt"/> 
    307308    <delete file="${src}/com/sun/fortress/scala_src/nodes/FortressAst.scala" /> 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/IndexBuilder.java

    r3206 r3210  
    195195    public static ObjectTraitIndex buildObjectExprIndex(ObjectExpr obj) { 
    196196        Span fake_span = NodeFactory.makeSpan("FAKE_SPAN"); 
    197         Id fake_object_name = new Id(fake_span, "FAKE_NAME"); 
     197        Id fake_object_name = NodeFactory.makeId(fake_span, "FAKE_NAME"); 
    198198        IndexBuilder builder = new IndexBuilder(); 
    199199 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/FreeNameCollection.java

    r3176 r3210  
    3535import com.sun.fortress.nodes.VarType; 
    3636import com.sun.fortress.nodes_util.NodeUtil; 
     37import com.sun.fortress.nodes_util.NodeFactory; 
    3738import com.sun.fortress.useful.Debug; 
    3839 
     
    131132                newFreeVarRefs.add(var); 
    132133            } else if( NodeUtil.isBoolParam(spOp.unwrap()) ) { 
    133                 this.add( new BoolRef(var.getSpan(), var.getVarId()) ); 
     134                this.add( NodeFactory.makeBoolRef(var.getSpan(), var.getVarId()) ); 
    134135            } else if( NodeUtil.isIntParam(spOp.unwrap()) ) { 
    135                 this.add( new IntRef(var.getSpan(), var.getVarId()) ); 
     136                this.add( NodeFactory.makeIntRef(var.getSpan(), var.getVarId()) ); 
    136137            } else if( NodeUtil.isNatParam(spOp.unwrap()) ) { 
    137                 this.add( new IntRef(var.getSpan(), var.getVarId()) ); 
     138                this.add( NodeFactory.makeIntRef(var.getSpan(), var.getVarId()) ); 
    138139            } else { 
    139140                throw new DesugarerError( "Unexpected Static Param type " + 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/FreeNameCollector.java

    r3156 r3210  
    3434import com.sun.fortress.nodes.*; 
    3535import com.sun.fortress.nodes_util.Span; 
     36import com.sun.fortress.nodes_util.NodeFactory; 
    3637import com.sun.fortress.useful.Debug; 
    3738 
     
    242243                          enclosingObjectDecl : 
    243244                          enclosingTraitDecl).unwrap().getSpan(); 
    244             Option<Type> type = objExprTypeEnv.type( new Id(s, "self") ); 
     245            Option<Type> type = objExprTypeEnv.type( NodeFactory.makeId(s, "self") ); 
    245246            freeNames.setEnclosingSelfType(type); 
    246247        } 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/ObjectExpressionVisitor.java

    r3202 r3210  
    833833 
    834834        if( NodeUtil.isBoolParam(sParam) ) { 
    835             BoolRef boolRef = new BoolRef(span, (Id)sParam.getName()); 
     835            BoolRef boolRef = NodeFactory.makeBoolRef(span, (Id)sParam.getName()); 
    836836            return new BoolArg(span, boolRef); 
    837837        } else if( NodeUtil.isIntParam(sParam) ) { 
    838             IntRef intRef = new IntRef(span, (Id)sParam.getName()); 
     838            IntRef intRef = NodeFactory.makeIntRef(span, (Id)sParam.getName()); 
    839839            return new IntArg(span, intRef); 
    840840        } else if( NodeUtil.isNatParam(sParam) ) { 
    841             IntRef intRef = new IntRef(span, (Id)sParam.getName()); 
     841            IntRef intRef = NodeFactory.makeIntRef(span, (Id)sParam.getName()); 
    842842            return new IntArg(span, intRef); 
    843843        } else if( NodeUtil.isTypeParam(sParam) ) { 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/PreDisambiguationDesugaringVisitor.java

    r3206 r3210  
    4949public class PreDisambiguationDesugaringVisitor extends NodeUpdateVisitor { 
    5050 
    51     private final Id anyTypeId = new Id(NodeFactory.makeSpan("singleton"), WellKnownNames.anyTypeName); 
     51    private final Id anyTypeId = NodeFactory.makeId(NodeFactory.makeSpan("singleton"), WellKnownNames.anyTypeName); 
    5252 
    5353    /** If the extends clause of a trait declaration, an object declaration, or 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/disambiguator/ExprDisambiguator.java

    r3206 r3210  
    299299 
    300300    private ExprDisambiguator extendWithSelf(Span span) { 
    301         Set<Id> selfSet = Collections.singleton(new Id(span, "self")); 
     301        Set<Id> selfSet = Collections.singleton(NodeFactory.makeId(span, "self")); 
    302302        return extendWithVars(selfSet); 
    303303    } 
    304304 
    305305    private ExprDisambiguator extendWithOutcome(Span span) { 
    306         Set<Id> outcomeSet = Collections.singleton(new Id(span, "outcome")); 
     306        Set<Id> outcomeSet = Collections.singleton(NodeFactory.makeId(span, "outcome")); 
    307307        return extendWithVars(outcomeSet); 
    308308    } 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/disambiguator/TopLevelEnv.java

    r3156 r3210  
    165165        Id key = entry.getKey(); 
    166166        if (table.containsKey(key)) { 
    167             table.get(key).add(new Id(key.getSpan(), 
     167            table.get(key).add(NodeFactory.makeId(key.getSpan(), 
    168168                                      Option.some(apiEntry.getKey()), 
    169169                                      key.getText())); 
     
    171171        } else { 
    172172            Set<Id> matches = new HashSet<Id>(); 
    173             matches.add(new Id(key.getSpan(), 
     173            matches.add(NodeFactory.makeId(key.getSpan(), 
    174174                               Option.some(apiEntry.getKey()), 
    175175                               key.getText())); 
     
    236236                if (fnName instanceof Id ) { 
    237237                    Id _fnName = (Id)fnName; 
    238                     Id name = new Id(_fnName.getSpan(), 
     238                    Id name = NodeFactory.makeId(_fnName.getSpan(), 
    239239                            Option.some(apiEntry.getKey()), 
    240240                            _fnName.getText()); 
     
    545545 
    546546    private Id ignoreApi(Id id) { 
    547         return new Id(id.getSpan(), id.getText()); 
     547        return NodeFactory.makeId(id.getSpan(), id.getText()); 
    548548    } 
    549549 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/disambiguator/TypeDisambiguator.java

    r3206 r3210  
    347347                    return p.getKind().accept(new NodeAbstractVisitor<StaticArg>() { 
    348348                            @Override public StaticArg forKindBool(KindBool k) { 
    349                                 return new BoolArg(s, new BoolRef(s, name)); 
     349                                return new BoolArg(s, NodeFactory.makeBoolRef(s, name)); 
    350350                            } 
    351351                            @Override public StaticArg forKindDim(KindDim p) { 
     
    353353                            } 
    354354                            @Override public StaticArg forKindInt(KindInt p) { 
    355                                 return new IntArg(s, new IntRef(s, name)); 
     355                                return new IntArg(s, NodeFactory.makeIntRef(s, name)); 
    356356                            } 
    357357                            @Override public StaticArg forKindNat(KindNat p) { 
    358                                 return new IntArg(s, new IntRef(s, name)); 
     358                                return new IntArg(s, NodeFactory.makeIntRef(s, name)); 
    359359                                // TODO: shouldn't there be a NatArg class? 
    360360                            } 
     
    363363                            } 
    364364                            @Override public StaticArg forKindUnit(KindUnit p) { 
    365                                 return new UnitArg(s, new UnitRef(s, name)); 
     365                                return new UnitArg(s, new UnitRef(s, false, name)); 
    366366                            } 
    367367                            @Override public StaticArg forKindOp(KindOp p) { 
     
    559559                NodeAbstractVisitor<StaticArg> v =new NodeAbstractVisitor<StaticArg>(){ 
    560560                    @Override public StaticArg forKindBool(KindBool k) { 
    561                         return new BoolArg(arg.getSpan(), new BoolRef(arg.getSpan(), (Id)name)); 
     561                        return new BoolArg(arg.getSpan(), NodeFactory.makeBoolRef(arg.getSpan(), (Id)name)); 
    562562                    } 
    563563                    @Override 
     
    567567                    @Override 
    568568                    public StaticArg forKindInt(KindInt k) { 
    569                         return new IntArg(arg.getSpan(), new IntRef(arg.getSpan(), (Id)name)); 
     569                        return new IntArg(arg.getSpan(), NodeFactory.makeIntRef(arg.getSpan(), (Id)name)); 
    570570                    } 
    571571                    @Override 
    572572                    public StaticArg forKindNat(KindNat k) { 
    573                         return new IntArg(arg.getSpan(), new IntRef(arg.getSpan(), (Id)name)); 
     573                        return new IntArg(arg.getSpan(), NodeFactory.makeIntRef(arg.getSpan(), (Id)name)); 
    574574                    } 
    575575                    @Override 
     
    580580                    public StaticArg forKindUnit(KindUnit k) { 
    581581                        return new UnitArg(arg.getSpan(), 
    582                                            new UnitRef(arg.getSpan(), (Id)name)); 
     582                                           new UnitRef(arg.getSpan(), false, (Id)name)); 
    583583                    } 
    584584                    @Override 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/index/FieldSetterMethod.java

    r3206 r3210  
    6161            Param p = NodeFactory.makeParam(_ast.getSpan(), 
    6262                                            Modifiers.None, 
    63                                             new Id(_ast.getSpan(), "fakeParamForImplicitSetter"), 
     63                                            NodeFactory.makeId(_ast.getSpan(), "fakeParamForImplicitSetter"), 
    6464                                            _ast.getIdType()); 
    6565                return Collections.singletonList(p); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/FnDeclTypeEnv.java

    r3203 r3210  
    6767                Id _var = (Id)var; 
    6868                if (_var.getApiName().isSome()) 
    69                     return binding(new Id(_var.getSpan(), _var.getText())); 
     69                    return binding(NodeFactory.makeId(_var.getSpan(), _var.getText())); 
    7070            } 
    7171            return parent.binding(var); 
     
    102102                Id _var = (Id)var; 
    103103                if (_var.getApiName().isSome()) 
    104                     return declarationSite(new Id(_var.getSpan(), _var.getText())); 
     104                    return declarationSite(NodeFactory.makeId(_var.getSpan(), _var.getText())); 
    105105            } 
    106106            return parent.declarationSite(var); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/SubtypeCheckerJUTest.java

    r3184 r3210  
    390390        for (String sup : supers) { 
    391391            BaseType supT = (BaseType) parseType(sup); 
    392             extendsClause.add(new TraitTypeWhere(span, supT, Option.<WhereClause>none())); 
     392            extendsClause.add(NodeFactory.makeTraitTypeWhere(span, supT, Option.<WhereClause>none())); 
    393393        } 
    394394        TraitDecl ast; 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TraitTable.java

    r3123 r3210  
    4141    public Option<TypeConsIndex> typeCons(Id name) { 
    4242        TypeConsIndex result; 
    43         Id simpleName = new Id(NodeFactory.makeSpan(name), name.getText()); 
     43        Id simpleName = NodeFactory.makeId(NodeFactory.makeSpan(name), name.getText()); 
    4444        // TODO: Shouldn't qualified names only point to APIs? -- Dan 
    4545        if (name.getApiName().isNone() || 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeAnalyzer.java

    r3202 r3210  
    355355                    List<BaseType> reduced = reduceDisjuncts(normalThrows.unwrap(), 
    356356                                                             _emptyHistory); 
    357                     if (reduced.isEmpty()) { return new Effect(NodeFactory.makeSpan(e), e.isIoEffect()); } 
     357                    if (reduced.isEmpty()) { return NodeFactory.makeEffect(NodeFactory.makeSpan(e), e.isIoEffect()); } 
    358358                    else if (reduced.equals(e.getThrowsClause().unwrap())) { 
    359359                        return e; 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeAnalyzerJUTest.java

    r3203 r3210  
    463463        for (String sup : supers) { 
    464464            BaseType supT = (BaseType) parseType(sup); 
    465             extendsClause.add(new TraitTypeWhere(span, supT, Option.<WhereClause>none())); 
     465            extendsClause.add(NodeFactory.makeTraitTypeWhere(span, supT, Option.<WhereClause>none())); 
    466466        } 
    467467        TraitDecl ast; 
     
    607607 
    608608    private static Effect parseEffect(String s) { 
    609         if (s.length() == 0) { return new Effect(span); } 
     609        if (s.length() == 0) { return NodeFactory.makeEffect(span); } 
    610610 
    611611        boolean io = false; 
    612612        s = s.trim(); 
    613         if (s.equals("io")) { return new Effect(span, true); } 
     613        if (s.equals("io")) { return NodeFactory.makeEffect(span, true); } 
    614614        else if (s.startsWith("io ")) { io = true; s = s.substring(3).trim(); } 
    615615        else if (s.endsWith(" io")) { io = true; s = s.substring(0, s.length()-3).trim(); } 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeCheckerTestCase.java

    r3202 r3210  
    106106        for (String sup : supers) { 
    107107            BaseType supT = (BaseType) parseType(sup); 
    108             extendsClause.add(new TraitTypeWhere(span, supT, Option.<WhereClause>none())); 
     108            extendsClause.add(NodeFactory.makeTraitTypeWhere(span, supT, Option.<WhereClause>none())); 
    109109        } 
    110110        TraitDecl ast = NodeFactory.makeTraitDecl(span, NodeFactory.makeId(name), sparams, 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeEnv.java

    r3206 r3210  
    4040import com.sun.fortress.compiler.index.Variable; 
    4141import com.sun.fortress.nodes.AnonymousFnName; 
     42import com.sun.fortress.nodes.APIName; 
    4243import com.sun.fortress.nodes.BoolArg; 
    4344import com.sun.fortress.nodes.BoolRef; 
     
    190191            result.add(param.getKind().accept(new NodeAbstractVisitor<StaticArg>() { 
    191192                        public StaticArg forKindBool(KindBool k) { 
    192                             return new BoolArg(new Span(), new BoolRef(new Span(), (Id)name)); 
     193                            return new BoolArg(new Span(), NodeFactory.makeBoolRef(new Span(), (Id)name)); 
    193194                        } 
    194195                        public StaticArg forKindDim(KindDim k) { 
     
    196197                        } 
    197198                        public StaticArg forKindInt(KindInt k) { 
    198                             return new IntArg(new Span(), new IntRef(new Span(), (Id)name)); 
     199                            return new IntArg(new Span(), NodeFactory.makeIntRef(new Span(), (Id)name)); 
    199200                        } 
    200201                        public StaticArg forKindNat(KindNat k) { 
    201                             return new IntArg(new Span(), new IntRef(new Span(), (Id)name)); 
     202                            return new IntArg(new Span(), NodeFactory.makeIntRef(new Span(), (Id)name)); 
    202203                        } 
    203204                        public StaticArg forKindType(KindType k) { 
     
    206207                        } 
    207208                        public StaticArg forKindUnit(KindUnit k) { 
    208                             return new UnitArg(new Span(), new UnitRef(new Span(), (Id)name)); 
     209                            return new UnitArg(new Span(), new UnitRef(new Span(), false, (Id)name)); 
    209210                        } 
    210211                        public StaticArg forKindOp(KindOp that) { 
     
    221222 
    222223    static Op removeApi(Op id) { 
    223         return new Op(id.getSpan(), id.getText(), id.getFixity(), id.isEnclosing()); 
     224        return new Op(id.getSpan(), Option.<APIName>none(), 
     225                      id.getText(), id.getFixity(), id.isEnclosing()); 
    224226    } 
    225227 
    226228    static IdOrOpOrAnonymousName removeApi(IdOrOpOrAnonymousName id) { 
    227229        return id.accept(new NodeDepthFirstVisitor<IdOrOpOrAnonymousName>(){ 
    228                 @Override public IdOrOpOrAnonymousName forId(Id that) { return removeApi(that); } 
    229                 @Override 
    230                 public IdOrOpOrAnonymousName forOp(Op that) { 
    231                     return new Op(that.getSpan(), that.getText(), that.getFixity(), that.isEnclosing()); 
    232                 } 
    233                 @Override 
    234                 public IdOrOpOrAnonymousName forAnonymousFnName(AnonymousFnName that) { 
    235                     return new AnonymousFnName(that.getSpan()); 
    236                 } 
    237                 @Override 
    238                 public IdOrOpOrAnonymousName forConstructorFnName(ConstructorFnName that) { 
    239                     return new ConstructorFnName(that.getSpan(), that.getDef()); 
    240                 } 
     230                        @Override public IdOrOpOrAnonymousName forId(Id that) { return removeApi(that); } 
     231                        @Override 
     232                        public IdOrOpOrAnonymousName forOp(Op that) { 
     233                            return new Op(that.getSpan(), Option.<APIName>none(), 
     234                                          that.getText(), that.getFixity(), that.isEnclosing()); 
     235                        } 
     236                        @Override 
     237                        public IdOrOpOrAnonymousName forAnonymousFnName(AnonymousFnName that) { 
     238                                return new AnonymousFnName(that.getSpan(), 
     239                                                           Option.<APIName>none()); 
     240                        } 
     241                        @Override 
     242                        public IdOrOpOrAnonymousName forConstructorFnName(ConstructorFnName that) { 
     243                                return new ConstructorFnName(that.getSpan(), 
     244                                                             Option.<APIName>none(), 
     245                                                             that.getDef()); 
     246                        } 
    241247        }); 
    242248    } 
     
    451457            for (FnDecl decl : decls) { 
    452458                overloads.add(genericArrowFromDecl(decl)); 
    453                 mods = mods.combine(decl.getMods()); 
    454459            } 
    455460            this.mods = mods; 
     
    495500            if( mutable ) 
    496501                return true; 
     502 
    497503            return mods.isMutable(); 
    498504        } 
     
    508514     * Replace all of the inference variables given with their corresponding types. 
    509515     */ 
    510     public abstract TypeEnv replaceAllIVars(Map<_InferenceVarType, Type> ivars); 
     516        public abstract TypeEnv replaceAllIVars(Map<_InferenceVarType, Type> ivars); 
    511517} 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/glue/NativeApp.java

    r3182 r3210  
    114114 
    115115    public <RetType> RetType accept(NodeVisitor<RetType> visitor) { 
    116         return visitor.forId(new Id(NodeFactory.makeSpan(""), "")); 
     116        return visitor.forId(NodeFactory.makeId(NodeFactory.makeSpan(""), "")); 
    117117    } 
    118118    public void accept(NodeVisitor_void visitor) {} 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/rewrite/DesugarerVisitor.java

    r3202 r3210  
    458458        if (i > 0) { 
    459459            return ExprFactory.makeFieldRef(s, dottedReference(s, i - 1), 
    460                                             new Id(s,WellKnownNames.secretParentName)); 
     460                                            NodeFactory.makeId(s,WellKnownNames.secretParentName)); 
    461461        } else { 
    462462            throw new Error("Confusion in member reference numbering."); 
     
    765765        Id id = lvb.getName(); 
    766766        if ("_".equals(id.getText())) { 
    767             Id newId = new Id(id.getSpan(), WellKnownNames.tempForUnderscore(id)); 
     767            Id newId = NodeFactory.makeId(id.getSpan(), WellKnownNames.tempForUnderscore(id)); 
    768768            return NodeFactory.makeLValue(lvb, newId); 
    769769        } 
     
    917917            int element_index = 0; 
    918918            for (LValue lv : lhs) { 
    919                 Id newName = new Id(at, "$" + element_index); 
     919                Id newName = NodeFactory.makeId(at, "$" + element_index); 
    920920                Option<Type> type = lv.getIdType(); 
    921921                newdecls.add(new VarDecl(at, Useful.list(lv), 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/ExprFactory.java

    r3202 r3210  
    675675                                    Expr body) { 
    676676        return makeFnExpr(span, false, Option.<Type>none(), 
    677                           new AnonymousFnName(span), 
     677                          new AnonymousFnName(span, Option.<APIName>none()), 
    678678                          Collections.<StaticParam>emptyList(), params, 
    679679                          returnType, Option.<WhereClause>none(), 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/NodeFactory.java

    r3206 r3210  
    284284        return makeFnDecl(span, mods, name, staticParams, params, returnType, 
    285285                          throwsC, whereC, contract, 
    286                           new Id(span, "FN$"+span.toString()), 
     286                          makeId(span, "FN$"+span.toString()), 
    287287                          Option.<Expr>none(), Option.<Id>none()); 
    288288    } 
     
    299299        return makeFnDecl(span, mods, name, staticParams, params, returnType, 
    300300                          throwsC, whereC, contract, 
    301                           new Id(span, "FN$"+span.toString()), 
     301                          makeId(span, "FN$"+span.toString()), 
    302302                          body, Option.<Id>none()); 
    303303    } 
     
    491491    public static Param makeAbsParam(Type type) { 
    492492        return makeParam(type.getSpan(), Modifiers.None, 
    493                          new Id(type.getSpan(), "_"), type); 
     493                         makeId(type.getSpan(), "_"), type); 
    494494    } 
    495495 
     
    792792    } 
    793793 
    794     /***************************************************************************/ 
    795  
    796  
    797     public static Id makeTemporaryId() { 
    798         return makeId("$$bogus_name$$"); 
    799     } 
    800  
    801     public static Op makeTemporaryOp() { 
    802         return makeOp("$$bogus_name$$"); 
     794    /** Create an "empty" effect at the given location. */ 
     795    public static Effect makeEffect(SourceLoc loc) { 
     796        return makeEffect(new Span(loc, loc)); 
     797    } 
     798 
     799    public static Effect makeEffect(Span span) { 
     800        return makeEffect(span, Option.<List<BaseType>>none(), false); 
     801    } 
     802 
     803    public static Effect makeEffect(List<BaseType> throwsClause) { 
     804        return makeEffect(FortressUtil.spanAll(throwsClause), 
     805                          Option.some(throwsClause), false); 
     806    } 
     807 
     808    public static Effect makeEffect(SourceLoc defaultLoc, List<BaseType> throwsClause) { 
     809        return makeEffect(FortressUtil.spanAll(defaultLoc, throwsClause), 
     810                          Option.some(throwsClause), false); 
     811    } 
     812 
     813    public static Effect makeEffect(Option<List<BaseType>> throwsClause) { 
     814        Span span = FortressUtil.spanAll(throwsClause.unwrap(Collections.<BaseType>emptyList())); 
     815        return makeEffect(span, throwsClause, false); 
     816    } 
     817 
     818    public static Effect makeEffect(SourceLoc defaultLoc, Option<List<BaseType>> throwsClause) { 
     819        Span span = FortressUtil.spanAll(defaultLoc, 
     820                throwsClause.unwrap(Collections.<BaseType>emptyList())); 
     821        return makeEffect(span, throwsClause, false); 
     822    } 
     823 
     824    public static Effect makeEffect(Span span, boolean ioEffect) { 
     825        return new Effect(span, Option.<List<BaseType>>none(), ioEffect); 
     826    } 
     827 
     828 
     829    public static Effect makeEffect(Span span, Option<List<BaseType>> throwsC, 
     830                                    boolean ioEffect) { 
     831        return new Effect(span, throwsC, ioEffect); 
     832    } 
     833 
     834    public static TraitTypeWhere makeTraitTypeWhere(BaseType in_type) { 
     835        Span sp = in_type.getSpan(); 
     836        return makeTraitTypeWhere(sp, in_type, 
     837                                  Option.<WhereClause>none()); 
     838    } 
     839 
     840    public static TraitTypeWhere makeTraitTypeWhere(BaseType in_type, Option<WhereClause> in_where) { 
     841        if ( in_where.isSome() ) 
     842            return makeTraitTypeWhere(new Span(in_type.getSpan(), in_where.unwrap().getSpan()), in_type, in_where); 
     843        else 
     844            return makeTraitTypeWhere(in_type.getSpan(), in_type, in_where); 
     845    } 
     846 
     847    public static TraitTypeWhere makeTraitTypeWhere(Span span, BaseType type, 
     848                                                    Option<WhereClause> where) { 
     849        return new TraitTypeWhere(span, type, where); 
     850    } 
     851 
     852    public static ConstructorFnName makeConstructorFnName(GenericWithParams def) { 
     853        return new ConstructorFnName(def.getSpan(), Option.<APIName>none(), def); 
     854    } 
     855 
     856    public static Id makeId(Span span, String name) { 
     857        return makeId(span, Option.<APIName>none(), name); 
     858    } 
     859 
     860    public static Id makeId(Span span, Option<APIName> apiName, String text) { 
     861        return new Id(span, apiName, text); 
     862    } 
     863 
     864 
     865    public static Id bogusId(Span span) { 
     866        return makeId(span, Option.<APIName>none(), "_"); 
     867    } 
     868 
     869    public static Id makeId(Id id, String newName) { 
     870        return makeId(id.getSpan(), id.getApiName(), newName); 
     871    } 
     872 
     873    public static Id makeId(Span span, Id id) { 
     874        return makeId(span, id.getApiName(), id.getText()); 
     875    } 
     876 
     877    public static Id makeId(Iterable<Id> apiIds, Id id) { 
     878        Span span; 
     879        Option<APIName> api; 
     880        if (IterUtil.isEmpty(apiIds)) { 
     881            span = id.getSpan(); 
     882            api = Option.none(); 
     883        } 
     884        else { 
     885            APIName n = makeAPIName(apiIds); 
     886            span = FortressUtil.spanTwo(n, id); 
     887            api = Option.some(n); 
     888        } 
     889        return makeId(span, api, id.getText()); 
     890    } 
     891 
     892    public static Id makeId(Span span, String api, String name) { 
     893        List<Id> apis = new ArrayList<Id>(); 
     894        apis.add(makeId(span, api)); 
     895        apis = Useful.immutableTrimmedList(apis); 
     896        return makeId(span, Option.some(makeAPIName(span, apis)), name); 
     897    } 
     898 
     899    public static Id makeId(Span span, Iterable<Id> apiIds, Id id) { 
     900        Option<APIName> api; 
     901        if (IterUtil.isEmpty(apiIds)) { api = Option.none(); } 
     902        else { api = Option.some(makeAPIName(apiIds)); } 
     903        return makeId(span, api, id.getText()); 
     904    } 
     905 
     906    public static Id makeId(Span span, Id id, Iterable<Id> ids) { 
     907        Option<APIName> api; 
     908        Id last; 
     909        if (IterUtil.isEmpty(ids)) { api = Option.none(); last = id; } 
     910        else { api = Option.some(makeAPIName(id, IterUtil.skipLast(ids))); 
     911        last = IterUtil.last(ids); 
     912        } 
     913        return makeId(span, api, last.getText()); 
     914    } 
     915 
     916    public static Id makeId(Span span, APIName api, Id id) { 
     917        return makeId(span, Option.some(api), id.getText()); 
     918    } 
     919 
     920    /** Assumes {@code ids} is nonempty. */ 
     921    public static Id makeId(Iterable<Id> ids) { 
     922        return makeId(IterUtil.skipLast(ids), IterUtil.last(ids)); 
     923    } 
     924 
     925    public static Id makeId(String nameFirst, String... nameRest) { 
     926        Iterable<Id> ids = IterUtil.compose(makeId(nameFirst), 
     927                IterUtil.map(IterUtil.asIterable(nameRest), STRING_TO_ID)); 
     928        return makeId(ids); 
     929    } 
     930 
     931    public static Id makeId(APIName api, Id name) { 
     932        return makeId(FortressUtil.spanTwo(api, name), Option.some(api), 
     933                name.getText()); 
     934    } 
     935 
     936    public static Id makeId(APIName api, Id name, Span span) { 
     937        return makeId(span, Option.some(api), name.getText()); 
     938    } 
     939 
     940    public static Id makeId(Option<APIName> api, Id name) { 
     941        return makeId(name.getSpan(), api, name.getText()); 
     942    } 
     943 
     944    public static Id makeId(Span span, APIName api, String name) { 
     945        return makeId(span, Option.some(api), name); 
     946    } 
     947 
     948    public static Id makeId(String string) { 
     949        return makeId(new Span(), string); 
    803950    } 
    804951 
     
    813960        } 
    814961        ids = Useful.immutableTrimmedList(ids); 
    815         return new APIName(FortressUtil.spanTwo(first, last), ids); 
     962        return makeAPIName(FortressUtil.spanTwo(first, last), ids); 
    816963    } 
    817964 
     
    822969            ids.addAll(rest.getApiName().unwrap().getIds()); 
    823970        } 
    824         ids.add(new Id(rest.getSpan(), rest.getText())); 
     971        ids.add(makeId(rest.getSpan(), rest.getText())); 
    825972        ids = Useful.immutableTrimmedList(ids); 
    826         return new APIName(FortressUtil.spanTwo(first, rest), ids); 
     973        return makeAPIName(FortressUtil.spanTwo(first, rest), ids); 
     974    } 
     975 
     976    public static APIName makeAPIName(Span span, List<Id> apis) { 
     977        return makeAPIName(span, apis, Useful.<Id>dottedList(apis).intern()); 
     978    } 
     979 
     980    public static APIName makeAPIName(Span span, String s) { 
     981        return makeAPIName(span, Useful.list(makeId(span, s))); 
     982    } 
     983 
     984    public static APIName makeAPIName(Span span, Id s) { 
     985        return makeAPIName(span, Useful.list(s)); 
     986    } 
     987 
     988    public static APIName makeAPIName(Id s) { 
     989        return makeAPIName(s.getSpan(), Useful.list(s)); 
     990    } 
     991 
     992    public static APIName makeAPIName(Span span, List<Id> apis, String text) { 
     993        return new APIName(span, apis, text); 
     994    } 
     995 
     996    public static APIName makeAPIName(String s) { 
     997        return makeAPIName(stringToIds(s)); 
     998    } 
     999 
     1000    public static APIName makeAPIName(Iterable<Id> ids) { 
     1001        return makeAPIName(FortressUtil.spanAll(ids), CollectUtil.makeList(ids)); 
     1002    } 
     1003 
     1004    public static APIName makeAPIName(Id id, Iterable<Id> ids) { 
     1005        return makeAPIName(CollectUtil.makeList(IterUtil.compose(id, ids))); 
     1006    } 
     1007 
     1008    public static APIName makeAPIName(Span span, Iterable<Id> ids) { 
     1009        return makeAPIName(span, CollectUtil.makeList(ids)); 
     1010    } 
     1011 
     1012    public static BoolRef makeBoolRef(String string) { 
     1013        return makeBoolRef(new Span(), false, makeId(string), lexicalDepth); 
     1014    } 
     1015 
     1016    public static BoolRef makeBoolRef(BoolRef old, int depth) { 
     1017        return makeBoolRef(old.getSpan(), old.isParenthesized(), old.getName(), depth); 
     1018    } 
     1019 
     1020    public static BoolRef makeBoolRef(Span span, Id name) { 
     1021        return makeBoolRef(span, false, name, lexicalDepth); 
     1022    } 
     1023 
     1024    public static BoolRef makeBoolRef(Span span, boolean parenthesized, 
     1025                                      Id name, int depth) { 
     1026        return new BoolRef(span, parenthesized, name, depth); 
     1027    } 
     1028 
     1029    public static BoolBinaryOp makeBoolBinaryOp(Span span, 
     1030                                                BoolExpr left, BoolExpr right, Op op) { 
     1031        return makeBoolBinaryOp(span, false, left, right, op); 
     1032    } 
     1033 
     1034    public static BoolBinaryOp makeBoolBinaryOp(Span span, boolean parenthesized, 
     1035                                                BoolExpr left, BoolExpr right, Op op) { 
     1036        return new BoolBinaryOp(span, parenthesized, left, right, op); 
     1037    } 
     1038 
     1039    public static IntBinaryOp makeIntBinaryOp(Span span, 
     1040                                              IntExpr left, IntExpr right, Op op) { 
     1041        return makeIntBinaryOp(span, false, left, right, op); 
     1042    } 
     1043 
     1044    public static IntBinaryOp makeIntBinaryOp(Span span, boolean parenthesized, 
     1045                                              IntExpr left, IntExpr right, Op op) { 
     1046        return new IntBinaryOp(span, parenthesized, left, right, op); 
     1047    } 
     1048 
     1049    public static IntRef makeIntRef(String string) { 
     1050        return makeIntRef(new Span(), makeId(string)); 
     1051    } 
     1052 
     1053    public static IntRef makeIntRef(IntRef old, int depth) { 
     1054        return makeIntRef(old.getSpan(), old.isParenthesized(), old.getName(), depth); 
     1055    } 
     1056 
     1057    public static IntRef makeIntRef(Span span, Id name) { 
     1058        return new IntRef(span, false, name, lexicalDepth); 
     1059    } 
     1060 
     1061    public static IntRef makeIntRef(Span span, boolean parenthesized, 
     1062                                    Id name, int depth) { 
     1063        return new IntRef(span, parenthesized, name, depth); 
     1064    } 
     1065 
     1066    /***************************************************************************/ 
     1067 
     1068 
     1069    public static Id makeTemporaryId() { 
     1070        return makeId("$$bogus_name$$"); 
     1071    } 
     1072 
     1073    public static Op makeTemporaryOp() { 
     1074        return makeOp("$$bogus_name$$"); 
    8271075    } 
    8281076 
    8291077    public static Id makeIdFromLast(Id id) { 
    830         return new Id(id.getSpan(), id.getText()); 
    831     } 
    832  
    833     public static TraitTypeWhere makeTraitTypeWhere(BaseType in_type) { 
    834         Span sp = in_type.getSpan(); 
    835         return new TraitTypeWhere(sp, in_type, 
    836                                   Option.<WhereClause>none()); 
    837     } 
    838  
    839     public static TraitTypeWhere makeTraitTypeWhere(BaseType in_type, Option<WhereClause> in_where) { 
    840         if ( in_where.isSome() ) 
    841             return new TraitTypeWhere(new Span(in_type.getSpan(), in_where.unwrap().getSpan()), in_type, in_where); 
    842         else 
    843             return new TraitTypeWhere(in_type.getSpan(), in_type, in_where); 
     1078        return makeId(id.getSpan(), id.getText()); 
    8441079    } 
    8451080 
     
    8651100 
    8661101    public static UnitRef makeUnitRef(Span span, String name) { 
    867         return new UnitRef(span, makeId(name)); 
     1102        return new UnitRef(span, false, makeId(name)); 
    8681103    } 
    8691104 
     
    8831118    } 
    8841119 
    885     /** Create an "empty" effect at the given location. */ 
    886     public static Effect makeEffect(SourceLoc loc) { 
    887         return new Effect(new Span(loc, loc)); 
    888     } 
    889  
    890     public static Effect makeEffect(List<BaseType> throwsClause) { 
    891         return new Effect(FortressUtil.spanAll(throwsClause), Option.some(throwsClause)); 
    892     } 
    893  
    894     public static Effect makeEffect(SourceLoc defaultLoc, List<BaseType> throwsClause) { 
    895         return new Effect(FortressUtil.spanAll(defaultLoc, throwsClause), 
    896                 Option.some(throwsClause)); 
    897     } 
    898  
    899     public static Effect makeEffect(Option<List<BaseType>> throwsClause) { 
    900         Span span = FortressUtil.spanAll(throwsClause.unwrap(Collections.<BaseType>emptyList())); 
    901         return new Effect(span, throwsClause); 
    902     } 
    903  
    904     public static Effect makeEffect(SourceLoc defaultLoc, Option<List<BaseType>> throwsClause) { 
    905         Span span = FortressUtil.spanAll(defaultLoc, 
    906                 throwsClause.unwrap(Collections.<BaseType>emptyList())); 
    907         return new Effect(span, throwsClause); 
    908     } 
    909  
    9101120    public static KeywordType makeKeywordType(Id name, Type type) { 
    9111121        return new KeywordType(new Span(), name, type); 
    912     } 
    913  
    914     public static ConstructorFnName makeConstructorFnName(GenericWithParams def) { 
    915         return new ConstructorFnName(def.getSpan(), def); 
    916     } 
    917  
    918     public static APIName makeAPIName(Span span, String s) { 
    919         return new APIName(span, Useful.list(new Id(span, s))); 
    920     } 
    921  
    922     public static APIName makeAPIName(Span span, Id s) { 
    923         return new APIName(span, Useful.list(s)); 
    924     } 
    925  
    926     public static APIName makeAPIName(Id s) { 
    927         return new APIName(s.getSpan(), Useful.list(s)); 
    9281122    } 
    9291123 
     
    9401134    } 
    9411135 
    942     public static APIName makeAPIName(String s) { 
    943         return makeAPIName(stringToIds(s)); 
    944     } 
    945  
    946     public static APIName makeAPIName(Iterable<Id> ids) { 
    947         return new APIName(FortressUtil.spanAll(ids), CollectUtil.makeList(ids)); 
    948     } 
    949  
    950     public static APIName makeAPIName(Id id, Iterable<Id> ids) { 
    951         return makeAPIName(CollectUtil.makeList(IterUtil.compose(id, ids))); 
    952     } 
    953  
    954     public static APIName makeAPIName(Span span, Iterable<Id> ids) { 
    955         return new APIName(span, CollectUtil.makeList(ids)); 
    956     } 
    957  
    9581136    /** 
    9591137     * Create a APIName from the name of the file with the given path. 
     
    9751153        String file = new File(path).getName(); 
    9761154        if (file.length() <= 4) { 
    977             return error(new Id(span, "_"), "Invalid file name."); 
     1155            return error(makeId(span, "_"), "Invalid file name."); 
    9781156        } 
    9791157        for (String n : file.substring(0, file.length()-4).split(delimiter)) { 
    980             ids.add(new Id(span, n)); 
     1158            ids.add(makeId(span, n)); 
    9811159        } 
    9821160        ids = Useful.immutableTrimmedList(ids); 
    983         return new APIName(span, ids); 
    984     } 
    985  
    986     public static Id bogusId(Span span) { 
    987         return new Id(span, Option.<APIName>none(), "_"); 
    988     } 
    989  
    990     public static Id makeId(Id id, String newName) { 
    991         return new Id(id.getSpan(), id.getApiName(), newName); 
    992     } 
    993  
    994     public static Id makeId(Span span, String s) { 
    995         return new Id(span, Option.<APIName>none(), s); 
    996     } 
    997  
    998     public static Id makeId(Span span, Id id) { 
    999         return new Id(span, id.getApiName(), id.getText()); 
    1000     } 
    1001  
    1002     public static Id makeId(Iterable<Id> apiIds, Id id) { 
    1003         Span span; 
    1004         Option<APIName> api; 
    1005         if (IterUtil.isEmpty(apiIds)) { 
    1006             span = id.getSpan(); 
    1007             api = Option.none(); 
    1008         } 
    1009         else { 
    1010             APIName n = makeAPIName(apiIds); 
    1011             span = FortressUtil.spanTwo(n, id); 
    1012             api = Option.some(n); 
    1013         } 
    1014         return new Id(span, api, id.getText()); 
    1015     } 
    1016  
    1017     public static Id makeId(Span span, String api, String name) { 
    1018         List<Id> apis = new ArrayList<Id>(); 
    1019         apis.add(makeId(span, api)); 
    1020         apis = Useful.immutableTrimmedList(apis); 
    1021         return new Id(span, Option.some(new APIName(span, apis)), name); 
    1022     } 
    1023  
    1024     public static Id makeId(Span span, Iterable<Id> apiIds, Id id) { 
    1025         Option<APIName> api; 
    1026         if (IterUtil.isEmpty(apiIds)) { api = Option.none(); } 
    1027         else { api = Option.some(makeAPIName(apiIds)); } 
    1028         return new Id(span, api, id.getText()); 
    1029     } 
    1030  
    1031     public static Id makeId(Span span, Id id, Iterable<Id> ids) { 
    1032         Option<APIName> api; 
    1033         Id last; 
    1034         if (IterUtil.isEmpty(ids)) { api = Option.none(); last = id; } 
    1035         else { api = Option.some(makeAPIName(id, IterUtil.skipLast(ids))); 
    1036         last = IterUtil.last(ids); 
    1037         } 
    1038         return new Id(span, api, last.getText()); 
    1039     } 
    1040  
    1041     public static Id makeId(Span span, APIName api, Id id) { 
    1042         return new Id(span, Option.some(api), id.getText()); 
    1043     } 
    1044  
    1045     /** Assumes {@code ids} is nonempty. */ 
    1046     public static Id makeId(Iterable<Id> ids) { 
    1047         return makeId(IterUtil.skipLast(ids), IterUtil.last(ids)); 
    1048     } 
    1049  
    1050     public static Id makeId(String nameFirst, String... nameRest) { 
    1051         Iterable<Id> ids = IterUtil.compose(makeId(nameFirst), 
    1052                 IterUtil.map(IterUtil.asIterable(nameRest), STRING_TO_ID)); 
    1053         return makeId(ids); 
    1054     } 
    1055  
    1056     public static Id makeId(APIName api, Id name) { 
    1057         return new Id(FortressUtil.spanTwo(api, name), Option.some(api), 
    1058                 name.getText()); 
    1059     } 
    1060  
    1061     public static Id makeId(APIName api, Id name, Span span) { 
    1062         return new Id(span, Option.some(api), name.getText()); 
    1063     } 
    1064  
    1065     public static Id makeId(Option<APIName> api, Id name) { 
    1066         return new Id(name.getSpan(), api, name.getText()); 
    1067     } 
    1068  
    1069     public static Id makeId(Span span, APIName api, String name) { 
    1070         return new Id(span, Option.some(api), name); 
    1071     } 
    1072  
    1073     public static Id makeId(String string) { 
    1074         return new Id(new Span(), string); 
     1161        return makeAPIName(span, ids); 
    10751162    } 
    10761163 
     
    10801167 
    10811168    public static Op makeEnclosing(Span in_span, String in_open, String in_close) { 
    1082         return new Op(in_span, PrecedenceMap.ONLY.canon(in_open + " " + in_close), 
     1169        return new Op(in_span, Option.<APIName>none(), 
     1170                      PrecedenceMap.ONLY.canon(in_open + " " + in_close), 
    10831171                      enclosing, true); 
    10841172    } 
     
    10951183 
    10961184    public static Op makeOp(String name) { 
    1097         return new Op(new Span(), PrecedenceMap.ONLY.canon(name), unknownFix, false); 
     1185        return new Op(new Span(),  Option.<APIName>none(), 
     1186                      PrecedenceMap.ONLY.canon(name), unknownFix, false); 
    10981187    } 
    10991188 
    11001189    public static Op makeOp(Span span, String name) { 
    1101         return new Op(span, PrecedenceMap.ONLY.canon(name), unknownFix, false); 
     1190        return new Op(span, Option.<APIName>none(), 
     1191                      PrecedenceMap.ONLY.canon(name), unknownFix, false); 
    11021192    } 
    11031193 
    11041194    public static Op makeOp(Span span, String name, Fixity fixity) { 
    1105         return new Op(span, PrecedenceMap.ONLY.canon(name), fixity, false); 
     1195        return new Op(span, Option.<APIName>none(), 
     1196                      PrecedenceMap.ONLY.canon(name), fixity, false); 
    11061197    } 
    11071198 
    11081199    public static Op makeOp(Op op, String name) { 
    1109         return new Op(op.getSpan(), PrecedenceMap.ONLY.canon(name), 
     1200        return new Op(op.getSpan(), Option.<APIName>none(), 
     1201                      PrecedenceMap.ONLY.canon(name), 
    11101202                      op.getFixity(), op.isEnclosing()); 
    11111203    } 
    11121204 
    11131205    public static Op makeOpInfix(Span span, String name) { 
    1114         return new Op(span, PrecedenceMap.ONLY.canon(name), infix, false); 
     1206        return new Op(span, Option.<APIName>none(), 
     1207                      PrecedenceMap.ONLY.canon(name), infix, false); 
    11151208    } 
    11161209 
     
    11271220 
    11281221    public static Op makeOpPrefix(Span span, String name) { 
    1129         return new Op(span, PrecedenceMap.ONLY.canon(name), prefix, false); 
     1222        return new Op(span, Option.<APIName>none(), 
     1223                      PrecedenceMap.ONLY.canon(name), prefix, false); 
    11301224    } 
    11311225 
     
    11351229 
    11361230    public static Op makeOpPostfix(Span span, String name) { 
    1137         return new Op(span, PrecedenceMap.ONLY.canon(name), postfix, false); 
     1231        return new Op(span, Option.<APIName>none(), 
     1232                      PrecedenceMap.ONLY.canon(name), postfix, false); 
    11381233    } 
    11391234 
     
    11521247 
    11531248    public static Op makeOpNofix(Op op) { 
    1154         return new Op(op.getSpan(), op.getText(), nofix, op.isEnclosing()); 
     1249        return new Op(op.getSpan(), Option.<APIName>none(), 
     1250                      op.getText(), nofix, op.isEnclosing()); 
    11551251    } 
    11561252 
    11571253    public static Op makeOpMultifix(Op op) { 
    1158         return new Op(op.getSpan(), op.getText(), multifix, op.isEnclosing()); 
     1254        return new Op(op.getSpan(), Option.<APIName>none(), 
     1255                      op.getText(), multifix, op.isEnclosing()); 
    11591256    } 
    11601257 
    11611258    public static Op makeOpEnclosing(Span span, String name) { 
    1162         return new Op(span, PrecedenceMap.ONLY.canon(name), enclosing, false); 
     1259        return new Op(span, Option.<APIName>none(), 
     1260                      PrecedenceMap.ONLY.canon(name), enclosing, false); 
    11631261    } 
    11641262 
    11651263    public static Op makeOpBig(Span span, String name) { 
    1166         return new Op(span, PrecedenceMap.ONLY.canon(name), big, false); 
     1264        return new Op(span, Option.<APIName>none(), 
     1265                      PrecedenceMap.ONLY.canon(name), big, false); 
    11671266    } 
    11681267 
    11691268    public static Op makeOpUnknown(Span span, String name) { 
    1170         return new Op(span, PrecedenceMap.ONLY.canon(name), unknownFix, false); 
     1269        return new Op(span, Option.<APIName>none(), 
     1270                      PrecedenceMap.ONLY.canon(name), unknownFix, false); 
    11711271    } 
    11721272 
     
    11791279            return makeEnclosing(op.getSpan(), left, right); 
    11801280        } else 
    1181             return new Op(op.getSpan(), PrecedenceMap.ONLY.canon("BIG " + op.getText()), big, op.isEnclosing() ); 
     1281            return new Op(op.getSpan(), Option.<APIName>none(), 
     1282                          PrecedenceMap.ONLY.canon("BIG " + op.getText()), big, op.isEnclosing() ); 
    11821283    } 
    11831284 
    11841285    public static StaticParam makeTypeParam(String name) { 
    11851286        Span s = new Span(); 
    1186         return new StaticParam(s, new Id(s, name), 
     1287        return new StaticParam(s, makeId(s, name), 
    11871288                               Collections.<BaseType>emptyList(), 
    11881289                               Option.<Type>none(), false, 
     
    11941295        List<BaseType> supers = new ArrayList<BaseType>(1); 
    11951296        supers.add(makeVarType(sup)); 
    1196         return new StaticParam(s, new Id(s, name), supers, 
     1297        return new StaticParam(s, makeId(s, name), supers, 
    11971298                               Option.<Type>none(), false, 
    11981299                               new KindType()); 
     
    12081309    public static StaticParam makeBoolParam(String name) { 
    12091310        Span s = new Span(); 
    1210         return new StaticParam(s, new Id(s, name), 
     1311        return new StaticParam(s, makeId(s, name), 
    12111312                               Collections.<BaseType>emptyList(), 
    12121313                               Option.<Type>none(), false, 
     
    12161317    public static StaticParam makeDimParam(String name) { 
    12171318        Span s = new Span(); 
    1218         return new StaticParam(s, new Id(s, name), 
     1319        return new StaticParam(s, makeId(s, name), 
    12191320                               Collections.<BaseType>emptyList(), 
    12201321                               Option.<Type>none(), false, 
     
    12241325    public static StaticParam makeUnitParam(String name) { 
    12251326        Span s = new Span(); 
    1226         return new StaticParam(s, new Id(s, name), 
     1327        return new StaticParam(s, makeId(s, name), 
    12271328                               Collections.<BaseType>emptyList(), 
    12281329                               Option.<Type>none(), false, 
     
    12321333    public static StaticParam makeIntParam(String name) { 
    12331334        Span s = new Span(); 
    1234         return new StaticParam(s, new Id(s, name), 
     1335        return new StaticParam(s, makeId(s, name), 
    12351336                               Collections.<BaseType>emptyList(), 
    12361337                               Option.<Type>none(), false, 
     
    12401341    public static StaticParam makeNatParam(String name) { 
    12411342        Span s = new Span(); 
    1242         return new StaticParam(s, new Id(s, name), 
     1343        return new StaticParam(s, makeId(s, name), 
    12431344                               Collections.<BaseType>emptyList(), 
    12441345                               Option.<Type>none(), false, 
     
    12661367    } 
    12671368 
    1268     public static BoolRef makeBoolRef(String string) { 
    1269         return new BoolRef(new Span(), makeId(string)); 
    1270     } 
    12711369 
    12721370    public static BoolArg makeBoolArg(String string) { 
     
    12741372    } 
    12751373 
    1276     public static IntRef makeIntRef(String string) { 
    1277         return new IntRef(new Span(), makeId(string)); 
    1278     } 
    1279  
    12801374    public static IntExpr makeIntVal(String i) { 
    12811375        Span span = new Span(); 
    1282         return new IntBase(span, ExprFactory.makeIntLiteralExpr(span, 
    1283                                                                 new BigInteger(i))); 
     1376        return new IntBase(span, false, 
     1377                           ExprFactory.makeIntLiteralExpr(span, 
     1378                                                          new BigInteger(i))); 
    12841379    } 
    12851380 
     
    13191414 
    13201415    public static VarDecl makeVarDecl(Span span, String name, Expr init) { 
    1321         Id id = new Id(span, name); 
     1416        Id id = makeId(span, name); 
    13221417        FortressUtil.validId(id); 
    13231418        LValue bind = new LValue(span, id, 
     
    13331428            } 
    13341429            public BoolExpr forBoolRef(BoolRef b) { 
    1335                 return new BoolRef(b.getSpan(), true, b.getName()); 
     1430                return makeBoolRef(b.getSpan(), true, b.getName(), b.getLexicalDepth()); 
    13361431            } 
    13371432            public BoolExpr forBoolUnaryOp(BoolUnaryOp b) { 
     
    13391434            } 
    13401435            public BoolExpr forBoolBinaryOp(BoolBinaryOp b) { 
    1341                 return new BoolBinaryOp(b.getSpan(), true, 
     1436                return makeBoolBinaryOp(b.getSpan(), true, 
    13421437                                        b.getLeft(), b.getRight(), b.getOp()); 
    13431438            } 
     
    13811476            } 
    13821477            public IntExpr forIntRef(IntRef i) { 
    1383                 return new IntRef(i.getSpan(), true, i.getName()); 
     1478                return makeIntRef(i.getSpan(), true, i.getName(), i.getLexicalDepth()); 
    13841479            } 
    13851480            public IntExpr forIntBinaryOp(IntBinaryOp i) { 
    1386                 return new IntBinaryOp(i.getSpan(), true, i.getLeft(), 
     1481                return makeIntBinaryOp(i.getSpan(), true, i.getLeft(), 
    13871482                                       i.getRight(), i.getOp()); 
    13881483            } 
     
    14671562    public static Import makeImportStar(APIName api, List<IdOrOpOrAnonymousName> excepts) { 
    14681563        return new ImportStar(makeSpan(api, excepts), Option.<String>none(), api, excepts); 
    1469     } 
    1470  
    1471     public static BoolRef makeBoolRef(BoolRef old, int depth) { 
    1472         return new BoolRef(old.getSpan(), old.isParenthesized(), old.getName(), depth); 
    1473     } 
    1474  
    1475  
    1476     public static IntRef makeIntRef(IntRef old, int depth) { 
    1477         return new IntRef(old.getSpan(), old.isParenthesized(), old.getName(), depth); 
    14781564    } 
    14791565 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/NodeUtil.java

    r3206 r3210  
    543543    public static final Fn<String, Id> StringToIdFn = new Fn<String, Id>() { 
    544544            public Id apply(String x) { 
    545                 return new Id(new Span(), x); 
     545                return NodeFactory.makeId(new Span(), x); 
    546546            } 
    547547        }; 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/OprUtil.java

    r3132 r3210  
    1818package com.sun.fortress.nodes_util; 
    1919 
     20import com.sun.fortress.nodes.APIName; 
    2021import com.sun.fortress.nodes.Fixity; 
    2122import com.sun.fortress.nodes.Node; 
     
    139140    /** Return a new operator with the fixity prepended to the text. */ 
    140141    public static Op decorateOperator(Op o) { 
    141         return new Op(o.getSpan(), fixityDecorator(o.getFixity(), o.getText()), o.getFixity(), o.isEnclosing()); 
     142        return new Op(o.getSpan(), Option.<APIName>none(), 
     143                      fixityDecorator(o.getFixity(), o.getText()), 
     144                      o.getFixity(), o.isEnclosing()); 
    142145    } 
    143146 
     
    148151            return o; 
    149152        } 
    150         return new Op(o.getSpan(), o.getText().substring(i+1), o.getFixity(), o.isEnclosing()); 
     153        return new Op(o.getSpan(), Option.<APIName>none(), 
     154                      o.getText().substring(i+1), 
     155                      o.getFixity(), o.isEnclosing()); 
    151156    } 
    152157 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/Function.rats

    r3206 r3210  
    6262           TupleType _d = (TupleType)d; 
    6363           for (Type argT : _d.getElements()) { 
    64                Id name = new Id(argT.getSpan(), "_"); 
     64               Id name = NodeFactory.makeId(argT.getSpan(), "_"); 
    6565               params.add(NodeFactory.makeParam(argT.getSpan(), mods, name, argT)); 
    6666           } 
    6767           if (_d.getVarargs().isSome()) { 
    6868               Type argT = _d.getVarargs().unwrap(); 
    69                Id name = new Id(argT.getSpan(), "_"); 
     69               Id name = NodeFactory.makeId(argT.getSpan(), "_"); 
    7070               params.add(NodeFactory.makeVarargsParam(argT.getSpan(), mods, name, argT)); 
    7171           } 
     
    7474 
    7575       } else { 
    76            Id name = new Id(d.getSpan(), "_"); 
     76           Id name = NodeFactory.makeId(d.getSpan(), "_"); 
    7777           params.add(NodeFactory.makeParam(d.getSpan(), mods, name, d)); 
    7878       } 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/Identifier.rats

    r3132 r3210  
    5353 
    5454Id Id = 
    55      <FIRST> a1:IdText { yyValue = new Id(createSpan(yyStart,yyCount), a1); }; 
     55     <FIRST> a1:IdText { yyValue = NodeFactory.makeId(createSpan(yyStart,yyCount), a1); }; 
    5656 
    5757/* IdOrOpName ::= Id | OpName */ 
     
    6161Id BindId = 
    6262     Id 
    63    / a1:"_" { yyValue = new Id(createSpan(yyStart,yyCount), a1); }; 
     63   / a1:"_" { yyValue = NodeFactory.makeId(createSpan(yyStart,yyCount), a1); }; 
    6464 
    6565/* BindIdList ::= BindId (w , w BindId)* */ 
     
    101101           yyValue = NodeFactory.makeAPIName(span, bogusId); 
    102102       } else if (FortressUtil.validId(a1)) 
    103            yyValue = NodeFactory.makeAPIName(span, new Id(span, a1)); 
     103           yyValue = NodeFactory.makeAPIName(span, NodeFactory.makeId(span, a1)); 
    104104       else if (FortressUtil.validOp(a1)) { 
    105105           log(span, a1 + " is not a valid Fortress identifier."); 
     
    112112   / a1:idOrKeyword a2s:(dot idOrKeyword)* &(w ellipses) 
    113113     { Span span = createSpan(yyStart,yyCount); 
    114        List<Id> ids = CollectUtil.makeList(IterUtil.compose(new Id(span, a1), 
     114       List<Id> ids = CollectUtil.makeList(IterUtil.compose(NodeFactory.makeId(span, a1), 
    115115                                                       IterUtil.map(a2s.list(), 
    116116                                                                    NodeUtil.StringToIdFn))); 
     
    133133   / a1:idOrKeyword a2s:(dot idOrKeyword)* 
    134134     { Span span = createSpan(yyStart,yyCount); 
    135        List<Id> ids = CollectUtil.makeList(IterUtil.compose(new Id(span, a1), 
     135       List<Id> ids = CollectUtil.makeList(IterUtil.compose(NodeFactory.makeId(span, a1), 
    136136                                                       IterUtil.map(a2s.list(), 
    137137                                                                    NodeUtil.StringToIdFn))); 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/LocalDecl.rats

    r3206 r3210  
    196196   / Unpasting 
    197197     { Span span = createSpan(yyStart,yyCount); 
    198        yyValue = NodeFactory.makeLValue(span, new Id(span, "_")); 
     198       yyValue = NodeFactory.makeLValue(span, NodeFactory.makeId(span, "_")); 
    199199     }; 
    200200 
     
    227227/* CaseClause ::= NoNewlineExpr w => w BlockElems */ 
    228228CaseClause CaseClause = a1:NoNewlineExpr w match w a2:BlockElems 
    229      { yyValue = new CaseClause(createSpan(yyStart,yyCount), a1, a2); }; 
     229     { yyValue = new CaseClause(createSpan(yyStart,yyCount), a1, a2, 
     230                                Option.<FunctionalRef>none()); 
     231     }; 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/MayNewlineHeader.rats

    r3170 r3210  
    122122transient IntExpr IntVal = 
    123123     a1:IntLiteralExpr 
    124      { yyValue = new IntBase(createSpan(yyStart,yyCount), a1); } 
     124     { yyValue = new IntBase(createSpan(yyStart,yyCount), false, a1); } 
    125125   / a1:QualifiedName 
    126      { yyValue = new IntRef(createSpan(yyStart,yyCount), a1); }; 
     126     { yyValue = NodeFactory.makeIntRef(createSpan(yyStart,yyCount), a1); }; 
    127127 
    128128/* IntExpr ::= 
     
    156156           public IntExpr run(IntExpr base) { 
    157157               Op plus = NodeFactory.makeOpInfix(a1.getSpan(), "+"); 
    158                return new IntBinaryOp(createSpan(yyStart,yyCount), 
     158               return NodeFactory.makeIntBinaryOp(createSpan(yyStart,yyCount), 
    159159                                      (IntExpr)base, a1, plus); 
    160160           }}; 
     
    166166           public IntExpr run(IntExpr base) { 
    167167               Op minus = NodeFactory.makeOpInfix(a1.getSpan(), "-"); 
    168                return new IntBinaryOp(createSpan(yyStart,yyCount), 
     168               return NodeFactory.makeIntBinaryOp(createSpan(yyStart,yyCount), 
    169169                                      (IntExpr)base, a1, minus); 
    170170           }}; 
     
    176176           public IntExpr run(IntExpr base) { 
    177177               Op product = NodeFactory.makeOpInfix(a1.getSpan(), " "); 
    178                return new IntBinaryOp(createSpan(yyStart,yyCount), 
     178               return NodeFactory.makeIntBinaryOp(createSpan(yyStart,yyCount), 
    179179                                      (IntExpr)base, a1, product); 
    180180           }}; 
     
    191191                       "An exponentiation should not be immediately followed " + 
    192192                       "by an exponentiation."); 
    193                    return new IntBinaryOp(span, (IntExpr)base, a1, exponent); 
    194                } return new IntBinaryOp(span, (IntExpr)base, a1, exponent); 
     193                   return NodeFactory.makeIntBinaryOp(span, (IntExpr)base, a1, exponent); 
     194               } return NodeFactory.makeIntBinaryOp(span, (IntExpr)base, a1, exponent); 
    195195           }}; 
    196196     }; 
     
    211211     { Span span = createSpan(yyStart,yyCount); 
    212212       Op not = NodeFactory.makeOpPrefix(span, "NOT"); 
    213        yyValue = new BoolUnaryOp(span, a1, not); 
     213       yyValue = new BoolUnaryOp(span, false, a1, not); 
    214214     } 
    215215   / a1:BoolConstraintHead w OR w a2:BoolExpr 
    216216     { Span span = createSpan(yyStart,yyCount); 
    217217       Op op = NodeFactory.makeOpInfix(span, "OR"); 
    218        yyValue = new BoolBinaryOp(span, a1, a2, op); 
     218       yyValue = NodeFactory.makeBoolBinaryOp(span, a1, a2, op); 
    219219     } 
    220220   / a1:BoolConstraintHead w AND w a2:BoolExpr 
    221221     { Span span = createSpan(yyStart,yyCount); 
    222222       Op op = NodeFactory.makeOpInfix(span, "AND"); 
    223        yyValue = new BoolBinaryOp(span, a1, a2, op); 
     223       yyValue = NodeFactory.makeBoolBinaryOp(span, a1, a2, op); 
    224224     } 
    225225   / a1:BoolConstraintHead w IMPLIES w a2:BoolExpr 
    226226     { Span span = createSpan(yyStart,yyCount); 
    227227       Op op = NodeFactory.makeOpInfix(span, "IMPLIES"); 
    228        yyValue = new BoolBinaryOp(span, a1, a2, op); 
     228       yyValue = NodeFactory.makeBoolBinaryOp(span, a1, a2, op); 
    229229     } 
    230230   / a1:BoolConstraintHead w equals w a2:BoolExpr 
    231231     { Span span = createSpan(yyStart,yyCount); 
    232232       Op op = NodeFactory.makeOpInfix(span, "="); 
    233        yyValue = new BoolBinaryOp(span, a1, a2, op); 
     233       yyValue = NodeFactory.makeBoolBinaryOp(span, a1, a2, op); 
    234234     }; 
    235235 
     
    252252               Span span = createSpan(yyStart,yyCount); 
    253253               Op op = NodeFactory.makeOpInfix(span, "OR"); 
    254                return new BoolBinaryOp(span, (BoolConstraint)base, a1, op); 
     254               return NodeFactory.makeBoolBinaryOp(span, (BoolConstraint)base, a1, op); 
    255255           }}; 
    256256     }; 
     
    262262               Span span = createSpan(yyStart,yyCount); 
    263263               Op op = NodeFactory.makeOpInfix(span, "AND"); 
    264                return new BoolBinaryOp(span, (BoolConstraint)base, a1, op); 
     264               return NodeFactory.makeBoolBinaryOp(span, (BoolConstraint)base, a1, op); 
    265265           }}; 
    266266     }; 
     
    272272               Span span = createSpan(yyStart,yyCount); 
    273273               Op op = NodeFactory.makeOpInfix(span, "IMPLIES"); 
    274                return new BoolBinaryOp(span, (BoolConstraint)base, a1, op); 
     274               return NodeFactory.makeBoolBinaryOp(span, (BoolConstraint)base, a1, op); 
    275275           }}; 
    276276     }; 
     
    282282               Span span = createSpan(yyStart,yyCount); 
    283283               Op op = NodeFactory.makeOpInfix(span, ""); 
    284                return new BoolBinaryOp(span, (BoolConstraint)base, a1, op); 
     284               return NodeFactory.makeBoolBinaryOp(span, (BoolConstraint)base, a1, op); 
    285285           }}; 
    286286     }; 
     
    293293transient private BoolExpr BoolVal = 
    294294     a1:"true" 
    295      { yyValue = new BoolBase(createSpan(yyStart,yyCount), true); } 
     295     { yyValue = new BoolBase(createSpan(yyStart,yyCount), false, true); } 
    296296   / a1:"false" 
    297      { yyValue = new BoolBase(createSpan(yyStart,yyCount), false); } 
     297     { yyValue = new BoolBase(createSpan(yyStart,yyCount), false, false); } 
    298298   / a1:QualifiedName 
    299      { yyValue = new BoolRef(createSpan(yyStart,yyCount), a1); }; 
     299     { yyValue = NodeFactory.makeBoolRef(createSpan(yyStart,yyCount), a1); }; 
    300300 
    301301/* BoolExpr ::= 
     
    315315     { Span span = createSpan(yyStart,yyCount); 
    316316       Op not = NodeFactory.makeOpPrefix(span, "NOT"); 
    317        yyValue = new BoolUnaryOp(span, a1, not); 
     317       yyValue = new BoolUnaryOp(span, false, a1, not); 
    318318     }; 
    319319 
     
    331331               Span span = createSpan(yyStart,yyCount); 
    332332               Op op = NodeFactory.makeOpInfix(span, "OR"); 
    333                return new BoolBinaryOp(span, (BoolExpr)base, a1, op); 
     333               return NodeFactory.makeBoolBinaryOp(span, (BoolExpr)base, a1, op); 
    334334           }}; 
    335335     }; 
     
    341341               Span span = createSpan(yyStart,yyCount); 
    342342               Op op = NodeFactory.makeOpInfix(span, "AND"); 
    343                return new BoolBinaryOp(span, (BoolExpr)base, a1, op); 
     343               return NodeFactory.makeBoolBinaryOp(span, (BoolExpr)base, a1, op); 
    344344           }}; 
    345345     }; 
     
    351351               Span span = createSpan(yyStart,yyCount); 
    352352               Op op = NodeFactory.makeOpInfix(span, "IMPLIES"); 
    353                return new BoolBinaryOp(span, (BoolExpr)base, a1, op); 
     353               return NodeFactory.makeBoolBinaryOp(span, (BoolExpr)base, a1, op); 
    354354           }}; 
    355355     }; 
     
    361361               Span span = createSpan(yyStart,yyCount); 
    362362               Op op = NodeFactory.makeOpInfix(span, "="); 
    363                return new BoolBinaryOp(span, (BoolExpr)base, a1, op); 
     363               return NodeFactory.makeBoolBinaryOp(span, (BoolExpr)base, a1, op); 
    364364           }}; 
    365365     }; 
     
    382382     a1:"dimensionless" 
    383383     { Span span = createSpan(yyStart,yyCount); 
    384        yyValue = new UnitRef(span, NodeFactory.makeId(span, a1)); 
     384       yyValue = new UnitRef(span, false, NodeFactory.makeId(span, a1)); 
    385385     } 
    386386   / a1:QualifiedName 
    387      { yyValue = new UnitRef(createSpan(yyStart,yyCount), a1); } 
     387     { yyValue = new UnitRef(createSpan(yyStart,yyCount), false, a1); } 
    388388   / openparen w a1:UnitExpr w closeparen 
    389389     { yyValue = NodeFactory.makeInParentheses(a1); }; 
     
    400400           public UnitExpr run(UnitExpr base) { 
    401401               Op product = NodeFactory.makeOpInfix(a1.getSpan(), " "); 
    402                return new UnitBinaryOp(createSpan(yyStart,yyCount), 
     402               return new UnitBinaryOp(createSpan(yyStart,yyCount), false, 
    403403                                       (UnitExpr)base, a1, product); 
    404404           }}; 
     
    410410           public UnitExpr run(UnitExpr base) { 
    411411               Op quotient = NodeFactory.makeOpInfix(a1.getSpan(), "/"); 
    412                return new UnitBinaryOp(createSpan(yyStart,yyCount), 
     412               return new UnitBinaryOp(createSpan(yyStart,yyCount), false, 
    413413                                       (UnitExpr)base, a1, quotient); 
    414414           }}; 
     
    420420           public UnitExpr run(UnitExpr base) { 
    421421               Op exponent = NodeFactory.makeOpInfix(a1.getSpan(), "^"); 
    422                return new UnitBinaryOp(createSpan(yyStart,yyCount), 
     422               return new UnitBinaryOp(createSpan(yyStart,yyCount), false, 
    423423                                       (UnitExpr)base, a1, exponent); 
    424424           }}; 
     
    559559   / a1:"true" 
    560560     { Span span = createSpan(yyStart,yyCount); 
    561        yyValue = new BoolArg(span, new BoolBase(span, true)); 
     561       yyValue = new BoolArg(span, new BoolBase(span, false, true)); 
    562562     } 
    563563   / a1:"false" 
    564564     { Span span = createSpan(yyStart,yyCount); 
    565        yyValue = new BoolArg(span, new BoolBase(span, false)); 
     565       yyValue = new BoolArg(span, new BoolBase(span, false, false)); 
    566566     } 
    567567   / !(QualifiedName (w DOT / w slash / w per / w DimPostfixOp) / "dimensionless") 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/Method.rats

    r3206 r3210  
    143143       Span span = createSpan(yyStart+9,8); 
    144144       yyValue = FortressUtil.mkFnDecl(createSpan(yyStart,yyCount), mods, 
    145                                        new Id(span,"coerce"),a1, params, a4, a6); 
     145                                       NodeFactory.makeId(span,"coerce"),a1, params, a4, a6); 
    146146     }; 
    147147 
     
    157157       Span span = createSpan(yyStart+9,8); 
    158158       yyValue = FortressUtil.mkFnDecl(createSpan(yyStart,yyCount), mods, 
    159                                        new Id(span, "coerce"), 
     159                                       NodeFactory.makeId(span, "coerce"), 
    160160                                       a1, params, a4); 
    161161    }; 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/MethodParam.rats

    r3132 r3210  
    5151     PlainParam 
    5252   / a1:self 
    53      { yyValue = NodeFactory.makeParam(new Id(createSpan(yyStart,yyCount), 
     53     { yyValue = NodeFactory.makeParam(NodeFactory.makeId(createSpan(yyStart,yyCount), 
    5454                                              "self")); }; 
    5555 
    5656Param AbsParam := 
    5757     a1:self 
    58      { yyValue = NodeFactory.makeParam(new Id(createSpan(yyStart,yyCount), 
     58     { yyValue = NodeFactory.makeParam(NodeFactory.makeId(createSpan(yyStart,yyCount), 
    5959                                              "self")); } 
    6060   / AbsPlainParam; 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/NoNewlineHeader.rats

    r3206 r3210  
    5353       else 
    5454           where = Option.some(a2); 
    55        yyValue = new TraitTypeWhere(createSpan(yyStart,yyCount), 
    56                                     a1, where); 
     55       yyValue = NodeFactory.makeTraitTypeWhere(createSpan(yyStart,yyCount), 
     56                                                a1, where); 
    5757     }; 
    5858 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/Syntax.rats

    r3206 r3210  
    112112          else 
    113113              where = Option.some(whereClauses); 
    114           yyValue = new NonterminalHeader(createSpan(yyStart, yyCount), mod, name, params, staticParams, type1, where); 
     114          yyValue = new NonterminalHeader(createSpan(yyStart, yyCount), mod, name, 
     115                                          params, staticParams, type1, where); 
    115116        }; 
    116117 
  • trunk/ProjectFortress/src/com/sun/fortress/parser_util/FortressUtil.java

    r3206 r3210  
    8888    } 
    8989 
    90     private static Effect effect = new Effect(NodeFactory.makeSpan("singleton")); 
     90    private static Effect effect = NodeFactory.makeEffect(NodeFactory.makeSpan("singleton")); 
    9191 
    9292    public static Effect emptyEffect() { 
  • trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/phases/EscapeRewriter.java

    r3122 r3210  
    127127        String s = removeEscape(result_id.getText()); 
    128128        // TODO is span correct below? 
    129         return new PrefixedSymbol(that.getSpan(), new Id(result_id.getSpan(), s), result_symbol); 
     129        return new PrefixedSymbol(that.getSpan(), NodeFactory.makeId(result_id.getSpan(), s), result_symbol); 
    130130    } 
    131131 
  • trunk/ProjectFortress/src/com/sun/fortress/tests/unit_tests/ConstructorsJUTest.java

    r3200 r3210  
    7777 
    7878    public void testId() { 
    79         Id id1 = new Id(newSpan("cat", 1, 2, 3), "TheIdString"); 
    80         Id id2 = new Id(newSpan("cat", 1, 2, 3), "TheIdString"); 
    81         Id id3 = new Id(newSpan("cat", 1, 2, 999), "TheIdString"); 
    82         Id id4 = new Id(newSpan("cat", 1, 2, 3), "AnotherString"); 
     79        Id id1 = NodeFactory.makeId(newSpan("cat", 1, 2, 3), "TheIdString"); 
     80        Id id2 = NodeFactory.makeId(newSpan("cat", 1, 2, 3), "TheIdString"); 
     81        Id id3 = NodeFactory.makeId(newSpan("cat", 1, 2, 999), "TheIdString"); 
     82        Id id4 = NodeFactory.makeId(newSpan("cat", 1, 2, 3), "AnotherString"); 
    8383        Assert.assertEquals(id1, id2); 
    8484        Assert.assertTrue(id1.equals(id3)); // We ignore Sourceloc for equality 
     
    8888 
    8989    Id newId(String id, int l, int c1, int c2) { 
    90         return new Id(newSpan("somefile", l, c1, c2), id); 
     90        return NodeFactory.makeId(newSpan("somefile", l, c1, c2), id); 
    9191    } 
    9292    Id newId(String id) { 
    93         return new Id(newSpan("somefile", 1, 2, 3), id); 
     93        return NodeFactory.makeId(newSpan("somefile", 1, 2, 3), id); 
    9494    } 
    9595    public void testAPIName() {