Changeset 3122

Show
Ignore:
Timestamp:
11/29/08 22:56:33 (12 months ago)
Author:
sukyoungryu
Message:

[ast refactoring] Renaming AST node fields: Use names (including field names) that are not Java reserved words, nor Scala reserved words, nor Fortress reserved words.

Location:
trunk/ProjectFortress
Files:
52 modified

Legend:

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

    r3120 r3122  
    144144                 *                 | QualifiedName (as Id)? 
    145145                 */ 
    146                 abstract ImportedNames(APIName api); 
     146                abstract ImportedNames(APIName apiName); 
    147147                    /** 
    148148                     * Names must be unqualified. 
    149149                     * e.g.) import Set.{...} except {opr UNION, union} 
    150150                     */ 
    151                     ImportStar(List<IdOrOpOrAnonymousName> except); 
     151                    ImportStar(List<IdOrOpOrAnonymousName> exceptNames); 
    152152                    /** 
    153153                     * e.g.) import Set.{empty, union} 
     
    175175             * Alias must be unqualified. 
    176176             */ 
    177             AliasedAPIName(APIName api, 
     177            AliasedAPIName(APIName apiName, 
    178178                           Option<Id> alias = Option.<Id>none()); 
    179179            /** 
     
    192192                                         List<TraitTypeWhere> extendsClause 
    193193                                             = Collections.<TraitTypeWhere>emptyList(), 
    194                                          Option<WhereClause> where 
     194                                         Option<WhereClause> whereClause 
    195195                                             = Option.<WhereClause>none(), 
    196196                                         List<Decl> decls) 
     
    239239                     *       end 
    240240                     */ 
    241                     TraitDecl(List<BaseType> excludes = Collections.<BaseType>emptyList(), 
    242                               Option<List<BaseType>> comprises 
     241                    TraitDecl(List<BaseType> excludesClause = Collections.<BaseType>emptyList(), 
     242                              Option<List<BaseType>> comprisesClause 
    243243                                  = Option.<List<BaseType>>none()) implements Generic; 
    244244                    /** 
     
    340340                       Option<Type> returnType = Option.<Type>none(), 
    341341                       Option<List<BaseType>> throwsClause = Option.<List<BaseType>>none(), 
    342                        Option<WhereClause> where = Option.<WhereClause>none(), 
     342                       Option<WhereClause> whereClause = Option.<WhereClause>none(), 
    343343                       Option<Contract> contract = Option.<Contract>none(), 
    344344                       Id unambiguousName = new Id(in_span, "FN$"+in_span.toString()), 
     
    374374                     * e.g.) dim Length SI_unit meter meters m 
    375375                     */ 
    376                     DimDecl(Id dim, Option<Type> derived = Option.<Type>none(), 
    377                             Option<Id> default = Option.<Id>none()); 
     376                    DimDecl(Id dimId, Option<Type> derived = Option.<Type>none(), 
     377                            Option<Id> defaultId = Option.<Id>none()); 
    378378                    /** 
    379379                     * unit declaration 
     
    383383                    UnitDecl(boolean si_unit = false, 
    384384                             List<Id> units = Collections.<Id>emptyList(), 
    385                              Option<Type> dim = Option.<Type>none(), 
    386                              Option<Expr> def); 
     385                             Option<Type> dimType = Option.<Type>none(), 
     386                             Option<Expr> defExpr); 
    387387                /** 
    388388                 * test declaration 
     
    408408                          List<StaticParam> staticParams 
    409409                              = Collections.<StaticParam>emptyList(), 
    410                           Type type); 
     410                          Type typeDef); 
    411411                /** 
    412412                 * grammar declaration 
    413413                 * Names (but not extends elements) must be unqualified. 
    414414                 */ 
    415                 abstract GrammarDecl(Id name, List<Id> extends); 
     415                abstract GrammarDecl(Id name, List<Id> extendsClause); 
    416416                    /** 
    417417                     * grammar definition 
    418418                     */ 
    419419                    GrammarDef(List<GrammarMemberDecl> members, List<TransformerDecl> transformers, 
    420                            boolean native); 
     420                               boolean nativeDef); 
    421421                /** 
    422422                 * grammar member (nonterminal or terminal) declaration 
     
    445445                              List<StaticParam> staticParams 
    446446                                = Collections.<StaticParam>emptyList(), 
    447                               Option<Type> type, 
     447                              Option<Type> paramType, 
    448448                              Option<WhereClause> whereClause 
    449449                                = Option.<WhereClause>none()); 
     
    452452             * nonterminal parameter 
    453453             */ 
    454             NonterminalParameter(Id name, BaseType type); 
     454            NonterminalParameter(Id name, BaseType paramType); 
    455455 
    456456            /** 
     
    464464                          TransformerDecl transformer); 
    465465 
    466                 SuperSyntaxDef(Id nonterminal, Id grammar); 
     466                SuperSyntaxDef(Id nonterminal, Id grammarId); 
    467467 
    468468            /** 
     
    605605                     * character interval 
    606606                     */ 
    607                     CharacterInterval(String begin, String end); 
     607                    CharacterInterval(String beginSymbol, String endSymbol); 
    608608            /** 
    609609             * left-hand side of variable declaration or value parameter 
     
    611611            abstract Binding(Id name, 
    612612                             List<Modifier> mods = Collections.<Modifier>emptyList(), 
    613                              Option<Type> type = Option.<Type>none()) implements Lhs; 
     613                             Option<Type> idType = Option.<Type>none()) implements Lhs; 
    614614                /** 
    615615                 * left-hand side of variable declaration 
     
    896896                       Option<Type> returnType 
    897897                           = Option.<Type>none(), 
    898                        Option<WhereClause> where 
     898                       Option<WhereClause> whereClause 
    899899                           = Option.<WhereClause>none(), 
    900900                       Option<List<BaseType>> throwsClause 
     
    13701370                    _RewriteGenericArrowType(List<StaticParam> staticParams 
    13711371                                              = Collections.<StaticParam>emptyList(), 
    1372                                              Option<WhereClause> where 
     1372                                             Option<WhereClause> whereClause 
    13731373                                              = Option.<WhereClause>none()); 
    13741374                /** 
     
    20192019             */ 
    20202020            TraitTypeWhere(BaseType type, 
    2021                            Option<WhereClause> where 
     2021                           Option<WhereClause> whereClause 
    20222022                               = Option.<WhereClause>none()); 
    20232023            /** 
     
    21392139                             List<Param> params, 
    21402140                             Option<Type> returnType, 
    2141                              Option<WhereClause> where); 
     2141                             Option<WhereClause> whereClause); 
    21422142 
    21432143end; 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/Disambiguator.java

    r2729 r3122  
    217217                GrammarDef og = e.getValue().ast(); 
    218218                List<GrammarIndex> ls = new LinkedList<GrammarIndex>(); 
    219                 for (Id n: og.getExtends()) { 
     219                for (Id n: og.getExtendsClause()) { 
    220220                    GrammarIndex g = grammars.get(n.getText()); 
    221221                    if ( g == null ){ 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/IndexBuilder.java

    r3107 r3122  
    343343                    ast.getParams(), 
    344344                    ast.getThrowsClause(), 
    345                     ast.getWhere()); 
     345                    ast.getWhereClause()); 
    346346            constructor = Option.some(c); 
    347347            functions.add(name, c); 
     
    436436    private void buildDimension(DimDecl ast, 
    437437            Map<Id, Dimension> dimensions) { 
    438         dimensions.put(ast.getDim(), new Dimension(ast)); 
     438        dimensions.put(ast.getDimId(), new Dimension(ast)); 
    439439    } 
    440440 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/DesugaringVisitor.java

    r3115 r3122  
    245245                obj = ExprFactory.makeVarRef(obj, obj.getExprType(), 
    246246                                             mangleName(obj.getVar())); 
    247                 body = (Expr)forFieldRefOnly(rewrite, field.getType(), 
     247                body = (Expr)forFieldRefOnly(rewrite, field.getIdType(), 
    248248                                             obj, rewrite.getField()); 
    249249            } else { 
     
    255255        if ( inTrait ) 
    256256            return NodeFactory.makeFnDecl(span, mods, field.getName(), 
    257                                           field.getType(), Option.<Expr>none()); 
     257                                          field.getIdType(), Option.<Expr>none()); 
    258258        else 
    259259            return NodeFactory.makeFnDecl(span, mods, field.getName(), 
    260                                          field.getType(), body); 
     260                                         field.getIdType(), body); 
    261261    } 
    262262 
     
    264264        Span span = field.getSpan(); 
    265265        Type voidType = NodeFactory.makeVoidType(span); 
    266         Option<Type> ty = field.getType(); 
     266        Option<Type> ty = field.getIdType(); 
    267267        List<Modifier> mods = new LinkedList<Modifier>(); 
    268268        for (Modifier mod : field.getMods()) { 
     
    581581        return forObjectDeclOnly(that, that.getMods(), that.getName(), 
    582582                                 that.getStaticParams(), that.getExtendsClause(), 
    583                                  that.getWhere(), gettersAndDecls, params_result, 
     583                                 that.getWhereClause(), gettersAndDecls, params_result, 
    584584                                 that.getThrowsClause(), contract_result); 
    585585    } 
     
    603603        return forTraitDeclOnly(that, that.getMods(), that.getName(), 
    604604                                that.getStaticParams(), that.getExtendsClause(), 
    605                                 that.getWhere(), gettersAndDecls, 
    606                                 that.getExcludes(), that.getComprises()); 
     605                                that.getWhereClause(), gettersAndDecls, 
     606                                that.getExcludesClause(), that.getComprisesClause()); 
    607607    } 
    608608 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/DottedMethodRewriteVisitor.java

    r3098 r3122  
    5151        return super.forObjectDeclOnly(that, that.getMods(), that.getName(), 
    5252                                       that.getStaticParams(), 
    53                                        that.getExtendsClause(), that.getWhere(), 
     53                                       that.getExtendsClause(), that.getWhereClause(), 
    5454                                       decls_result, that.getParams(), 
    5555                                       that.getThrowsClause(), that.getContract()); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/FreeNameCollector.java

    r3102 r3122  
    10141014        @Override 
    10151015        public void forDimDecl(DimDecl that) { 
    1016             decledNames.add(that.getDim()); 
     1016            decledNames.add(that.getDimId()); 
    10171017        } 
    10181018 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/MutableVarRefRewriteVisitor.java

    r3102 r3122  
    9494        return super.forObjectDeclOnly(that, that.getMods(), that.getName(), 
    9595                                       that.getStaticParams(), 
    96                                        that.getExtendsClause(), that.getWhere(), 
     96                                       that.getExtendsClause(), that.getWhereClause(), 
    9797                                       decls_result, that.getParams(), 
    9898                                       that.getThrowsClause(), that.getContract()); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/ObjectExpressionVisitor.java

    r3112 r3122  
    881881        VarRef varRef = ExprFactory.makeVarRef( param.getSpan(), 
    882882                                                param.getName(), 
    883                                                 param.getType() ); 
     883                                                param.getIdType() ); 
    884884        return varRef; 
    885885    } 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/disambiguator/ExprDisambiguator.java

    r3098 r3122  
    670670                                v.recurOnListOfStaticParam(that.getStaticParams()), 
    671671                                extendsClause, 
    672                                 v.recurOnOptionOfWhereClause(that.getWhere()), 
     672                                v.recurOnOptionOfWhereClause(that.getWhereClause()), 
    673673                                v.recurOnListOfDecl(that.getDecls()), 
    674                                 v.recurOnListOfBaseType(that.getExcludes()), 
    675                                 v.recurOnOptionOfListOfBaseType(that.getComprises())); 
     674                                v.recurOnListOfBaseType(that.getExcludesClause()), 
     675                                v.recurOnOptionOfListOfBaseType(that.getComprisesClause())); 
    676676    } 
    677677 
     
    718718                                 v.recurOnListOfStaticParam(that.getStaticParams()), 
    719719                                 extendsClause, 
    720                                  v.recurOnOptionOfWhereClause(that.getWhere()), 
     720                                 v.recurOnOptionOfWhereClause(that.getWhereClause()), 
    721721                                 v.recurOnListOfDecl(that.getDecls()), 
    722722                                 v.recurOnOptionOfListOfParam(that.getParams()), 
     
    749749                            v.recurOnOptionOfType(that.getReturnType()), 
    750750                            v.recurOnOptionOfListOfBaseType(that.getThrowsClause()), 
    751                             v.recurOnOptionOfWhereClause(that.getWhere()), 
     751                            v.recurOnOptionOfWhereClause(that.getWhereClause()), 
    752752                            v.recurOnOptionOfContract(that.getContract()), 
    753753                            that.getUnambiguousName(), 
     
    803803                             v.recurOnListOfParam(that.getParams()), 
    804804                             v.recurOnOptionOfType(that.getReturnType()), 
    805                              v.recurOnOptionOfWhereClause(that.getWhere()), 
     805                             v.recurOnOptionOfWhereClause(that.getWhereClause()), 
    806806                             v.recurOnOptionOfListOfBaseType(that.getThrowsClause()), 
    807807                             (Expr) that.getBody().accept(v)); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/disambiguator/TopLevelEnv.java

    r3118 r3122  
    707707                Boolean implib = true; 
    708708                for( AliasedAPIName api : that.getApis() ) { 
    709                     APIName name = api.getApi(); 
     709                    APIName name = api.getApiName(); 
    710710                    if(name.getText().equals(WellKnownNames.fortressLibrary)) 
    711711                        implib=false; 
     
    718718            @Override 
    719719            public Boolean forImportNames(ImportNames that) { 
    720                 APIName name = that.getApi(); 
     720                APIName name = that.getApiName(); 
    721721 
    722722                // TODO Handle these aliased names more thoroughly 
     
    737737            @Override 
    738738            public Boolean forImportStar(ImportStar that) { 
    739                 APIName name = that.getApi(); 
     739                APIName name = that.getApiName(); 
    740740                if( exceptions.containsKey(name) ) 
    741                     exceptions.get(name).addAll(that.getExcept()); 
     741                    exceptions.get(name).addAll(that.getExceptNames()); 
    742742                else 
    743                     exceptions.put(name, new HashSet<IdOrOpOrAnonymousName>(that.getExcept())); 
     743                    exceptions.put(name, new HashSet<IdOrOpOrAnonymousName>(that.getExceptNames())); 
    744744                return !name.getText().equals(WellKnownNames.fortressLibrary); 
    745745            } 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/disambiguator/TypeDisambiguator.java

    r3114 r3122  
    142142                v.recurOnListOfStaticParam(that.getStaticParams()), 
    143143                v.recurOnListOfTraitTypeWhere(that.getExtendsClause()), 
    144                 v.recurOnOptionOfWhereClause(that.getWhere()), 
     144                v.recurOnOptionOfWhereClause(that.getWhereClause()), 
    145145                v.recurOnListOfDecl(that.getDecls()), 
    146                 v.recurOnListOfBaseType(that.getExcludes()), 
    147                 v.recurOnOptionOfListOfBaseType(that.getComprises())); 
     146                v.recurOnListOfBaseType(that.getExcludesClause()), 
     147                v.recurOnOptionOfListOfBaseType(that.getComprisesClause())); 
    148148    } 
    149149 
     
    160160                v.recurOnListOfStaticParam(that.getStaticParams()), 
    161161                v.recurOnListOfTraitTypeWhere(that.getExtendsClause()), 
    162                 v.recurOnOptionOfWhereClause(that.getWhere()), 
     162                v.recurOnOptionOfWhereClause(that.getWhereClause()), 
    163163                v.recurOnListOfDecl(that.getDecls()), 
    164164                v.recurOnOptionOfListOfParam(that.getParams()), 
     
    181181                v.recurOnOptionOfType(that.getReturnType()), 
    182182                v.recurOnOptionOfListOfBaseType(that.getThrowsClause()), 
    183                 v.recurOnOptionOfWhereClause(that.getWhere()), 
     183                v.recurOnOptionOfWhereClause(that.getWhereClause()), 
    184184                v.recurOnOptionOfContract(that.getContract()), 
    185185                that.getUnambiguousName(), 
     
    441441        List<Id> ls = new LinkedList<Id>(); 
    442442        Collection<GrammarIndex> gs = new LinkedList<GrammarIndex>(); 
    443         for (Id name: that.getExtends()) { 
     443        for (Id name: that.getExtendsClause()) { 
    444444            Id nname = handleGrammarName(name); 
    445445            ls.add(nname); 
     
    470470        Id name = handleGrammarName(name_result); 
    471471 
    472         GrammarDef disambiguatedGrammar = new GrammarDef(that.getSpan(), name, p.first(), members_result, transformers, that.isNative()); 
     472        GrammarDef disambiguatedGrammar = new GrammarDef(that.getSpan(), name, p.first(), members_result, transformers, that.isNativeDef()); 
    473473 
    474474        List<StaticError> newErrs = new ArrayList<StaticError>(); 
     
    536536        TypeDisambiguator v = this.extend(that.getStaticParams()); 
    537537 
    538 //        System.err.println("T: "+that.getType()); 
    539  
    540         Option<Type> t = v.recurOnOptionOfType(that.getType()); 
     538//        System.err.println("T: "+that.getParamType()); 
     539 
     540        Option<Type> t = v.recurOnOptionOfType(that.getParamType()); 
    541541//        System.err.println("t: "+t); 
    542542        return forNonterminalHeaderOnly(that, 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/environments/TopLevelEnvGen.java

    r3082 r3122  
    232232                ImportApi importApi = (ImportApi) imports; 
    233233                for (AliasedAPIName api : importApi.getApis()) { 
    234                     importedApiNames.add(NodeUtil.nameString(api.getApi())); 
     234                    importedApiNames.add(NodeUtil.nameString(api.getApiName())); 
    235235                } 
    236236            } else if (imports instanceof ImportedNames) { 
    237237                ImportedNames importNames = (ImportedNames) imports; 
    238                 importedApiNames.add(NodeUtil.nameString(importNames.getApi())); 
     238                importedApiNames.add(NodeUtil.nameString(importNames.getApiName())); 
    239239            } else { 
    240240                throw StaticError.make("Unrecognized import type in bytecode generation", imports); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/index/CompilationUnitIndex.java

    r2699 r3122  
    7171            _import.accept(new NodeAbstractVisitor_void() { 
    7272                public void forImportedNames(ImportedNames that) { 
    73                     result.add(that.getApi()); 
     73                    result.add(that.getApiName()); 
    7474                } 
    7575            }); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/index/FieldGetterMethod.java

    r3115 r3122  
    7474        @Override 
    7575        public Type getReturnType() { 
    76                 return _ast.getType().unwrap(); 
     76                return _ast.getIdType().unwrap(); 
    7777        } 
    7878 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/index/FieldSetterMethod.java

    r3115 r3122  
    6161                                new Id(_ast.getSpan(), "fakeParamForImplicitSetter"), 
    6262                                Collections.<Modifier>emptyList(), 
    63                                 _ast.getType(), 
     63                                _ast.getIdType(), 
    6464                                Option.<Expr>none()); 
    6565                return Collections.singletonList(p); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/index/TypeAliasIndex.java

    r2455 r3122  
    3838    public List<StaticParam> staticParameters() { return _ast.getStaticParams(); } 
    3939     
    40     public Type type() { return _ast.getType(); } 
     40    public Type type() { return _ast.getTypeDef(); } 
    4141 
    4242        @Override 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/FnTypeEnv.java

    r3107 r3122  
    8686                if( param.getName().equals(IndexBuilder.SELF_NAME) ) { 
    8787                    if( param.getVarargsType().isNone() ) 
    88                                 self_type_ = param.getType(); 
     88                                self_type_ = param.getIdType(); 
    8989                        else 
    9090                                InterpreterBug.bug("self cannot be a varargs."); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/MethodTypeEnv.java

    r3115 r3122  
    7171                                            Types.VOID, 
    7272                                             // all types have been filled in at this point 
    73                                             binding.getType().unwrap())); 
     73                                            binding.getIdType().unwrap())); 
    7474 
    7575            } else { // method instanceof FieldSetterMethod 
     
    7878 
    7979                overloads.add(makeArrowType(binding.getSpan(), 
    80                                             binding.getType().unwrap(), 
     80                                            binding.getIdType().unwrap(), 
    8181                                            // all types have been filled in at this point 
    8282                                            Types.VOID)); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/ObjectTypeEnv.java

    r3099 r3122  
    9494                                                     NodeFactory.makeTraitType(_var, TypeEnv.staticParamsToArgs(decl.getStaticParams())), 
    9595                                                     decl.getStaticParams(), 
    96                                                      decl.getWhere()); 
     96                                                     decl.getWhereClause()); 
    9797            } 
    9898        } 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeChecker.java

    r3112 r3122  
    132132        } 
    133133        static private Type getTypeOfLValue(LValue lval) { 
    134             return lval.getType().unwrap(); 
     134            return lval.getIdType().unwrap(); 
    135135        } 
    136136        private static boolean isExprMI(MathItem item) { 
     
    152152 
    153153                for (LValue binding: bindings) { 
    154                         if (binding.getType().isSome()) { 
    155                                 results.add(binding.getType().unwrap()); 
     154                        if (binding.getIdType().isSome()) { 
     155                                results.add(binding.getIdType().unwrap()); 
    156156                        } else 
    157157                                bug(binding, "Missing type."); 
     
    249249                                            if( arg1.getVarargsType().isNone() ) { 
    250250                                                        typeCount++; 
    251                                                         arg0.add(arg1.getType().unwrap()); 
     251                                                        arg0.add(arg1.getIdType().unwrap()); 
    252252                                                        return arg0; 
    253253                                                } 
     
    619619                                                                        public Type forParam(Param that) { 
    620620                                                                            if ( that.getVarargsType().isNone() ) 
    621                                                                                 return that.getType().unwrap(); 
     621                                                                                return that.getIdType().unwrap(); 
    622622                                                                            else 
    623623                                                                                return that.getVarargsType().unwrap(); 
     
    630630                                                        DeclaredVariable var = (DeclaredVariable)field; 
    631631                                                        LValue bind = var.ast(); 
    632                                                         return Option.some(bind.getType().unwrap()); 
     632                                                        return Option.some(bind.getIdType().unwrap()); 
    633633                                                } 
    634634                                                else { 
     
    14051405                                } 
    14061406                                else { 
    1407                                         Type lhs_type = that.getType().unwrap(); 
     1407                                        Type lhs_type = that.getIdType().unwrap(); 
    14081408                                        return Pair.make(checkSubtype(rhs_type, 
    14091409                                                        lhs_type, that, 
     
    14211421                                } 
    14221422                                else { 
    1423                                         Type lhs_type = that.getType().unwrap(); 
     1423                                        Type lhs_type = that.getIdType().unwrap(); 
    14241424                                        return Pair.make(checkSubtype(rhs_type, 
    14251425                                                        lhs_type, that, 
     
    22812281                    return super.forFnDecl(that); 
    22822282 
    2283                 TypeChecker newChecker = this.extend(that.getStaticParams(), that.getParams(), that.getWhere()); 
     2283                TypeChecker newChecker = this.extend(that.getStaticParams(), that.getParams(), that.getWhereClause()); 
    22842284 
    22852285                TypeCheckerResult result = new TypeCheckerResult(that); 
     
    23222322                                             returnType, 
    23232323                                             that.getThrowsClause(), 
    2324                                              that.getWhere(), 
     2324                                             that.getWhereClause(), 
    23252325                                             contract, 
    23262326                                             Option.<Expr>some((Expr)bodyResult.ast())); 
     
    23582358                for(Param p: that.getParams()){ 
    23592359                    if(p.getVarargsType().isNone()){ 
    2360                         if(p.getType().isSome()){ 
    2361                             dlist.add(p.getType().unwrap()); 
     2360                        if(p.getIdType().isSome()){ 
     2361                            dlist.add(p.getIdType().unwrap()); 
    23622362                        } 
    23632363                        else{ 
     
    24192419                                that.getParams(), 
    24202420                                (Option<Type>)TypeCheckerResult.astFromResult(returnType_result), 
    2421                                 that.getWhere(), 
     2421                                that.getWhereClause(), 
    24222422                                (Option<List<BaseType>>)TypeCheckerResult.astFromResults(throwsClause_result), 
    24232423                                (Expr)body_result.ast() ); 
     
    33453345        @Override 
    33463346        public TypeCheckerResult forObjectDecl(final ObjectDecl that) { 
    3347                 TypeChecker checker_with_sparams = this.extend(that.getStaticParams(), that.getParams(), that.getWhere()); 
     3347                TypeChecker checker_with_sparams = this.extend(that.getStaticParams(), that.getParams(), that.getWhereClause()); 
    33483348                List<TypeCheckerResult> modsResult = checker_with_sparams.recurOnListOfModifier(that.getMods()); 
    33493349                TypeCheckerResult nameResult = that.getName().accept(checker_with_sparams); 
     
    33513351                TypeCheckerResult whereResult; 
    33523352                Option<WhereClause> where; 
    3353                 if ( that.getWhere().isSome() ) { 
    3354                         whereResult = that.getWhere().unwrap().accept(checker_with_sparams); 
     3353                if ( that.getWhereClause().isSome() ) { 
     3354                        whereResult = that.getWhereClause().unwrap().accept(checker_with_sparams); 
    33553355                        where = Option.some((WhereClause)whereResult.ast()); 
    33563356                } else { 
     
    39183918        @Override 
    39193919        public TypeCheckerResult forTraitDecl(final TraitDecl that) { 
    3920                 TypeChecker checker_with_sparams = this.extend(that.getStaticParams(), that.getWhere()); 
     3920                TypeChecker checker_with_sparams = this.extend(that.getStaticParams(), that.getWhereClause()); 
    39213921 
    39223922                List<TypeCheckerResult> modsResult = checker_with_sparams.recurOnListOfModifier(that.getMods()); 
     
    39243924                TypeCheckerResult whereResult; 
    39253925                Option<WhereClause> where; 
    3926                 if ( that.getWhere().isSome() ) { 
    3927                         whereResult = that.getWhere().unwrap().accept(checker_with_sparams); 
     3926                if ( that.getWhereClause().isSome() ) { 
     3927                        whereResult = that.getWhereClause().unwrap().accept(checker_with_sparams); 
    39283928                        where = Option.some((WhereClause)whereResult.ast()); 
    39293929                } else { 
     
    39313931                        where = Option.<WhereClause>none(); 
    39323932                } 
    3933                 List<TypeCheckerResult> excludesResult = checker_with_sparams.recurOnListOfBaseType(that.getExcludes()); 
     3933                List<TypeCheckerResult> excludesResult = checker_with_sparams.recurOnListOfBaseType(that.getExcludesClause()); 
    39343934 
    39353935                // Verify that this trait only extends other traits 
     
    39403940                                        }})); 
    39413941 
    3942                 Option<List<TypeCheckerResult>> comprisesResult =  checker_with_sparams.recurOnOptionOfListOfBaseType(that.getComprises()); 
     3942                Option<List<TypeCheckerResult>> comprisesResult =  checker_with_sparams.recurOnOptionOfListOfBaseType(that.getComprisesClause()); 
    39433943 
    39443944                TypeChecker method_checker = checker_with_sparams; 
     
    43234323                if (lhs.size() == 1) { // We have a single variable binding, not a tuple binding 
    43244324                        LValue var = lhs.get(0); 
    4325                         Option<Type> varType = var.getType(); 
     4325                        Option<Type> varType = var.getIdType(); 
    43264326                        if (varType.isSome()) { 
    43274327                                if (initResult.type().isNone()) { 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeEnv.java

    r3114 r3122  
    131131    protected static Option<Type> typeFromParam(Param param) { 
    132132        if (param.getVarargsType().isNone()) { 
    133             return param.getType(); 
     133            return param.getIdType(); 
    134134        } else { // a varargs param 
    135135            // Convert the declared varargs type into a reference to 
     
    148148                                                       decl.getThrowsClause()), 
    149149                                            decl.getStaticParams(), 
    150                                             decl.getWhere()); 
     150                                            decl.getWhereClause()); 
    151151    } 
    152152 
     
    161161        for (Param param: params) { 
    162162            if (param.getVarargsType().isNone()) { 
    163                 Option<Type> maybeType = param.getType(); 
     163                Option<Type> maybeType = param.getIdType(); 
    164164 
    165165                if (maybeType.isSome()) { // An explicit type is declared. 
     
    442442        public BindingLookup(LValue binding) { 
    443443            var = binding.getName(); 
    444             type = binding.getType(); 
     444            type = binding.getIdType(); 
    445445            mods = binding.getMods(); 
    446446            mutable = binding.isMutable(); 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/Driver.java

    r3096 r3122  
    295295            } else if (i instanceof ImportedNames) { 
    296296                ImportedNames ix = (ImportedNames) i; 
    297                 APIName source = ix.getApi(); 
     297                APIName source = ix.getApiName(); 
    298298                String from_apiname = NodeUtil.nameString(source); 
    299299 
     
    324324                    /* All names BUT excepts, as they are listed. */ 
    325325                    final List<IdOrOpOrAnonymousName> excepts = ((ImportStar) ix) 
    326                             .getExcept(); 
     326                            .getExceptNames(); 
    327327                    final Set<String> except_names = Useful.applyToAllInserting( 
    328328                            excepts, 
     
    436436                List<AliasedAPIName> apis = ix.getApis(); 
    437437                for (AliasedAPIName adi : apis) { 
    438                     APIName id = adi.getApi(); 
     438                    APIName id = adi.getApiName(); 
    439439                    ensureApiImplemented(fr, linker, pile, id); 
    440440                } 
     
    442442            else if (i instanceof ImportedNames) { 
    443443                ImportedNames ix = (ImportedNames) i; 
    444                 APIName source = ix.getApi(); 
     444                APIName source = ix.getApiName(); 
    445445                ensureApiImplemented(fr, linker, pile, source); 
    446446            } 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/BuildEnvironments.java

    r3112 r3122  
    674674        LValue lvb = lhs.get(0); 
    675675 
    676           Option<Type> type = lvb.getType(); 
     676          Option<Type> type = lvb.getIdType(); 
    677677          Id name = lvb.getName(); 
    678678          String sname = NodeUtil.nameString(name); 
     
    749749 
    750750         { 
    751                 Option<Type> type = lvb.getType(); 
     751                Option<Type> type = lvb.getIdType(); 
    752752                Id name = lvb.getName(); 
    753753                String sname = NodeUtil.nameString(name); 
     
    875875 
    876876        EvalType et; 
    877         if ( x.getWhere().isSome() ) 
    878             et = processWhereClauses(x.getWhere().unwrap(), interior); 
     877        if ( x.getWhereClause().isSome() ) 
     878            et = processWhereClauses(x.getWhereClause().unwrap(), interior); 
    879879        else 
    880880            et = new EvalType(interior); 
    881881 
    882882        List<FType> extl = et.getFTypeListFromList(extends_); 
    883         List<FType> excl = et.getFTypeListFromList(x.getExcludes()); 
     883        List<FType> excl = et.getFTypeListFromList(x.getExcludesClause()); 
    884884        ftt.setExtendsAndExcludes(extl, excl, interior); 
    885         Option<List<BaseType>> comprs = x.getComprises(); 
     885        Option<List<BaseType>> comprs = x.getComprisesClause(); 
    886886        if (!comprs.isNone()) { 
    887887            List<FType> c = et.getFTypeListFromList(comprs.unwrap()); 
     
    960960    public void finishObjectTrait(ObjectDecl x, FTypeObject ftt) { 
    961961        List<BaseType> extends_ = NodeUtil.getTypes(x.getExtendsClause()); 
    962         finishObjectTrait(extends_, null, x.getWhere(), ftt, containing, x); 
     962        finishObjectTrait(extends_, null, x.getWhereClause(), ftt, containing, x); 
    963963    } 
    964964 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/BuildLetEnvironments.java

    r3082 r3122  
    128128            EvalType eval_type = new EvalType(containing); 
    129129            for (LValue lvb : lhs) { 
    130                 if (lvb.isMutable() && lvb.getType().isSome()) { 
     130                if (lvb.isMutable() && lvb.getIdType().isSome()) { 
    131131                    FValue fv = lvb.accept(new_eval); 
    132                     FType fvt = lvb.getType().unwrap().accept(eval_type); 
     132                    FType fvt = lvb.getIdType().unwrap().accept(eval_type); 
    133133                    containing.putVariable(fv.getString(),fvt); 
    134134                } else { 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/BuildTopLevelEnvironments.java

    r3112 r3122  
    8888        List<AliasedAPIName> apis = x.getApis(); 
    8989        for (AliasedAPIName aliased_api : apis) { 
    90             APIName imported = aliased_api.getApi(); 
     90            APIName imported = aliased_api.getApiName(); 
    9191            importAPIName(imported); 
    9292        } 
     
    9696  @Override 
    9797    public Boolean forImportNames(ImportNames x) { 
    98         APIName imported = x.getApi(); 
     98        APIName imported = x.getApiName(); 
    9999        importAPIName(imported); 
    100100        return null; 
     
    103103    @Override 
    104104    public Boolean forImportStar(ImportStar x) { 
    105         APIName imported = x.getApi(); 
     105        APIName imported = x.getApiName(); 
    106106        importAPIName(imported); 
    107107        return null; 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/EvalType.java

    r3114 r3122  
    171171            FType ptype; 
    172172            if (in_p.getVarargsType().isNone()) { 
    173                 Option<Type> type = in_p.getType(); 
     173                Option<Type> type = in_p.getIdType(); 
    174174                ptype = e.getFTypeFromOption(type, FTypeTop.ONLY); 
    175175            } 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/EvaluatorBase.java

    r3107 r3122  
    208208            try { 
    209209                if (p.getVarargsType().isNone()) { 
    210                     Option<Type> t = p.getType(); 
     210                    Option<Type> t = p.getIdType(); 
    211211                    // why can't we just skip if missing? 
    212212                    if (t.isNone()) { 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/LHSEvaluator.java

    r3111 r3122  
    144144    public Voidoid forLValue(LValue x) { 
    145145        Id name = x.getName(); 
    146         Option<Type> type = x.getType(); 
     146        Option<Type> type = x.getIdType(); 
    147147        String s = NodeUtil.nameString(name); 
    148148        boolean mutable = x.isMutable(); 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/values/FGenericFunction.java

    r3102 r3122  
    193193 
    194194    protected Option<WhereClause> getWhere() { 
    195         return fndef.getWhere(); 
     195        return fndef.getWhereClause(); 
    196196    } 
    197197 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/values/SingleFcn.java

    r3102 r3122  
    147147    static public List<FType> createSymbolicInstantiation(Environment bte, Applicable ap, HasAt location) throws Error { 
    148148        List<StaticParam> tpl = ap.getStaticParams(); 
    149         Option<WhereClause> wcl = ap.getWhere(); 
     149        Option<WhereClause> wcl = ap.getWhereClause(); 
    150150 
    151151        // The (possibly multiple and interrelated) symbolic 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/glue/NativeApp.java

    r3102 r3122  
    105105    } 
    106106    public IdOrOpOrAnonymousName getName() { return a.getName(); } 
    107     public Option<WhereClause> getWhere() { return a.getWhere(); } 
     107    public Option<WhereClause> getWhereClause() { return a.getWhereClause(); } 
    108108    public String at() { return a.at(); } 
    109109    public String stringName() { return a.stringName(); } 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/rewrite/DesugarerVisitor.java

    r3112 r3122  
    792792    public Node forTraitTypeWhere(TraitTypeWhere vre) { 
    793793        lexicalNestingDepth++; 
    794         Option<WhereClause> owc = vre.getWhere(); 
     794        Option<WhereClause> owc = vre.getWhereClause(); 
    795795        if (owc.isSome()) { 
    796796            WhereClause wc = owc.unwrap(); 
     
    880880                                  fndef.getStaticParams(), fndef.getParams(), 
    881881                                  fndef.getReturnType(), fndef.getThrowsClause(), 
    882                                   fndef.getWhere(), Option.<Contract>none(), Option.<Expr>some(b)); 
     882                                  fndef.getWhereClause(), Option.<Contract>none(), Option.<Expr>some(b)); 
    883883 
    884884            n = visitNode(f); 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/rewrite/IsAnArrowName.java

    r3107 r3122  
    4747    @Override 
    4848    public ArrowOrFunctional forLValue(LValue that) { 
    49         return optionTypeIsArrow(that.getType()); 
     49        return optionTypeIsArrow(that.getIdType()); 
    5050    } 
    5151 
     
    7676    public ArrowOrFunctional forParam(Param that) { 
    7777        if ( that.getVarargsType().isNone() ) 
    78             return optionTypeIsArrow(that.getType()); 
     78            return optionTypeIsArrow(that.getIdType()); 
    7979        else 
    8080            return ArrowOrFunctional.NEITHER; 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/ApiMaker.java

    r3119 r3122  
    127127                                                   that.getStaticParams(), 
    128128                                                   that.getExtendsClause(), 
    129                                                    that.getWhere(), 
     129                                                   that.getWhereClause(), 
    130130                                                   absDecls, 
    131                                                    that.getExcludes(), 
    132                                                    that.getComprises())); 
     131                                                   that.getExcludesClause(), 
     132                                                   that.getComprisesClause())); 
    133133        } else return Option.<Node>none(); 
    134134    } 
     
    144144                                                    that.getStaticParams(), 
    145145                                                    that.getExtendsClause(), 
    146                                                     that.getWhere(), 
     146                                                    that.getWhereClause(), 
    147147                                                    absDecls, 
    148148                                                    that.getParams(), 
     
    159159            List<LValue> lhs = new ArrayList<LValue>(); 
    160160            for (LValue lvb : that.getLhs()) { 
    161                 if ( lvb.getType().isNone() ) 
     161                if ( lvb.getIdType().isNone() ) 
    162162                    log(lvb, "The type of " + lvb.getName() + " is required."); 
    163163                if ( inObject && NodeUtil.isVar(lvb.getMods()) ) { 
     
    181181                log(that, "The return type of " + that.getName() + " is required."); 
    182182            for ( Param p : that.getParams() ) { 
    183                 if ( p.getType().isNone() && 
     183                if ( p.getIdType().isNone() && 
    184184                     p.getVarargsType().isNone() && 
    185185                     ! p.getName().getText().equals("self") ) 
     
    200200                                                that.getReturnType(), 
    201201                                                that.getThrowsClause(), 
    202                                                 that.getWhere(), 
     202                                                that.getWhereClause(), 
    203203                                                that.getContract(), 
    204204                                                Option.<Expr>none(), 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/ErrorMsgMaker.java

    r3114 r3122  
    299299    public String forLValue(LValue node) { 
    300300        String r = ""; 
    301         if (node.getType().isSome()) { 
    302             r = ":" + node.getType().unwrap().accept(this); 
     301        if (node.getIdType().isSome()) { 
     302            r = ":" + node.getIdType().unwrap().accept(this); 
    303303        } 
    304304        return NodeUtil.nameString(node.getName()) + r; 
     
    321321        sb.append(NodeUtil.nameString(node.getName())); 
    322322        if ( node.getVarargsType().isNone() ) { 
    323             if (node.getType().isSome()) { 
     323            if (node.getIdType().isSome()) { 
    324324                sb.append(":"); 
    325                 sb.append(node.getType().unwrap().accept(this)); 
     325                sb.append(node.getIdType().unwrap().accept(this)); 
    326326            } 
    327327            if (node.getDefaultExpr().isSome()) { 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/ExprFactory.java

    r3120 r3122  
    796796            return new FnExpr(e.getSpan(), true, e.getName(), 
    797797                              e.getStaticParams(), e.getParams(), 
    798                               e.getReturnType(), e.getWhere(), 
     798                              e.getReturnType(), e.getWhereClause(), 
    799799                              e.getThrowsClause(), e.getBody()); 
    800800        } 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/NodeComparator.java

    r3114 r3122  
    212212        if (x != 0) return x; 
    213213        if ((left.getVarargsType().isNone()) && (right.getVarargsType().isNone())) { 
    214             x = compareOptionalType(left.getType(), right.getType()); 
     214            x = compareOptionalType(left.getIdType(), right.getIdType()); 
    215215        } 
    216216        if ((left.getVarargsType().isSome()) && (right.getVarargsType().isSome())) { 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/NodeFactory.java

    r3120 r3122  
    772772 
    773773    public static LValue makeLValue(LValue lvb, Id name) { 
    774         return new LValue(lvb.getSpan(), name, lvb.getMods(), lvb.getType(), 
     774        return new LValue(lvb.getSpan(), name, lvb.getMods(), lvb.getIdType(), 
    775775                          lvb.isMutable()); 
    776776    } 
    777777 
    778778    public static LValue makeLValue(LValue lvb, boolean mutable) { 
    779         return new LValue(lvb.getSpan(), lvb.getName(), lvb.getMods(), lvb.getType(), 
     779        return new LValue(lvb.getSpan(), lvb.getName(), lvb.getMods(), lvb.getIdType(), 
    780780                          mutable); 
    781781    } 
     
    787787                mutable = true; 
    788788        } 
    789         return new LValue(lvb.getSpan(), lvb.getName(), mods, lvb.getType(), mutable); 
     789        return new LValue(lvb.getSpan(), lvb.getName(), mods, lvb.getIdType(), mutable); 
    790790    } 
    791791 
    792792    public static LValue makeLValue(LValue lvb, List<Modifier> mods, 
    793793            boolean mutable) { 
    794         return new LValue(lvb.getSpan(), lvb.getName(), mods, lvb.getType(), mutable); 
     794        return new LValue(lvb.getSpan(), lvb.getName(), mods, lvb.getIdType(), mutable); 
    795795    } 
    796796 
     
    819819    public static LValue makeLValue(Param param) { 
    820820        return new LValue(param.getSpan(), param.getName(), 
    821                           param.getMods(), param.getType(), false); 
     821                          param.getMods(), param.getIdType(), false); 
    822822    } 
    823823 
     
    991991    public static Param makeParam(Param param, Expr expr) { 
    992992        return new Param(param.getSpan(), param.getName(), param.getMods(), 
    993                          param.getType(), Option.some(expr)); 
     993                         param.getIdType(), Option.some(expr)); 
    994994    } 
    995995 
    996996    public static Param makeParam(Param param, List<Modifier> mods) { 
    997997        return new Param(param.getSpan(), param.getName(), mods, 
    998                          param.getType(), param.getDefaultExpr()); 
     998                         param.getIdType(), param.getDefaultExpr()); 
    999999    } 
    10001000 
    10011001    public static Param makeParam(Param param, Id newId) { 
    10021002        return new Param(param.getSpan(), newId, param.getMods(), 
    1003                          param.getType(), param.getDefaultExpr()); 
     1003                         param.getIdType(), param.getDefaultExpr()); 
    10041004    } 
    10051005 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/NodeUtil.java

    r3112 r3122  
    8888            if (i instanceof ImportedNames) { 
    8989                ImportedNames names = (ImportedNames) i; 
    90                 all.add( names.getApi() ); 
     90                all.add( names.getApiName() ); 
    9191            } else { // i instanceof ImportApi 
    9292                ImportApi apis = (ImportApi) i; 
    9393                for (AliasedAPIName a : apis.getApis()) { 
    94                     all.add(a.getApi()); 
     94                    all.add(a.getApiName()); 
    9595                } 
    9696            } 
     
    104104                @Override 
    105105                public void forImportedNamesDoFirst(ImportedNames that) { 
    106                     Debug.debug(Debug.Type.SYNTAX, 2, "Add import api ", that.getApi()); 
    107                     all.add(that.getApi()); 
     106                    Debug.debug(Debug.Type.SYNTAX, 2, "Add import api ", that.getApiName()); 
     107                    all.add(that.getApiName()); 
    108108                } 
    109109 
     
    111111                public void forImportApi(ImportApi that){ 
    112112                    for (AliasedAPIName api : that.getApis()){ 
    113                         Debug.debug(Debug.Type.SYNTAX, 2, "Add aliased api ", api.getApi()); 
    114                         all.add(api.getApi()); 
     113                        Debug.debug(Debug.Type.SYNTAX, 2, "Add aliased api ", api.getApiName()); 
     114                        all.add(api.getApiName()); 
    115115                    } 
    116116                } 
     
    328328    public static String nameString(IdOrOpOrAnonymousName n) { 
    329329        final String last = n.accept(nameGetter); 
    330         Option<APIName> odn = n.getApi(); 
     330        Option<APIName> odn = n.getApiName(); 
    331331        return odn.isSome() ? nameString(odn.unwrap()) + "." + last : last; 
    332332    } 
     
    383383            @Override 
    384384        public String forDimDecl(DimDecl node) { 
    385             return nameString(node.getDim()); 
     385            return nameString(node.getDimId()); 
    386386        } 
    387387            @Override 
     
    445445        return decl.accept(new NodeAbstractVisitor<IterableOnce<String>>() { 
    446446            public IterableOnce<String> forDimDecl(DimDecl d) { 
    447                 return new UnitIterable<String>(d.getDim().getText()); 
     447                return new UnitIterable<String>(d.getDimId().getText()); 
    448448            } 
    449449            public IterableOnce<String> forUnitDecl(UnitDecl d) { 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/TraitObject.rats

    r3107 r3122  
    225225     a1:ParamFldMods? a2:PlainParam 
    226226     { if (a1 != null) { 
    227            if (FortressUtil.getMutable(a1) && a2.getType().isNone()) 
     227           if (FortressUtil.getMutable(a1) && a2.getIdType().isNone()) 
    228228               syntaxError(a2.getSpan(), 
    229229                           "Mutable fields should be declared with their types."); 
  • trunk/ProjectFortress/src/com/sun/fortress/parser_util/FortressUtil.java

    r3115 r3122  
    397397    public static void allHaveTypes(List<LValue> vars) { 
    398398        for (LValue l : vars) { 
    399             if (l.getType().isNone()) 
     399            if (l.getIdType().isNone()) 
    400400                syntaxError(l.getSpan(), 
    401401                            "Mutable variables should be declared with their types."); 
  • trunk/ProjectFortress/src/com/sun/fortress/parser_util/SyntaxChecker.java

    r3107 r3122  
    143143        if ( that.getInit().isNone() ) { // variable declaration without a body expression 
    144144            for (LValue lvb : that.getLhs()) { 
    145                 if ( lvb.getType().isNone() ) 
     145                if ( lvb.getIdType().isNone() ) 
    146146                    log(lvb, "The type of " + lvb.getName() + " is required."); 
    147147            } 
     
    276276            if ( (! hasBody) && 
    277277                 p.getVarargsType().isNone() && 
    278                  p.getType().isNone() && 
     278                 p.getIdType().isNone() && 
    279279                 ! p.getName().getText().equals("self") ) 
    280280                log(p, "The type of " + p.getName() + " is required."); 
  • trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/GrammarComposer.java

    r2771 r3122  
    117117            Debug.debug(Debug.Type.SYNTAX, 3, 
    118118                        "Grammar " + grammarDef.getName() +  
    119                         " native?: " + grammarDef.isNative()); 
    120             if (grammarDef.isNative()) { 
     119                        " native?: " + grammarDef.isNativeDef()); 
     120            if (grammarDef.isNativeDef()) { 
    121121                // A native grammar can only contain nonterminal declarations 
    122122                for (GrammarMemberDecl member : grammarDef.getMembers()) { 
     
    187187        } else if (decl instanceof SuperSyntaxDef) { 
    188188            SuperSyntaxDef def = (SuperSyntaxDef) decl; 
    189             for (SyntaxDecl extension : findExtension(def.getNonterminal(), def.getGrammar())){ 
     189            for (SyntaxDecl extension : findExtension(def.getNonterminal(), def.getGrammarId())){ 
    190190                resolveAndAdd(defs, extension, false); 
    191191            } 
  • trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/environments/EnvFactory.java

    r2748 r3122  
    130130            GrammarDef og = grammar.ast(); 
    131131            List<GrammarIndex> ls = new LinkedList<GrammarIndex>(); 
    132             for (Id n: og.getExtends()) { 
     132            for (Id n: og.getExtendsClause()) { 
    133133                Debug.debug(Debug.Type.SYNTAX, 3, "Add grammar " + n.getText() +  
    134134                            "[" + grammarMap.get(n.getText()) + 
  • trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/parser/PreParser.java

    r3078 r3122  
    8686 
    8787                @Override public void forImportStarOnly(ImportStar that) { 
    88                     if (env.definesApi(that.getApi())) { 
    89                         APIName api = that.getApi(); 
     88                    if (env.definesApi(that.getApiName())) { 
     89                        APIName api = that.getApiName(); 
    9090                        for (GrammarIndex g: env.api(api).grammars().values()) { 
    91                             if (!that.getExcept().contains(g.getName())) { 
     91                            if (!that.getExceptNames().contains(g.getName())) { 
    9292                                grammars.add(g); 
    9393                            } 
    9494                        } 
    9595                    } else { 
    96                         StaticError.make("Undefined api: "+that.getApi(), that); 
     96                        StaticError.make("Undefined api: "+that.getApiName(), that); 
    9797                    } 
    9898                } 
    9999 
    100100                @Override public void forImportNamesOnly(ImportNames that) { 
    101                     if (env.definesApi(that.getApi())) { 
    102                         ApiIndex api = env.api(that.getApi()); 
     101                    if (env.definesApi(that.getApiName())) { 
     102                        ApiIndex api = env.api(that.getApiName()); 
    103103                        for (AliasedSimpleName aliasedName: that.getAliasedNames()) { 
    104104                            if (aliasedName.getName() instanceof Id) { 
     
    110110                        } 
    111111                    } else { 
    112                         StaticError.make("Undefined api: "+that.getApi(), that); 
     112                        StaticError.make("Undefined api: "+that.getApiName(), that); 
    113113                    } 
    114114                } 
  • trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/phases/ComposingSyntaxDefTranslator.java

    r3071 r3122  
    125125            String parameters = collectParameters(def, code, indents); 
    126126            String name = def.getName(); 
    127             code.add(String.format("yyValue = new _SyntaxTransformation%s(createSpan(yyStart,yyCount), \"%s\", %s, %s);",  
     127            code.add(String.format("yyValue = new _SyntaxTransformation%s(createSpan(yyStart,yyCount), \"%s\", %s, %s);", 
    128128                                   type, name, BOUND_VARIABLES, parameters)); 
    129129            indents.add(3); 
     
    135135    } 
    136136 
    137     private static String collectParameters( NamedTransformerDef def,  
    138                                              List<String> code,  
     137    private static String collectParameters( NamedTransformerDef def, 
     138                                             List<String> code, 
    139139                                             List<Integer> indents ){ 
    140140        String variable = FreshName.getFreshName("parameterList"); 
    141         code.add(String.format("java.util.List %s = new java.util.LinkedList<String>();",  
     141        code.add(String.format("java.util.List %s = new java.util.LinkedList<String>();", 
    142142                               variable)); 
    143143        indents.add(3); 
    144144        for ( NonterminalParameter parameter : def.getParameters() ){ 
    145             code.add( String.format( "%s.add( \"%s\" );",  
    146                                      variable,  
     145            code.add( String.format( "%s.add( \"%s\" );", 
     146                                     variable, 
    147147                                     parameter.getName().getText() ) ); 
    148148            indents.add(3); 
     
    165165        } 
    166166 
    167         @Override  
     167        @Override 
    168168        public void forNonterminalSymbol(NonterminalSymbol that) { 
    169169            Debug.debug( Debug.Type.SYNTAX, 3, 
     
    227227                        @Override 
    228228                        public CharRange forCharacterInterval(CharacterInterval that) { 
    229                             if (that.getBegin().length() != 1) { 
    230                                 new MacroError(mess +that.getBegin()); 
     229                            if (that.getBeginSymbol().length() != 1) { 
     230                                new MacroError(mess +that.getBeginSymbol()); 
    231231                            } 
    232                             if (that.getEnd().length() != 1) { 
    233                                 new MacroError(mess+that.getEnd()); 
     232                            if (that.getEndSymbol().length() != 1) { 
     233                                new MacroError(mess+that.getEndSymbol()); 
    234234                            } 
    235                             return new CharRange(that.getBegin().charAt(0), that.getEnd().charAt(0)); 
     235                            return new CharRange(that.getBeginSymbol().charAt(0), that.getEndSymbol().charAt(0)); 
    236236                        } 
    237237 
     
    418418                String varName = prefixJavaVariable(varId.getText()); 
    419419                String baseFortressType = inner.gapEnv.getJavaType(varId); 
    420                 String fullType = varMap.get(varId).getType(baseFortressType);  
     420                String fullType = varMap.get(varId).getType(baseFortressType); 
    421421                indents2.add(1); 
    422422                code2.add(modifier.unpackDecl(fullType, varName, packedName, index)); 
     
    451451        } 
    452452        public String unpackDecl(String fullType, String varName, String packedName, int index) { 
    453             return String.format("List<%s> %s = com.sun.fortress.syntax_abstractions.util.ArrayUnpacker.<%s>unpack(%s, %d);",  
     453            return String.format("List<%s> %s = com.sun.fortress.syntax_abstractions.util.ArrayUnpacker.<%s>unpack(%s, %d);", 
    454454                                 fullType, varName, fullType, packedName, index); 
    455455        } 
     
    473473         */ 
    474474        public String unpackDecl(String fullType, String varName, String packedName, int index) { 
    475             return String.format("%s %s = (%s)(%s == null ? null : %s[%d]);",  
    476                                  fullType, varName, fullType,  
     475            return String.format("%s %s = (%s)(%s == null ? null : %s[%d]);", 
     476                                 fullType, varName, fullType, 
    477477                                 packedName, packedName, index); 
    478478        } 
     
    565565 
    566566            indents.add(3); 
    567             code.add(String.format("%s.put(\"%s\", new Level(NodeFactory.makeSpan(\"blame ComposingSyntaxDefTranslater\"), %d, %s));",  
    568                                    BOUND_VARIABLES,  
    569                                    var,  
    570                                    levelDepth,  
     567            code.add(String.format("%s.put(\"%s\", new Level(NodeFactory.makeSpan(\"blame ComposingSyntaxDefTranslater\"), %d, %s));", 
     568                                   BOUND_VARIABLES, 
     569                                   var, 
     570                                   levelDepth, 
    571571                                   prefixJavaVariable(resultVar))); 
    572572        } 
     
    583583    } 
    584584 
    585     private static String convertToStringLiteralExpr(String id, List<String> code,  
     585    private static String convertToStringLiteralExpr(String id, List<String> code, 
    586586                                                     List<Integer> indents) { 
    587587        String name = FreshName.getFreshName("stringLiteral"); 
    588588        indents.add(3); 
    589         code.add("StringLiteralExpr " + prefixJavaVariable(name) +  
     589        code.add("StringLiteralExpr " + prefixJavaVariable(name) + 
    590590                 " = new StringLiteralExpr(NodeFactory.makeSpan(\"blame ComposingSyntaxDefTranslater\"), \"\"+" + prefixJavaVariable(id) + ");"); 
    591591        return name; 
  • trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/phases/EscapeRewriter.java

    r3071 r3122  
    8787                public List<CharacterSymbol> forCharacterInterval(CharacterInterval that) { 
    8888                    List<CharacterSymbol> head = new LinkedList<CharacterSymbol>(); 
    89                     String begin = removeLeadingEscape(that.getBegin(), head); 
     89                    String begin = removeLeadingEscape(that.getBeginSymbol(), head); 
    9090                    List<CharacterSymbol> tail = new LinkedList<CharacterSymbol>(); 
    91                     String end = removeTrailingEscape(that.getSpan(), that.getEnd(), tail); 
     91                    String end = removeTrailingEscape(that.getSpan(), that.getEndSymbol(), tail); 
    9292                    head.add(new CharacterInterval(that.getSpan(), begin, end)); 
    9393                    head.addAll(tail); 
  • trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/phases/ExtensionDesugarer.java

    r2771 r3122  
    144144        // Recombine into GrammarDef 
    145145        GrammarDef result = 
    146             new GrammarDef(grammar.getSpan(), grammar.getName(), grammar.getExtends(), 
    147                            newMembers, grammar.getTransformers(), grammar.isNative()); 
     146            new GrammarDef(grammar.getSpan(), grammar.getName(), grammar.getExtendsClause(), 
     147                           newMembers, grammar.getTransformers(), grammar.isNativeDef()); 
    148148        Debug.debug(Debug.Type.SYNTAX, 3, 
    149149                    "Desugared grammar into:\n" + result.accept(new FortressAstToConcrete())); 
     
    233233                } else if (decl instanceof SuperSyntaxDef) { 
    234234                    SuperSyntaxDef ssd = (SuperSyntaxDef) decl; 
    235                     Id superGrammarName = ssd.getGrammar(); 
     235                    Id superGrammarName = ssd.getGrammarId(); 
    236236                    if (availableGrammarNames.contains(superGrammarName)) { 
    237237                        availableGrammarNames.remove(superGrammarName); 
     
    246246                        throw new MacroError(decl, 
    247247                                             "No extensions of " + name +  
    248                                              " in grammar " + ssd.getGrammar()); 
     248                                             " in grammar " + ssd.getGrammarId()); 
    249249                    } 
    250250                } 
  • trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/phases/GrammarRewriter.java

    r2771 r3122  
    162162                GrammarDef og = e.getValue().ast(); 
    163163                List<GrammarIndex> ls = new LinkedList<GrammarIndex>(); 
    164                 for (Id n: og.getExtends()) { 
     164                for (Id n: og.getExtendsClause()) { 
    165165                    ls.add(grammars.get(n.getText())); 
    166166                } 
  • trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/phases/TemplateParser.java

    r3071 r3122  
    6262        return (Api) raw.accept(new NodeUpdateVisitor() { 
    6363                @Override public Node forGrammarDef(GrammarDef that) { 
    64                     if (!that.isNative()){ 
     64                    if (!that.isNativeDef()){ 
    6565                        final Class<?> parser = createParser(findGrammar(that)); 
    6666                        return that.accept(new NodeUpdateVisitor() { 
  • trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/phases/Transform.java

    r3115 r3122  
    271271            List<Param> params_result = Useful.applyToAll(that.getParams(), renameParam); 
    272272            Option<Type> returnType_result = recurOnOptionOfType(that.getReturnType()); 
    273             Option<WhereClause> where_result = recurOnOptionOfWhereClause(that.getWhere()); 
     273            Option<WhereClause> where_result = recurOnOptionOfWhereClause(that.getWhereClause()); 
    274274            Option<List<BaseType>> throwsClause_result = recurOnOptionOfListOfBaseType(that.getThrowsClause()); 
    275275            Expr body_result = (Expr) recur(that.getBody()); 
  • trunk/ProjectFortress/src/com/sun/fortress/tools/FortressAstToConcrete.java

    r3120 r3122  
    413413            List<String> staticParams_result = recurOnListOfStaticParam(that.getStaticParams()); 
    414414            List<String> extendsClause_result = recurOnListOfTraitTypeWhere(that.getExtendsClause()); 
    415             Option<String> where_result = recurOnOptionOfWhereClause(that.getWhere()); 
    416             List<String> excludes_result = recurOnListOfBaseType(that.getExcludes()); 
    417             Option<List<String>> comprises_result = recurOnOptionOfListOfBaseType(that.getComprises()); 
     415            Option<String> where_result = recurOnOptionOfWhereClause(that.getWhereClause()); 
     416            List<String> excludes_result = recurOnListOfBaseType(that.getExcludesClause()); 
     417            Option<List<String>> comprises_result = recurOnOptionOfListOfBaseType(that.getComprisesClause()); 
    418418            List<String> decls_result = myRecurOnListOfDecl(that.getDecls()); 
    419419            return forTraitDeclOnly(that, mods_result, name_result, 
     
    477477            List<String> staticParams_result = recurOnListOfStaticParam(that.getStaticParams()); 
    478478            List<String> extendsClause_result = recurOnListOfTraitTypeWhere(that.getExtendsClause()); 
    479             Option<String> where_result = recurOnOptionOfWhereClause(that.getWhere()); 
     479            Option<String> where_result = recurOnOptionOfWhereClause(that.getWhereClause()); 
    480480            Option<List<String>> params_result = recurOnOptionOfListOfParam(that.getParams()); 
    481481            Option<List<String>> throwsClause_result = recurOnOptionOfListOfBaseType(that.getThrowsClause()); 
     
    793793        StringBuilder s = new StringBuilder(); 
    794794 
    795         if ( that.isNative() ){ 
     795        if ( that.isNativeDef() ){ 
    796796            s.append( "native " ); 
    797797        } 
     
    10651065 
    10661066    @Override public String forCharacterIntervalOnly(CharacterInterval that) { 
    1067         return that.getBegin() + ":" + that.getEnd(); 
     1067        return that.getBeginSymbol() + ":" + that.getEndSymbol(); 
    10681068    } 
    10691069